Skip to content

bench(warp-core): fixture F6, real-time game scenes - #933

Open
flyingrobots wants to merge 4 commits into
mainfrom
claude/f6-game-scenes
Open

flyingrobots wants to merge 4 commits into
mainfrom
claude/f6-game-scenes

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • Adds fixture F6: three game scenes (arena, pile, bullets) run frame by frame through the trusted host. Each frame submits a step intent, admits it, ticks, and reads every body back as a renderer would. A run is validated against an in-memory reference and reports figures only when it is valid.
  • Bench and test code only, plus the fixtures topic. No runtime code changes.

Scope

  • Tests only
  • Docs only
  • Runtime code

Links

  • No issue. This came out of the stack-on-main study (docs/studies/stack-on-main.md on branch claude/measure-stack) and its review.

What a valid run shows, and does not

  • The same pure step function 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 step is correct physics, because a bug in step occurs on both sides. Two hand-computed scenes check collision, despawn and contact edges independently:

    • f6_hand_collision_swaps_velocities_and_adds_then_removes_the_contact
    • f6_hand_projectile_despawns_and_drops_its_contact

    With step deliberately broken (impulse sign flipped; projectiles expiring a frame early), both hand tests fail while f6_small_scenes_run_validly still passes.

  • The headline F6 line 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 separate F6-residual line reports frame_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-globals scans benches).

Evidence (local, Rust 1.96, macOS, on a4df6b2a's code; the last commit is docs only)

  • F6 test file, a debug build with footprint enforcement: 12 passed, 0 failed.
  • Checks: fmt, both clippy runs, SPDX, the feature-gated test check and ban-globals pass.
  • Full warp-core suite: 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 than SUN_LEN; from a short TMPDIR its whole target passes, 27 of 27.
  • Measured figures are in docs/studies/stack-on-main/summary.md on claude/measure-stack. They were taken before the rename: the study's echo_model column is the same quantity as the residual estimate here.

Documentation gate

  • docs/topics/BenchmarkSceneFixtures.md listed 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

  • CI green (fmt, clippy, tests, rustdoc, audit/deny)
  • Kept PR small and focused (one thing)

🤖 Generated with Claude Code

flyingrobots and others added 4 commits October 20, 2026 11:40
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>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: flyingrobots/echo/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f0560ea5-c843-44b4-844f-45f26b27e44c
📥 Commits

Reviewing files that changed from the base of the PR and between 0faaf58 and a4df6b2.

📒 Files selected for processing: 6
  • crates/warp-core/Cargo.toml
  • crates/warp-core/benches/game_scenes.rs
  • crates/warp-core/benches/support/fixtures/game.rs
  • crates/warp-core/benches/support/fixtures/mod.rs
  • crates/warp-core/tests/scene_fixture_tests.rs
  • docs/topics/BenchmarkSceneFixtures.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T12:07:51.049693Z a4df6b2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant