ludic/packages/ludic.base/tests
Orkuncakilkaya c592974055 ludic.base: baked files - the header, baked_open, a streamed reader, the inputs hash (ludic bake's API)
What is deterministic is made at build time by the game's own code (`ludic bake`) and read at run
time. baked.ludic, baked_hash.ludic, baked_stream.ludic:

- The header, 32 bytes little-endian: "LBAK" | u32 format (BAKE_FORMAT 1) | u32 generator version |
  u32 payload offset | u64 inputs hash | u64 payload length | then the key (UTF-8, zero-padded to 8),
  then the payload at its offset, whose layout is the bake's own.
- bake_write(path, key, version, inputs_hash, payload, n) makes the directories and writes it;
  bake_inputs_hash(inputs) is FNV-1a 64 over each space-separated input: its path, a 0, its bytes.
- baked_open(path, key, version) -> []byte: the payload as a view of the file (no copy), or null for
  a missing file or another format, key or version. The runtime never hashes inputs; `ludic bake
  --check` holds a baked file to them at build time.
- baked_open_range(path, key, version) -> BakedFile kept open (header checked once),
  baked_read(bf, at, n, into) -> count read into the caller's buffer from payload offset `at`
  (held to the buffer and the payload), baked_len, baked_close: a streamed bake (placements by chunk,
  terrain by tile) with nothing made per read. Pack-aware through file_open: on macOS a packed entry
  is an fmemopen over the mapped pack (a seek is free), on Windows a temporary copy of the entry made
  once when it is opened.
- baked_path(map, file), bake_missing(bake_st, key) (a dev build's line, once a key).

tests/baked_test.ludic: a payload round-trips for its key and version only, a streamed read at an
offset and one past the end, the inputs hash follows path and bytes. Written, type-checked, not run
(compile-only rule).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 17:21:02 +03:00
..
toys feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune 2026-09-26 04:19:56 +03:00
actions_test.ludic compiler(0.R): a dispatched action's record is the queue's to keep - one list per action, filled in place, all free again when the drain ends 2026-09-28 02:02:11 +03:00
baked_test.ludic ludic.base: baked files - the header, baked_open, a streamed reader, the inputs hash (ludic bake's API) 2026-09-29 17:21:02 +03:00
ecs_fuzz_test.ludic feat(ecs): ludic.base Table<T> - dense rows of hot columns, generational handles, a spatial grid, kind indexes and an id map kept current by the setters; ludic.things on it 2026-09-27 15:52:51 +03:00
ecs_test.ludic ludic.base: tb_reserve and imap_reserve size a table up front; HandlePool (a slot and a generation, nothing made after hd_pool_new, past its capacity a panic naming it); kept_push is the one declared grow, and every growth path left says its bound in @alloc_ok 2026-09-28 15:58:11 +03:00
handle_test.ludic ludic.base: tb_reserve and imap_reserve size a table up front; HandlePool (a slot and a generation, nothing made after hd_pool_new, past its capacity a panic naming it); kept_push is the one declared grow, and every growth path left says its bound in @alloc_ok 2026-09-28 15:58:11 +03:00
queue_test.ludic ludic.base: a queue's fact records come round again (q_rec / q_ring_add), used by effects, clock, wallet, weather, tracks, needs, fire, settings, update, steps, crafting, shop, gear, hints, session and photo instead of a new record per fact; the minimap's marks cleared and rubbed out in place, its scale steps without a list; the clock's dice seeded again, not made again; once-per-join, per-save and pool-miss paths declared 2026-09-28 20:03:46 +03:00
registry_test.ludic wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run 2026-09-25 15:31:34 +03:00
rng_test.ludic feat(ludic.base): the vocabulary mechanic packages share - Tick, phases, Queue<T>, rng streams, the save tree, the system runner 2026-09-25 04:01:16 +03:00
route_test.ludic ludic.base: core_undrained fills a list the caller keeps; hd_refuse's panic declared; ludic.photo's slug declared (a photograph taken) 2026-09-28 17:06:50 +03:00
save_test.ludic feat(ludic.base): the vocabulary mechanic packages share - Tick, phases, Queue<T>, rng streams, the save tree, the system runner 2026-09-25 04:01:16 +03:00
system_test.ludic wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run 2026-09-25 15:31:34 +03:00
text_test.ludic @max on the bounded lists: TextRing's slots, the pack's counts and change ring, the net's fact ring, the compass pools, ludic.ui's memo (its 3/4 of MM_CAP), screen pools, answer and pointer rings; ludic.base's intern test holds the table to its cap now that past it is Mem.over 2026-09-28 16:48:53 +03:00