Commit Graph

117445 Commits

Author SHA1 Message Date
evan 5906b67287 feat(xteink): add interactive emulator mode 2026-07-24 18:56:11 -04:00
evan 0da29e8871 feat(skill): isolate firmware emulator invocation 2026-07-24 17:30:09 -04:00
evan cc539e448f docs(xteink): add firmware testing skill 2026-07-24 17:24:40 -04:00
evan 5950fa2086 feat(xteink): add keyboard input helper 2026-07-24 17:19:19 -04:00
evan 1ede8fe42c feat(xteink): support direct emulator workflow 2026-07-24 17:12:12 -04:00
evan fe35cb68d6 feat(xteink): add ESP32-C3 Wi-Fi emulation with qemu AP
Ports the ESP32 Wi-Fi emulation (esp32c3_wifi, esp32_wifi_ap, esp32_wlan_*)
from the lcgamboa/PICSimLab QEMU fork and integrates it behind the
esp32c3_wifi NIC model, plus the supporting radio peripherals
(ANA/PHYA/FE/PWR manager).

- Exposes an open SSID 'qemu' bridged to the host via QEMU user-mode NAT
  (libslirp, now enabled in the native build).
- Adds ESP-IDF 5.5 compatibility fixes: channel resolution from the
  beacon DS Parameter Set IE / AP lookup, persistent SYSCON register
  backing (phy_module_has_clock_bits), DMA inlink/outlink descriptor
  mirroring, RX descriptor ring reset on item.next==0, and descriptor
  ownership/length semantics.
- xteink-emu now starts with -nic user,model=esp32c3_wifi and synthesizes
  an eFuse image with a fixed guest MAC.

Verified against a stock Arduino-ESP32 sketch: scans, finds 'qemu',
associates, gets DHCP 192.168.4.15, and completes an outbound TCP
connection. Unmodified CrossPoint firmware still needs the power-button
hold during boot (tracked separately).
2026-07-24 16:21:12 -04:00
evan ee101c8698 feat(xteink): add native emulator harness 2026-07-24 14:13:55 -04:00
evan 598b5e66fd tcg/wasm32: remove compiled-store investigation probes 2026-07-24 10:37:12 -04:00
evan c1fc905cf2 tcg/wasm32: narrow fallback to aliased qemu_ld TBs 2026-07-23 20:49:17 -04:00
evan ec4c6cc95a tcg/wasm32: refine TLB corruption diagnostics 2026-07-23 13:12:22 -04:00
evan 29cab65aff tcg/wasm32: compile pure store TBs, keep mixed store-helper TBs TCI 2026-07-23 11:53:57 -04:00
evan e4a6de07c6 tcg/wasm32: add tlbguard and store-PC window probes 2026-07-23 10:37:23 -04:00
evan cd3f083fb0 tcg/wasm32: trace compiled-store TLB corruption under ramrace 2026-07-23 07:50:54 -04:00
evan 346c789851 tcg/wasm32: add opt-in stateflush no-chain probe
?stateflush reuses the app-flash no-chain window without differential shadowing.
It shows that returning to C between TBs does not materialize CPUArchState; the
nostoretci reader-open corruption still reproduces.
2026-07-23 06:59:21 -04:00
evan ab9c5823ee tcg/wasm32: add opt-in ramrace guest-RAM/TLB probe
?ramrace logs off-vCPU guest DRAM reads/writes/maps and TLB flushes. The
open-window crash shows zero such accesses, ruling out IO-thread guest-RAM
access during inflate as the compiled-store corruption source.
2026-07-22 23:11:02 -04:00
evan b6d67a89bb tcg/wasm32: add opt-in ?noremove to leak TB functions
Skips removeFunction recycling of WASM table indices. nostoretci+noremove still
crashes 4/4, ruling out table-index reuse as the corruption source and leaving a
vCPU/IO-thread guest-RAM data race as the standing hypothesis.
2026-07-22 21:57:44 -04:00
evan 9e9184949d tcg/wasm32: add opt-in ?yieldtrace store-yield counter
Counts compiled-TB DONE_FLAG redispatch/resume re-entries. Three crashing
nostoretci runs showed zero such re-entries, ruling out the store
block-replay-via-redispatch path as the corruption trigger and pointing at a
guest-RAM data race with concurrent device/timer callbacks.
2026-07-22 21:43:06 -04:00
evan a18a2991c6 tcg/wasm32: add opt-in runtime store gating for race isolation
Add wasm_set_store_tci_hash and wasm_set_store_bisect so store compilation can
be split by pc hash (both widths) or bisected per width at runtime, no rebuild.
Used to show the compiled-store corruption is a nondeterministic race, not a
specific miscompiled TB: identity-independent, and a fixed config alternates
crash/pass across runs. Default path unchanged (blanket store-TCI).
2026-07-22 20:56:56 -04:00
evan f46ca3b386 tcg/wasm32: restore blanket store-TCI default after benchmark
The 32-bit-only store-TCI fallback passes reader-open when it works, but a
3-run benchmark hit an app-init watchdog once. Restore the upstream blanket
store-TCI fallback for reliability; keep ?nostoretci as the all-compiled repro.
2026-07-22 19:47:41 -04:00
evan 59a198dcf8 tcg/wasm32: narrow store-TCI fallback to 32-bit stores
The compiled-store corruption requires 8-bit and 32-bit store TB populations
compiled together. Interpreting either width breaks the interaction; keep only
32-bit qemu store TBs on TCI and allow the rest to compile. ?nostoretci remains
the all-compiled repro path.
2026-07-22 19:05:38 -04:00
evan b3ffe97fb3 tcg/wasm32: add normal-speed store-TCI bypass and windowed diff2 arming support
Add an opt-in wasm_disable_store_tci() probe so browser tests can run compiled
stores at normal speed without the differential harness. Also let E11 request
no-chain only for TBs inside its PC window, avoiding the global no-chain
watchdog artifact while preserving valid per-window comparisons.

This keeps production store-TCI unchanged unless explicitly disabled.
2026-07-22 18:16:01 -04:00
evan 4dd54253ab tcg/wasm32: add ?tcgdiff2 whole-execution differential (live compiled vs TCI shadow)
Mode 2 runs compiled LIVE and authoritative so corruption accumulates across
TBs as in the real crash, with a per-TB TCI shadow (restored from pre-snapshot)
as the known-good reference. Store-TCI disabled under this mode; compares
env/pc/DRAM per eligible store TB, now including slow-path completions.

Result: 153k+ live-compiled comparisons, zero divergence, confirming inline
store codegen is correct even under live accumulation. Cannot reach the reader
corruption in-browser: 2x-execution + full-state snapshot trips the guest
interrupt watchdog and is throughput-bound. Suspects narrowed to the store
slow-path (helper/unwind) and store-width interaction.
2026-07-22 16:45:01 -04:00
evan 1473b7ab10 tcg/wasm32: add opt-in compiled-vs-TCI per-TB differential checker
Runs authoritative TCI first, snapshots its result, rewinds guest state,
runs the compiled TB as a disposable shadow, compares GPRs/DRAM, then
restores TCI. Opt-in via wasm_diff_enable(); normal execution unchanged.

Valid comparison required restoring all state a single TB can touch:
- full CPUNegativeOffsetState (the env-8 interrupt check sits before env)
- deep CPUTLB.f[].table / d[].fulltlb per MMU mode
- and skipping async cpu_exit() force-exit races.

Only side-effect-safe candidates compared (store TB, no general helper).
Result: 160k+ store-TB comparisons during reader-open, zero divergence.
Per-TB store codegen is exonerated; corruption is emergent across TBs.
2026-07-22 16:05:41 -04:00
evan e45c1e2db1 wasm32: add node-only TB wasm dump tooling for static analysis (E9) 2026-07-22 08:00:39 -04:00
evan e80c3c7088 wasm32: E8 proves store bug is emergent (aggregate on 8-bit and 32-bit axes) 2026-07-22 07:25:17 -04:00
evan 3c064ae6c9 wasm32: add instantiated-TB counter; keep store-TCI (E4-E7 narrowed root cause) 2026-07-22 06:53:41 -04:00
evan 725845d0d8 docs(wasm32): record E3 bisection - store bug is aggregate, not one TB 2026-07-21 21:48:07 -04:00
evan b3ca9f1eb6 docs(wasm32): note per-op TCI needed to isolate store bug 2026-07-21 20:42:01 -04:00
evan 7cab93ede7 docs(wasm32): correct store-TCI comment to upstream root cause 2026-07-21 16:14:22 -04:00
evan 962fc6e71d feat(block): add ephemeral wasm vvfat writes 2026-07-21 15:36:39 -04:00
evan cbeba3fbe9 fix(display): classify X3 grayscale from loaded LUTs 2026-07-21 11:42:04 -04:00
evan e6ed78243d Ignore meson subprojects/.wraplock build artifact 2026-07-21 10:35:06 -04:00
evan ede6e5b9f3 Render X3 reader grayscale correctly (persistence + 4-level overlay)
The reader draws a crisp BW page, then a 4-level grayscale antialiasing
pass with inverted plane polarity (white = level 0 = both planes clear)
and near-empty planes. The old model replaced the whole frame with those
planes, wiping the page to an inverted muddle.

Model it as e-ink actually behaves: keep a persistent surface, detect
grayscale vs BW by DTM2's set-fraction (background is the white
majority), and in grayscale treat level 0 as no-drive (keep pixel) so
only the sparse antialiased edges repaint over the retained BW page. BW
refreshes still repaint every pixel. Reader text now renders sharp.
2026-07-21 10:27:17 -04:00
evan 1f76f73fee Work around wasm32 store-TB miscompile (reader font decompression)
A TB containing a guest store is miscompiled by the wasm backend: it
corrupts a pointer that a later load faults on. It reproduces in uzlib
inflate during the reader's font prewarm (browser panics with a rejected
Load access fault); native QEMU decompresses the same static flash font
fine, confirming a wasm32 codegen bug.

Force store-containing TBs onto the TCI interpreter as the working
workaround. Perf ceiling: those TBs no longer JIT-compile. Upgrade path:
localize the miscompiled op in tcg_wasm_out_qemu_st and drop this.
2026-07-21 09:16:31 -04:00
evan d2bb76e672 Ignore native build-native/ output dir 2026-07-21 08:34:50 -04:00
evan 3623a36693 Fix SPI-SD write-token timing and CMD13 response
ssi-sd now enters token mode as it returns the final R1 byte, so the
write-data token that immediately follows is not discarded. SPI CMD13
returns the internal sd_r1 response (upstream fix) instead of sd_r2_s,
which the adapter converts to the two-byte SPI R2 status; this stops the
repeated "Unexpected response to cmd 13" loop on guest status polls.

Drops the experimental store-TB TCI forcing and sd-watch OOB logging now
that the raw FAT32 image path is stable.
2026-07-21 07:42:41 -04:00
xteink 13b9231f6e Add xteink fork dev tooling (native flake devShell + README)
build / Vars (push) Successful in 2s
build / Build (aarch64-apple-darwin, ./.github/workflows/scripts/configure-macos.sh, ./.github/workflows/scripts/prerequisites-macos.sh, macos-14-xlarge, bash -e {0}, riscv32-softmmu) (push) Has been cancelled
build / Build (aarch64-apple-darwin, ./.github/workflows/scripts/configure-macos.sh, ./.github/workflows/scripts/prerequisites-macos.sh, macos-14-xlarge, bash -e {0}, xtensa-softmmu) (push) Has been cancelled
build / Build (debian:11.11, aarch64-linux-gnu, ./.github/workflows/scripts/configure-cross-linux-arm64.sh, ./.github/workflows/scripts/prerequisites-cross-linux-arm64.sh, ubuntu-22.04, bash -e {0}, riscv32-softmmu) (push) Has been cancelled
build / Build (debian:11.11, aarch64-linux-gnu, ./.github/workflows/scripts/configure-cross-linux-arm64.sh, ./.github/workflows/scripts/prerequisites-cross-linux-arm64.sh, ubuntu-22.04, bash -e {0}, xtensa-softmmu) (push) Has been cancelled
build / Build (debian:11.11, x86_64-linux-gnu, ./.github/workflows/scripts/configure-native.sh, ./.github/workflows/scripts/prerequisites-native.sh, ubuntu-22.04, bash -e {0}, riscv32-softmmu) (push) Has been cancelled
build / Build (debian:11.11, x86_64-linux-gnu, ./.github/workflows/scripts/configure-native.sh, ./.github/workflows/scripts/prerequisites-native.sh, ubuntu-22.04, bash -e {0}, xtensa-softmmu) (push) Has been cancelled
build / Build (x86_64-apple-darwin, ./.github/workflows/scripts/configure-macos.sh, ./.github/workflows/scripts/prerequisites-macos.sh, macos-14, bash -e {0}, riscv32-softmmu) (push) Has been cancelled
build / Build (x86_64-apple-darwin, ./.github/workflows/scripts/configure-macos.sh, ./.github/workflows/scripts/prerequisites-macos.sh, macos-14, bash -e {0}, xtensa-softmmu) (push) Has been cancelled
build / Build (x86_64-w64-mingw32, ./.github/workflows/scripts/configure-win.sh, windows-2022, msys2 {0}, riscv32-softmmu) (push) Has been cancelled
build / Build (x86_64-w64-mingw32, ./.github/workflows/scripts/configure-win.sh, windows-2022, msys2 {0}, xtensa-softmmu) (push) Has been cancelled
build / Upload (push) Has been cancelled
2026-07-20 17:51:18 -04:00
xteink 543cebcb3a WIP: SD write debugging (store-TB TCI + sd-watch) and vvfat/ssi-sd fixes
Diagnostic: routes store-containing TBs through TCI and logs out-of-bounds
guest stores to isolate the SdSpiCard corruption. Also carries the FAT32
vvfat root/cluster fixes and ssi-sd command framing. Squash/split before
upstreaming.
2026-07-20 17:48:33 -04:00
evan 64d7668b49 Fix browser TB compilation and ISSI flash commands 2026-07-20 10:17:58 -04:00
evan 2ab8860a24 Add SFDP data for IS25LP128 flash 2026-07-20 09:36:15 -04:00
evan c1ee841e58 Generalize m25p80 Read-ID 0x90/0xAB beyond SST chips 2026-07-20 09:00:24 -04:00
evan ce99303135 Fix esp_sha hash callback signature mismatch for emscripten 2026-07-20 07:45:14 -04:00
evan cddd964c57 Guard esp32c3 cache XTS-AES use when gcrypt absent 2026-07-20 07:25:59 -04:00
evan 1ff6c3a51e Fix GLib GCompareFunc type conflict for emscripten 2026-07-20 07:12:55 -04:00
evan a0adc5f6c0 Backport Emscripten RAM allocation fix 2026-07-20 06:50:58 -04:00
evan b0bce6c486 Add xteink browser bridge 2026-07-20 00:20:51 -04:00
evan d58495104a Declare minimal xteink device dependencies 2026-07-19 22:06:20 -04:00
evan d1d3f6e360 Limit wasm build to xteink devices 2026-07-19 21:57:52 -04:00
evan c4227568de Add xteink machine for wasm build 2026-07-19 21:56:40 -04:00
evan fa545a4ec1 Port qemu-wasm backend to Espressif QEMU 9.2 2026-07-19 21:40:41 -04:00