test(fact): LS-A-9 regression for callback POLL dispatch#166
Conversation
The async-callback adapter at lines 3992-3998 of `fact.rs` dispatches `[waitable-set-poll]` on `WAIT (2)` OR `POLL (3)` via an `I32Const(WAIT) + I32Eq + LocalGet + I32Const(POLL) + I32Eq + I32Or` instruction skeleton. A previous version of that branch matched only `WAIT`, silently treating `POLL` as YIELD which sent `(EVENT_NONE, 0, 0)` to `[callback]` and dropped any event the host had ready (LS-A-9). The fix landed without a regression test; the LS-N verification gate surfaced this gap as the next-to-last missing entry. Adds `ls_a_9_callback_adapter_dispatches_both_wait_and_poll`, which: 1. Builds a minimal `MergedModule` fixture with the prerequisites the callback emitter requires: - One `() -> i32` lift function - The `[callback]<export_name>` companion export - A `[waitable-set-poll]` host import 2. Drives `generate_async_callback_adapter` to produce the adapter 3. Scans the emitted function body for the byte sequence `0x41 0x02 0x46 0x20` (i32.const WAIT(2) / i32.eq / local.get) followed by `0x41 0x03 0x46 0x72` (i32.const POLL(3) / i32.eq / i32.or), in order Pin-by-substring is robust against unrelated body changes (locals layout, surrounding control flow); a regression that drops the POLL arm or reorders the comparisons would fail this test. Gate verdict moves from 17/19 verified to **18/19**; remaining missing entry is LS-A-8 (inner-list rep_func selection — surveyed in task #52 at ~2-4h scope). This is the **first PR to touch a Tier-5 source file** since the mythos-auto.yml plumbing fixes (#164), so it also serves as the auto-runner's first true end-to-end matrix-scan smoke test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
LS-N verification gate
Approved Failed LS entries(none) Missing regression tests
Updated automatically by |
Admin-merge per #139 (filed 2 smithy issues)9 of 13 checks green including everything substantive (Test, Clippy, Coverage, Bench, LS-N gate, 2 fuzz smokes, Detect Tier-5 changes). The 4 remaining failures are all #139 infra, not regressions in this PR's content:
Two new tracking issues filed for smithy:
LS-A-9 regression test itself is sound (1 pass, 237/237 in Admin-merge counter for #139 since last reset:
|
Summary
Closes the missing-regression gap for LS-A-9 that the LS-N verification gate has been surfacing. Prior fix at
meld-core/src/adapter/fact.rs:3992-3998added theWAIT || POLLOR-pattern to the callback dispatch but landed without a dedicated regression test.Why this matters
The async-callback adapter dispatches
[waitable-set-poll]when the guest callback returnsWAIT (2)orPOLL (3). A previous version matched onlyWAIT, silently lettingPOLLfall through to the YIELD path — which sent(EVENT_NONE, 0, 0)to[callback]and dropped host-ready events. The fused module diverged from the composed module on P3 async export call paths (H-3, UCA-F-3), and there's no host trap to catch it.Test approach
ls_a_9_callback_adapter_dispatches_both_wait_and_poll:MergedModulewith the prerequisites the callback emitter requires (lift func,[callback]<export>companion,[waitable-set-poll]import).generate_async_callback_adapterend-to-end.Pin-by-substring is robust against unrelated body changes (locals layout, surrounding control flow).
Gate verdict
Remaining: LS-A-8 (HashMap rep_func selection for
list<record<borrow>>) — surveyed in task #52 at ~2-4h scope.End-to-end mythos-auto smoke test
This is the first PR to touch a Tier-5 source file (
adapter/fact.rs) since the auto-runner's plumbing fixes (#164). Watching for:meld-core/src/adapter/fact.rs✓verdict: NO_FINDINGS | FINDINGJSONmythos-pass-donelabel auto-applied on NO_FINDINGSLocal tests:
cargo test ls_a_9_→ 1 pass; fullmeld-core --lib→ 237/237.🤖 Generated with Claude Code