pcbjam/tests/tools
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Istvan Matejcsok 0b8e7186d4 findings(E-1,E-2,E-3,E-6): ngspice service generations + credit-bounded event transport
Adapted from codex/asyncify-execution-owner-core 3753320. Service side mirrors
the occ-service shape (E-1 watchdogs, E-2 fail-all + boot-death fix — onerror
now rejects the in-flight boot waiter instead of stranding it, E-3
onmessageerror terminal, Blob URL revoked, per-generation evtQueue cleared on
retirement).

E-6 transport bounds (worker hunks re-applied inside the emscripten-6
em-pthread else-branch — the codex file predates that split, so this is a
re-application, not a cherry-pick):
- batch cut at 512 lines / 1 MiB exact JSON-UTF-8 bytes, measured before a
  line is retained; a single line > 1 MiB flushes the accepted prefix then
  stops the event stream terminally (never retained);
- posting gated by a 64-frame / 8 MiB unacked credit window; each frame
  carries { eventSequence, eventBytes } and is released only by an exact
  { sequence, bytes } ack; any mismatched ack is terminal;
- the service mirrors the same 64-frame / 8 MiB bound on its pre-handler
  queue, acks after handing a frame to __ngspiceOnEvent, and retires the
  generation on invalid credit; { fatal } frames retire the worker.

Tests: ngspice-service.test.ts (11, ported) — watchdogs, crash/bootError/
decode-fault settlement + recovery, out-of-order ids, sync postMessage throw,
stale-generation event drops, fatal-frame retirement. tests/tools/
ngspice-worker-batch-unit.ts (node:vm over the production worker source;
`npm run ngspice:worker-batch`) — bounded ordered chunks, byte-pressure
flush, 100k-chunk credit storm, over-limit line, exact ack lease. e2e harness
twin updated to speak the ack protocol (adds __ngspiceServiceTestHooks).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 18:18:02 +02:00
..
screenshots build+perf: wasm-opt the shipped wasm, and measure real frames in CI 2026-08-22 12:53:00 +02:00
cli-contract.ts batched upload resave: --resave-batch CLI + one staging pass per bulk upload (tasks-runner 0004) 2026-08-24 14:46:43 +02:00
corpus-lint.ts kicad-validity B3+C+S: revert toast, corpus lint, .kicad_mod tier 2026-07-14 19:02:13 +02:00
lint-ci-coverage.ts jspi: migration phases 0-7 — build knob, scheduler shim, test successor suite 2026-08-13 07:06:24 +02:00
lint-determinism.ts jspi cleanup: remove the asyncify-era residue — dead code, conditionals, pipeline scaffolding, stale prose 2026-08-14 09:25:32 +02:00
ngspice-worker-batch-unit.ts findings(E-1,E-2,E-3,E-6): ngspice service generations + credit-bounded event transport 2026-08-31 18:18:02 +02:00