chore(repo): DX cleanup — categorise examples, text-diffable golden, build/ output (#27 #28 #30)

Repository-cleanup / DX pass folding three tracker items into one coherent
change, verified green end to end (`bin/x test` 49/0, `bin/x selfhost-test`
29/0, `bin/x test-tools` 29/0).

#28 — curate & categorise examples/
- 42 flat entries regrouped into intent-revealing subdirs: games/, rendering/,
  ecs/, events/, networking/, lang/, library/ (was lib/).
- chronorift dir-vs-file duplication resolved: the entry file and its import
  modules now live together under games/chronorift(.ludic).
- Every path reference updated repo-wide (test runner, editor-tool drivers,
  docs/site, design docs).
- New examples/README.md indexes the whole set with run commands.
- Showcase examples without a self-asserting entry (hello, events, net_rt) now
  get a compile-only rot guard in `bin/x test`, so nothing here rots silently.

#30 — text-diffable golden baseline
- The 4 binary selfhost/golden/*.ppm blobs are replaced by a single
  selfhost/golden/renders.sha256 manifest (SHA-256 per render). Hashes are
  byte-identical to the old PPMs, so the baseline is unchanged — only its form.
- game_case now compares framebuffer hashes; a regression shows as a changed
  hex line in review, not "binary files differ".
- New `bin/x golden` regenerates the manifest deliberately (review with
  `git diff selfhost/golden/renders.sha256`).

#27 — PPM & asset handling
- Headless renders now write build/out.ppm, never the repo root; `x app`,
  `x clean`, messaging and .gitignore updated to match. Nothing is written to
  the working root any more.
- Redundant local Kenney .zip archives removed (the art ships extracted;
  .gitignore already excludes *.zip). CC0 License.txt files retained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-30 18:54:21 +03:00
parent 0bc5d76952
commit fb728bbefe
73 changed files with 364 additions and 194 deletions

View file

@ -20,8 +20,8 @@
> clang selfhost/ludicc.seed.ll -o bin/ludicc && bin/ludicc tools/x/main.ludic -o bin/x
> bin/x build # rebuild the whole toolchain into bin/
> # (ludicc, ludic, x, ludic-fmt, ludic-lsp)
> bin/ludicc examples/snake.ludic -o bin/snake # compile
> bin/ludic examples/snake.ludic # compile + run
> bin/ludicc examples/games/snake.ludic -o bin/snake # compile
> bin/ludic examples/games/snake.ludic # compile + run
> bin/x help # list every command
> ```
>
@ -76,10 +76,10 @@ self-hosted `ludicc`.
`bin/x app` wraps the common cases:
```bash
bin/x app examples/snake.ludic # -> build/snake (native)
bin/x app examples/lib/combat.ludic --lib # -> build/libcombat.* (library)
bin/x app examples/snake.ludic --headless # -> build/snake_headless (out.ppm)
bin/x app examples/snake.ludic --web # -> build/web/ (browser)
bin/x app examples/games/snake.ludic # -> build/snake (native)
bin/x app examples/library/combat.ludic --lib # -> build/libcombat.* (library)
bin/x app examples/games/snake.ludic --headless # -> build/snake_headless (out.ppm)
bin/x app examples/games/snake.ludic --web # -> build/web/ (browser)
```
The `--lib` and `--web` targets were part of the old C driver and are **not yet
@ -109,7 +109,7 @@ program Combat {
```
```bash
ludicc examples/lib/combat.ludic --shared -o build/libcombat.dylib
ludicc examples/library/combat.ludic --shared -o build/libcombat.dylib
nm -gU build/libcombat.dylib
# T _damage T _hits_to_kill T _xp_for (no _curve)
```
@ -122,7 +122,7 @@ extern function damage(attack: int, armour: int, roll: int) -> int = "damage"
```
```bash
ludicc examples/lib/arena.ludic -o build/arena -Lbuild -lcombat
ludicc examples/library/arena.ludic -o build/arena -Lbuild -lcombat
```
Libraries are linked as `@rpath/…` (`$ORIGIN` on Linux) and executables search
@ -219,7 +219,7 @@ only the triple changes.
```
```bash
bin/x app examples/chronorift.ludic --web
bin/x app examples/games/chronorift.ludic --web
python3 -m http.server -d build/web 8000 # then open http://localhost:8000/
```