Skip to content

tools/pta-web: publish the canary harness as a browser module, checked byte for byte - #121

Merged
kubeworkz merged 1 commit into
mainfrom
tools/pta-web
Nov 1, 2026
Merged

kubeworkz merged 1 commit into
mainfrom
tools/pta-web

Conversation

@kubeworkz

Copy link
Copy Markdown
Owner

Summary

Publishes the canary's PTA harness as a browser module, checked against the native harness byte for byte, so a web page can run the PTA error model on the frozen canary and show exactly what the harness prints.

Follows the spike/pta-web run 41330840193: the pinned harness built with emcc 3.1.74 printed the same bytes as gcc on three canary rows, in about 0.4–0.5 s per 1,000-image eval, from roughly 2.8 MB compressed (module ~110 KB, mostly pooled training data for --gatescale).

tools/pta-web/

  • build.sh: builds docs/designs/canary/harness with gcc and emcc (SHAPE=chain flags): a node build and the browser module (-sMODULARIZE, callMain + FS, loadable in node too). Checks MNIST against regenerate.sh's digests; pools to 8×8 with the harness's own pool
  • compare.sh: runs the canary's rows (seed 1, 128×64 tile, 1,000 images: format only, as budgeted, as budgeted, lit, fitted) natively, as the node build, and as the shipped browser module; fails unless all three print the same bytes; writes rows.json (each row's arguments and output) and a timing table
  • run-web.mjs: runs the browser module as a page would (in-memory filesystem, callMain)
  • README.md

.github/workflows/pta-web.yml

  • Runs on changes to docs/designs/canary/**, tools/pta-web/** or the workflow, on pull requests, and on demand
  • On main, a passing build is force-pushed as one commit to an orphan pta-web branch: module, canary network, pooled data, rows.json, and manifest.json (source commit, harness digests, compilers, per-file digests)
  • Pull requests check and publish nothing; a build that differs from the harness is never published (the publish step runs only after the comparison passes)

Testing

This pull request's own run builds everything and runs the three-way comparison. The spike already showed node-build parity; this adds the shipped module to the comparison.


Generated by Claude Code

…d byte for byte

The canary's pinned harness (docs/designs/canary/harness) built with
emcc, for a page to run in a worker.

- build.sh builds it with gcc and emcc: a node build, and the browser
  module (also loadable in node); checks MNIST against regenerate.sh's
  digests and pools it to 8x8 with the harness's own pool
- compare.sh runs the canary's rows natively, as the node build and as
  the browser module itself (run-web.mjs: in-memory filesystem and
  callMain, as a page does), fails unless all three print the same
  bytes, and writes rows.json (each row's arguments and output)
- .github/workflows/pta-web.yml runs both on changes to the canary or
  these tools; on main a passing build is force-pushed to the orphan
  branch pta-web with manifest.json (commit, harness and file digests,
  compilers). Pull requests check and publish nothing; a build that
  differs from the harness is never published

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017DE7ei4TzTMxDkSu5KwUv5
@kubeworkz
kubeworkz marked this pull request as ready for review November 1, 2026 17:47
@kubeworkz
kubeworkz merged commit 98954ac into main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants