Skip to content

feat(prioritization): expand manifest package hint variants - #7

Merged
caverav merged 2 commits into
mainfrom
feat/manifest-package-hints-expansion
Feb 23, 2026
Merged

caverav merged 2 commits into
mainfrom
feat/manifest-package-hints-expansion

Conversation

@caverav

@caverav caverav commented Feb 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • expand manifest-derived package hint generation to include normalized suffix variants
  • support hints like localsend_app + localsend, and mobile_flutter + mobile
  • keep strict filtering for non-app/common manifest segments
  • update docs/context/readme to describe normalized manifest package hints

Validation

  • nix develop -c cargo fmt --all
  • nix develop -c cargo test -p flutterdec-core
  • nix develop -c cargo clippy --workspace --all-targets -- -D warnings

@caverav
caverav merged commit d01aab3 into main Feb 23, 2026
2 checks passed
@caverav
caverav deleted the feat/manifest-package-hints-expansion branch February 23, 2026 15:15
caverav added a commit that referenced this pull request Aug 9, 2026
Two coverage defects in the prologue matcher, both found by measuring the match
positions instead of trusting the shape.

A thunk that tail-calls a stub reads the same `Thread` slot the stub reads from
itself: `ldr x24, [x26, #0x1d8]; ldur x16, [x24, #7]; br x16`. Two per sample
matched and were named after the stub they call, and one of them guards its tail
call with `cmp w0, w22`, so the name hid a null check.
`GenerateSharedStubGeneric` saves the register set before the self-load and the
thunks push nothing, so requiring one push onto the Dart stack separates them
exactly.

The mint allocators save the FPU set as well, which puts their self-load at
instruction 37 on 3.5 and 38 on 3.12. The 32-instruction window dropped one stub
from every binary and said nothing, because a stub that goes unnamed looks
identical to a stub that is not there. Window is 48, which is the deepest
measured position plus room.

Net on real input: 13 stubs to 12, and 21,889 to 21,369 call sites on LocalSend,
26,649 to 25,967 on Immich. Fewer sites, no false ones -- `slowTypeTest` was
entirely thunks and is now zero, and the mint allocator gained the 31 and 14
sites the window had been dropping.

The fingerprint guard was calibrated on the old matcher, so it was re-measured:
the correct table still wins on both samples, 12 prologues against 7 and 8, with
the margin tightening from 2.00x and 1.75x to 1.71x and 1.50x.

Both guards are mutation-checked. Dropping the push requirement fails the thunk
test; narrowing the window to 32 fails the deep-prologue test.
caverav added a commit that referenced this pull request Aug 9, 2026
Refusing to call a trampoline by its callee's name was right, but it left the
trampoline's own call sites anonymous -- 520 on LocalSend and 696 on Immich --
and made the corrected counts read as a clean improvement when part of the drop
was lost naming.

The trampoline is still exactly derivable. Its whole body after the slot load is
`ldur x16, [x24, #7]` then `br x16`: it pulls the entry point out of the `Code`
it just read and branches, never returning, so it is equivalent to the stub. That
earns `<stub>Thunk` -- marked, because one of the two guards its tail call with
`cmp w0, w22`, and calling it the stub outright would hide the check.

The discriminator is the full sequence, not merely loading a stub slot without
pushing. An ordinary function that calls a shared stub uses `blr` and carries on
afterwards; naming that after the stub it calls is the same false claim, so it
stays anonymous. Mutation-checked: accepting any pre-push slot loader as a
trampoline fails the test, and the `blr` caller is the pinned negative.

Now 14 named per sample, 12 stubs and 2 trampolines. Call sites 21,920 on
LocalSend and 26,663 on Immich, above the counts from before the false naming was
removed, because the mint allocator the window had been dropping is included too.

Dropped `thunk_tests`, subsumed by `trampoline_tests`, which pins the marked name
and the `blr` negative rather than only the absence of the bare stub name.
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