docs(wasm): E3 PC-windowed bisection findings for store bug

This commit is contained in:
2026-07-21 21:48:07 -04:00
parent a071badfe8
commit e3296dc533
2 changed files with 23 additions and 1 deletions
+22
View File
@@ -127,6 +127,28 @@ interaction with a co-located op.
the generated wasm for one miscompiled TB. Large task; reader already works at
~31s with the store flag, so this is headroom, not a blocker.
### E3 — PC-windowed bisection: not a single TB, it's aggregate
Added a compile-window to `tcg_out_qemu_st` (`s->gen_tb->pc` gate): store-TBs
inside `[LO,HI)` compile, all others stay TCI. Each run rebuilt + browser-tested.
| window | region | result |
|--------|--------|--------|
| 0x4201d0000x4201f800 | uzlib inflate + FontDecompressor | **pass** |
| 0x400000000x40400000 | ROM (memcpy/memset) + IRAM (tlsf/malloc) | **pass** |
| 0x420000000x420d0000 | flash text lower half (prewarm callers) | **pass** |
| 0x420d00000x421a0000 | flash text upper half | **pass** |
| (none / all store-TBs compiled) | everything | **crash** |
Every region compiles safely *in isolation*; only the full set corrupts. So the
bug is **not a localizable miscompiled op/TB** — it is an aggregate effect that
appears once enough compiled store-TBs run together. The faulting load is
`d->dict_ring[d->lzOff]` (tinflate.c:476) off a stack-resident inflate struct,
i.e. some store clobbers a *neighbouring* stack/heap pointer, and which store
depends on timing. This matches a **rewind/replay or TB-instance-management
race** in the compiled restartable-block store path, not a codegen typo — and it
is exactly why upstream forces every store-TB to TCI. Fixing it is architectural
(rewind/instance-safe compiled stores), not a one-op correction.
### Next options
1. **Ship E1 as a guarded workaround** — reader works now; measure real
navigation/page-turn perf before judging it unacceptable.