ludic deps: the reach bitsets hold 30 states to a word, not 60 - an int is 32 bits, so states 32 apart shared a bit and a function could reach fewer states than it takes; examples/state/reach_wide.ludic and a deps case hold it; reseeded (bootstrap-cfree fixpoint)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-30 16:49:34 +03:00
parent d7adc28125
commit 2a18d9b51f
6 changed files with 2894 additions and 2814 deletions

View file

@ -698,6 +698,15 @@ function deps_wreach_case() -> void {
if not s_contains(top, " 0 2 2 changes (examples/state/write_reach.ludic:27)") or not s_contains(top, " 0 1 0 asks (examples/state/write_reach.ludic:22)") or s_contains(top, "asks_local") { bad2(lbl, s_trim(top)); return }
ok(lbl)
}
# an int is 32 bits: states numbered 32 apart once shared a bit of the reach, so `pair` (S00 and S32)
# reached 1 and could change 1; the counts must not depend on how the states are numbered
function deps_reach_wide_case() -> void {
let lbl = "ludic deps: a reach counts states past 32 apart (S00 and S32 are two states, not one)"
let top = capture(`bin/ludic deps examples/state/reach_wide.ludic --wreach 2 2>&1`)
if not s_contains(top, " 4 4 2 all4 (examples/state/reach_wide.ludic:51)\n 2 2 2 pair (examples/state/reach_wide.ludic:46)") { bad2(lbl, s_trim(top)); return }
let sum = capture(`bin/ludic deps examples/state/reach_wide.ludic 2>&1`)
if s_contains(sum, "widest_reach: 4") and s_contains(sum, "widest_write_reach: 2") { ok(lbl) } else { bad2(lbl, s_trim(sum)) }
}
# a program built headless with the toolchain and run: its first line
function headless_case(path: pointer, exp: pointer, label: pointer) -> void {
let out = `{tmp_dir()}/h_{flat(path)}`
@ -1234,6 +1243,7 @@ function cmd_dev_test() -> int {
actions_deps_case()
deps_reach_case()
deps_wreach_case()
deps_reach_wide_case()
feat_case("state/reach", "", "3", "reach.ludic (0.R4: a step list of fn values supplies each step its states)")
feat_case("actions/phases", "dd a q", "1 0 2 0 2 1 1 1 1 2 1 2", "phases.ludic (0.R: the frame loop drains the queue after every phase - Input's actions are reduced before Update)")
feat_case("actions/runaway", "", "actions: Ping is still being dispatched after 64 rounds of reducers - a reducer dispatches what dispatches it", "runaway.ludic (0.R: a reducer that dispatches what dispatches it is stopped by name)")