luvcraft/light-reference.lisp
ENTRY supplies the semantic chunk boundary, while OFFSET and LEVEL are unboxed site data. The generated buffer owns their shared extent.
Make the reference solver's packed LIFO or level-scheduled worklist.
This machinery belongs to the test-only voxel-light oracle. Both modes retain ENTRY plus dense OFFSET and LEVEL lanes, never a cons or coordinate object per item. #QS1ERH #LDP5UR
Push entry, domain offset, and propagation level onto worklist.
Pop (VALUES ENTRY OFFSET LEVEL PRESENT-P), clearing retained ENTRY.
Run the reference FIELD's max-fixpoint propagation from packed queue sites.
Solve region with the explicit test/reference voxel-light oracle.
Compare the test-only legacy oracle with production candidate over world.
Equivalent captures are solved without publication. The result reports exact per-chunk array equality, work and runtime observations, and the candidate's retained frontier executions. Unsupported candidate names signal through the production solver protocol.
(name-and-options &body lane-descriptions)Define a concrete synchronized structure-of-arrays buffer. Each lane is (NAME INITIAL-ELEMENT :TYPE TYPE [:CLEAR-ON-REMOVE T]). Optional :QUANTITIES on NAME-AND-OPTIONS groups named physical lanes into fixed quantity projections. The generated MAKE-, -PUSH, -POP, and -RESET functions operate on raw specialized…
Logical disjunction of tests and raw truth values.
One distributed fact's identity and per-site meaning. #FKAV5Y The inherited represented-value declaration describes a reading after its storage encoding has been resolved. REPRESENTATION-POLICY separately names the aggregate encoding, such as a palette-index column or a u8 level array.
(&key (scheduling :lifo) field-definition)Make the reference solver's packed LIFO or level-scheduled worklist. This machinery belongs to the test-only voxel-light oracle. Both modes retain ENTRY plus dense OFFSET and LEVEL lanes, never a cons or coordinate object per item. #QS1ERH #LDP5UR
(name)Return the inspectable physical row layout named by NAME.
(definition &optional declarations)Bind concrete represented DECLARATIONS to DEFINITION's physical lanes. DECLARATIONS is an alist from lane names to represented-value declarations. Representation compatibility and duplicate semantic ownership are checked once; returned rows retain the concrete declarations without wrapping values.
Logical conjunction of tests and raw truth values.
(materialization field-name)Return the definition object retained by MATERIALIZATION for FIELD-NAME.
One top-level defining form of a source file.
(worklist)(worklist entry offset level)The maximum of compatible quantities.
(worklist)(region field-reader queue skylight-p)((name &key (tracy-value nil tracy-value-supplied-p)) &body body)Measure BODY as nested zone NAME for whichever measurement is watching. TRACY-VALUE, when supplied, is attached to the Tracy zone at exit. It does not affect the bounded CPU trace, whose zones retain time and runtime costs. Two independent things may be: a Tracy viewer attached to this image, and an opt-in…
(domain offset)((offset destination crossing direction materialization availability
window domain local directions &optional result)
&body body)Execute BODY for the DIRECTIONS neighboring LOCAL through WINDOW. DIRECTIONS is the caller's explicit neighborhood policy. DESTINATION has dynamic extent on each iteration and must be copied before BODY retains it. Interior steps remain domain arithmetic; window dispatch occurs only at an actual chunk crossing.…
(entry offset)Addition over compatible quantities.
Subtraction or unary negation.
Test whether one compatible scalar is greater than another.
(entry offset downward-p)(entry)(region key entry enqueue)Logical negation of one test or raw truth value.
(region coordinate direction)(region key direction)(entry direction function)Call FUNCTION with OFFSET and borrowed LOCAL for one face of ENTRY. LOCAL has dynamic extent and must be copied before FUNCTION retains it.
(region &key (scheduling :level))(region &key (scheduling :level))((offset local domain &optional result) &body body)Execute BODY for every site in DOMAIN, in dense storage order. LOCAL is a DYNAMIC-EXTENT LOCAL-COORDINATE and must not be retained after BODY returns. This gives dense algorithms a nominal coordinate without one heap allocation per site. See #B3UEVE.
(region &key (scheduling :level))(left right)(world &key (candidate :compiled))Compare the test-only legacy oracle with production CANDIDATE over WORLD. Equivalent captures are solved without publication. The result reports exact per-chunk array equality, work and runtime observations, and the candidate's retained frontier executions. Unsupported candidate names signal through the production…
(world &key immutable-p)Capture every resident chunk of WORLD for a from-scratch relight. With IMMUTABLE-P, copy content indices and capture absent-boundary semantics; the returned region may then be solved without reading the live world.
((observation) &body body)Measure time, allocation, GC time, and collections while executing BODY. OBSERVATION is reset in place and BODY's values are preserved. SBCL's byte and GC clocks are process-wide; in a multithreaded image this deliberately attributes concurrent runtime activity during the observed extent too.
(name value)Multiplication and scalar scaling.
(solver region &key &allow-other-keys)Solve captured REGION with the explicitly implemented voxel-light SOLVER. There is deliberately no default method: unsupported solver names signal instead of silently selecting another implementation.
Intent: remove the retained frontier's per-item list cell, light-region-site, and copied local-coordinate without prematurely extracting the general fixed-point algebra discussed in #BA9MCA. Represent a lighting site densely as a region entry plus domain offset, while iteration reconstructs only a dynamic-extent…
Intent: extract the synchronized specialized storage proven by the lighting frontier into a generated columnar-buffer substrate, while making its physical lanes and concrete row quantity declaration inspectable. Keep level scheduling, spatial stepping, and fixed-point behavior in lighting. Evidence:…
The deliberately simple voxel-light oracle and its differential harness. This file is loaded only by the explicit LUVCRAFT/LIGHT-REFERENCE system; no reference implementation participates in production solver dispatch.