luft/z-fiber-benchmark.lisp
Index every maximal empty Z interval in every haloed fiber.
Return the runnable Z-fiber kernels, fastest first.
Slow per-cell oracle for the bit-fiber surface masks.
Camera-connected air is a different question from the complete boundary. The complete boundary includes sealed caves. These kernels seed the air containing a camera above the center fiber, discover only that component, and then write the solid faces incident to it. AIR-CELL is the obvious oracle, AIR-BITS propagates directly through the four-word fibers, and AIR-RUNS traverses maximal empty Z intervals joined by horizontal overlap.
Return the center fiber's top air cell, or NIL when the camera is obstructed.
Write solid faces incident to reachable air into case's output buffer.
Slow, direct oracle for the packed camera-boundary writer.
Reference breadth-first search over individual empty cells.
Propagate reachable air through packed masks one cell per fixed-point wave.
Flood maximal air intervals; horizontal overlap is the adjacency test.
Maintaining the atmosphere chain is cheap when an edit is known not to change the component topology. The benchmark below repeatedly removes and restores one exposed terrain cell. Only that cell and its six solid neighbors can gain or lose boundary faces. Arbitrary edits still require dynamic-connectivity machinery or the full rebuild used here as an oracle.
Refresh every camera-air face owned by one central-domain cell.
Toggle edit's voxel and return true when its new state is solid.
Make a terrain case whose edit removes and restores one exposed cell.
Toggle a topology-preserving surface cell and update its boundary locally.
Toggle edit, rebuild the air-run index, and rediscover the atmosphere.
Benchmark Z-fiber extraction, camera air, and maintained surface edits.
Multiplication and scalar scaling.
(stride local-x local-y)(width x y)(occupancy base z)(occupancy base z)Headings, paragraphs, figures and their IDs, mentions, marks.
Addition over compatible quantities.
Logical conjunction of tests and raw truth values.
Test whether one compatible scalar is at most another.
Test whether one compatible scalar is less than another.
(x y)The maximum of compatible quantities.
The minimum of compatible quantities.
Division of two represented quantities.
Subtraction or unary negation.
(x y z)Logical disjunction of tests and raw truth values.
Test whether two compatible scalars are equal.
The non-negative remainder of integer division.
(x y z)Test whether one compatible scalar is greater than another.
(pattern x y z)(width pattern)(occupancy base)(occupancy base)Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
(occupancy stride width)(occupancy stride)Logical negation of one test or raw truth value.
(width pattern)(occupancy input-base output output-base)(name package lanes)(family)(output base direction z)(reachable fiber z)(reachable fiber z)(case)(reachable fiber low high)(case reachable)(case reachable)Test whether one compatible scalar is at least another.
(arguments)(words index value)(output base direction z value)(case local-x local-y z)(case x y z)(output)(case)(case)(phase)(phase)(case function)(case phase simd-family)((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…
(case phase simd-family)((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.
(case phase simd-family sample-count warmup-count stream face-count)(edit phase)(width phase)(width phase sample-count warmup-count stream)(values fraction)Sample a two-dimensional texture through a sampler at a UV coordinate.
(case phase samples stream)(stream)(sample stream)(&key (widths '(16 32))
(patterns '(:solid :terrain :architecture :caves :checkerboard))
(sample-count 15) (warmup-count 3)
(csv-pathname #P"build/luft-z-fiber-benchmark.csv")
(stream *standard-output*))
CPU experiments for full-height
luftoccupancy fibers.