Repository navigation
bench(warp-core): fixture F6, real-time game scenes - #933
flyingrobots wants to merge 4 commits into
Conversation
Three scenes (arena, pile, bullets) start a trusted host, install the game's contract package and build the world, then run 600 frames and tear down. Each frame submits one step intent with that frame's input, admits it, ticks once, and reads every body back as a renderer would. A pure Q16.16 physics step drives both the Echo rule and an in-memory reference; a run is valid only if the graph holds exactly the reference world and replaying retained patches reproduces the live root. The bench reports start-up, frame p50/p90/p99/max, frames over 16.7 ms, the render read, teardown and replay, and the game's own step time apart from Echo's. The rule runs the step twice per frame (footprint and executor), so Echo's share is reported as a stated model: the frame less twice the reference step time for the same frame. The step intent carries the scene's dimensions and the seed, so the rule reads nothing outside the graph and the intent; warp-core admits no global state, benches included (scripts/ban-globals.sh). The debug test f6_small_scenes_run_validly runs scaled scenes under footprint enforcement, with contacts made and broken and projectiles despawning. Written on claude/game-fixture (e564514), never compiled there; carried onto main and compiled here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clippy -D warnings rejected the f64-to-usize cast in the percentile index and the range loop that indexed the contact normal. Percentiles now take thousandths and round half up in integers; the impulse loop iterates the normal. The physics is unchanged: the same values, in the same order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The headline F6 line now carries only measured durations: frame
p50/p90/p99/max, frames over the 60 Hz budget, start-up, the render read,
the reference step timed alone (renamed from physics_p50_ms to
reference_step_p50_ms), teardown and replay. The old echo_model columns
move to a separate F6-residual line as
frame_minus_2x_reference_step_estimate_{p50,p99,max}_ms. Its comment says
it is a residual estimate, neither Echo's cost nor an upper bound on it:
the reference step is timed in a separate pass under different cache and
measurement conditions, and the residual also holds the rule's own world
read and diff.
The module and step docs no longer say a valid run means Echo stored
"what the game computed" in a sense that covers physics. Sharing step()
between the rule and the reference checks that hosted execution stores and
recovers the reference result; a bug in step() occurs on both sides.
Two hand-computed scenes check step() independently and, through the new
game::run_from, check the hosted graph too: an elastic head-on collision
that adds and then removes a contact edge, and a projectile that despawns
while in contact and takes its contact edge with it. Under a mutation of
step() (impulse sign flipped on one body, projectiles expire a frame
early) both fail while f6_small_scenes_run_validly still passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The topic listed C1 and F5 as the implemented fixtures. It now lists F6 and its runner, and says what a valid F6 run shows and does not show, and what its headline and residual lines measure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4df6b2a02
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Body { | ||
| id, | ||
| kind, | ||
| pos: [x, y.max(radius)], |
There was a problem hiding this comment.
Fit the full pile into the initial lattice before clamping
For the full PILE scene, the 12-unit lattice spacing allows only 42 bodies per row, so bodies 1764–2047 start below the floor and this clamp places all 284 at the same height. Bodies sharing a column then have centres less than two units apart despite having eight-unit diameters, creating deeply overlapping stacks instead of the documented non-overlapping starting lattice. This makes the benchmark measure artificial overlap recovery alongside the intended falling-pile workload. The scaled conformance test uses only 128 bodies and does not exercise this case. Adjust the placement spacing or scene dimensions so all 2,048 bodies fit without initial overlap, and add a full-size generator check.
Useful? React with 👍 / 👎.
Summary
Scope
Links
docs/studies/stack-on-main.mdon branchclaude/measure-stack) and its review.What a valid run shows, and does not
The same pure
stepfunction drives the Echo rule and the reference. A valid run shows that hosted execution stored, and the graph gave back, exactly what the reference path computed.It does not show that
stepis correct physics, because a bug instepoccurs on both sides. Two hand-computed scenes check collision, despawn and contact edges independently:f6_hand_collision_swaps_velocities_and_adds_then_removes_the_contactf6_hand_projectile_despawns_and_drops_its_contactWith
stepdeliberately broken (impulse sign flipped; projectiles expiring a frame early), both hand tests fail whilef6_small_scenes_run_validlystill passes.The headline
F6line reports only measured durations: frame p50, p90, p99 and max, frames over the 60 Hz budget, start-up, the render read, the reference step timed alone, teardown and replay. A separateF6-residualline reportsframe_minus_2x_reference_step_estimate. That is an estimate, not Echo's cost and not a bound on it.The graph stays the authority. The scene and seed travel in the intent, and there is no global state (
ban-globalsscans benches).Evidence (local, Rust 1.96, macOS, on
a4df6b2a's code; the last commit is docs only)ban-globalspass.warp-coresuite: 2,058 passed and 1 failed,special_files_are_rejected_before_a_read_attempt. That test binds a Unix socket under a scratch path longer thanSUN_LEN; from a shortTMPDIRits whole target passes, 27 of 27.docs/studies/stack-on-main/summary.mdonclaude/measure-stack. They were taken before the rename: the study'secho_modelcolumn is the same quantity as the residual estimate here.Documentation gate
docs/topics/BenchmarkSceneFixtures.mdlisted only C1 and F5 as implemented. It now lists F6 and its runner, and describes F6's construction, what validity shows, footprint enforcement and its clocks.Checklist
🤖 Generated with Claude Code