frame keeps: a model's records filled in place, kept event numbers, list spares, Json.read_file
From the fence's kept frames in 22 minutes of play: - A component field that is a record or a list of records was `value_put(o, k, view_val_T(x))`, a whole new tree every frame (HudPrompt's notifications). view_fill.ludic generates view_set_T / view_set_list_T / view_fill_T that fill the object and list under the key in place. - value_list_fit dropped the items it cut off and value_item made new ones as the list grew back, a Value per item per regrowth (value_item / value_set_strs); the cut-off items are now the list's spares (Val.spare), and an item of another kind is turned rather than replaced. - ludic.ui: a scroll box's "scroll" and a slider's "change" fired a fresh Value.float a frame (sc_walk, scroll.ludic:36); ui_fire_float takes one from a ring kept with the state (fired.ludic). ui_object_fit_into is exported, for a draw that keeps its list. - Json.read_file(path): read, parsed, and the file's text given back - Json.parse(Fs.read_text()) kept the whole file on every read (Maroon Lake's settings peeks). Golden value_list_regrow: a list alternating 6 and 2 items every frame keeps nothing (the toolchain before this fails it: +128 B new Val from value_item). Game compiles; ludic.i18n/settings/hints/ base tests pass (ludic.ui has none); arena and fence goldens unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9c24d707bc
commit
a299117858
15 changed files with 71088 additions and 69253 deletions
16
examples/lang/value_list_regrow.ludic
Normal file
16
examples/lang/value_list_regrow.ludic
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# value_list_regrow.ludic - a model's list filled in place that shrinks and grows back, frame after
|
||||
# frame, makes nothing: the items cut off are the list's spares, handed out again as it grows (each
|
||||
# regrowth once made a new Value per item, and the failing fence stopped it at the warm-up's cap):
|
||||
# bad 0 xs 2
|
||||
program ValueListRegrow {
|
||||
entry {
|
||||
let o = Value.object()
|
||||
let long = ["a", "b", "c", "d", "e", "f"]
|
||||
let short = ["x", "y"]
|
||||
for f in 0 .. 3500 {
|
||||
if f % 2 == 0 { value_set_strs(o, "xs", long) } else { value_set_strs(o, "xs", short) }
|
||||
Mem.frame()
|
||||
}
|
||||
print(`bad {Mem.bad_frames()} xs {Value.count(Value.get(o, "xs"))}`)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue