Repository navigation
Description
Environment
- OS: Linux x86_64 host, ARM64 target
- Input type: synthetic monomorphic fixture; not seen on LocalSend
- Command: model and consumer probe from the review fixture; no CLI command reproduces it yet
flutterdeccommit/tag:ab00bd76de5e7ba87e909e0b8d5e300edb86ddd9(PR feat(serwalker): add the Dart 3.11.1 FullAOT adapter #74 head when the review was written)
What Happened
Function.code starts at the payload start, not at the callable entry. In the monomorphic fixture the function starts at 0x1010 while its Code-pool target is 0x1028. The exact-address join in build_function_metadata_lookup then misses the function, so the selector, owner, and library are lost. Selecting the function with EntryVa(0x1028) also fails.
The producer already has the decoded Code object, including entry_point and monomorphic_entry_point. produce_functions_info checks code.entry_point at crates/flutterdec-serwalker/src/info_producer/functions_info.rs:66-70, but it does not emit either entry into the model. The model's Function at crates/flutterdec-adapter/src/model.rs:466-481 has code: CodeRange and code_section_va, with no field for a callable entry. The range is intentionally the whole function: functions_info.rs:114-133 starts at the payload and covers the switchable-call-miss, monomorphic, and polymorphic entries.
Expected Behavior
The model should carry the callable entry or entries without dropping the full range. build_function_metadata_lookup should join on that value and keep the selector, owner, and library. EntryVa(0x1028) should select the monomorphic function. Two declarations that share one Code body should not get a unique owner.
Reproduction
- Build the monomorphic fixture from the review thread: payload
0x1010, Code-pool target0x1028. - Print
Function.code.start_vaand the pool target. - Run the metadata join used by
build_pool_semantic_hints(build_function_metadata_lookupatcrates/flutterdec-core/src/pipeline/runners/symbols.rs:367-380); the function is not found. - Select with
EntryVa(0x1028)atcrates/flutterdec-core/src/pipeline/runners.rs:1156-1160; selection fails.
The review thread has the decoder and consumer evidence: #74 (comment)
Additional Context
This is a model contract gap, not a producer bug. The gap predates PR #74, and the PR's producer keeps the full range. The reply in the thread says the same: the current Function cannot hold both the full range and the callable entry.
The fix changes the adapter model, so it needs a MODEL_VERSION bump from 4. That bump updates every producer, validator, fixture, and compatibility record. It also means old adapters are rejected. That is why it belongs in its own PR, not #74.
A single callable_entry_va is not enough. The range covers three entries (switchable-call-miss, monomorphic, polymorphic), so the model needs a Code entity, an entry table, or a field that names the entry kind. The issue is to choose that shape and implement it.
A stopgap is to put callable_entry_va in the existing serwalker.function.<id> extension and teach the consumer to read it. That avoids a version bump but stays producer-specific and untyped, so it is not the preferred fix.
Acceptance Tests
- The model can represent the callable entry, or entries, for a function.
build_function_metadata_lookupjoins on it and keeps the selector, owner, and library.EntryVa(0x1028)selects the function in the monomorphic fixture.- Two
Functiondeclarations that share oneCodebody do not receive a unique owner.
Scope and Risks
Affected crates: flutterdec-adapter for the model and validation, flutterdec-serwalker for the producer, flutterdec-core for the metadata lookup and entry selection, plus fixtures and compatibility records. The model version bump means installed adapters from the old version are rejected. Test with the monomorphic fixture and a shared-code fixture.
Activity
feat(serwalker): add the Dart 3.11.1 FullAOT adapter