Skip to content

thumb2c batch: score registered owners inside retained regions (--owner-spans, --sweep) - #8

Open
wowwheaties wants to merge 1 commit into
PascalPixel:mainfrom
wowwheaties:wip/thumb2c-owner-spans
Open

thumb2c batch: score registered owners inside retained regions (--owner-spans, --sweep)#8
wowwheaties wants to merge 1 commit into
PascalPixel:mainfrom
wowwheaties:wip/thumb2c-owner-spans

Conversation

@wowwheaties

Copy link
Copy Markdown

Summary

thumb2c batch scores each retained region at its extent, but many regions hold more than one registered owner (regions.json manual_regions). Scoring the unchanged draft at the owner's own span instead often links exact already — that observation produced most of the owners in #6, by hand. This makes thumb2c do it (supersedes #7, which targeted the removed lifter).

  • --owner-spans (batch, list): after the region pass, score every registered owner whose start lies inside the region at that owner's span; one row per owner (resource_3a2:02000924 span=412 differing_halfwords=6 (region 02000924 extent 1036)) and an owner_spans=… owner_exact=… summary line.
  • --sweep: when the owner span is not exact, retry with the span widened to the rest of the region and report both (sweep_span=… best=owner|sweep), for owners registered short of the pool island their function really runs to (the 3c5:02001238 / 379:02000074 shape from ☀️ 74% – adopt seventy-four exact owners on 7d8a72083: eight main-image functions and sixty-six scene sequences #6).
  • trailing pad: a reference exactly one halfword longer than the candidate with wrong_instructions=0 is ranked exact and marked trailing_pad=1 with the raw count kept in the row; adopt still decides on the real bytes.

Default output is byte-identical without the flags. No new dependencies; cargo test and cargo fmt --check clean; make verify green.

On this tree (187bb97)

thumb2c batch --all --jobs 8 --owner-spans --sweep: 184 regions, 270 owner spans, 51 exact from the unchanged draft (one via the pad rule: 3a6:020011a0), 12 spans where the widened sweep scores better than the registered span. Of the 386 overlay-assembly regions, 64 nest two or more registered owners; those are the ones the region-extent pass could not see.

Notes

  • Under --jobs 8 a handful of owner scores come back with no score line (23 here); each scores fine when retried alone. That is the existing scorer subprocess path under load, not new code — left as is rather than adding a retry you might prefer to shape.
  • The sweep widens to the region end only. Widening to the next registered owner start would be a natural refinement if you want the tool to propose the corrected span for the registry.

… batch

`thumb2c batch` scores each retained region at its extent, but 64 of the
386 overlay-assembly regions hold more than one registered owner
(regions.json manual_regions). Scored at the owner's own span, the
unchanged draft often links exact already.

- `--owner-spans`: after the region pass, score every registered owner
  (not yet mapped to C) whose start lies inside the region at that owner's
  span, one row per owner, with an `owner_spans=` summary line
  (`list --owner-spans` lists them).
- `--sweep`: when the owner span is not exact, retry with the span widened
  to the rest of the region and report both, for owners registered short
  of the pool island their function really runs to.
- trailing pad: a reference one halfword longer than the candidate with no
  other differing halfword is ranked exact and marked `trailing_pad=1`
  with the raw count kept in the row; `adopt` still decides on the real
  bytes.

Default output is unchanged without the flags. On this tree
`batch --all --jobs 8 --owner-spans --sweep` reports 270 owner spans in
184 regions, 51 of them exact from the unchanged draft; resource_3a2's
02000ac0 and 02000b2c stay exact at their registered spans, unadopted.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant