Skip to content

spec(t27f): reel host entry points for wasm hosts (Closes #9980) - #9982

Merged
gHashTag merged 1 commit into
masterfrom
t27f/reel-host-entry
Oct 17, 2026
Merged

gHashTag merged 1 commit into
masterfrom
t27f/reel-host-entry

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Summary

This PR adds scalar host entry points to specs/t27f/reel.t27, so a wasm host can draw stills of the demo reel without re-implementing the spec's math. Closes #9980. Refs #9965.

A wasm export carries scalars only, and gen-js emits constants but no bodies. So the new entry points take the demo reel by name rather than as arrays. They also compose the camera with the screen mapping inside the spec, so the host only draws what they return:

  • corner_dx(i) and corner_dy(i): corner i of a pointy-top hexagon, in world units;
  • demo_frames(), demo_scene_at(f) and demo_still(scene): the demo reel's frame clock;
  • demo_sx, demo_sy and demo_r: world coordinates to screen pixels at frame f, for a given preset;
  • demo_corner_sx and demo_corner_sy: a cell's corner on screen.

The consumer is gHashTag/t27-mcp t27f_view, which runs the bodies from a wasm build of this file's Zig output and reads the constants from its gen-js output.

Tests added

  • hexagon_corners_close_the_cell: opposite corners mirror, the top corner is at -HEX_R, and the side corners are at +/-HALF_W.
  • demo_entry_points_match_the_reel:
    • 360 frames; frame 224 is scene 2 and is its still;
    • out-of-range scenes return END_OF_REEL;
    • the focus cell lands at the screen centre (640, 360) with focus radius;
    • the lens still maps the lens centre to the screen's vertical centre.
  • overview_still_fits_every_frame: every corner of every cell at the overview still lies inside the frame on all three presets (486 asserts).

Evidence (Railway lab, compiler 0.5.2 built at 57474a4)

  • Verbose test report: 19/19 tests pass and 4 invariants are proved, 0 vacuous.
  • Negative controls, each a mutated copy of the spec, all killed:
    • n1: the sign of corner_dy(0) flipped fails 2 tests;
    • n2: >= changed to > in demo_still fails 1 test;
    • n3: camera_cy replaced by OVERVIEW_CY in demo_sy fails 1 test. It survived until the lens-still assert was added, because cell 10's y equals OVERVIEW_CY.
  • sha256 of specs/t27f/reel.t27: 1ec53e9f89801946c7c265049e20b775dbf4d71822bd4c00b262c827a3e76f87.

The header no longer says that no host imports the file. It now names t27f_view as the only host. It still says that no video has been rendered.

🤖 Generated with Claude Code

A wasm export carries scalars only and gen-js emits no bodies, so a host
could not run reel.t27's camera and screen mapping without re-implementing
them. Add scalar entry points that name the demo reel and compose camera with
screen mapping: corner_dx/dy, demo_frames, demo_scene_at, demo_still,
demo_sx/sy, demo_r, demo_corner_sx/sy. gHashTag/t27-mcp t27f_view draws stills
from a wasm build of the Zig output.

Tests: hexagon_corners_close_the_cell, demo_entry_points_match_the_reel,
overview_still_fits_every_frame (every corner of every cell on every preset).

Refs #9965

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag

Copy link
Copy Markdown
Owner Author

Consumer: gHashTag/t27-mcp#3 (t27f_view) builds these entry points into wasm/reel.wasm and draws the demo stills from them.

@gHashTag
gHashTag enabled auto-merge (squash) October 17, 2026 15:10
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-17 15:10:58 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e769ef021713 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit f055775 into master Oct 17, 2026
26 of 28 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.

spec(t27f): reel host entry points so a wasm host can draw stills

1 participant