journal 2026-05-05

P93: branch predictor v0

P93 added a shadow branch predictor: 32-entry direct-mapped BTB, 2-bit conditional counters, and an 8-entry return-address stack. It learns at retire but does not steer fetch yet.

The shell smoke passed:

P93 direct UART console + memory attribution smoke PASS

The shell window improved versus P92 but remains behind P91:

metricP91P92P93
post-load cycles221,327,811222,624,131221,863,586
shell window cycles65,985,29767,206,63566,342,842
fetch stall cycles55,533,55523,555,00523,503,650

Predictor counters are the main point:

predictor sliceresult
conditional direction accuracy71.93%
jump target accuracy45.00%
return target accuracy96.57%

The RAS is worth keeping. The direct-mapped BTB is useful but too aliased. P94 should make the memory path less tangled so a later frontend PC can actually use prediction.