You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Course infra: browser test runner must run hardware specs (calls, locals, struct fields, hex/binary/underscore literals) #1477
Every lesson promises a spec whose test blocks run in the reader's browser. For hardware specs this is false today. Running runSpecTests (scripts/viewport-from-spec.mjs) and constsOf (scripts/agents-from-specs.mjs) from apps/website over the hardware spec tree:
Tests that typecheck and lower to HIR but fail in the runner
Spec
Result
Cause
fpga/clock_domain.t27
12 tests fail
locals in test blocks (StmtLocal: "statement is not an assert")
src/lib/t27Compiler.ts exposes only analyze / loaders; there is no evaluator in the player, so these courses fall back to recorded tri casts.
Scope
Evaluator support in the browser runner for: local bindings inside test, function calls (pure functions in the same module), struct construction and field access, if/switch expressions used in tests.
constsOf: integer literals with _, 0x, 0b; unary minus/not; references to other consts.
Legacy hardware specs written as module X { } that cannot be evaluated: port them, or list them as not-runnable with a reason.
A report: node scripts/spec-runnable-report.mjs (or a tri subcommand) listing, per spec under specs/fpga, specs/isa, specs/ternary, specs/pins, specs/boards: typecheck, HIR, tests run/passed, and the first unsupported node kind. Committed output is the ratchet; it only improves.
Acceptance
All specs in the table above run their tests in the browser runner (pass or fail on real assertions, not on unsupported nodes).
constsOf reads every literal form above.
Ratchet file of runnable specs added to CI; a course lesson cannot name a non-runnable spec without a cast marker.
Evaluator itself is specified in t27 where possible (only-t27 rule); any non-t27 code needs the owner-approved-foreign label first.
This issue blocks every hardware course in the epic.
Activity
player: baseline carries the four specs main gained since the old bas…
player: absorb the buses course -- regen for 7 courses, baseline carr…