Skip to content

v0.11.36+: register exhaustion on dissolved k_mutex_unlock (call-result-pair pressure) — 3b-lite retry doesn't recover this site #326

@avrabe

Description

@avrabe

v0.11.36+: mutex dissolution hits register exhaustion the 3b-lite retry doesn't recover — blocks the k_mutex_unlock lane (#237's follow-on)

Ran the staged remeasure_wasm_lto.sh (your "should run unpatched" pointer after the #237 fixes — and indeed the .bss sizing is fixed). New blocker, compile-time this time:

warning: skipping function 'z_impl_k_mutex_unlock': backend 'arm' failed:
  compilation failed: instruction selection failed: Synthesis failed:
  register exhaustion: no free callee-saved register to hold a call result
  while reloading a preserved param

Bisect (same module, --target cortex-m4f --native-pointer-abi --all-exports --relocatable):

release result
v0.11.35 compiles (830 B, 24 relocs)
v0.11.36 skipped — register exhaustion ← first bad
v0.11.37 / 38 / 39 skipped (same message; 3b-lite doesn't catch this site)

Mechanism hypothesis: v0.11.36's call-result pair tagging (the #311 fix) is the likely pressure source — i64 call results now legitimately hold a register pair across the surrounding code, and the dissolved z_impl_k_mutex_unlock is the densest body we ship (5 kernel import calls + the packed-u64 decide + the pointer params kept live across them). The same change that made sem correct (silicon-verified at 860) pushes mutex past the callee-saved pool. Failing loudly is the right ASIL posture — but v0.11.38's spill-on-exhaustion retry (RA-001 3b-lite, "the first hard-fail becomes recoverable") evidently covers a different exhaustion path than this one ("call result while reloading a preserved param").

Ask: extend the 3b retry to this site (spill the preserved param or the call result to the frame instead of requiring a callee-saved reg). It's presumably exactly the pressure case the full RA-001 allocator dissolves naturally — if it's cleaner to wait for that wiring, a known-limitation note on the lane is fine; just say which way it'll go.

Repro: wasm_mutex_shim_poc.c + libgale_ffi → the usual pipeline (the module from the #237 thread, unchanged). Staged for same-day silicon (native ref 124 cyc) the moment it compiles — sem went repro→fix→silicon-verified inside a day; happy to repeat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions