Repository navigation
Phase 7 (partial): browser visualizer for the engine - #4
Merged
Merged
Conversation
…s, NAIVE P matrix /app runs the WASM engine in the browser: start, step, back, run to end, reset. Shows the tile schedule (FLASH and NAIVE), the current tile's values, HBM bytes, tile and K/V counters, controller state, the dequantized output with its deviation from float attention, and for NAIVE the probability matrix read back from HBM. Shared with the golden model: presets (generated presets.ts), quantization (quantize.ts checked against golden values), tile order (checked against tile counts in the fixtures). Engine harness gains the tile-state and probability readouts (32-bit values; BigInt avoided). Not yet built from the Phase 7 list: MatrixEditor, SramPanel, HbmMeter, FLASH heatmap, Playwright smoke test. See docs/ARCHITECTURE.md section 12.
…ter, heatmap, smoke tests - Matrix editor: Q, K and V values are editable in the page; the browser quantizes them the same way as the golden model. Editing resets the run; "Reset to preset" restores the preset. - SRAM panel: the K and V tile buffers, read from the RTL (new debug ports dbg_kbuf, dbg_vbuf, dbg_kv_sel; no behavior change). The buffer in use is outlined. - HBM meter: bytes so far against the expected total for the configuration, from web/src/lib/traffic-table.ts, generated from sim/golden/traffic.py (freshness checked in pytest). - Attention heatmap: engine probabilities from HBM for NAIVE; float reference for FLASH, which never stores P (labelled as such). - Playwright smoke test (pnpm test:e2e, five tests) against the production build: FLASH output against the float reference, step and back, NAIVE probabilities, editing and re-running, phone width without horizontal scroll. - WASM harness: getKVBuffers(); the Node test checks the buffer in use holds the last K/V tile loaded. Phase 7 exit criteria in docs/PLAN.md are met. Docs updated: ARCHITECTURE section 12, STATE_SCHEMA, PLAN, CONTEXT, README.
web/public/tiny_attn.{mjs,wasm} are tracked again: the Vercel build has no Emscripten, so /app needs
them in git. web CI now runs Vitest and the Playwright smoke tests against the committed engine.
.gitignore re-includes the two files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 7: the browser visualizer at
/appruns the WASM engine clock by clock.cfg_qrows, HBM latency; Start, Step, Back, Run to end, Reset.dbg_kbuf,dbg_vbuf,dbg_kv_sel); no behavior change.Verification
pnpm test:e2e(Playwright, production build): 5 passed.pnpm test(Vitest): 10 passed.node wasm/test.mjs: PASS (exact O, bytes, tiles, K/V loads, cycles, tile state, probabilities, K/V buffer in use).pytest sim/golden: 54 passed (fixture, web-data and traffic-table freshness).bash sim/lint.sh: clean.pnpm typecheck,pnpm lint,pnpm build: clean.Notes
astro devhangs without output in this environment; the production build works.