Skip to content

build(family): sync family files and build through presets on shared ci - #8

Merged
siracozmen01 merged 6 commits into
mainfrom
standard
Oct 23, 2026
Merged

siracozmen01 merged 6 commits into
mainfrom
standard

Conversation

@siracozmen01

@siracozmen01 siracozmen01 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

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 refactor: assert the tree and voxel invariants #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 (test: prune the suites to golden scenes and public behavior #11) replaces all of this with the golden scenes. This keeps refactor(family): break the include cycles into a one-way module graph #9 (pure moves) and refactor: assert the tree and voxel invariants #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:

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

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

…e package version, the tools on clang-cl and the sanitizer cell's limit
@siracozmen01 siracozmen01 changed the title build(family): sync the family files and build through presets on shared ci build(family): sync family files and build through presets on shared ci Oct 23, 2026

@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 4700b26: changes needed (1), and the budget is over until #11.

  1. No cell compares the determinism hashes while #8 to #10 are on main. This needs a change.

    • The old compare-hashes job required every cell to print the same 12 hashes and tools/check_hashes.py to match test/hashes.txt. This pull request removes it, and nothing takes its place until the tests pull request (#11). The body says so.
    • But ci.yml's own comments claim the opposite at this head: "every cell checks its world hashes against test/hashes.txt", and the build cells run "the golden scenes included". The golden scenes do not exist yet.
    • The two pull requests that land in this gap are exactly the ones whose promise is "no result moves": #9's pure moves and #10's assertions. If either one moved a bit, on AVX2 against NEON or on clang-cl against GCC, it would merge green.
    • Fix, in order of preference: keep compare-hashes and check_hashes.py as a job here until #11 replaces them, or merge #11 before #9 and #10. At the very least, correct the two comments.
  2. Budget: over the 10-minute pull request budget.

    • On run 40004257351, linux-clang-20-asan took 12m51s on its own, with a 45-minute limit.
    • linux-clang-20-tsan hit its 20-minute limit and passed in 9m23s on a re-run. The body says the tsan scale test timed out twice on the 1000-body scene.
    • The body says #11 prunes scale and soak and turns the three repeats on. Until then the required check is both slow and flaky. Merging #11 directly after this pull request would also close the gap in 1.

Each point you asked about:

  • Shared CI at v0.0.8 and the image digest: OK. changes, docs-check, zizmor and cpp.yml, plus pr-gate and pr-title, are all at ffd926f # v0.0.8. The checks and testbed containers use the 2026.10.4 digest that cpp.yml pins. Every action is pinned by SHA, with permissions: {}, bash as the default shell and persist-credentials: false.
  • Presets: OK. base sets binaryDir to ${sourceDir}/out/${presetName}. There is one configure, build and test preset per cell, and the matrix lists exactly those names. The asan preset uses the scalar backend, so NEON, AVX2 and scalar are all covered.
  • The required job and the title check: OK. required runs if: always() and needs changes, docs, zizmor, checks, build, msvc-headers, web and testbed. testbed is skipped on pull requests, which counts as passed. pr-title passes the repository's scopes.
  • zizmor: OK. The job passed. pr-gate's pull_request_target carries a reasoned ignore, and the shared workflow never checks out the code.
  • Family files: OK. family_sync.py --check maul3d reports 0 differences. That is on the local checkout, which is at #11's head and includes this pull request. The family copy tools and docs/adr are gone.
  • Budget: over, as in 2 above.

Small, not blocking: the clang-format step pipes git ls-files into xargs without a guard. With an empty list, xargs runs clang-format on stdin and passes with nothing checked, which is the trap maul-locale fell into. [ -n "$files" ] or a count check closes it.

…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.
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 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.

Re-review of 38c0c78 (the delta since 4700b26: f6c1d01 and 38c0c78).

Ready. The hash gate gap is closed. Two notes for the rebase of #9 to #11.

  • Every value the old job compared is checked in every PR cell. The old compare-hashes job compared the M3_*_HASH lines printed by twelve suites with test/hashes.txt: CHARACTER, DET, DRIVETRAIN, JOINT, MATH, SOFTBODY, SOFTSOFT, SOLVER, VEHICLE, VOXEL, WATER and WORLD. Each of those printfs is now CheckHash("<NAME>", hash, M3_GOLDEN_<NAME>), which fails the suite on a mismatch. test/CMakeLists.txt turns each line of hashes.txt into a directory-wide definition before any suite is added, so every target gets them. That covers all nine build presets (the asan scalar backend, tsan, shared, macOS, both Windows) and the web job under Node. The old job covered nine cells plus asan and wasm, so tsan, shared and Windows arm64 are new.
  • A missing hash fails the build, it is not skipped. hash_check.h has no #ifndef fallback, so a suite whose M3_GOLDEN_<NAME> is absent from hashes.txt does not compile. A malformed or repeated line fails configuration. The one case nothing catches is a hashes.txt line that no suite checks any more, but that takes removing a CheckHash call, which shows in review.
  • The ci.yml comments now match: the header ("Twelve suites compare their world hash with test/hashes.txt in every cell, and the bench-pins job compares the benchmark scenes with bench/pins.txt"), the build job's, and the web job's ("the committed world hashes hold there too").
  • clang-format: the file list is taken first and [ -n "$files" ] || { echo "::error::no C sources found"; exit 1; } runs before xargs.
  • tsan limits: timeout: 45 on both sanitizer cells, and the tsan test preset sets execution.timeout: 1800. CMake merges execution field by field, so the preset keeps noTestsAction: error and jobs: 4 from base. The cells took 12m42s (asan) and 17m35s (tsan), over the 10 minute PR budget until #11 prunes the suites. Merge the series together so main does not keep this check.

For the rebase of #9 to #11 (each was cut from 4700b26):

  1. #11's test/CMakeLists.txt adds its own loop over hashes.txt (target_compile_definitions on test_golden and test_bench). Keep one of the two loops, not both.
  2. #11 replaces the twelve suite hashes, so it should delete test/hash_check.h. Its comment names tools/check_hashes.py --update, which #11 deletes. #11 must also drop the tsan timeout: 45 and the 1800 s preset override along with the asan one. #11 as reviewed only touched the asan line, so the tsan values would survive the rebase.

@siracozmen01
siracozmen01 merged commit 0eeb43d into main Oct 23, 2026
22 checks passed
@siracozmen01
siracozmen01 deleted the standard branch October 23, 2026 22:48
siracozmen01 added a commit that referenced this pull request Oct 24, 2026
#9)

## 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 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.
siracozmen01 added a commit that referenced this pull request Oct 24, 2026
## Problem

- **The README's API reference was stale.** It linked `docs/api.md`, a
committed copy of the reference that nothing regenerates or reads. The
family's `tools/gen_api.py` says the reference "is built into the
documentation site by tools/build_docs.py and is not committed".
`build_docs.py` renders the site's `api.html` from the headers on every
build, so the site stayed current while the committed copy kept an older
API. It still showed `void m3World_RebuildBroadphase(m3WorldId
worldId)`, from before the family API shape (#13) and before the rebuild
returned `m3Result` (#23). The copy dates from before the family docs
pipeline, which is why it went stale: no check compared it with
anything. No other Maul library commits a copy; maul2d, maul-tween,
maul-unicode and maul-anim link their site's page.
- **Other links pointed at files #8 removed:** `docs/conventions.md`,
`docs/adr/README.md` and `CONTRIBUTING.md` in the README, and
`conventions.md` in `docs/references.md`.
- **The README's status paragraph was wrong.**
  - It said "Version 0.0.1", which nothing updates.
- It said snapshots and tapes "belong to one library version and are
refused by any other". The snapshot's config hash deliberately leaves
the library version out: a release that keeps the format reads its
predecessor's snapshots.
- **Two header docs were behind the code.**
- `m3World_Hash` listed "transforms, velocities, mass, types, step
count, gravity", but since #22 it covers far more.
- `m3Counters.voxelEditsRefused` did not say that it is a counter and
not state (from #38's review).
- The guide's broadphase rebuild paragraph did not mention the capacity
refusal that #23 added.

## Change

- `docs/api.md` is deleted. The README and the Godot binding's README
link the site's reference,
https://rawframe-project.github.io/maul3d/api.html, as maul2d's README
does. With no committed copy there is nothing to go stale, and the docs
job builds the page from the headers on every pull request.
- The conventions links point at the family's
`docs/internals/maul-conventions.md`, and `docs/references.md` points at
its "Outside code and data" section. The design records link is dropped,
since there is nothing to point it at. Contributing points at the
organization's `CONTRIBUTING.md`.
- The status paragraph drops the version and says what refuses what: a
snapshot carries its format version and solver revision, and a release
that changed either refuses it; a replay file carries its container
version the same way.
- `m3World_Hash`'s doc lists what the hash covers, read from
`src/world_hash.c`, and what it leaves out.
- Covered: the step count, gravity and tuning off its defaults, every id
pool's identity, bodies, shapes (the height field each reads, voxel
grids, mesh paint), characters, soft bodies, vehicles, joints (limits,
motors, collide flags), water volumes and persistent contacts.
- Left out: mesh geometry and height field samples, which nothing
changes after create, and derived data and observers.
- `voxelEditsRefused`'s doc says it is a counter, not state. It is
neither hashed nor snapshotted, a restore or a replay's back-out leaves
it as it is, and so a refused replay leaves it higher.
- The guide's rebuild paragraph says the rebuild returns
`m3_errorCapacity`, with the tree unchanged and nothing journaled, when
the allocator refuses its scratch.

## Verification

- A scan of every committed Markdown file's relative links finds none
broken, except `docs/index.md`'s links to the site's `.html` pages. That
file is not a page `build_docs.py` publishes, and it goes with the docs
layout in #4.
- `build_docs.py` builds the site, `api.html` included.
- `m3World_Hash`'s list matches `WorldHashWorker`'s parts and
`HashPool`. `voxelEditsRefused` appears in neither the hash nor the
snapshot state table.
- The checks job's steps pass locally on 660fd17 (on main 609e4c5,
v0.2.0): clang-format, the family checks, the bindings check, the docs
build and `family_sync --check`.
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.

2 participants