r8forge_tape_opt rewrites a tape with three run-local rules:
> < a maximal run of pointer moves becomes its net displacement
+ a run becomes (length % _CELL_SIZE), a whole turn is a no-op
- a run becomes (length % 2), two flips cancel
The nice part is what it does NOT do: it never looks at brackets. '[' and ']' are
not in any of the three character classes, so they always end a run, and within a
run only the net matters (the pointer moves are pure additions and nothing in
between is observable). Keeping every run's net keeps the pointer identical at
every surviving character, brackets included, so the pairing that the machine
finds by scanning cannot change; and since bracket characters are never added or
removed, a run can never be merged across one. No stack, no offset table, one
linear pass.
Measured, with tape_run's out stream compared before and after (and the reference
machine on the flagship's -n stream, same 93 values):
asm/test.r8asm 64513 -> 58060 (-6453, 10.0%)
examples/calc.r8asm 62585 -> 54863 (-7722, 12.3%) "12 34 + ." identical
examples/term.r8asm 3467 -> 3402 ( -65, 1.9%) "hi" identical
Step counts unchanged (the removed instructions did nothing). Not yet wired into
`r8forge` itself: the pipeline is `r8forge f.r8asm > t.rot8 && r8forge_tape_opt
t.rot8 t2.rot8`, and a --opt flag can wrap that later.