Skip to content

docs: the guide moves into docs/user/, one page per feature - #359

Merged
siracozmen01 merged 2 commits into
mainfrom
docs/user-pages
Nov 3, 2026
Merged

siracozmen01 merged 2 commits into
mainfrom
docs/user-pages

Conversation

@siracozmen01

Copy link
Copy Markdown
Collaborator

Problem

The repository standard puts the user documentation in docs/user/, one page per major feature and each under 400 lines, with docs/README.md as the index. maul3d had none of that:

  • docs/guide.md held the whole user documentation on one page of 1410 lines, which docs_check.py --strict reports as over the limit of 400;
  • docs/samples.md and docs/references.md sat at the top of docs/, outside the three folders;
  • docs/index.md, the old site's front page, has four broken links under --strict, and the site no longer publishes it;
  • there was no docs/README.md.

CHANGELOG.md also ends with a ## [0.0.1] - 2026-09-24 entry whose release has no tag: git ls-remote --tags origin 'v0.0.*' lists nothing.

Change

This is the move half of #51. The pages carry the guide's text unchanged, and a second pull request rewrites each one from the code and the headers.

  • docs/guide.md is split into thirteen pages under docs/user/, each section moved whole. The pages are getting started, determinism and the step, bodies and shapes, queries and events, joints, snapshots and rollback, the journal and replay files, destruction, vehicles, the character, soft bodies, water, and limits and capacities. The longest is 175 lines. Beyond each page's # title, the text changes in only four ways:
    • two "this guide" and "this document" become "these pages";
    • the "Magnitude limits" reference becomes a link to that section;
    • the state formats link gains ../;
    • the limits page starts with a contents list.
  • docs/samples.md moves to docs/user/samples.md, with its links one level deeper.
  • docs/references.md moves to docs/internals/references.md.
  • docs/README.md is new: the index of the user pages, the internals pages and the operations page.
  • docs/index.md and docs/guide.md are deleted. The README and the Godot README point at the new pages.
  • The untagged 0.0.1 entry is removed from CHANGELOG.md.

tools/check_docs.py and tools/check_guide.py already run in the checks job and in tools/check.sh, so nothing more needs wiring. The bindings' READMEs outside docs/ are #54, and CLAUDE.md is #288.

Verification

  • Every non-blank line of the old guide appears in the pages. A sorted diff of the two shows only the page titles, the contents list and the four changes above.
  • docs_check.py passes. --strict is down from 8 problems to 3: CLAUDE.md and the two bindings READMEs, which The repository has no AGENTS.md or CLAUDE.md #288 and docs: the bindings' READMEs are Markdown outside docs/ #54 cover.
  • tools/build_docs.py builds the site in the CI image: the index, docs.html, the fourteen user pages, the API reference and the changelog. The new limits.html#magnitude-limits link resolves.
  • tools/check.sh changed passes.

Part of #51

The user documentation was one 1410-line guide outside docs/user/, and
docs/ had no index. The guide's sections move unchanged into thirteen
pages under docs/user/, each under 400 lines, with docs/README.md as
the index. The samples page moves to docs/user/ and the references to
docs/internals/. docs/index.md, the old site's front page with four
broken links, goes. The untagged 0.0.1 entry leaves the changelog.

Part of #51

@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 0777df8: changes needed (1). Read, not run; CI was pending.

The move itself is clean. I repeated the sorted-diff check. I took every non-blank line removed from docs/guide.md and every non-blank line added in the new pages under docs/user/, sorted both, and diffed them. The old guide side differs in only four lines, each matched by its replacement: "this document" becomes "these pages", "this guide promised" becomes "these pages promised", "Magnitude limits" becomes the limits.md#magnitude-limits link, and internals/state-formats.md becomes ../internals/state-formats.md. The new side adds only the 13 page titles, the two lines of the limits contents list, and the samples.md lines whose links moved one level. diff counts repeated lines, so nothing was lost or duplicated.

Every link resolves.

  • The only links in the moved pages are #magnitude-limits and #capacities (headings on limits.md), limits.md#magnitude-limits, ../internals/state-formats.md (present), and the samples links at ../../samples/... (car.c, character.c, rollback.c, stack.c and minimal/ all exist).
  • docs/README.md: every user, internals and operations target exists, and so does ../CHANGELOG.md.
  • The README now points at docs/README.md, docs/user/getting-started.md, docs/user/samples.md and docs/internals/references.md.
  • references.md: maul-conventions.md#outside-code-and-data (the heading is at line 146) and rotation.md resolve from the new folder.
  • No link in the workflows, the tools, the docs/internals pages, release.md, the bindings READMEs or the public headers names guide.md, index.md, docs/samples.md or docs/references.md. build_docs.py and check_guide.py already read docs/README.md and docs/user/. The CHANGELOG change removes only the [0.0.1] entry.

Change to make: three references still name the guide, which this PR deletes. They are text, not links, so no link check catches them, but each now sends a reader to a document that no longer exists:

  1. include/maul3d/world.h:490: "(the guide's "Magnitude limits")". This header comment is published in the API reference. It should name the limits page's Magnitude limits section.
  2. docs/internals/overview.md:37: "The guide's "Which refusals count misuse" lists every case." That list now sits under Introspection in docs/user/queries-and-events.md, and a link to it would fit.
  3. bindings/godot/README.md:50: "behave exactly as the guide describes". This PR edits line 42 of the same file. If the bindings READMEs are left to #54 on purpose, say so in the body, and this one can wait there.

The body has Problem, Change and Verification, and no column-0 line that release-please would read as a header.

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

Delta review at c0055c1: ready. Read, not run. CI was pending, so this approval assumes the gate passes.

I compared this head's diff with the one at 0777df8. Every hunk of the earlier diff is unchanged. The new hunks are text only: a header doc comment, a docs sentence, a README sentence and two test comments, with no code line among them.

  • world.h:490 now names "the magnitude limits of docs/user/limits.md". The section is ## Magnitude limits on that page.
  • overview.md:37 links ../user/queries-and-events.md#introspection. From docs/internals that is docs/user/queries-and-events.md, and its ## Introspection heading gives the anchor introspection. The "Which refusals count misuse, in one place:" list sits under that heading, before the next page's content. So the link resolves to the list it names.
  • The Godot README's line 50 says docs/user/, as its line 42 already did.
  • test_drivetrain.c and test_mover.c now point at docs/user/vehicles.md and docs/user/character.md, both of which exist. These are comment lines only.

With the three references gone, nothing outside the CHANGELOG's history names the deleted guide.

@siracozmen01
siracozmen01 merged commit 4ed4875 into main Nov 3, 2026
27 checks passed
@siracozmen01
siracozmen01 deleted the docs/user-pages branch November 3, 2026 13:57
siracozmen01 added a commit that referenced this pull request Nov 3, 2026
…360)

## Problem

#359 moved the old guide into `docs/user/` unchanged. The text was written over many releases, and the pages it became state things the code no longer does:

- `character.md` said a refused stand-up "returns false"; `m3Character_SetStance` returns `m3_errorState`.
- `character.md` told the rigid walker to lock "angular locks (bits 3..5)"; the API takes an `m3MotionLocks` struct.
- `soft-bodies.md` said "Soft-versus-soft and self-collision are NOT in this version" and, two sections later, that lattices collide with each other. Particles of different soft bodies do collide, at the sum of their radii with a friction of 0.5; particles of one soft body never do.
- `water.md` gave the snapshot format as "v48" and ended with a paragraph on snapshot sizes.
- No page's C was built or run.

In the headers, `m3FragmentEvent.mass` says "cell volume times count", but `src/voxel_fracture.c` weighs each cell by its fill over 255. Two doc comments still state the 0.x rule that #355 rewrote everywhere else: `world.h` says "Only the release that wrote a tape replays it", and `replay.h` says "the release that wrote a container reads it". Six comments in `src/` say "another release" for another minor version.

## Change

This is the first content half of #51: six pages rewritten from the headers and `src/`, the old text used only to recover intent. The other pages follow in a second pull request.

- `water.md`, `character.md`, `soft-bodies.md`, `vehicles.md`, `destruction.md` and `snapshots-and-rollback.md`: what each feature does, its def fields and defaults, what a step does with it, its refusals and limits, and how rollback covers it.
- Each page opens with a C snippet, and `test/test_guide.c`, new and registered as `maul_add_test(guide)`, runs every snippet unchanged and checks the outcome the page describes. A water pool floats and carries a crate, a character walks, a rope swings on its pin, a car drives, a tower cut through drops one fragment of the stated mass, a blast pushes a ball away, and a snapshot round trip lands on the same hash. `tools/check_guide.py` finds 8 snippets and none marked not run.
- `world.h`: the fragment mass comment says what the code computes, and the tape comment states the minor version rule. `replay.h` does the same for the container.
- `src/journal_replay.c`, `src/replay.c`, `src/snapshot.c` and `src/state_prefix.c`: comments only, "another minor version" where they said "another release".

The sizes on the snapshot page were measured, not carried over. A probe against the library gives 1924 bytes per shape slot, 12821 per voxel slot and 99659 per soft body slot. The content maxima follow from `src/snapshot.c`'s size formulas: about 1.31 MB for a mesh at 65535 triangles, 5.8 KB for a 64-vertex hull and 260 KB for a 255 by 255 height field. The lockstep paragraph gives what `m3lockstep` prints: 303 rollbacks over 300 frames, at most four frames deep, every checkpoint matched. The pages state these figures as release 1.0.0's measured values, naming the build and the method, and promise only what the code enforces: `m3World_GetSnapshotSize` is exact, and `m3lockstep` fails on a mismatch. Internal constants the pages mention, the 2 cm box margin, the fragment buffer sizes, the soft friction and wind rate, and the escape step, are named as 1.0.0's values, not as limits.

## Verification

- `tools/check.sh pr` passes on this head in the main checkout, `test_guide` included.
- `test_guide` passes under the linux-clang-20-asan preset. Two of its checks failed first, and each time the test was at fault, not the page: the crate bobs above the surface before it settles, and a default-density chassis weighs 3 kg. Each test now sets up what its page assumes.
- `tools/check_docs.py`, `tools/check_guide.py` and the organization's `docs_check.py` pass, and `tools/build_docs.py` builds the site in the CI image.

Part of #51
siracozmen01 added a commit that referenced this pull request Nov 3, 2026
## Problem

After #360, seven pages under `docs/user/` still carried the old guide's text, which #359 moved unchanged. Read against the headers and `src/`, they state things the code no longer does:

- `journal-and-replays.md`: "`m3World_StopJournal` returns the bytes written, or -1". It returns an `m3Result` and writes the length to `bytesOut`, with `m3_errorCapacity` for an overflow.
- `queries-and-events.md`: hull casts "take up to 24 base-relative cloud points"; `M3_MAX_CAST_POINTS` is 64. The counters' allocation counts were "process-wide"; `allocCount` and `freeCount` are the world's own. It described `m3SetAssertHandler`, which no header declares. It said an impure pre-solve callback breaks a journal replay; `world.h` says each step's vetoes are recorded and a replay applies them without the callback, so only rollback from a snapshot calls it again.
- `determinism.md`: CI covers "seven cells (... Windows MSVC ...)"; it runs twelve, and the Windows cells are clang-cl. Reentering the API from a task was "not supported"; it is refused with `m3_errorBusy`.
- `bodies-and-shapes.md`: motion locks were "bits 0..2 linear xyz, 3..5 angular xyz"; the API takes `m3MotionLocks`.
- `limits.md`: each pair keeps "544 bytes of persistent tables", for "21.4 MiB" in the default world; `m3World_GetMemoryUsage` gives 564 bytes and 21.7 MiB at 1.0.0. The page also pointed at a "chapter above" that #359 moved to another page.
- `getting-started.md` listed three joint types of the twelve, and no page's C was built.

## Change

This is the second and last content half of #51: seven pages rewritten from the headers and `src/`, the old text used only to recover intent.

- `getting-started.md`, `determinism.md`, `bodies-and-shapes.md`, `queries-and-events.md`, `joints.md` and `journal-and-replays.md`: what each part does, its defs and defaults, its refusals, and how rollback covers it. The two longest, bodies and shapes and queries and events, start with a contents list.
- `limits.md`: the memory figures measured again and stated as release 1.0.0's values, taken on x86-64 Linux with a clang-20 build by comparing `m3World_GetMemoryUsage` across worlds whose capacities differ by a known count, with that call as the exact source. The capacities row names `M3_MAX_PAIR_CAPACITY`.
- `getting-started.md`: CI's bench job pins cityblock's hash on main and nightly on six native 64-bit cells, which the page names.
- `test/test_guide.c` runs each new snippet unchanged: a first world comes to rest, a crate falls on its locks, a ray meets the floor, a motorized door stops at its limit, a recorded session replays into a twin to the same hash, two twins compare equal until one is nudged, and a world with room for one pair reports dropped pairs. `tools/check_guide.py` finds 16 snippets and none marked not run; the limits page's pair check, an indented block before, is now a fenced `c` block like every other.

As #360 did, figures the code does not enforce are given as release 1.0.0's values. `docs/user/samples.md` was read against `samples/` and stays as it is.

## Verification

- `tools/check.sh pr` passed on b89cacd in the main checkout, `test_guide` included. The last commit adds the pair check to `test_guide.c`, which passes under ASan and UBSan and compiles with `-Wall -Wextra -Wconversion -Wshadow -Werror`.
- `tools/check_docs.py`, `tools/check_guide.py` and the organization's `docs_check.py` pass, and `tools/build_docs.py` builds the site in the CI image. `docs_check.py --strict` reports only `CLAUDE.md` (#288) and the two bindings READMEs (#54).

Closes #51
@siracozmen01 siracozmen01 mentioned this pull request Nov 3, 2026
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