Skip to content

refactor(family): break the include cycles into a one-way module graph - #9

Merged
siracozmen01 merged 10 commits into
mainfrom
module-graph
Oct 24, 2026
Merged

siracozmen01 merged 10 commits into
mainfrom
module-graph

Conversation

@siracozmen01

@siracozmen01 siracozmen01 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The family conventions require a one-way module graph, declared in tools/modules.txt and checked by tools/check_modules.py. maul3d's includes formed two cycles, one of 4 modules (allocator, core, dynamic_tree, world_internal) and one of 24 (body through world_state). Most of it came from low-level helpers declared in high-level headers, and from 106 includes nothing used. This is the second pull request of the migration series (#4). It targets main now that #8 has merged, and is brought up to date with a merge commit. The 12 world hashes that #8 checks in every cell must still match, which is what shows these moves change no result.

Change

Code moves between files; no logic changes. Each new module holds functions moved verbatim, with their comments:

New module Moved from What
misuse core m3Refuse, m3MisuseCount (core keeps the thread-local result behind a new m3NoteResult, which m3Refuse calls; the allocator's world-less refusal calls it directly)
world_table world the world table, m3WorldFromId, m3WorldFromTag, and four accessors for the slot bookkeeping m3CreateWorld and m3DestroyWorld did inline
body_state body m3BodySlot, m3ResolveBody, m3SetAwakeInternal, m3WakeRegionAabb, m3WakeIfDynamic, M3_LOCKS_ALLOW_FAST_ROTATION
shape_state shape m3ShapeSlot, m3ShapeWorldTransform, m3FilterPass
solver_math solver m3Softness, m3MakeSoft, m3Solve3, m3WorldInvInertia, the joint softness defaults
contact_constraint.h contact_solver.h the contact constraint, coloring and plan types the lane kernel and the solver share
voxel_coverage voxel chunk links and face coverage (m3VoxelRebuildLinks, m3VoxelCoverageBuild, m3VoxelCoverageRefreshAround)

Also: the water volume internals' declarations move from world.h to water.h, where they are defined, and the fragment caps move from voxel.h to world_internal.h, which sizes their arrays. Includes that nothing used are dropped, and the white-box tests include the new headers. tools/modules.txt declares the resulting graph of 82 modules, and CI runs check_modules.py.

Verification

  • python3 tools/check_modules.py: 82 modules, every include allowed, no cycles.
  • linux-gcc-14: 54/54 tests pass. tools/check_hashes.py: all 12 determinism hashes match test/hashes.txt, so moving code across translation units moved no bit.
  • linux-clang-20-asan (scalar backend, assertions on): 52/52 pass with scale and soak left to CI for time; no sanitizer report.

Part of #4

@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 35279e8, its own diff on top of standard: ready.

I compared every moved function with its removed original. They are moved verbatim, comments included:

  • world_table.c: the table, m3WorldFromId and m3WorldFromTag. The four new accessors are the inline bookkeeping of create and destroy, one statement each: the free-slot loop, the generation read, the set, and the release that clears the slot and bumps its generation.
  • misuse.c: m3Refuse and m3MisuseCount. m3Refuse now calls m3NoteResult for the thread-local result, which is exactly what its first line did before. The allocator's world-less m3Refuse(NULL, ...) becomes m3NoteResult(...), which is the same effect, since a NULL world counted nothing.
  • body_state.c/.h: m3BodySlot, m3ResolveBody, m3SetAwakeInternal, m3WakeRegionAabb, m3WakeIfDynamic and the fast-rotation flag.
  • shape_state.c/.h: m3ShapeSlot, m3ShapeWorldTransform and m3FilterPass.
  • solver_math.c/.h: m3MakeSoft, m3WorldInvInertia, m3Solve3, the softness type and the joint defaults.
  • voxel_coverage.c/.h: the links, VoxelFaceCovered, the coverage build and the refresh. The fragment caps move to world_internal.h unchanged.

The rest of the diff is include lists. CI now runs check_modules.py in the checks job, and all checks are green.

Only one thing limits the evidence. Because #8 removes the cross-platform hash comparison (see my comment there), CI does not prove that "no bit moved". The proof is the body's local check_hashes.py on linux-gcc-14 alone. For moves of verbatim code across translation units with -ffp-contract=off, that is convincing. NEON and clang-cl are confirmed only once the golden scenes of #11 run in every cell.

…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
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.
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
Base automatically changed from standard to main October 23, 2026 22:48
# Conflicts:
#	.github/workflows/ci.yml
#	src/body.c
#	src/core.h
#	src/diff.c
#	src/joint.c
#	src/joint_distance.c
#	src/joint_fixed.c
#	src/joint_gear.c
#	src/joint_generic.c
#	src/joint_motor.c
#	src/joint_parallel.c
#	src/joint_prismatic.c
#	src/joint_pulley.c
#	src/joint_revolute.c
#	src/joint_wheel.c
#	src/journal.c
#	src/journal_replay_actors.c
#	src/journal_replay_joints.c
#	src/journal_replay_shapes.c
#	src/query.c
#	src/raycast.c
#	src/shape.c
#	src/solver.c
#	src/voxel.c
#	src/water.c
#	src/world.c
@siracozmen01
siracozmen01 enabled auto-merge (squash) October 23, 2026 23:05
@siracozmen01
siracozmen01 merged commit 1f97155 into main Oct 24, 2026
25 checks passed
@siracozmen01
siracozmen01 deleted the module-graph branch October 24, 2026 00:05
siracozmen01 added a commit that referenced this pull request Oct 24, 2026
Part of #4. It targets `main` now that #8 and #9 have merged, and is
brought up to date with a merge commit; its diff against `main` is the
three files below. The 12 world hashes #8 checks in every cell must
still match.

The repository standard asks production code to assert its invariants,
so that sanitizer and fuzz builds catch a broken state where it happens.
This PR adds the assertions the test pruning relies on:

- `m3UpdatePairs` validates the broadphase tree once per step (the AVL
heights, the parent links and the fat boxes enclosing their children).
It does not run after every insert, because that would make large debug
scenes quadratic.
- `m3TreeRebuild` validates the tree it built.
- `m3VoxelSurfaceBuild` checks the chunk's filled count against its
occupancy bits. Every occupancy edit rebuilds the surface, so a
miscounted edit shows up at the edit.

`M3_ASSERT` compiles out under `NDEBUG`, so Release builds and the
golden hashes are unchanged. The next PR deletes `test_tree` and the
voxel edit storm, which checked the same invariants from outside.

Verified locally on the merged head: `linux-gcc-14` (Release) passes
54/54 with all 12 hashes, and `linux-clang-20-asan` (Debug, assertions
on) passes the 52 tests other than `scale` and `soak`.
siracozmen01 added a commit that referenced this pull request Oct 24, 2026
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.
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