Skip to content

test: prune the suites to golden scenes and public behavior - #11

Merged
siracozmen01 merged 19 commits into
mainfrom
prune-tests
Oct 24, 2026
Merged

siracozmen01 merged 19 commits into
mainfrom
prune-tests

Conversation

@siracozmen01

@siracozmen01 siracozmen01 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #4. It targets main now that #8, #9 and #10 have merged, and is brought up to date with merge commits.

Problem

The suites pinned twelve per-suite hashes (M3_DET_HASH, M3_SOLVER_HASH, M3_JOINT_HASH, M3_VOXEL_HASH and eight more) plus seven benchmark pins in bench/pins.txt, compared by tools/check_hashes.py. On top of those, almost every suite carried its own twin, replay and rollback copy of the same promise. A deliberate change of results meant regenerating many values, each covering one corner. The white-box suites (test_tree, test_voxstorm, test_soak) reached into internal state. And the 1000-body scale test made the sanitizer cells slow: the tsan cell of #8 timed out once at 900 s on it.

Change

Nothing under src/ or include/ changes (git diff --stat origin/main -- src include is empty).

Golden scenes. test/test_golden.c holds five result scenes and two format lines. The names line up with maul2d's where the job is the same (STACK, ROLLBACK, JOURNAL, ROLLBACK_SNAPSHOT, JOURNAL_TAPE):

  • STACK: a sphere pyramid, a column of every convex family, a compound, a mesh ramp, a height-field bowl, and every joint kind with springs, motors and limits on. A four-worker twin must match, and a warm world must step without allocating.
  • DESTRUCTION: a voxel wall carved by a box edit and an explosion, fracturing into islands.
  • VEHICLES: a geared car, a character on voxel stairs, cloth and a jelly in wind, crates in moving water.
  • ROLLBACK: the tour, snapshotted halfway. After a restore, the rerun must land on the same bits, a re-snapshot must be byte-equal, and a different continuation must diverge.
  • JOURNAL: the tour and then a seeded API walk, recorded from the world's birth. The replay into a fresh world and the same session on four workers must land on the recorded bits.
  • ROLLBACK_SNAPSHOT and JOURNAL_TAPE: the bytes of that snapshot and that tape, on lines of their own so the API pull request can move a format line while every result line stays.

The tour is one world holding the terrain, the joints, the vehicles and the wall, and a script that makes every journaled call at least once. That covers each create and destroy, each body, shape and joint setter, vehicle commands and gears, character moves and stance, soft-body pins and anchors, water in and out, wind, conveyors, mesh paint, geometry swaps, a broadphase rebuild and a pre-solve veto. The tour's results are pinned, not only run. ROLLBACK requires the rerun after the restore to land on the first run's hash and pins that hash; JOURNAL requires the replay and the four-worker run to land on the recorded hash and pins it. So an op whose state escapes the snapshot, or whose replay diverges, fails in every cell. ROLLBACK_SNAPSHOT and JOURNAL_TAPE pin the bytes.

The tour's coverage is asserted too, so it cannot erode quietly:

  • The journal scene walks its tape as [i32 op][i32 size][payload] records and requires every op code from 1 up to m3_opCount - 1. The bound comes from the op enum in src/journal.h (included only for the enum, so the suite still runs against the shared library), so a new op without a tour call fails the test.
  • After every tour frame, the world's public misuse counter must still be 0, so a tour call that starts being refused fails at the frame where it happens. Creates are checked for valid ids where they happen. m3LastResult is not used for this: the slot is per thread and success never clears it, so after the walk's by-design refusals (impulses on an empty pick) it would read as an error in every later check.
  • Both checks were shown to fail by hand: removing the tour's broadphase rebuild fails with "journal op 73 never reaches the tape", and adding a spring to the distance rope (refused, since springs drive hinge-like joints only) fails with "a tour call was refused by frame 24". This is what lets the per-suite twin, replay and rollback tests go: the golden scenes check every subsystem's snapshot state and every op's replay in every cell.

The values come from test/hashes.txt as M3_GOLDEN_<NAME> definitions. Configuration fails on a malformed or repeated line, and the regeneration command is in test/test_golden.c and docs/internals/determinism.md.

Benchmark scenes. As agreed, the PR check pins the 7 golden lines above. The seven benchmark scenes (bench/scenes.c, shared by the benchmark and the new test/test_bench.c) keep their old pins as M3_BENCH_* lines in test/hashes.txt, with one exception: BENCH_MESHGRAND moves from 8b0bad5eb01629a0 to f80cbd6d19b77d28. test_bench also checks the city block's twin run and the exactness of the 5000-body rollback. It is registered only in Release builds that are not sanitized, under the ctest label bench. The PR test presets exclude that label, the new <cell>-bench presets run only it, and the CI bench job runs them on main and every night: Linux x64 (GCC and Clang) and arm64, macOS, and Windows x64 and arm64. bench/pins.txt and tools/check_hashes.py are gone, and the benchmark only prints timings. So is #8's interim check, which the golden scenes replace: test/hash_check.h, the twelve suites' CheckHash calls (they went with the suites' hash scenes), the old per-line definitions in test/CMakeLists.txt, and the bench-pins job, whose seven pins test_bench now checks on six cells every night. docs/internals/determinism.md lists every pinned scene, where it is pinned and why the large ones are nightly only.

Why MESHGRAND moved. The first run of the nightly path on all six cells (run 40030134132, by workflow_dispatch) had five cells agreeing on all seven values. windows-clang-cl on x64 hashed MESHGRAND as f04e7adc16bee30d, while Windows arm64 with the same compiler agreed with the rest. The scene built its terrain heights with the host's sinf and cosf, and the Windows x64 C runtime differs from glibc and macOS in the last bits, so the scene's input differed before the engine ran a step. The old pin was only ever checked on Linux. The heights now come from the engine's m3ComputeCosSin, which is the same everywhere, so the value moves once, on every platform.

Host libm audit. The sources behind pinned values (test/test_golden.c, test/test_bench.c, bench/scenes.c) call no host math function at all, sqrt and floor included. Eight other suites use host trig (character, compound, jointdrive, queries, vehicle, math, joints, quickhull), but only for checks within a tolerance or for twin runs on one platform. No suite outside golden and bench compares a hash with a literal.

Nightly runtime: test_bench takes 19.1 s (ctest --preset linux-gcc-14-bench, Ryzen 9 5900X, GCC 14 Release).

Random draws. Every draw in the golden walk and in bench/scenes.c is its own statement. C leaves argument and initializer evaluation order to the compiler, and GCC and Clang differ: the old JOURNAL value differed between them for that reason.

Tests kept that cover a spec. Hostile-input refusals, documented contracts and a few behaviors that only one test pinned stay, moved where their suite went: TestAnchorConventionPinned, TestNegativeAndEdgeCoordinates, TestJournalCompositionRefusal, TestVoxelPoolSweep and TestFractureStorms (the fragment event cap and the dropped count) move into test_voxel.c. The dense colored pile twin moves into test_scale.c. The stale-id half of the runtime red team is now TestStaleRuntimeSetters, and the refusal half of the joint walls test is now TestJointWalls. test_scale.c shrinks from 1000 to 300 bodies; the full-size scenes are the nightly bench.

Suite headers now say what each suite checks after the pruning, and lose their record numbers.

Removed tests

Kinds: duplicate (another test or a golden scene checks the same promise), per-suite hash (a hash gate the golden scenes replace), storm (a long mixed run whose individual behaviors other tests pin), white-box (internal state or internal APIs), change detector, wall clock.

Removed Kind Covered by
test_determinism.c (whole suite): GateGoldenAndReplay, GateRollback, GateWorkerTwins per-suite hash, duplicate STACK (four-worker twin), ROLLBACK, JOURNAL
test_determinism.c: GateColoredPile moved TestColoredPileTwins in test_scale.c
test_tree.c (whole suite): churn and rebuild against brute-force queries white-box: the internal m3Tree the tree assertions of #10, which validate the tree every step and after every rebuild in Debug, sanitizer and fuzz builds; TestRebuildChangesNoAnswer, TestOverlapBeyondTwoHundredFiftySix and the analytic query tests
test_soak.c (whole suite): twenty thousand steps of journaled segments and rolling rollbacks storm, white-box allocator counts ROLLBACK and JOURNAL; STACK checks that a warm world steps without allocating; LeakSanitizer in the ASan cell
test_voxstorm.c: TestEditStormTwins storm, white-box filled counts the voxel assertion of #10 (filled count against occupancy at every surface rebuild); DESTRUCTION; the walk's voxel edits in JOURNAL
test_voxstorm.c: the other five tests moved test_voxel.c (see above)
test_world.c: TestWorldHashGate; test_solver.c: TestSolverHashGate; test_joints.c: TestJointHashGate; test_math.c: TestBitStability per-suite hash the five golden scenes, which run the math library throughout and every joint kind
test_angularcap.c: TestTwinsAndReplay, TestRollbackAcrossTheClamp duplicate ROLLBACK, JOURNAL (the tour sets the spin cap and the fast-rotation flag)
test_bodycontrol.c: TestSettersReplay duplicate JOURNAL (the tour calls every body setter)
test_bvh.c: TestBuildDeterminismAndRestore white-box: internal BVH bytes ROLLBACK (the tour's meshes ride the snapshot), TestRefereeGather
test_bvh.c: TestMeshSimUnperturbed duplicate STACK (mesh ramp), JOURNAL
test_character.c: TestMoveDeterminismAndJournal duplicate ROLLBACK, JOURNAL (two characters moving every frame, stance, a destroy)
test_character.c: TestFractureStorm storm TestCarvedFloorDrop, TestCarouselAndFragmentSurf, DESTRUCTION
test_character.c: TestCharacterCapacitySweep duplicate TestCharacterContracts (pool refusal, stale after destroy), the tour's create and destroy under ROLLBACK
test_compound.c: TestOffsetsReplayAndRollback, TestCompoundStorm duplicate, storm STACK (offset compound), the tour's two-shape crate whose lid it destroys after the snapshot; TestOffsetEquivalence, TestDumbbellInertia
test_core.c: TestIdPool, TestStack white-box: internal pool and scratch stack TestGenerationRetirement, TestStaleIdsEverywhere, TestIdsOutliveNoWorld; every scene under ASan
test_core.c: TestIdShapes change detector of struct sizes the format lines pin the bytes the snapshot and tape store; the API pull request redefines the ids
test_cylinder.c: TestCapsStackAndReplay duplicate STACK (cylinder column), the tour's cylinder
test_drivetrain.c: TestJournalReplay, TestMidShiftRollback, TestShiftThrashStorm duplicate, storm ROLLBACK, JOURNAL (drivetrain, gear select and commands mid-run), TestAutoShiftSprintTwins, TestNeutralAndReverse
test_explosion.c: TestTwinsReplayRollback duplicate DESTRUCTION, ROLLBACK, JOURNAL
test_fields.c: TestFieldsReplay duplicate JOURNAL (wind and conveyor set mid-run), TestWindStreamsTheFlag, TestConveyorCarries
test_filter.c: TestFilteredReplayAndRollback duplicate ROLLBACK, JOURNAL (the tour sets a filter)
test_force.c: TestForceReplayAndRollback duplicate ROLLBACK, JOURNAL (every force and impulse call)
test_gearpulley.c: TestTransmissionTwinsAndReplay duplicate STACK (gear and pulley), ROLLBACK, JOURNAL
test_hardening.c: TestZoo duplicate STACK, ROLLBACK, JOURNAL
test_heightfield.c: TestSnapshotAndReplay, TestContactTwins duplicate STACK (bowl), the tour's native grid under ROLLBACK and JOURNAL, TestContacts
test_introspection.c: TestProfileFillsAfterAStep wall clock none needed: profile times are not results; TestReadingIsPure still reads them
test_jointdrive.c: TestRuntimeOpsReplay duplicate JOURNAL (every joint setter)
test_joints.c: TestJointDeterminismSpine duplicate STACK, ROLLBACK, JOURNAL (a joint destroyed after the snapshot)
test_meshmaterial.c: TestPaintTwinsReplayRollback duplicate ROLLBACK, JOURNAL (the tour paints its deck)
test_newjoints.c: TestWallsTwinsAndReplay duplicate; its refusal half stays TestJointWalls; STACK (parallel joint)
test_queries.c: TestEventDeterminism duplicate TestEventTwinsAndJointStream (events), TestContactEvents
test_rebuild.c: TestRebuildTwinsReplayRollback duplicate ROLLBACK, JOURNAL (the tour rebuilds the broadphase), TestRebuildChangesNoAnswer
test_replayfile.c: TestFuzzPhase12Ops to TestFuzzPhase20Ops (8 tests) duplicate TestFuzz (kept) mutates a container; the JOURNAL tape holds every op; the libFuzzer journal target arrives in the release pull request
test_reshape.c: TestTwinsReplayRollback duplicate ROLLBACK, JOURNAL (the tour swaps a sphere's geometry)
test_scale.c: TestScaleSessionAndRollback duplicate at 1000 bodies ROLLBACK, JOURNAL; the nightly 5000-body rollback in test_bench
test_scale.c: TestCapacityGrowthSweep duplicate TestCapacityExhaustion (hardening)
test_sequences.c: TestRuntimeOpsRedTeam storm; its stale-id half stays TestStaleRuntimeSetters, TestStaleIdsEverywhere, ROLLBACK; of its bullet cross case, the filter half is in test_filter.c, the disabled-body half in test_bodycontrol.c and the wall in TestBulletStopsAtWall
test_softbody.c: TestSoftSessionAndRollback, TestSurfaceTwins duplicate ROLLBACK, JOURNAL (cloth, pressurized jelly, rope and tet jelly; pins and both anchor kinds)
test_softbody.c: TestSoftFractureStorm storm TestRopeInBowlAndCarve, DESTRUCTION
test_softsoft.c: TestMidContactRollback, TestShowcase duplicate ROLLBACK, JOURNAL; TestJelliesRefuseToMerge, TestRopeDrapesOverCloth, TestRopeBridge
test_softsoft.c: TestAnchorDeathStorm storm TestAnchorRedTeam (anchors to a destroyed body release silently); the tour destroys an anchored rope after the snapshot
test_softsoft.c: TestCapacityStormAndRing storm TestRopeBridge, TestCapacityExhaustion
test_solver.c: TestReplayEquality, TestMeshJournalAndRollback, TestSleepDeterminism, TestCcdDeterminism duplicate ROLLBACK, JOURNAL (sleep toggles, the bullet flag, continuous on and off); TestSleepFreezesAndWakes, TestBulletStopsAtWall
test_solver.c: TestDeepFuzzDeterminism duplicate TestDeepSphereRecovers, TestDeepCapsuleRecovers, TestCrossedCapsulesSeparate
test_stance.c: TestMidTunnelRollback, TestCrouchSpamMovingCeiling duplicate, storm ROLLBACK, JOURNAL (stance mid-run); TestDuckWalkStand (the veto)
test_tuning.c: TestKnobTwinsAndReplay duplicate JOURNAL (every world knob), TestGravityAndSpeedCap
test_vehicle.c: TestDriveDeterminism, TestBounceTwinsAndRollback duplicate VEHICLES, ROLLBACK, JOURNAL (car and skid-steer tank)
test_vehicle.c: TestStormUnderMovingCar storm TestCarveUnderParkedCar, TestDriveOnFragment
test_voxel.c: TestEditRollbackReedit duplicate ROLLBACK (voxel edits before and after the snapshot), TestSnapshotJournalAndDerivedRebuild
test_water.c: TestWaterTwinsReplayRollback duplicate VEHICLES, ROLLBACK, JOURNAL (a pool created and removed)
test_wheeljoint.c: TestJournalReplay, TestAxleCascadeStorm duplicate, storm STACK (wheel joint), JOURNAL, TestBrokenAxleDeterministic
test_world.c: TestGeometryCeilingConstants change detector none needed: the documentation PR cites the ceilings from the headers

Test code: 23,246 lines before, 18,865 after.

Budget

#8 is over the 10-minute budget (on run 40004257351, linux-clang-20-asan took 12m51s and linux-clang-20-tsan reached its 20-minute limit on the 1000-body scale test). This pull request brings it back: in CI, linux-clang-20-tsan takes 4m16s and linux-clang-20-asan 7m51s with three runs of every test. It also reverts the stopgaps #8 needed for the 1000-body scene: both sanitizer cells go back to the default 20-minute job limit, the tsan cell's 1800-second test limit goes, and every test in the pull request presets is held to 300 seconds. Locally the slowest test under TSan is now scale at 87 s, and the whole TSan suite takes 119 s.

Verification

Run locally through tools/heavy.sh:

  • linux-gcc-14: 51/51 in 2.8 s. linux-clang-20: 51/51 in 2.9 s, on the same values.
  • linux-clang-20-asan (Debug, scalar SIMD): 51/51 in 78 s, on the same values.
  • linux-clang-20-tsan: 51/51 in 119 s.
  • linux-shared: 45/45 (the whitebox suites are skipped there), golden included.
  • linux-gcc-14-bench: only bench runs, 1/1 in 19.1 s.
  • Regenerating with the documented command reproduces test/hashes.txt byte for byte.

Nightly path, by workflow_dispatch on 804c504 (run 40037539253): all six bench cells pass bench on the same 7 values, and required passes. Times: Linux x64 GCC 18.9 s, Linux x64 Clang 20.5 s, Linux arm64 22.1 s, macOS 21.7 s, Windows x64 13.9 s, Windows arm64 21.0 s.

CI shows the remaining cells (macOS, Windows x64 and arm64 on clang-cl, wasm, the shared-library package test) agreeing on the same values.

…e package version, the tools on clang-cl and the sanitizer cell's limit
The broadphase tree is validated once per step and after every rebuild, and a voxel chunk's filled count is checked against its occupancy bits whenever its surface is rebuilt. Debug, sanitizer and fuzz builds now catch a broken tree or a miscounted edit where it happens.
…ch pins

The shared build workflow uploads no hash output from a passing cell, so the compare-hashes job cannot run on it. Instead each suite that prints a world hash now compares it with test/hashes.txt, passed in as a definition, and the bench-pins job compares the benchmark scenes with bench/pins.txt again. A moved bit fails in the cell that moved it until the golden scenes replace both.
# Conflicts:
#	.github/workflows/ci.yml

@siracozmen01 siracozmen01 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review of f2ea214, this pull request's own diff on top of #10.

Changes needed (2), plus one verification step before merge.

  1. The tour's coverage, which the deleted tests rely on, is asserted nowhere (test/test_golden.c, the tour and SceneJournal). About seventy replay, rollback and twin tests are removed with "covered by ROLLBACK, JOURNAL (the tour calls every ...)". The body says that the tape holds every op code from 1 to 84 and that no tour call is refused was checked once by hand, with a temporary print, and that the test does not assert it. docs/internals/determinism.md states the rule "A new journaled call joins the tour" as prose only. Concrete failure: op 85 is added with its replay path and no tour call, or a tour call starts being refused ((void)m3Character_SetStance(...) already discards its result), and that op drops off the tape. Every golden scene still passes, or is regenerated, and no test replays the op anywhere. The standard asks for a rule that must always hold to be enforced by a tool. The check is small: walk the tape SceneJournal already holds ([op:4][bytes:4][payload], as TestHostileTape documents) and require every op code up to the journal's last one, and check m3LastResult() after each tour call group. If that needs the internal op enum, register golden as WHITEBOX for that one check.

  2. docs/internals/determinism.md line 3 describes the migration, not the product: "The documentation pull request of the migration completes the page." Docs say how the product works today, with no history or process notes. Delete the sentence. The docs pull request can extend the page when it lands.

Before merge: the seven M3_BENCH_* pins used to be checked on one cell (linux-gcc-14 x64, the old bench-pins job). From now on the nightly checks them on six cells, and five of them (gcc arm64, clang-20, macOS, both Windows) have never run these scenes against the pins. The bench job skips on pull requests, so a mismatch would first show as a red main. ci.yml has workflow_dispatch, so one run on prune-tests (gh workflow run ci.yml --ref prune-tests) shows all six bench cells before merge. Put the result in Verification.

What I checked and found correct

  • The hash gap from #8 is closed. test_golden gets its seven values from test/hashes.txt as compile definitions and runs in every PR cell (web and linux-shared included). A malformed or repeated line fails configuration, and a missing value reads as 0, so its scene fails. The ci.yml header ("every cell checks its world hashes against test/hashes.txt") is true again.
  • The scenes do what the body says. STACK checks 67 bodies and 14 joints, the zero alloc/free delta while warm (public m3World_GetCounters) and the four-thread twin. ROLLBACK reruns frames 120 to 239 after the restore and checks the same hash, a byte-equal re-snapshot, and that a different continuation diverges. JOURNAL records from birth, replays into a fresh world and reruns on four threads. Every draw in the walk and in bench/scenes.c is its own statement. The two format lines are pinned apart from the result lines.
  • Bench: bench/scenes.c is a verbatim move of the old scenes, apart from the split draws. The pins carried into hashes.txt are the old bench/pins.txt values. test_bench reads no clock (NULL) and checks the city block twin and the 5k restore and re-fight. It is registered only in non-sanitized Release builds (Release only for multi-config). The base test preset excludes the bench label, every PR test preset inherits base, and the -bench presets include only it, with noTestsAction: error. The bench job is pinned to v0.0.8 with contents: read. required lists it, and its "skipped" result on PRs passes.
  • Scale: BuildMiniBlock goes from 1000 to 300 bodies. Its draws still share one initializer, but test_scale compares serial and pooled runs of the same build only, so the order cannot matter there. The tsan cell took 4m16s.
  • Budget: the asan cell now has repeat: 3 and its 45 minute override is gone. It took 7m51s. The slowest PR cell is under 10 minutes, and the per-test timeout drops from 900 s to 300 s.
  • The deleted white-box suites are covered as stated. test_tree is replaced by #10's m3TreeValidate asserts after every pair update and every rebuild, and the TestEditStormTwins filled count by #10's FilledVoxels assert. Both are on in the Debug sanitizer cells.
  • Nothing under src/ or include/ changes. tools/check_hashes.py and bench/pins.txt are gone, the README is updated, and docs and zizmor are green.

# Conflicts:
#	.github/workflows/ci.yml
#	test/CMakeLists.txt
#	test/test_character.c
#	test/test_determinism.c
#	test/test_drivetrain.c
#	test/test_joints.c
#	test/test_math.c
#	test/test_softbody.c
#	test/test_softsoft.c
#	test/test_solver.c
#	test/test_vehicle.c
#	test/test_voxel.c
#	test/test_water.c
#	test/test_world.c
Under ThreadSanitizer the 1000-body scale test ran past its 900-second test limit on three runs. The cell now allows 1800 seconds per test and 45 minutes per job; the tests pull request, which shrinks the scene, reverts both.
# Conflicts:
#	.github/workflows/ci.yml
siracozmen01 added a commit that referenced this pull request Oct 23, 2026
…ci (#8)

## Problem

maul3d still builds as C17 with its own copy of the family's build
files, runs a hand-rolled CI whose pull request check takes 18 to 25
minutes, and does not use the organization's shared workflows. This is
the first pull request of the migration to the repository standard (#4).

## Change

- **Family files:** `family_sync.py --write maul3d` (the check reports 0
differences). This brings the C23 `CompilerFlags.cmake` (GCC 14, Clang
19, clang-cl; MSVC's cl is refused), the header tests, the shared tools,
the renamed `cpu.c`, `cpu.h` and `simd.h`, and
`docs/internals/maul-conventions.md`. It removes `CONTRIBUTING.md`,
`docs/conventions.md` and `docs/adr/`. The family copy tools
(`check_family.py` and its lists) go, since the canonical copies now
live in the organization's `.github` repository.
- **Build:** the library names for the family checks, libm linked by the
library itself, the world's CPU check through `m3CheckCpu`, the public
CPU functions kept exported, and the MSVC contraction pragma gone
(clang-cl gets `-ffp-contract=off` from the flags). `MAUL3D_FUZZ` and
`MAUL3D_TEST_PACKAGE` options; `cmake/PackageTest.cmake` installs the
build and builds `samples/minimal` against it.
- **Formatting:** every C file reformatted with the family's
`.clang-format` (regrouped includes, inserted braces). No code changes.
- **Presets:** `CMakePresets.json` defines one configure, build and test
preset per CI cell, built in `out/<preset>`.
- **CI:** `ci.yml` calls the shared `changes`, `docs-check`, `zizmor`
and `cpp` workflows at v0.0.8, in CI image 2026.10.4, with `permissions:
{}` and bash as the default shell. Cells: GCC 14 on x86-64 and arm64,
Clang 20, ASan and UBSan on the scalar backend, TSan, shared with the
package test, macOS, and clang-cl on Windows x64 and arm64. Also MSVC
headers, wasm under Node, the testbed on main and nightly, and one
`required` job. Also `codeql.yml` (gcc-14 in the image),
`scorecard.yml`, `pr-gate.yml`, `pr-title.yml`, `pages.yml` and
`dependabot.yml`.
- **Checks that turn on later:** the pull requests that fix them enable
their checks. `check_modules` arrives with the module graph.
`check_source` and `check_docs` arrive with the API that meets the
conventions. Cognitive complexity arrives with the pull request that
splits or lists the functions above 25.
- **Release:** the old tag-push `release.yml` goes. The release-please
workflow arrives in the migration's last pull request, so no release
pull request opens before it.
- **Timeout:** the test presets allow 900 seconds per test. The two
sanitizer cells run once with a 45-minute job limit, and the tsan cell
allows 1800 seconds per test, until the tests pull request prunes
`scale` and `soak`. That pull request reverts both and turns on the asan
cell's three runs of every test. The tsan limits are needed because the
1000-body `scale` test is slow, not flaky: it passes or fails only on
how close it lands to its limit. Under TSan it ran past 900 seconds on
three runs (run 40004257351 on this pull request, the first run on #10's
head, and run 40028656793 on f6c1d01, where `soak` took 317 s besides).
A rerun of the same commit passed in 9m23s. Retrying until green would
hide that, so the limit is raised instead.
- **Fixes the new cells needed:** `samples/minimal` asks for the package
without a version, since before 1.0 the package accepts only its exact
version. The tools build on clang-cl with `_CRT_SECURE_NO_WARNINGS` for
`fopen`. The bindings check runs with `clang-20`, since the image has no
`cc`.

- **Hashes, until the golden scenes:** the old `compare-hashes` job
collected every cell's printed hashes as artifacts, but the shared
`cpp.yml` uploads nothing from a passing cell. Instead, the twelve
suites that print a world hash now compare it with `test/hashes.txt`
themselves, through `test/hash_check.h` and one `M3_GOLDEN_<NAME>`
definition per line. Configuration fails on a malformed or repeated
line. Every cell checks the same file, so a bit that moves on one
platform, or everywhere, fails the cell where it moves. The `bench-pins`
job (one Release cell in the image) compares the seven benchmark scenes
with `bench/pins.txt` again, and `required` needs it.
`tools/check_hashes.py` stays for regenerating the file. The tests pull
request (#11) replaces all of this with the golden scenes. This keeps #9
(pure moves) and #10 (assertions), whose promise is that no bit moves,
checked.
- **Formatting check:** the clang-format step fails on an empty file
list instead of letting `xargs` run on stdin.

## Budget

This pull request is over the 10-minute pull request budget, and that is
accepted only for this series, because the tests pull request (#11)
fixes it:
- On run 40004257351, `linux-clang-20-asan` took 12m51s on its own, with
one run of every test and a 45-minute limit.
- On the same run, `linux-clang-20-tsan` reached its 20-minute limit
because the 1000-body `scale` test hit the 900-second ctest timeout. It
did so again on #10's head and on f6c1d01, so the tsan cell now has the
longer limits described above.
- #11 shrinks `scale` to 300 bodies and moves the large scenes to the
nightly `bench` label. There, locally, the whole suite takes 61 s under
ASan and 109 s under TSan, and #11's body gives the CI numbers.

## Verification

- `family_sync.py --check maul3d`: 0 differences.
- Presets `linux-gcc-14` and `linux-clang-20-asan` configure and build.
`linux-gcc-14`: 54/54 tests pass, and `tools/check_hashes.py` reports
all 12 hashes match `test/hashes.txt`, so C23 and the reformat moved no
bit.
- Local runs of the checks job: `check_lengths` (20 exceptions within
ceilings), `check_guide`, `check_bindings` and `build_docs.py` pass.
clang-tidy 20 without the complexity check is clean.
- `linux-shared` with the package test, and `check_bindings.py
clang-20`: pass locally.
- Hash check: `linux-gcc-14` and `linux-clang-20` pass 54/54 with the
committed values. Changing one digit of `M3_MATH_HASH` fails
`test_math`, and a malformed line fails configuration. The bench-pins
steps, run locally, match all seven pins in 20 s.
- `docs_check.py`: ok. zizmor 1.30.1: no findings.

Part of #4
The terrain heights came from the platform's sinf and cosf, which differ in the last bits on Windows x64, so its pinned hash differed there before the engine ran a step. m3ComputeCosSin gives the same heights everywhere; BENCH_MESHGRAND moves once, on every platform.
Base automatically changed from invariant-asserts to main October 24, 2026 02:05
# Conflicts:
#	.github/workflows/ci.yml
#	CMakePresets.json
#	test/CMakeLists.txt
#	test/test_bodycontrol.c
#	test/test_character.c
#	test/test_compound.c
#	test/test_determinism.c
#	test/test_drivetrain.c
#	test/test_filter.c
#	test/test_force.c
#	test/test_joints.c
#	test/test_math.c
#	test/test_queries.c
#	test/test_soak.c
#	test/test_softbody.c
#	test/test_softsoft.c
#	test/test_solver.c
#	test/test_tuning.c
#	test/test_vehicle.c
#	test/test_voxel.c
#	test/test_voxstorm.c
#	test/test_water.c
#	test/test_world.c

@siracozmen01 siracozmen01 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review at 32d4d6a. I had not reviewed this pull request before, so this covers the whole diff against main, with the merge leftovers, the tape walk and MESHGRAND checked in detail.

Ready. No findings.

Merge leftovers: none remain. The diff touches no file under src/ or include/. test/hash_check.h, bench/pins.txt, tools/check_hashes.py and the determinism, soak, tree and voxstorm suites are deleted, and no added line refers to hash_check, CheckHash, check_hashes or pins.txt. No suite gains a duplicate #include; new includes appear only in bench/scenes.c, bench/scenes.h, test/test_bench.c and test/test_golden.c. ci.yml no longer has the bench-pins job, and required lists bench in its place.

Tape walk: src/journal.c writes the tape from offset 0 as bare records (op int32, payload size int32, payload), with no header, so CheckTapeHoldsEveryOp reads the same layout. Each of its checks can fail: an op outside 1..m3_opCount-1, a negative size, or a size past the end stops the walk short, and at == bytes fails; an overflowed tape (StopJournal returns -1) fails the same check; and every op code never seen fails with its own line. The per-frame misuse != 0 check in TourFrame runs before each step and reports once, so a tour call refused for any reason fails the suite.

MESHGRAND: the terrain heights now come from m3ComputeCosSin(...).s and .c, so no host libm call shapes the scene. The pin moves to f80cbd6d19b77d28 in test/hashes.txt, and determinism.md states the rule for every scene.

Hashes and presets: test/CMakeLists.txt still refuses a malformed or repeated line, and gives the definitions to test_golden and, when it exists, to test_bench. A missing value reads as 0, so its scene fails. test_bench is built only in Release without sanitizers (single-config) or registered for Release only (multi-config). The PR test presets exclude the bench label, and the six -bench presets include only it with noTestsAction: error, so an empty selection fails. The tsan cell is back on the preset timeout and the base timeout is 300 s, which suits the pruned suites.

Note, not blocking: the comment above test_bench in test/CMakeLists.txt says the scenes "take minutes", while test_bench.c, ci.yml and determinism.md say about twenty seconds in Release.

@siracozmen01
siracozmen01 enabled auto-merge (squash) October 24, 2026 02:15
@siracozmen01
siracozmen01 merged commit 26eaeae into main Oct 24, 2026
28 of 35 checks passed
@siracozmen01
siracozmen01 deleted the prune-tests branch October 24, 2026 03:05
siracozmen01 added a commit that referenced this pull request Oct 24, 2026
Part of #4. The first of four pull requests that follow the tests pull
request: this one (CI and family files), the API change, the audits, and
the source check.

## Change

- **Shared workflows:** every reusable workflow moves from v0.0.8 to
v0.0.12 (`0364102`). The jobs that name the CI image themselves
(ci.yml's `checks` and `testbed`, and codeql.yml) move from 2026.10.4 to
2026.10.6, the image v0.0.12's `cpp.yml` runs. It adds the llvm-20
symbolizer, so sanitizer stacks are readable again. `cpp.yml` now also
runs its container with `--init`.
- **Schedules:** the scheduled runs take maul3d's slots from the
organization's schedule: ci at `37 4 * * *` (the nightly bench job is
part of it), CodeQL at `41 8 * * 4`, and Scorecard at `52 9 * * 0`.
- **Family sync:** `family_sync.py --write maul3d` brings three
canonical files, and `--check` reports 0 differences:
- `docs/internals/maul-conventions.md`: a creation that takes no other
library object is a root that carries the ABI stamp, and bad untrusted
data (a file, a snapshot, a tape, a packet) is refused with its status
and counts no misuse.
- `tools/check_lengths.py`: it also lists `NOLINTNEXTLINE` complexity
exceptions.
- `tools/gen_api.py`: the API page renders `@param`, `@return` and
`@par`.
- **A stale comment:** `test/CMakeLists.txt` said the bench scenes take
minutes. They take about twenty seconds in Release, as everything else
says (the reviewer's note on #11).

The conventions this sync brings are not met yet. The API pull request
and the audits that follow it apply them to maul3d.

## Verification

- `family_sync.py --check maul3d`: 0 differences.
- `check_lengths.py` (20 exceptions within their ceilings),
`check_modules.py`, `check_guide.py` and `build_docs.py` pass locally
with the synced tools.
- zizmor 1.30.1: no findings.
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