GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(id): prove world snapshot determinism across architectures by dezren39 · Pull Request #3953 · developing-today/code

test(id): prove world snapshot determinism across architectures #3953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
dezren39 merged 2 commits into main from queue/5781-3791-determinism-proof
Nov 1, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

test(id): prove world snapshot determinism across architectures #3953

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
703af4b
test(id): pin world snapshot hashes for replay
dezren39 Nov 1, 2026
a853bd6
fix(ci): scope ARM64 snapshot test to id package
dezren39 Nov 1, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

45 changes: 40 additions & 5 deletions 45 .github/workflows/id-check.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ on:
- ".github/scripts/check-id-pr-checks.sh"
- ".github/scripts/check-crash-gate-coverage.sh"
- ".github/scripts/check-id-source-snapshot.sh"
pull_request:
paths:
- "pkgs/id/**"
- ".github/workflows/id-check.yml"
- ".github/scripts/id-pr-checks.txt"
- ".github/scripts/check-id-pr-checks.sh"
- ".github/scripts/check-crash-gate-coverage.sh"
- ".github/scripts/check-id-source-snapshot.sh"
schedule:
# Nightly backstop for the full flake check (main tier, #1781).
- cron: "41 8 * * *"
Expand Down Expand Up @@ -174,22 +182,49 @@ jobs:
- name: Run PR check
run: nix build -L --no-link "./pkgs/id#checks.x86_64-linux.${{ matrix.check }}"

# Replay the same checked-in WASM session natively on ARM64. This is a
# focused test, not a cross-compiled build: the fixture's per-event snapshot
# digests must match the x86_64-pinned values above.
world-snapshot-arm64:
name: "native arm64: world snapshot determinism"
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
env:
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_TEST_DEBUG: line-tables-only
steps:
- uses: actions/checkout@v7

- uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23
with:
extra-conf: |
accept-flake-config = true

- name: Run the checked-in session snapshot test natively
run: >-
nix develop ./pkgs/id --command cargo test
--manifest-path pkgs/id/Cargo.toml --lib
world_fixture::tests::replay_tests::checked_in_session_snapshot_hashes_are_stable
Comment thread Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 1, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Select the id package in the required ARM64 test job

The new ARM64 command omits -p id, so it selects both workspace default members (id and id-core, as configured in pkgs/id/Cargo.toml). The test-name filter does not prevent compiling id-core's library tests, which reference vt100::Parser in crates/id-core/src/world_presentation.rs without declaring that dependency. Consequently this job fails before providing the cross-architecture verdict, and its newly required status makes the nix flake check aggregate fail too. The commit's verification notes already report this exact workspace-default failure. Add -p id, matching the locally verified invocation; cargo test --help documents --package as “Package to run tests for,” whereas --lib only selects the library target.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dezren39 dezren39 Nov 1, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Agreed — this also explains the ARM64 job failure on this PR (exit code 101): without -p id the job builds the default workspace members including id-core, whose test build is already broken on clean main (vt100 / iroh test-utils mismatch, documented on task 5781). Fix on resume: add -p id to the ARM64 job test command in this PR branch (queue/5781-3791-determinism-proof, worktree ~/git/fleet/5781-3791), push, and re-read the native ARM64 verdict — the snapshot-hash result itself is still unreported because the run has not completed (guard job queued; job logs unavailable until the run finishes). Queue task 5781 is parked with this as the named next step.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dezren39 dezren39 Nov 1, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fixed in a853bd6 (already on this head): the ARM64 job command is now cargo test -p id (scoped to the id package, .github/workflows/id-check.yml), so id-core lib tests are no longer compiled by this job. Verified: the native arm64: world snapshot determinism job on this head completed with success (run 41349443029). Disposition recorded by queue task 5781, lane E.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
-- --exact

# Aggregator: preserves the historical required status context
# "nix flake check" so branch protection keeps working unchanged,
# while the matrix above does the real work in parallel.
check:
name: nix flake check
needs: check_each
needs: [check_each, world-snapshot-arm64]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require every PR check job to succeed
run: |
result="${{ needs.check_each.result }}"
echo "matrix result: $result"
if [ "$result" != "success" ]; then
echo "::error::one or more PR check jobs did not succeed (result: $result) — see the per-check jobs above."
matrix_result="${{ needs.check_each.result }}"
arm64_result="${{ needs.world-snapshot-arm64.result }}"
echo "matrix result: $matrix_result"
echo "native arm64 snapshot result: $arm64_result"
if [ "$matrix_result" != "success" ] || [ "$arm64_result" != "success" ]; then
echo "::error::the x86_64 PR checks or native arm64 determinism check did not succeed — see the jobs above."
exit 1
fi

Expand Down
67 changes: 67 additions & 0 deletions 67 pkgs/id/src/world_fixture.rs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,73 @@ mod tests {
assert_eq!(verification.steps, 5);
}

#[test]
fn checked_in_session_snapshot_hashes_are_stable() {
const EXPECTED_SNAPSHOTS: &[(u64, &str)] = &[
(
3,
"df60a55b4fe5303e1a769073e78e0fdb3febf9771a3d54ca8867fea5dcfa85fb",
),
(
4,
"106ec01c72ca951854c493419f42d63123a041ffb90bb88d15487d33aa587c34",
),
(
5,
"5f1a21e7982fcedda44d4fd00a59607179d123bcc5d1ae834067db61b568c119",
),
(
6,
"9d47f9be7afe3d2a965992b49c38e8e30b8217adfd5c18c76904d0ecd193abb5",
),
(
7,
"c95eed39e456d648b240018390710c9221a9f823fe5c98e0521b53fafcbe31f2",
),
];

let fixture_text = include_str!("../tests/fixtures/tic-tac-toe-determinism.jsonl");
let fixture = decode(fixture_text).unwrap();
check_module(&fixture.header, TIC_TAC_TOE).unwrap();
let runner = Sandbox::compile(TIC_TAC_TOE, SandboxLimits::default()).unwrap();
let start = replay_start(&fixture.events).unwrap();
let mut world = runner.instantiate(7).unwrap();

let mut snapshots = 0;
for event in &fixture.events[start..] {
let Some(world_event) = replay_event(event) else {
continue;
};
WorldProgram::update(&mut world, &world_event).unwrap();
let snapshot = world.snapshot().unwrap().unwrap();
let actual = blake3::hash(&snapshot).to_hex().to_string();
let Some(expected) = EXPECTED_SNAPSHOTS.get(snapshots) else {
panic!(
"snapshot digest mismatch at sequence {}: expected no further snapshot, actual {}",
world_event.sequence, actual
);
};
assert_eq!(
world_event.sequence, expected.0,
"snapshot sequence differs from the checked-in session"
);
assert_eq!(
actual, expected.1,
"snapshot digest mismatch at sequence {}: expected {}, actual {}",
world_event.sequence, expected.1, actual
);
snapshots += 1;
}
if let Some((sequence, expected)) = EXPECTED_SNAPSHOTS.get(snapshots) {
panic!(
"snapshot digest mismatch at sequence {sequence}: expected {expected}, actual <missing>"
);
}

let replayed = replay(&runner, 7, &fixture, false).unwrap();
assert_eq!(replayed.verdict, Verdict::Match);
}

#[test]
fn a_nondeterministic_guest_fails_verify() {
// The sandbox gives a guest no nondeterminism channel: it receives
Expand Down
8 changes: 8 additions & 0 deletions 8 pkgs/id/tests/fixtures/tic-tac-toe-determinism.jsonl
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"fixture":1,"world":"tic-tac-toe-determinism","module_hash":"8aaca464562944fa0832a9d42e97c838cad45a58fc8a12c293f3a222d884b9f9","current_sequence":7,"complete":true,"records":{"board":"XXXOO----","plays":5,"winner":"X"}}
{"sequence":1,"kind":"other","name":"program_installed"}
{"sequence":2,"participant_id":1,"kind":"chat","text":"gl hf"}
{"sequence":3,"participant_id":1,"kind":"input","hex":"30"}
{"sequence":4,"participant_id":2,"kind":"input","hex":"33"}
{"sequence":5,"participant_id":1,"kind":"input","hex":"31"}
{"sequence":6,"participant_id":2,"kind":"input","hex":"34"}
{"sequence":7,"participant_id":1,"kind":"input","hex":"32"}
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.