Commit Graph
2 Commits
Author SHA1 Message Date
dsh b1a8ca5617 Unmangle the two flat examples
Full_add_flat.r8asm and full_add_flat_spaced.r8asm had their comments turned
into question marks: they were written through a PowerShell Set-Content with
ASCII encoding, which cannot represent Chinese and substitutes '?'.  Rewritten
as UTF-8, with the comments saying what the files are for.

Both still assemble from cache (95 characters) and still produce the same tape,
which is the point of the layout free metric.

A scan of the whole tree for '???' now comes back empty.
2026-11-06 21:10:17 +08:00
dsh da16c111cf Add a layout independent metric so a result can be cached and reused
%synth could optimise the real tape characters, but that price depends on where
the cells sit, so the answer was only good for one layout and the cache could
only be shared between call sites with the same addresses.

  metric chars   tape characters including the .tp walk   layout dependent
  metric flat    characters without the walk             layout independent
  metric blocks  block count                             layout independent

'flat' is the step-free mode: it counts biz/flb/rnz and the ops, ignores how
far apart the cells are, so one search result and one cache entry serve every
layout.  The price is a slightly longer tape when the layout happens to suit a
different program: 90 characters for chars, 95 for flat on the full adder.

Checked: examples/full_add_flat.r8asm hits the cache on the second run, and the
same block with 'layout 0 2 4 6 8 10' added hits the *same* entry and emits a
byte-identical tape (the key drops the layout for the layout-free metrics).
Both pass the eight combination check.
2026-11-06 18:39:49 +08:00