Skip to content

lifter batch: score registered owners inside retained modules (--owner-spans, --sweep) - #7

Closed
wowwheaties wants to merge 1 commit into
PascalPixel:mainfrom
wowwheaties:wip/lifter-owner-spans
Closed

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

Conversation

@wowwheaties

Copy link
Copy Markdown

Summary

lifter batch scores each retained module at its extent, but many modules 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 lifter do it.

  • --owner-spans (batch, list): after the module pass, score every registered owner whose start lies inside the module at that owner's span; one row per owner (resource_3a2:02000924 span=412 differing_halfwords=6 (module 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 module 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 (9dbf29f)

lifter batch --all --jobs 8 --owner-spans --sweep: 187 modules, 273 owner spans, 47 exact from the unchanged draft (one of them via the pad rule: 3a6:020011a0), 14 spans where the widened sweep scores better than the registered span.

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 module 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

`lifter batch` scores each retained module at its extent, but many modules
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 module pass, score every registered owner whose
  start lies inside the module 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 module 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
  wrong instruction 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 --owner-spans --sweep` reports 273 owner spans in 187 modules,
47 of them exact from the unchanged draft.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@wowwheaties

Copy link
Copy Markdown
Author

Independent check of the 47 differing_halfwords=0 owner rows from batch --all --owner-spans --sweep on 9dbf29f: each module draft re-scored one at a time with overlay score <draft> --owner <owner> --span <span> — 46/47 reproduce dh=0 as printed. The 47th is the trailing_pad=1 row (resource_3a6:020011a0 span=184): raw dh=1 at 184, dh=0 at 182, --align header class=layout-only wrong_instructions=0, i.e. the pad rule fires only where the registered span includes the word after the final return.

@wowwheaties

Copy link
Copy Markdown
Author

Superseded by #8: lifter was removed in 6f712af, so this is re-done against thumb2c (same three pieces, same opt-in flags; 51 owner spans exact on 187bb97). Closing.

@wowwheaties wowwheaties closed this Sep 4, 2026
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