@PerMap and @Chunked(n) registries: rows read per map, a state and verbs written, every map checked

- @PerMap registry R of T from "file.lres" reads <maps root>/<map>/file.lres at run time
  (package.ludic's new `maps` line, default assets/maps); @Chunked(n) one file per chunk,
  {cx}/{cz} in its name. No as PREFIX, no constants, no def, never open.
- permap_gen: state R, r_load/_clear/_find/_path; chunked: RChunk, r_in/_out/_slot/_find/
  _clear/_path; a typed reset and fill per record over lres.ludic, rows, lists and list
  records pooled per table / chunk slot, @alloc_ok on what grows at high water.
- permap_consts: lres_consts__(), the program's int and float constants by name.
- permap_check: ludicc --check reads every map directory (fields, types, constants, fn,
  @OneOf/@Range/@Ref, cross-row @Ref keys in the same map, a key twice); --no-maps skips.
- @Ref(PerMapTable) is refused on a non-string field; the schema says scope/chunk per
  registry and scope map on such a Ref, and lists the canonical @Unit spellings; any other
  @Unit spelling is a warning naming the canonical one.
- reseeded (mac + win seeds; bootstrap-cfree out.ll == seed.ll).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 21:03:02 +03:00
parent 7170c31304
commit 2f4860ae71
14 changed files with 137400 additions and 100393 deletions

View file

@ -277,6 +277,7 @@ function parse_build_args(start: int) -> pointer {
else if a == "--save-temps" { g_save = true }
else if a == "--unsafe" { g_unsafe_build = true }
else if a == "--check" { g_check_build = true }
else if a == "--no-maps" { g_no_maps_build = true } # --check leaves the map directories alone
else if a == "--diagnostics=json" { g_check_build = true; g_diag_json_build = true } # every error, as JSON on stdout
else if a == "-o" {
ai += 1
@ -285,7 +286,7 @@ function parse_build_args(start: int) -> pointer {
}
else if a[0] == '-' {
err(`ludic: unknown option {a}\n`)
err(" build/run take: [file] [--headless|--windowed] [-o out] [--save-temps] [--check [--diagnostics=json]]\n")
err(" build/run take: [file] [--headless|--windowed] [-o out] [--save-temps] [--check [--diagnostics=json] [--no-maps]]\n")
g_argerr = true
}
else { src = a }
@ -309,13 +310,18 @@ function output_path(entry: pointer) -> pointer {
# and nothing emitted or linked; a fraction of a build's time, for iterating on uses lines
var g_check_build: bool = false
var g_diag_json_build: bool = false # --diagnostics=json: the compiler's JSON array is the whole stdout
var g_no_maps_build: bool = false
function no_maps_flag() -> pointer {
if g_no_maps_build { return " --no-maps" }
return ""
}
function check_app(src: pointer) -> int {
ensure_ludicc()
if g_diag_json_build {
if not shq(`{ludicc()} --check --diagnostics=json{title_flag()}{unsafe_flag()} {src}`) { return 1 }
if not shq(`{ludicc()} --check --diagnostics=json{no_maps_flag()}{title_flag()}{unsafe_flag()} {src}`) { return 1 }
return 0
}
if not shq(`{ludicc()} --check{title_flag()}{unsafe_flag()} {src}`) { return 1 }
if not shq(`{ludicc()} --check{no_maps_flag()}{title_flag()}{unsafe_flag()} {src}`) { return 1 }
print(`checked {src}`)
return 0
}

View file

@ -35,6 +35,10 @@ function selfhost_frags() -> []pointer {
push(f, "selfhost/frontend/attrs.ludic")
push(f, "selfhost/frontend/attrs_node.ludic")
push(f, "selfhost/frontend/resource.ludic")
push(f, "selfhost/frontend/permap.ludic")
push(f, "selfhost/frontend/permap_consts.ludic")
push(f, "selfhost/frontend/permap_gen.ludic")
push(f, "selfhost/frontend/permap_check.ludic")
push(f, "selfhost/frontend/defaults.ludic")
push(f, "selfhost/frontend/view.ludic")
push(f, "selfhost/frontend/view_conv.ludic")