Skip to content

The native runtime for three.js: three.js, down to the metal. 45× smaller than Electron, on a Sony PS3, and path-traced at 60 fps on ray-tracing GPUs.

621 KB
Raw Blame

Roadmap

Provenance note (2026-11-24). This file is a log. Entries before that date describe earlier implementations of the post chain, the specular temporal pass, the diffuse history rules, the BSDF's energy terms, the atmosphere and the fog volume, which have since been replaced by implementations written from public sources (PROVENANCE.md). Where an entry names another engine's or SDK's internals, it records how that earlier code came about, not how the present code works; do not implement from such entries.

Goal

ThreeRT's goal is AAA real-time game rendering: on consumer GPUs (Apple M series first), dynamic, open-world-scale game scenes (characters, vehicles, crowds, weather, day and night, all changing) at a steady 60 fps, with image quality close to an unbiased path-traced truth: ΔE ≤ 3 and SSIM ≥ 0.9 against our offline render, and no visible ghosting in motion.

Every new scene or feature maps to a capability in this goal that has not been proven yet, with measurable acceptance. No demos that repeat what is already proven.

Direction

Direction of 2026-11-25 (the user's, relayed by the supervisor, who rewrites the roadmap by it): the look comes first, judged by eye. A day flight recorded after 6a–6c showed no visible gain: the work had been held to "no regression" (ΔE / SSIM, frame time), so it added correct but small detail (streaks 3 mm off a wall, hoods seen at ΔE 0.07) that the live view's resolution and denoiser erase. The user wants the street level close to a photograph's quality soon. So a look item is done only when the Golden Gai pose, as the live view shows it, reads clearly better before / after, beside photographs of the place; order: shopfront windows and glass, Golden Gai's mass, the ground, the city's edge, then Shibuya. Tone mapping and exposure are left alone for now (the user's call).

Direction of 2026-11-24 (the user's, relayed by the supervisor, who rewrites the roadmap by it): § 0's order changes. The streamed city lives in its own repository, threert/TokyoRT (this engine as its submodule); its step 2 architecture is in (cells by distance, the kit as instances, in-place adds, incremental TLAS), none of step 2's acceptance is met yet. The user's review of a street-level day shot (Golden Gai) found the popping between levels the most visible fault, and the street level reading as generated: ground too clean, walls as boxes, weathering as tiled noise, windows without depth, props without purpose. So, after the script engine's GC hitches: a ΔE / SSIM tool against the offline render, then the popping, then the street level's look (step 6, split into 6a–6d), and only then the rest of step 2 (Shibuya stitched in) and steps 3 onward. Every PR reports frame start p95 and ΔE / SSIM; detail does not buy back frame time. A supervisor checks the line every two hours.

Direction of 2026-11-10 (the user's, relayed by the supervisor, who rewrites the roadmap by it): the day / night cycle and the weather are developed and measured on Tokyo, in this phase (§ 0 steps 1a and 1b), after step 1 and before streaming; there is no separate scene for them. The main line takes over the time of day the supervisor brought forward (#121, time-of-day); the supervisor is back to its two-hourly supervision.

Direction of 2026-11-09, evening (the user's, relayed by the supervisor, who rewrites the roadmap by it): the main line moves to an open city at the scale of Marvel's Spider-Man and GTA VI, Tokyo compiled from Japan's open 3D city model (§ 0); the dynamic content phase closes (its record is the history under § 0). Two lines share this repository and each merges its own PRs: this main line (Tokyo; the supervisor accepts and merges) and the voxel engine (§ 6, Yujia's line, which merges its own). This line does not start § 6 steps; a [ThreeRT] contract either line adds is there for the other, through its gate. Bistro and Zero Day stay the regression benchmarks.

Direction of 2026-11-09 (the user's): a voxel game engine built around ThreeRT, for voxel games in general, measured on a destructible benchmark level (§ 6, docs/VOXEL.md). A capability every kind of game needs that ThreeRT lacks goes into ThreeRT first, as a generic contract through its own gate, then the engine continues. Bistro stays ThreeRT's benchmark.

Direction of 2026-11-08, later the same day (the user's, relayed by the supervisor): the next phase is dynamic content (§ 0). Static Bistro night at 60 fps is proven; characters, vehicles and moving lights at scale are not. The static quality targets continue alongside.

Direction of 2026-11-08 (the user's, relayed by the supervisor, who rewrites the roadmap by it): the industry-standard scenes Amazon Lumberyard Bistro (night) and Beeple Zero Day replace Kabukichō as the scenes we are judged on. Each item has acceptance metrics; its status line is updated with the measured numbers when it lands. Merging PRs and deploying to production stay with the user.

Earlier direction (2026-11-05, kept for the history below): finish the three.js baseline and the UE mannequin → 2a / 2b → the A layer of the test suite (3) and the dev-loop tools (4) → the decision experiment (1) → split signals + caches (1, step 1) → the GTA gaps (5), all on Kabukichō.

How we are judged (2026-11-08, the user's decision, revised the same day)

  • Day-to-day truth is our own unbiased offline render: no clamps (clampIndirect off), no denoiser, high spp (4096 at 1280 × 720 for milestone images, 16 k at 320 × 180 for estimator studies). Together with layer A's analytic tests it is the reference for every PR, every evaluation and every report.
  • UE leaves the day-to-day loop. It is a milestone audit: once per milestone or per new scene, with the user present, small UE Path Tracer runs compared with our offline render, to confirm our path tracer and our reading of the assets (materials, emission, exposure). UE runs never happen while the user is away.
  • three.js is a real-time renderer we are compared with, not a target to approach. Every real-time renderer (ThreeRT live, three.js strongest / tuned) reports two kinds of numbers:
    • frame rate / GPU ms;
    • ΔE and SSIM against our offline render, overall and by region.
  • Budget: 60 fps on Bistro night, which means a frame interval ≤ 16.7 ms as a player sees it: along Bistro's FBX camera path, p95, at the 0.5 dynamic-resolution floor. GPU time at one pose within 16.7 ms is not enough (the first pose reads 16.1 ms, the path 18.6 ms p50). The perf smoke and perf suite measure both (docs/WORKFLOW.md). Since 2026-11-09 the budget is read on frame starts (start in the frame log: what the pacer sets); the open city's drive and flight (§ 0) are judged the same way.

0. Current work: an open city, Tokyo

  • Why (the user's, 2026-11-09): the main line needs the scenes of Marvel's Spider-Man and GTA VI, a dense real city at open-world scale that the player crosses fast, not Bistro copied again (the 3 × 3 district). It comes before day / night and weather, which this city then carries (its source app already has a time of day, a physical atmosphere and volumetric clouds).
  • What is proven and what is not:
    • Proven: one resident scene at a time, at most the 3 × 3 district (Bistro nine times, one copy in memory, 11.3 GB; GPU p95 14.1 ms along its path); crowds and traffic on one street at 60 fps (frame start p95 16.67 ms).
    • Not proven: a world larger than memory; kilometres of distinct geometry streamed in and out while the camera moves fast; a city's worth of emitters at once (lit windows, signs, screens, street lamps, headlights); traffic and trains on a real network.
  • The benchmark:
    • The city: Tokyo, from the pipeline of jeantimex/tokyo (MIT, three.js).
      • An offline compiler turns three sources into 256 m binary tiles:
        • Project PLATEAU, MLIT's open 3D city model: real footprints, heights, roof shapes and photo textures, roads, bridges, street furniture (CC BY 4.0, multi-licensed with ODbL);
        • OpenStreetMap: the road graph, railways, places (ODbL);
        • GSI: elevation and aerial photos.
      • The client streams the tiles and adds generated detail: facades and windows, signs, road paint, traffic on the real road graph, trains on the real lines.
      • Areas of ~3.4 × 2.8 km: Shinjuku (the skyscrapers, Kabukichō), Shibuya (the Scramble), Tokyo / Marunouchi, Shiba (Tokyo Tower), Chiyoda (Akihabara), Chuo (the waterfront and canals). PLATEAU covers ~300 cities, all 23 wards of Tokyo among them; an area is one config entry.
    • Scale and density targets from UE's City Sample (The Matrix Awakens). Its assets are licensed for Unreal only, so it serves as numbers and as the UE audit's look reference: 4.1 × 5 km (15.8 km²), 7,000 buildings, 260 km of roads, 1,248 intersections, 45 k parked cars, 17 k traffic vehicles, 35 k pedestrians, a night lit almost entirely by emissive windows.
    • Traversal targets from Marvel's Spider-Man 2: the city crossed at speed, with no loading screen.
    • Comparators:
      • the source app itself (three.js WebGL, on the same compiled tiles): frame time, and ΔE / SSIM against our offline render at the same poses, as milestone 1 did with three.js;
      • UE 5.8 with the official PLATEAU SDK for Unreal (MIT) on the same city, for the milestone audit with the user present.
    • Truth: our unbiased offline render, as everywhere.
    • Attribution and licences: PLATEAU (MLIT), GSI, © OpenStreetMap contributors, Poly Haven (CC0), ez-tree (MIT) and takram three-geospatial (MIT) are credited wherever the city is shown. Compiled tiles redistributed outside the team are a derived database under the ODbL: do not publish them without that.
  • The source's raster tricks become physics in ThreeRT, which is the point of the comparison:
    • lamp light-map quads → street lamps and headlights as emitters in the light tree;
    • the mirrored-city water and the screen-space window reflections → traced reflections;
    • n8ao → path-traced indirect light; the shadow map → shadow rays.
  • Bistro and Zero Day stay the regression benchmarks (layer B, perf suite); Tokyo's lines are added next to them.
  • Steps, one PR per item, in order; the supervisor accepts and merges. Each lands with its numbers in its status line.
    1. Import, one area resident. The pipeline brought in (tools/city/: compiler and tile format, its MIT notice and the data attributions kept) and Shinjuku compiled. A loader turns tiles into @threert/scene content: buildings (photo roofs and walls, generated facades; glass as glass, lit windows as emitters), ground (terrain under the aerial photo, roads with kerbs, paint), props, signs, water. Static (no traffic), the whole area resident, night and day under the existing sky.
      • Acceptance:
        • Shinjuku renders offline and live; counts stated (triangles, buildings, emitters, textures, memory, load time);
        • 5 poses (street level at Kabukichō's gate and at the station's west exit, a skyscraper canyon, two aerial): live vs our offline render ΔE / SSIM, and the source three.js app at the same poses (frame time, ΔE / SSIM);
        • live at the 0.5 floor, frame start p95 ≤ 16.7 ms on a scripted 60 s flight over the area.
      • Status, part 1 (2026-11-09, branch tokyo-import):
        • The pipeline is in tools/city/, from jeantimex/tokyo 1984760. It keeps its MIT notice and the data attributions. Paths were changed, nothing else. Downloads and tiles go to assets/city/, outside git:

          • Shinjuku's raw data is 1.5 GB;
          • compiled, it is 168 tiles and 68 MB;
          • fetching took 34 min, most of it on busy Overpass servers; compiling took 24 s.
        • tools/tokyo/to-glb.ts turns each tile into a GLB through the source's own mesher (tools/city/mesh). games/tokyo places the GLBs; room shinjuku-day / shinjuku-night. It carries:

          • terrain under GSI's aerial photo (tiles past the photo's edge padded with the land's colour);
          • road surfaces, kerbs, parks, water and paint, coloured as the source colours them;
          • buildings, PLATEAU's LOD2 roofs under their photo atlases (the atlas's v, up as GL reads it, turned to glTF's), and PLATEAU's models;
          • windows as geometry, cut from the source's facade rules (bays, floors, shopfronts): unlit ones as dark glass, 42 % lit (45 nits) as emitters.
        • By day the sun stands where it does over Tokyo at 12:00 on 2026-11-09, 36.8° high and 10.5° west of south (SUN in games/tokyo): where the source app puts it for that day's ?time=12.

        • Counts: 13.6 M triangles, 21,576 buildings, 1.32 M windows (584 k lit), 1.64 M emitter triangles, 215 textures, 1.44 GB of GLB. Offline: loaded in 1.6 s, acceleration structures in 1.0 s. Live: first frame 3.9 s, physical footprint ~15 GB.

        • Live at the 0.5 floor (64 frames) against our offline render (1024 spp, no clamps, no denoiser), ΔE / SSIM; the live GPU time at the pose, p50 / p95 ms; and the truth's own noise, a 256 spp render against it, as milestone 1 shows it (tools/tokyo/step1.ts):

          pose day: live GPU truth's noise night: live GPU truth's noise
          Kabukichō's gate 0.93 / 0.967 12.0 / 12.8 0.48 / 0.980 1.22 / 0.938 10.8 / 11.6 0.90 / 0.925
          west exit, Chūō-dōri 1.04 / 0.938 11.5 / 12.1 0.64 / 0.953 2.78 / 0.902 10.3 / 10.9 0.94 / 0.939
          skyscraper canyon, Tochō-dōri 1.55 / 0.894 10.6 / 11.2 0.67 / 0.924 2.61 / 0.914 9.9 / 10.4 0.99 / 0.943
          aerial east 1.86 / 0.944 11.5 / 11.9 0.52 / 0.990 4.63 / 0.879 9.9 / 10.2 0.58 / 0.994
          aerial west 2.13 / 0.954 11.6 / 12.0 0.50 / 0.994 4.69 / 0.871 10.9 / 11.6 0.64 / 0.990
          • By day, in sun at street level, the truth is specked with the sun's glints off window glass (paths that reach the sun through a mirror bounce, not converged at 1024 spp). They are most of the canyon's SSIM: its own noise reads 0.924. Live reads 1–5 % dark there; the glints' energy, which live does not carry, is the likely part of it.
          • By night the aerial views read 11 % bright, against a truth that is quiet there (0.99): hundreds of thousands of lit windows in view, which is step 3's subject.
          • Crops (offline | live): docs/img/tokyo-shinjuku-day.jpg (aerial west, Kabukichō's gate, the canyon), docs/img/tokyo-shinjuku-night.jpg.
        • The 60 s flight, once round the area at 300 m and 1.2 km out: frame start p95 16.67 ms by day and by night, within the budget. GPU p50 / p95 is 12.1 / 12.9 ms by day and 10.5 / 10.8 by night.

          • Two frames in each run take 70–120 ms, at the same two points of the orbit by day and by night (about 17 s and 27 s in). The time is the frame's CPU (80–104 ms) with the GPU at its usual 10–12 ms. Step 2 allows no frame over 50 ms: find them there.
        • Still to do for part 2:

          • props: street lights as emitters, trees, signals, vending machines, parked cars;
          • signs and road decals;
          • memory: the meshes are triangle soups with full attributes; step 2's 1.5 × bound needs them indexed and lean.
      • Status, part 1b (2026-11-09, branch tokyo-three-app): the source three.js app at the same poses.
        • node tools/tokyo/three-app.ts runs the app, served by its own vite dev server on the same compiled tiles (its public/tiles linked to assets/city/tiles), in headless Chrome at 1280 × 720 over the DevTools protocol (tools/three/browser.ts). It holds the GPU lock.

          • It waits until every tile is in (#loader.done), sets each pose on the app's camera, and waits for the tiles round it.
          • Traffic, birds and clouds are off. Day is the app's ?time=12, with its sun where ours is (SUN); night is its ?night=1 (22:00, moonlit).
          • The shot is the canvas alone, without the app's buttons and credits.
          • The app keeps its camera 2 m above the ground; ours stands at 1.7 m, so its street poses sit up to 0.4 m higher.
        • The app's frame time is taken two ways: its own frame loop (rAF intervals, what its user sees, capped at 60 Hz), and its frame function run back to back with gl.finish() ("finished"). Against our offline render it reads ΔE / SSIM / luminance, as live does. ThreeRT live's GPU time and distance are from part 1's table.

          pose three.js frame (rAF) ms finished ms three.js ΔE / SSIM / luminance ThreeRT live GPU ms ThreeRT live ΔE / SSIM
          day: Kabukichō's gate 16.7 / 33.3 1.6 / 18.4 30.4 / 0.345 / 2.37 12.0 / 12.8 0.93 / 0.967
          west exit 16.7 / 33.4 4.4 / 23.2 25.3 / 0.300 / 3.24 11.5 / 12.1 1.04 / 0.938
          skyscraper canyon 33.3 / 33.4 6.9 / 30.7 27.6 / 0.284 / 1.60 10.6 / 11.2 1.55 / 0.894
          aerial east 33.4 / 50.1 37.1 / 37.9 28.0 / 0.514 / 1.94 11.5 / 11.9 1.86 / 0.944
          aerial west 50.0 / 66.7 52.5 / 53.6 26.4 / 0.477 / 1.74 11.6 / 12.0 2.13 / 0.954
          night: Kabukichō's gate 16.7 / 33.3 4.5 / 18.4 23.5 / 0.373 / 0.60 10.8 / 11.6 1.22 / 0.938
          west exit 16.7 / 33.4 21.2 / 23.7 31.4 / 0.219 / 0.56 10.3 / 10.9 2.78 / 0.902
          skyscraper canyon 33.3 / 33.4 28.6 / 29.9 25.2 / 0.228 / 0.77 9.9 / 10.4 2.61 / 0.914
          aerial east 33.4 / 50.1 37.6 / 38.2 18.7 / 0.132 / 0.29 9.9 / 10.2 4.63 / 0.879
          aerial west 50.0 / 66.7 52.6 / 53.7 18.9 / 0.163 / 0.23 10.9 / 11.6 4.69 / 0.871
        • Frame time:

          • The app runs at 60 fps at street level, except in the canyon (30). It drops to 30 and 20 fps in the aerial views, where its frame function takes 37 and 53 ms to finish: the whole area is drawn.
          • ThreeRT live stays at 10–12 ms of GPU at every pose, and its 60 s flight paces at 60 fps.
          • The work differs: the app rasterises at full 1280 × 720, while ThreeRT path traces at the 0.5 floor (640 × 360) and upscales.
        • The image: ΔE 19–31 and SSIM 0.13–0.51 against our offline render. Milestone 1 read three.js at ΔE 10–16, but there both drew the same scene; here the app tones its own way and draws content we do not.

          • Exposure and tone account for much of it: the app is 1.6–3.2 × brighter by day and 0.23–0.77 × by night.
          • The rest is what the app draws and we do not yet (docs/img/tokyo-shinjuku-three.jpg: ours offline | ThreeRT live | the app):
            • trees (street trees, the park's canopy), poles and wires, shop signs and neon;
            • facades with window frames and wall finishes from its facade shader, where ours are flat colour and dark glass;
            • by night, street lights on the roads, and far fewer lit windows in warm and cool tones. Ours are 42 % lit and near white at EV100 5, and they wash the aerial views out;
            • the land beyond the area hazed into the sky, where ours is a brown band.
          • Part 2 takes the props (street lights as emitters, trees), the signs and the window mix. Facade finishes and the far haze are noted for step 3's look work.
      • Status, part 2 (2026-11-09, branch tokyo-props): street props, and the night's windows as the source lights them.
        • tools/tokyo/props.ts puts the client's street props into each tile's GLB as geometry. They are placed, turned and lifted as the client places them (src/world/props.js):

          • 4,421 street lights and 3,437 utility poles, each with an LED head;
          • 577 signals, red and green lit;
          • 514 vending machines, lit fronts, in the client's four body colours;
          • 2,152 parked cars;
          • 24,348 trees: a trunk and the client's far-tree crown. Park trees stand in clumps of three, as the client sets them.
          • Not yet: the mapped street furniture (bus stops, benches, bollards and the like). Near trees are still the far shape; the client draws ez-tree models up close.
        • The lamp heads are emitters by night only. Each tile's GLB holds them twice: lit in its "night" node, unlit in its "day" node (tools/tokyo/glb.ts). The scene loads "city" plus the room's node (GLTFModel's nodes).

          • A street light's head (0.3 × 0.75 m, 6000 nits) gives ~20 lux on the road 8.5 m below.
          • A utility pole's lamp gives ~19 lux 5.6 m below.
          • Both are within JIS Z 9111's range for such roads.
        • Lit windows follow the source's facade shader at night, with our hashes in place of its own:

          • the lit share by kind (shops 0.75, offices 0.32, homes 0.22), times 0.35–1.9 for the building;
          • most offices lit by the floor;
          • towers mostly dark glass, with a few storeys lit as bands;
          • warm bulbs, cool tubes and the odd screen blue;
          • brightness by room and building: 45 nits × 0.2–1.7, in three bins.
          • 34 % of windows are now lit (444 k), against 42 % before.
        • Counts:

          • 17.7 M triangles (+4.1 M, mostly trees), 1.29 M emitter triangles by night, 1.89 GB of GLB;
          • offline: loaded in 2.0 s, acceleration structures in 1.8–1.9 s;
          • live: first frame 5.1–5.3 s, physical footprint ~18 GB (15 GB before). The trees are triangle soups, one copy per tree; instancing them is part of step 2's memory work.
        • The tile photos and roof atlases carry a 16-texel margin: what lies beyond each edge (the neighbouring photo; the atlas's own edge texels), with the UVs inside it. The renderer repeats every glTF texture, so filtering at an edge used to reach across to the texture's other side, a seam along every tile boundary from above.

        • The truth is now 4096 spp, and its noise is measured with the 1024 spp render. At 1024 spp the night streets' truths read SSIM 0.80–0.87 against 256 spp, and comparing live with them said little.

        • Live at the 0.5 floor against the 4096 spp truth, with the live GPU time (p50 / p95 ms) and the truth's noise:

          pose day: live ΔE / SSIM GPU truth's noise night: live ΔE / SSIM GPU truth's noise
          Kabukichō's gate 0.85 / 0.975 11.8 / 12.6 0.30 / 0.992 1.27 / 0.940 10.6 / 11.3 0.72 / 0.948
          west exit, Chūō-dōri 0.90 / 0.951 11.2 / 12.1 0.37 / 0.973 2.18 / 0.842 10.2 / 11.0 1.34 / 0.875
          skyscraper canyon, Tochō-dōri 1.69 / 0.806 10.8 / 11.8 0.80 / 0.866 1.94 / 0.825 10.5 / 11.2 1.26 / 0.873
          aerial east 1.86 / 0.947 11.7 / 12.1 0.31 / 0.996 2.92 / 0.894 10.1 / 10.4 0.29 / 0.993
          aerial west 2.19 / 0.953 11.8 / 12.1 0.36 / 0.994 2.54 / 0.883 10.2 / 10.5 0.31 / 0.989
          • All ten poses are within ΔE ≤ 3. Five are within SSIM ≥ 0.9.
          • Three of the misses are bounded by the truth itself: the canyon by day, and the west exit and the canyon by night. Each truth's own noise reads 0.87 there.
            • By day this is the sun's glints off window glass, now also on the tree crowns. Live does not carry them and reads 7 % dark in the canyon.
            • By night it is the light of many small, bright sources on the road. Live shows it as blotches on the asphalt that the truth does not have.
          • The night aerials are a real gap with a quiet truth (0.99): SSIM 0.88–0.89, 3–4 % bright. They read 11 % bright with the old windows.
        • The 60 s flight: frame start p95 16.67 ms by day and by night, within the budget. GPU p50 / p95 is 12.4 / 13.0 ms by day and 10.5 / 10.9 ms by night.

          • The two CPU stalls are still there, at the same points, now 100–155 ms (the frame's CPU 88–138 ms): they grow with the scene.
        • The source app at the same poses (docs/img/tokyo-shinjuku-props.jpg: ours offline | ThreeRT live | the app):

          • by night ΔE 14–24 (19–31 before): our windows no longer wash the views out;
          • by day ΔE 25–30, unchanged. The app's exposure, 1.8–3.7 × brighter, and its facade finishes dominate.
      • Status, part 3 (2026-11-10, branch tokyo-signs): signboards and the road's painted symbols.
        • tools/tokyo/signs.ts letters the compiler's signboards as the client does (src/world/signs.js):

          • fascias flat on the wall, blades standing out from it (lettered on both faces), titles on top;
          • each tile's names in one atlas, drawn as SVG through sharp with the system's Japanese fonts: vertical writing on blades, long names squeezed to fit, the chains' stripes;
          • 3,746 boards, every board the tile data letters, on 140 atlas pages (2048 wide, up to 4096 high; two busy tiles take a second page). Billboards and screens (the client's poster atlas) are not drawn yet.
            • The first version dropped the boards that did not fit one page: 38 in Shinjuku, and 117 once the cells had their margins (Bugbot on #123).
          • The boards glow through their atlas: 200 nits by night (the GLB's "night" node), 20 by day ("day").
          • Each cell has an 8-texel margin of its own edge texels, and the boards' UVs sit half a texel inside the cell, so filtering at an edge, and the mips down to the fourth level, read the board alone. The renderer repeats every glTF texture whatever the sampler says, so the margin, not CLAMP_TO_EDGE, keeps the edge clean. Before (Bugbot on #123), the edges picked up the atlas's grey ground.
        • tools/tokyo/decals.ts paints the road's symbols: arrows, 止まれ, speed numbers, 1,919 of them.

          • They are drawn as the client draws them, then traced into outlines and triangulated: 12–159 triangles per symbol. Each is laid where the mesher lays its quad and draped as the road's paint is: split on the terrain's cells and diagonals, each piece in the plane of the road under it, 0.17 m above it.
            • With one height per vertex, as first done, a symbol stood between −0.015 and +0.311 m over the road (Bugbot on #123). Draped, it stands at 0.17 m everywhere: 140 k triangles instead of 75 k.
          • As alpha cutouts they cost 1.0–1.4 ms a frame over the whole view: one cutout in the scene turns on the kernel's alpha-test loop (F_MASKED) for every ray. Alternated A/B at the west exit and aerial east, by day: 12.10–12.15 against 11.07 ms and 13.05–13.06 against 11.65–11.66 ms. As geometry they cost nothing measurable: 11.07 against 11.02 ms and 11.61 against 11.64 ms.
        • Counts: 17.9 M triangles, 355 textures, 1.93 GB of GLB. Live: first frame 5.9 s (5.3 before: the atlases), physical footprint ~16 GB.

        • Shiba's GLBs carry them too: 4,416 boards and 2,225 symbols.

        • Live against the 4096 spp truth (GPU p50 / p95 ms):

          pose day: live ΔE / SSIM GPU truth's noise night: live ΔE / SSIM GPU truth's noise
          Kabukichō's gate 0.86 / 0.976 11.9 / 12.7 0.30 / 0.992 1.70 / 0.878 10.8 / 11.5 1.21 / 0.884
          west exit, Chūō-dōri 0.91 / 0.950 11.3 / 12.2 0.37 / 0.973 2.02 / 0.868 10.5 / 12.0 1.14 / 0.900
          skyscraper canyon, Tochō-dōri 1.70 / 0.804 10.8 / 11.9 0.81 / 0.865 1.87 / 0.836 10.5 / 11.5 1.20 / 0.877
          aerial east 1.86 / 0.947 11.8 / 12.1 0.32 / 0.996 2.95 / 0.894 10.7 / 10.9 0.29 / 0.993
          aerial west 2.19 / 0.953 11.8 / 12.2 0.35 / 0.994 2.57 / 0.882 10.2 / 10.5 0.31 / 0.989
          • All ten poses stay within ΔE ≤ 3, as in part 2. By day the numbers are part 2's: the boards glow at 20 nits and the symbols are paint. Four poses are within SSIM ≥ 0.9.
          • By night the boards are new small light sources, the more so round Kabukichō's gate. There the truth's own noise rose (ΔE 0.72 to 1.21, SSIM 0.948 to 0.884), and live reads ΔE 1.70 / SSIM 0.878 (1.27 / 0.940 in part 2): under 0.9, as its truth is.
        • The 60 s flight: frame start p95 16.67 ms by day and by night. GPU p50 / p95 is 12.4 / 13.1 ms by day and 10.5 / 11.0 ms by night.

          • No frame over 50 ms in either run. The two CPU stalls of parts 1 and 2 did not come back, in these runs or in a run before the symbols became geometry; what they were is still open for step 2.
        • Step 1's items are all in: the area resident, its props, signs and paint, measured live against the truth and beside the source app. What step 1 leaves to later steps:

          • memory (~16–18 GB, the meshes as soups, the trees uninstanced) and the first frame: step 2;
          • the sun's glints off glass (the canyon by day reads 7 % dark live), the blotches on the night streets, and the night aerials' 3–4 % excess: step 3's quality work;
          • near trees as the client's ez-tree models, billboards and screens, the street furniture: with step 3's look.

    1a. Time of day, completed (on #121's dynamic sky, which the main line takes over from the supervisor):

    • the land beyond the area hazed into the sky by the atmosphere's aerial perspective, not a brown band at the horizon;
    • windows that switch on and off with the clock (by building use, from late afternoon into the night, staggered by building, as the source app's facade shader does), in place (power or material);
    • moonlight (a second directional light: the moon's position and phase on the date), and the night sky's glow set against photographs of Tokyo at night.
    • Acceptance:
      • the Shiba fly-past (the supervisor's clip: 540–760 km/h past Tokyo Tower, the clock 15:30 → 17:45) and a Shinjuku drive at 60 fps: frame start p95 ≤ 16.7 ms, no frame over 50 ms, no rebuild;
      • live against our offline render at 5 poses × 4 times (15:30, sunset, civil dusk, night): ΔE ≤ 3, SSIM ≥ 0.9 where the truth's own noise allows (stated per pose);
      • in place against a fresh load of the same state (tools/bench-sun.ts, extended to Tokyo): ΔE ≤ 0.1;
      • a clip posted in the session.
    • Found by the acceptance runs (2026-11-11, branch light-tree-switchable): light sampling was set up at load for the lights on at that moment.
      • A room loaded by day (its lamps and windows off) left them out of the light tree. Switched on at dusk, they were drawn from the flat CDF beyond it, by power share alone, with no importance at the shading point and no distance cut: shadow rays across the city.
      • The sky's light-sampling floor (1 % of the emitters' mean radiance) also came from the lights on at load. The room kept light-sampling a night sky that a room loaded at night does not.
      • Both now count a switched-off emitter at full power (switchable_power); the tree's node powers are refit to the objects' powers now. The 12 catalog scenes and 6 game rooms with every emitter on at load render byte-identical; Tokyo's 15:30 room does not.
      • GPU p50 at the 0.5 floor, main → this branch, per second of path (alternated runs):
        • the Shiba fly-past: 14.6–17.9 → 8.9–12.5 ms by day, 20.0–21.7 → 12.2–12.8 ms from dusk;
        • the Yasukuni-dōri drive: 15.0–18.4 → 10.7–13.5 ms once the first lamps are on (16:09).
      • In place against a fresh load (Shinjuku's east aerial, on main + ThreeRT#3 and #4): ΔE 0.49 → 0.08 at sunset, 0.15 → 0.01 at civil dusk, 0.34 → 0 at night (bit for bit).
    • Status, part 1 (2026-11-10, branch aerial-perspective): the land beyond the area hazed into the sky.
      • SkyAtmosphere({ aerialPerspective }) in packages/scene: the atmosphere's own haze over the surfaces behind it, at a multiple of its density. It is off by default (0); the kernel's F_AERIAL is compiled out where no scene has it.

        • On every path segment that ends on a surface: transmittance through Rayleigh (RGB) and Mie with sky.rs's Earth scale heights (8 km, 1.2 km), in closed form.
        • The light scattered toward the viewer is the sky's own radiance a little above the horizon in that direction (2.3°), (1 − T) of it: a horizontal ray through the same air ends on that horizon, so far land fades into the sky behind it.
        • Camera rays see the sky near the horizon at that same elevation: the baked sky's fade to its black lower half would otherwise leave a dark seam between the sky and the hazed land.
        • Live: the camera ray's haze joins the emission signal. In the diffuse signal, which the denoiser divides by the albedo, dark glass with haze in it read 9–18 % bright. The cache's gather paths take a grey transmittance.
      • Tokyo's sky (tokyoSky in games/tokyo): Mie at 10× the clean-air default (a visual range near 70 km, Koschmieder), aerial perspective 1, in the static rooms and the time-of-day ones.

      • Check (tests/render/sky-aerial-perspective.ts): a black wall 5 km away reads (1 − T) of the sky above it, 0.3805 measured against 0.38 analytic.

      • Shinjuku by day, live against our 4096 spp offline render, both with the haze (ΔE / SSIM / luminance; part 3 of step 1 without it):

        pose without the haze with it
        Kabukichō's gate 0.86 / 0.976 / 0.986 1.04 / 0.976 / 0.968
        west exit, Chūō-dōri 0.91 / 0.950 / 0.955 1.00 / 0.953 / 0.922
        skyscraper canyon, Tochō-dōri 1.70 / 0.804 / 0.932 1.92 / 0.810 / 0.917
        aerial east 1.86 / 0.947 / 0.994 1.63 / 0.951 / 0.995
        aerial west 2.19 / 0.953 / 0.990 1.95 / 0.952 / 0.990
        • The aerial views come closer to the truth. At street level live reads 2–3 % darker than before.
          • The haze is not why: with the same Mie and the haze off, live reads the same against a 256 spp render (west exit 0.922 and 0.923, the canyon 0.941 and 0.941, off and on).
          • The hazier sky is: a dimmer sun and more of the light from the sky, which live underestimates in the streets' shade (step 3's quality work).
      • Cost, alternated A/B with the same Mie, live GPU p50: +0.11–0.15 ms at the west exit, within ±0.05 ms over the city from the air.

      • The 12 catalog scenes render byte-identical between main and this branch (offline, software traversal). The kernel's Params grow by 16 bytes at their end.

      • Before / after: docs/img/tokyo-aerial-perspective.jpg (no haze | with it, offline | with it, live).

    • Status, part 2 (2026-11-10, branch windows-clock): the windows come on with the clock.
      • tools/tokyo/to-glb.ts writes each building's lit windows to one of 6 GLB nodes (win0…win5), its switch group: the sun's elevation at which its rooms come on (games/tokyo/area.ts), within its use's span.
        • Offices come on from 12° to 0°, shops from 6° to −2°, homes from 4° to −8°, each building at its own moment within that span (a hash). Which rooms are lit, their colour and glow, are as before.
        • A lit room's window is the same glass as the panes around it (albedo 0.02, roughness 0.04, ior 1.5) with the room's light behind it. While its group is off by day, it reads as glass. It had been an opaque grey panel, which caught the sun as a cream patch amid the glass (Bugbot). Crops at 14:00, every group off: docs/img/tokyo-windows-glass.jpg.
      • The static rooms load every node. The regrouping alone changes nothing they render: Kabukichō's gate by night, at 1024 spp with the regrouped GLBs against the 4096 spp truth of the old ones, reads ΔE 1.30 / luminance 1.002, against its truth's own noise of 1.21. The glass changes the lit windows little by night: ΔE 0.15 / luminance 1.001 at the gate (256 spp, before against after).
      • The time-of-day rooms (tokyo-tod) load each tile's groups as objects of their own and switch their power by the clock, as the street lamps, with no rebuild. The frame script touches only what switches: setting every lamp's and group's power every frame cost it 15–20 ms.
      • Shiba from 16:18 to 17:36 in 20 s, live at the 0.5 floor (r1300: 106 tiles): no rebuild, frame start p95 16.67 ms and p99 17.1, no frame over 50 ms, GPU p50 / p95 13.7 / 13.9 ms. Crops at 16:30, 16:54 and 17:24: docs/img/tokyo-windows-clock.jpg.
      • A power change costs the live view's commit ~13 ms of CPU, whatever its size: write_emitters rebuilds the emitter CDF and refits the light tree over all 1.4 M emitters. A group therefore switches on every tile in one frame; making that update incremental is the next item.
      • Next for step 1a: the commit's cost, moonlight and the night sky.
    • Status, part 3 (2026-11-10, branch moonlight): moonlight and the night sky.
      • The moon (games/tokyo/moon.ts): a second directional light in the time-of-day rooms, where the moon stands over Tokyo at that moment.
        • Position by Schlyter's method: mean elements and the main perturbations, within a few arcminutes.
        • Its light by phase: Allen's magnitude against the sun's, through the same air as the sun's (Rayleigh, Mie at 10×, ozone; Kasten and Young's air mass).
        • Checked at November 2026's phases (tools/tokyo/test/moon.test.ts, USNO times): new on the 9th, first quarter on the 17th, full on the 24th, 0.25 lx above the air.
        • The rooms take a date (-d20261124); 2026-11-09 is a new moon.
        • It is black while it is down, until civil dusk, and under starlight's 1 mlx.
        • The full moon high over Shinjuku at 23:00 changes the city by ΔE 0.05 at EV 5 (0.2 lx against its lit streets), as in photographs: the moonlight is lost in the city's light.
      • The kernel skips a black directional light (no BSDF, no shadow ray), after the cone's random numbers, so every other light sees the same ones.
        • The moon while down, and the sun at night, cost nothing. Shiba from 16:18 to 17:36 live, GPU p50 with a black moon: 14.30 / 14.33 ms without the skip, 13.58 / 13.61 with it (serverless-agent-test#130: 13.7).
        • The 12 catalog scenes render byte-identical.
      • The night sky: SkyAtmosphere horizonGlow, a light dome over the glow (nits at the horizon, falling to 1/e at horizonGlowHeight). tests/render/sky-night-glow.ts: 1.349 measured, 1.349 analytic.
        • Tokyo's (NIGHT_GLOW in games/tokyo):
          • 27 mcd/m² at the zenith (16.5 mag/arcsec², Tokyo's clear-night zenith measured from Sumida, 2010–11);
          • a dome of 0.26 cd/m² more at the horizon, falling to 1/e by 3.5°;
          • a violet-blue zenith and a warm dome.
        • Set against photographs of the Shinjuku skyline at night (Wikimedia Commons, 2004 and 2005; not committed):
          • the sky at 1°, 7° and 15° reads 7.3 : 1.95 : 1, and the dome is shaped on that;
          • the colours are the 2004 photograph's, white-balanced on its office windows;
          • at the 2005 photograph's exposure (EV 3) our sky reads 4× brighter than its top of frame, whose blacks are crushed, and darker than the 2004 one (a longer exposure).
        • The static night rooms now have the same sky as the time-of-day rooms: the atmosphere with the sun 40° down, and the glow. Before, a uniform blue sky lit the city from below the horizon too.
        • The land beyond the area now fades into the dome by night (the aerial perspective's haze carries its light), not a black band under the sky. At EV 5 the sky stays near black, as in photographs at that exposure. Before and after, at EV 5 and as a long exposure: docs/img/tokyo-night-sky.jpg.
    • The commit's cost (ThreeRT#3, first serverless-agent-test#135): a power edit rebuilt the emitter CDF and refit the light tree in the frame, ~13–15 ms over Tokyo's 1.4 M emitters, ~90 times in the Shiba fly-past (the street lamps and the window groups switching).
      • Scenes with many emitters now rebuild both on a worker thread (EmitterWorker). The edits land with the result, a few frames later. (Removed 2026-11-27: the GPU makes the weights in the edit's frame, "The emitters' weights are made on the GPU".)
      • The fly-past's frame interval p95 went from 29.7 / 28.5 to 17.20 / 17.17 ms, and its commits over 5 ms from 91 to 0.
    • Acceptance (2026-11-11, branch tokyo-1a-acceptance; node tools/tokyo/accept-1a.ts, clips by node tools/tokyo/clip.ts tower|drive), on main + ThreeRT#6 (light sampling set up for the lights switched off at load, found by these runs):
      • The Shiba fly-past (15:30 → 17:45 in 10.5 s, 540–760 km/h) and a Shinjuku drive (Yasukuni-dōri eastbound from roads.json at 60 km/h, 16:00 → 18:00 over 67 s), real time at the dynamic resolution:

        run frames scale frame start p95 / p99 interval p95 / max over 50 ms rebuilds GPU p50 / p95
        fly-past 648 in 10.5 s 0.70 16.67 / 23.73 17.5 / 27.1 0 0 14.24 / 16.55
        drive 4,086 in 67.1 s 0.625 16.67 / 16.95 16.83 / 20.0 0 0 14.40 / 16.25

        Both pass. Before #6 neither did: frame start p95 19.92 and 17.21 ms at the 0.5 floor.

      • Live (the 0.5 floor, 64 frames after a reset) against our offline render (4096 spp, no denoiser, clamps off): ΔE / SSIM / luminance (the truth's own noise, its 1024 spp render against it, ΔE / SSIM; SSIM with both halved, at the resolution live renders):

        pose 15:30 sunset (16:40) civil dusk (17:07) night (19:30)
        Kabukichō's gate 0.50 / 0.983 / 0.976 (0.19 / 0.996; 0.990) 0.60 / 0.984 / 1.004 (0.23 / 0.998; 0.992) 0.62 / 0.966 / 0.989 (0.29 / 0.980; 0.979) 1.73 / 0.877 / 0.994 (1.20 / 0.884; 0.936)
        west exit 0.98 / 0.942 / 0.945 (0.29 / 0.975; 0.968) 0.91 / 0.965 / 1.011 (0.27 / 0.997; 0.980) 0.75 / 0.954 / 0.989 (0.26 / 0.982; 0.970) 2.01 / 0.869 / 0.993 (1.14 / 0.900; 0.916)
        skyscraper canyon 1.09 / 0.960 / 0.961 (0.28 / 0.987; 0.982) 0.88 / 0.965 / 1.011 (0.26 / 0.996; 0.985) 0.60 / 0.958 / 0.973 (0.22 / 0.978; 0.975) 1.88 / 0.835 / 0.994 (1.19 / 0.878; 0.905)
        aerial east 1.56 / 0.933 / 0.993 (0.29 / 0.991; 0.976) 1.83 / 0.916 / 0.963 (0.25 / 0.998; 0.964) 1.75 / 0.931 / 0.898 (0.13 / 0.998; 0.981) 2.89 / 0.896 / 1.037 (0.28 / 0.993; 0.962)
        aerial west 2.26 / 0.938 / 0.985 (0.34 / 0.993; 0.976) 2.07 / 0.880 / 0.975 (0.29 / 0.998; 0.939) 1.17 / 0.930 / 0.879 (0.12 / 0.997; 0.977) 2.52 / 0.884 / 1.030 (0.30 / 0.989; 0.951)
        • ΔE ≤ 3 at all 20. SSIM ≥ 0.9, or within 0.02 of the truth's own, at 15 (bold: the misses).
        • The night's numbers are step 1's static night rooms' (gate 1.70 / 0.878, west exit 2.02 / 0.868, canyon 1.87 / 0.836, aerials 2.95 / 0.894 and 2.57 / 0.882): the time-of-day room at 19:30 renders as they do. Their misses are step 1's, left to step 3.
        • Sunset's west aerial misses on the far city's detail at the 0.5 floor: halved, 0.939.
        • At civil dusk the aerials read 10–12 % dark (0.898, 0.879): the far lamps and windows the live view does not sample (LT_FAR, 120 m) and finds only by BSDF rays. Step 3.
      • In place against a fresh load (Shinjuku's east aerial; the clock run in lockstep to the time, held 200 frames, reset, 128 frames): ΔE 0.03 at 15:30, 0.08 at sunset, 0.01 at civil dusk, 0 at night (bit for bit). All pass. Before #6: 0.29 / 0.49 / 0.15 / 0.34.

      • Clips, posted in the session (animated WebP: the real-time run's frames, the lockstep snapshots of each):

        • the fly-past, 637 frames in 10.5 s at scale 0.70;
        • the drive, 4,078 frames in 67.1 s at scale 0.625.

    1b. Weather on Tokyo. States, and transitions between them, all in place (no rebuild):

    • rain: wet streets and puddles reflecting the city, and the rain curtain (Bistro's), measured on Tokyo;
    • fog and mist: height fog over the city, thickening and clearing;
    • overcast: cloud cover that dims and softens the sun and the sky;
      • Engine side done (2026-11-11, branch sky-cloud-cover): scene.cloudCover (0..1), changed in place.
        • The atmosphere's sky goes over to the CIE standard overcast sky, white. Its horizontal illuminance is 0.3 of what the clear sky and sun give the ground (stratus pass 0.1–0.4).
        • The sun's direct light is × (1 − cover), its mean share of time out of cloud.
        • A night glow is 3× brighter off the cloud base (Kyba et al. 2011).
        • The live view re-bakes the dynamic sky and relights the sun on a change, as for a sun move.
        • Unit test full_cover_is_the_cie_overcast_sky_lit_by_the_clear_day.
    • volumetric clouds in the sky, their shadows moving over the city (the sky's bake and the sun's visibility through them);
    • transitions in real time: clear → overcast → rain → clearing, with the clock running.
    • Acceptance:
      • each state and each transition with no rebuild; frame start p95 ≤ 16.7 ms on the Shiba fly-past, no frame over 50 ms; each effect's cost stated;
      • live against our offline render ΔE ≤ 3 per state at 5 poses (rain: the wet-street poses);
      • in place against a fresh load ΔE ≤ 0.1;
      • Tokyo lines in the perf suite: the Shiba fly-past clear and in rain;
      • a clip (a clear afternoon into a storm at dusk) posted in the session.
    • Status, part 1 (2026-11-11, branch gltf-material-functions): the engine side of the rain on the city.
      • GLTFModel.functions: material functions on a glTF file's own materials, by name prefix (the compiled tiles' ground, roads and roofs are glTF materials with the aerial photos as maps). Set at build; the model has its own copies of the file's materials and meshes. Their triangles are flattened per placement, as every material-function triangle is: on Tokyo 15.2 M of 17.8 M.
      • wetLayer(): SurfaceMaterial's wetness (Lagarde; puddles on up-facing ground, rain ripples) as a layer on another material's shading. surface/wet-layer-gltf: 0.556 against 0.549 analytic.
      • The translucency pass compiles only its particles' material functions: with every function of Tokyo's kernel in it, the Metal compiler failed on the translucent pipeline once the ground had wetLayer and the rain curtain was in the scene. Order: 1 (complete with its part 3, signs and road markings) → 1a → 1b → 2 → 3 → 4 → 5 → 6 → 7 (until 2026-11-24). Order since 2026-11-24 (the user's; the work in threert/TokyoRT, engine changes here):
    • (1) step 2's frame budget: the script engine's GC hitches (~100 ms a few times a minute over ~1 M live JS objects) → p99 ≤ 25 ms, no frame over 50 ms, by making fewer objects, not by switching collection off;
    • (2) a ΔE / SSIM tool for the streamed city: fixed poses, live against our offline render, and streamed against everything resident at full detail (step 2's ΔE ≤ 1.0 / SSIM ≥ 0.98); every PR reports it from here on;
    • (3) popping between levels (step 2's "streaming invisible"): first the levels agree (colour, material and outline of the same building far, mid and near: the far level's dark Tochō against the mid level's light curtain wall), then a dithered transition for the ~140 m swap; ΔE across a swap at fixed poses;
      • the dithered transition is deferred (2026-11-24, the supervisor's call on the data): the 140 m swap shows no flicker. Fixed poses offline ΔE 0.00; live, frame by frame through a swap, worst 0.50 / 0.55 against a single frame's noise of 0.44 / 0.47; the tour in lockstep with and without the swap (L0 to 280 m), every 15th frame, at most 0.39 against two runs of the same build's 0.14–0.26 (TokyoRT tools/quality.ts --swap). Taken up again if a recording shows a 140 m flicker (replayed in lockstep frame by frame first). The pop seen was the 480 m switch (TokyoRT #11).
      • the 480 m switch after TokyoRT #11 (the far level in the dress's colours): towers SSIM 0.983, within the bar; the skyline 0.967, not. Each far building's own window module (bays, layout, fractions, as the dress draws them) moved it to 0.968 for 8 % more far triangles, so it was not kept: what is left is structure all over (roof rims, rooftop plant, the windows' tone by kind of building, trees), each a little. A far level the dress makes itself (an L2 bake: walls, roofs and flat window quads, ~5–10 M triangles for the area, in place of the source mesher's buildings) would agree by construction; it is a later item. § 0's order goes on to (4).
    • (4) step 6a–6d below, in that order (6a–6c landed 2026-11-24 as TokyoRT #12, #14–#16; see step 6 for what changed on 2026-11-25);
    • (5) the rest of step 2: Shibuya stitched in (~20 km²), the drive, expressway and flight paths, resident memory, the first frame;
    • (6) then 3 → 4 → 5 → 7. Step 1b (weather) waits: its place is the user's to set. Order since 2026-11-25 (the user's, after a day flight showed no visible gain from 6a–6c), replacing (4) above; (1)–(3) stand as recorded:
    • (4a) 6d, windows and glass, shopfronts first;
    • (4b) Golden Gai's mass (6e below), the Golden Gai half of 6b folded in;
    • (4c) the ground again (6f), visible at eye height;
    • (4d) the city's edge (6g);
    • (5) and (6) as above. Tone mapping and exposure wait (the user's call).
    • 2026-11-25, later: 6d–6g and (5) landed (TokyoRT #19–#25); 6h (the ordinary street, to a photograph) goes first, ahead of step 2's remaining performance items (deferred far tiles, memory given back, night routes).
    1. Streaming. Tiles resident by distance:
      • geometry, textures and BLASes per tile, in a bounded pool;
      • the far field as proxies (merged, simplified tile meshes; roofs and facades as photo-textured blocks);
      • the TLAS and the light tree updated as tiles come and go, without whole-scene rebuilds (wgpu 30 rebuilds only: measure per-tile BLAS builds and the TLAS rebuild, then choose);
      • uploads spread over frames.
      • Acceptance, on a contiguous region of two areas (~20 km², Shinjuku through Shibuya):
        • resident memory ≤ 1.5 × one area's, whatever is loaded; first frame ≤ 3 s;
        • a drive at 60 km/h through the streets and 100 km/h on the expressway, and a flight at 150 km/h at roof height: frame start p95 ≤ 16.7 ms, p99 ≤ 25 ms, no frame over 50 ms;
        • streaming invisible: 5 poses against everything resident at full detail ΔE ≤ 1.0, SSIM ≥ 0.98 (§ 5 item 5's bar); popping in motion within the bench-ghosting limits.
      • Status, part 1 (2026-11-23 → 24, threert/TokyoRT #1–#10; engine #200, #202, #203, #205, #206): one area (Shinjuku, 3.4 × 2.8 km) streamed by level around a flying camera; none of the acceptance is met yet. Step 6's street level was done ahead of it (generated finishes, street models, trees, curtain-wall towers: TokyoRT #1, #5, #6), and step 1b (weather) skipped, both the user's call.
        • The levels: far (the compiled 256 m tiles, always resident, a quadrant hidden where a nearer level shows it), L1 within 480 m and L0 within 140 m (598 baked 128 m cells: 166 M triangles of their own at L0, 63 M at L1); what repeats is a kit of 8,350 pieces placed as instances (1.7 M copies at L0, 0.45 M at L1; 15 GB of cells where drawing each window out was 23 GB). A cell arrives in place, a frame budget at a time.

        • Engine: the TLAS built from the instances that changed, as slot ranges (vendored wgpu 30, #200, #203: commit 18.9 → 4.9 ms with 470 k instances); the first BLAS build in batches of ≤ 4 M triangles (#202); a scene object 8 script objects, none a cycle, so the script's GC no longer pauses (#205: frames with > 30 ms of script in a tour 3 → 0); an offline render's seek under setup's budget (#206).

        • The tour (tools/tour.ts, 90 s of fast flight, M3 Max, MetalFX's denoiser, after the first 20 s): frame interval p50 / p95 / p99 by day 17.4 / 31.9 / 40.6 ms, by night 17.0 / 47.7 / 60.7 ms. Not the bar (p95 16.7, p99 25, none over 50 ms): the slow frames left are commits and acceleration-structure builds. First frame 10–20 s.

        • Quality (tools/quality.ts, threert-render compare, ΔE76 / p99 / SSIM, day, 1280 × 720; offline renders at 128 spp, deterministic, so their floor is 0):

          pose L0 ↔ L1 at 140 m L1 ↔ far at 480 m as streamed vs 2 × radii live vs offline
          Golden Gai alley 0.00 / 0.0 / 1.000 0.00 / 0.0 / 1.000 0.04 / 0.8 / 1.000 1.47 / 11.5 / 0.935
          street 0.00 / 0.0 / 1.000 0.01 / 0.4 / 1.000 0.04 / 0.7 / 1.000 2.07 / 20.7 / 0.951
          block, 60 m up 0.00 / 0.0 / 1.000 0.11 / 0.8 / 0.996 0.12 / 1.0 / 0.996 1.69 / 15.8 / 0.953
          west avenue 0.00 / 0.0 / 1.000 0.08 / 0.9 / 1.000 0.08 / 0.9 / 0.999 4.94 / 23.7 / 0.860
          towers, 170 m up 0.00 / 0.0 / 1.000 0.43 / 14.8 / 0.971 1.18 / 32.9 / 0.965 3.37 / 21.0 / 0.900
          skyline, 240 m up 0.01 / 0.4 / 1.000 0.85 / 24.2 / 0.965 2.79 / 34.5 / 0.876 2.77 / 18.8 / 0.899
          • The 140 m switch does not show. The 480 m one does: the far level colours buildings from the source app's palette pulled to a cool aerial grey, the dressing in warm, light finishes. That is order item (3)'s first part.
          • "2 × radii" (L0 to 280 m, L1 to 960 m) stands for everything at full detail: L0 to 300 m is past the renderer's 4 GB vertex buffer.
          • Streaming in flight, the live frame held at a tour second against the same pose settled (the live view's own noise beside it): 20 s 0.42 / 0.994 (noise 0.39 / 0.995), 45 s while climbing 0.74 / 0.979 (0.48 / 0.992), 70 s 0.70 / 0.987 (0.63 / 0.989).
          • Live against offline is over the bar at every pose: the live path's own distance (denoiser, the sun's glints in glass), the same kind as step 1's table, not streaming.
    2. The city's lights. Lit windows that switch on and off, signs, LED screens, street lamps and headlights as emitters, 10^5–10^6 across the loaded tiles, in the light tree. Switching an emitter on or off costs no rebuild. If the voxel line's "dynamic emission" contract (§ 6 step 3) lands first, use it rather than duplicate it.
      • Acceptance: Shinjuku at night (Kabukichō, the station, the skyscrapers) live vs our offline render no worse than Bistro night's layer B (ΔE 3.3 / SSIM 0.82); the emitter count stated; step 2's frame budget held.
    3. Traffic, trains and pedestrians. The source's traffic (signals, one-way streets, expressway ramps) and its trains on the real network brought into @threert/gameplay; the walkers of games/bistro-crowd on the sidewalks; simulation and detail by distance. Deterministic (the frame clock), so lockstep runs repeat.
      • Acceptance: City Sample's densities (≈ 1,100 traffic vehicles and 2,200 pedestrians per km²) within the view range, or the largest that holds the budget, stated; frame start p95 ≤ 16.7 ms on step 2's drive; ghosting on moving objects within the bench-ghosting limits.
    4. The whole city. A contiguous stretch of central Tokyo of at least 30 km² (twice City Sample's 15.8 km²), covering the six areas, compiled from PLATEAU's 23-ward data. tools/bench-city.ts: a 5-minute drive and flight across it (frame start p95 / p99, frames over 50 ms, memory, streaming bandwidth, popping), added to the perf suite; a Tokyo pose added to layer B.
      • Acceptance: step 2's numbers across the whole city; memory still bounded.
    5. Street level. Hero detail for what the camera sees closest: storefronts, signage, vending machines, street furniture, vegetation (library or generated assets; Meshy is the natural source), and material upgrades where the generated facades read flat.
      • Acceptance: street-level poses live vs our offline render no worse than step 1; crops beside photos of the same places (qualitative, in the PR); the budget held.
      • Brought forward (the user's review, 2026-11-24, a Golden Gai day shot): what the street level lacks, in order. Each part lands with a before / after pair at the same day poses, frame start p95 and ΔE / SSIM. Repeated parts go into the kit (instances), so detail costs memory once.
        • 6a. Weathering by cause, and the ground. Ageing that follows rain, gravity, sun, structure and use, not a tiled noise: streaks under sills and air conditioners, splash and grime at the wall's foot, the cleaner band under eaves, sun-faded faces. The ground: gutters, manholes, asphalt patches, seams, dust at the kerb, slight unevenness (gratings and manholes are kit pieces already: their density and placement). The stucco's relief is too coarse and strong where the sun rakes it.
        • 6b. Secondary structure on the walls. Pipes, meters, conduits, vents, layered window frames, eaves, door sills and joints: what keeps a building from reading as a box.
        • 6c. Props with a purpose. Props in groups by what happens there: beer crates, bins, the exhaust duct and the mop bucket at a bar's back door; the A-board, planters and umbrella stand at its front.
        • 6d. Windows and glass. Shopfronts first: rooms with depth behind the glass (interior mapping), the street reflected in it, things standing behind it, dirt on it. Upper windows after. Placeholder posters replaced.
      • Acceptance for every look item from 2026-11-25 (the user's): a clear, at-a-glance gain at the Golden Gai pose (tools/quality.ts pose goldengai) as the live view shows it (1280 × 720, its resolution scale, denoised), before / after side by side and beside photographs of the place (references only: no photograph enters the repository or a texture). A gain seen only in an offline zoom does not count. Frame time A/B as before; ΔE / SSIM still reported, no longer the test of a look item. The aim is the street level close to a photograph.
        • 6d as above, first.
        • 6e. Golden Gai's mass. Above the ground floor: stacked signs, outside stairs, balconies, bundled pipes and cables, clutter, so the outline stops reading as a box. Replaces 6b for Golden Gai's small buildings (6b, #15, dressed only the mid-size ones).
        • 6f. The ground, at eye height. Drain covers along the walls, dark patches, water and grime stains, seams, with contrast enough to read from 1.7 m (6a's ground marks did not).
        • 6g. The city's edge. Above ~140 m the land beyond Shinjuku is a flat grey plain and the city stops ~1 km out: carry it on (far city, haze) so the world does not end in view.
        • 6h. The ordinary street, to a photograph (the user's, 2026-11-25, with a photograph of a two-lane residential street in late-afternoon sun; first, ahead of the performance items). Shibuya, once stitched in (#24), read as bare as Shinjuku had. In order of the frame they fill: concrete poles every ~30 m with crossarms, transformers, boxes and lamp arms, a dozen sagging cables between each; road markings to the Japanese standard (edge and stop lines, the green cycle band, the ◇ crossing-ahead mark, arrows) on worn asphalt; mid-rise flats with balconies in depth (glass or frosted panels, outdoor units, tile / concrete / metal panel), shutters, garage doors and lobbies at ground level; kerbless footways behind a white line, street trees, parked cars, vending machines, sign posts. Judged at a new pose street-ref (a comparable street, sun low in the late afternoon: the clock, not the tone mapping) beside the photograph, by eye, as 6d–6g; the Golden Gai pose checked for no regression.
    6. Milestone 2, the open city. Shinjuku and Shibuya at night, and by day:
      • a montage per view: our offline render | ThreeRT live | the source three.js app, each tile with its frame rate and ΔE / SSIM;
      • a side-by-side clip of a fast flight and drive (ThreeRT live | three.js), fps on each tile, posted in the session;
      • then the UE audit with the PLATEAU SDK, with the user present.
  • Not in this phase: the voxel engine (§ 6, its own line). The day / night cycle and the weather are developed in this phase, on Tokyo (steps 1a and 1b, the user's, 2026-11-10): there is no separate scene for them.
  • Brought forward (the user's, 2026-11-10; branch time-of-day, the supervisor's): time of day in the live view, for a clip that flies past Tokyo Tower at 540–760 km/h while the clock runs from 15:30 to 17:45.
    • Before it, every move of the sun rebuilt the scene (the sky is baked per sun direction): on games/sun-sweep (the sun room, its sun swept from 40 deg to −8 deg in 8 s) main read 166 frames in 9 s, 111 rebuilds (≤ 82 ms each), frame interval p50 71 ms; on a Tokyo area a rebuild takes 0.5–0.7 s.
    • Now (SkyAtmosphere({ sun, dynamic: true })): the sun's light is rewritten in place every move (its direction, and its colour through the atmosphere, sky::sun_illuminance), the sky is re-baked at 256 × 128 on a worker thread with three cores (~10–40 ms behind the sun; lockstep waits for it), a manual exposure that changes value is applied in place, and lamps switch through object power (in place already). glow adds the night sky's light pollution above the horizon.
      • games/sun-sweep (node tools/bench-sun.ts): 553 frames in 9 s, no rebuild, frame interval p50 / p95 / p99 16.7 / 17.6 / 18.2 ms, none over 50 ms; GPU p50 / p95 15.3 / 17.6 ms.
      • In place against a fresh load of the same state at 2, 5 and 7.5 s (the lamp switched on at 6.3 s), after the lighting-change transients and a history reset, drawing the same random numbers: ΔE 0.02 / 0.01 / 0.06, the same image. Right after a change the temporal pass's anti-lag reads 1–4 % bright for ~100 frames: the live pipeline's response to lighting changes, as before.
      • Crops along the clip (afternoon, the pass, sunset, dusk, night): docs/img/time-of-day-tokyo-tower.jpg.
      • Tokyo, Shiba within 1.3 km of Tokyo Tower (106 tiles, 17.4 M triangles), the clock 15:30 → 17:45 over 7 s with lamps switching tile by tile around sunset (games/tokyo/tokyo-tod.game.ts, the solar position of 2026-11-09): after the first second (dynamic resolution settling) 61 fps, frame interval p95 / p99 17.7 / 18.6 ms, max 21.4, GPU p50 / p95 15.6 / 16.9 ms at scale 0.62, no rebuild. The fly-past clip in real time: 60.7 fps, interval p95 18.2 ms, GPU p50 14.4 ms.
    • Shiba is compiled (180 tiles, 23 M triangles, Tokyo Tower built member by member); to-glb lights the lattice tower's bulbs and beacons in the "night" node, as street lamps are, and paints its steel (it was metal).
    • Still for the day / night phase: weather, volumetric clouds, the haze over the land beyond the area (a brown band at the horizon today), moonlight, windows that switch on at dusk.
  • Carried over from the dynamic phase (taken up when they block a step, or between steps):
    • live quality in motion: the crowd's ΔE at 10 s is 10.4 against static Bistro's 5.8, and the vans' roofs still sparkle;
    • the perf suite's first-frame recheck (alternate the two builds before reporting a first-frame regression).

History: the dynamic content phase (2026-11-08 → 2026-11-09)

Closed on 2026-11-09 by the user's call (the goal's coverage is enough to move on):

  • the frame budget met: w150-v60 frame start p95 16.67 ms along Bistro's path, with the accepted foliage-shadow bias;
  • live quality in motion short of its acceptance: the crowd's ΔE at 10 s 12.7 → 10.4 over the phase against static Bistro's 5.8; luminance 0.67 → 0.89 of the truth; trails 297 → 82 px (bench-crowd --quality, b20d791 → 20533d3);
  • ghosting within the bench-ghosting limits; the scaling curve recorded.

What is left is carried over in § 0. The phase's plan and results, as they were measured:

  • What is proven and what is not:
    • Proven: static Bistro night (2.8 M triangles, 20 k emitters) at 60 fps along its camera path at the 0.5 floor.
    • Also proven, at small scale: the C slice, with four walkers, one van, rain, an explosion and smoke, at 59–60 fps.
    • Not proven: dynamic content at the scale of the goal, with crowds, traffic and moving lights at once. The history below holds the static phase.
  • Continuing quality targets, static scenes:
    • Live against our offline render: SSIM ~0.81 -> 0.90 (Bistro 3.62 / 0.812, Zero Day 3.47 / 0.805, 64 frames after a reset at the 0.5 floor; layer B).
    • The mid-tones: lit surfaces read 7–13 % darker than the reference (§ 2d, § 0 history's live energy).
  • Steps, one PR per item; the supervisor accepts and merges.
    1. Stress scene first, measured before anything is optimised. Bistro night plus:

      • 100–200 walking skinned characters (Quaternius' mannequin with its existing LOD);
      • 50–100 vehicles driving with their lights on (rigid instances; head and tail lights as moving emitters);
      • some debris and moving props.

      Requirements:

      • Deterministic: driven by the frame clock, so lockstep runs repeat.
      • The camera follows Bistro's FBX path.
      • Measured:
        • frame interval p50 / p95;
        • GPU time split: BLAS rebuild, TLAS, trace, filters;
        • CPU time split: skinning, frame script, uploads;
        • live against our offline render, by segment;
        • ghosting on moving objects.
      • Added to the perf suite.
      • Also measured: the scaling curve, i.e. the cost of each additional walker and each additional vehicle.
      • Done (2026-11-08, branch bistro-crowd): games/bistro-crowd and node tools/bench-crowd.ts [--curve] [--quality].
        • The scene. Walkers on the 240 straight walks and vans on the lanes of games/bistro-crowd/paths.ts (one each way, broken where the street narrows; they hold about 60 vans nose to tail, so the curve's 120 overlap), generated by tools/bistro-crowd-paths.ts from Bistro's walkable ground (renderer/examples/walkable.rs: 1 m cells, clear from 0.15 to 2.2 m above the ground). Bistro's take swings its lanterns; debris is thrown every 8 s. Counts come from the room id (w150-v60 by default).

        • The perf suite gains "bistro crowd w150-v60" drive lines. The frame log gains js, skin, upload, wait and, with THREERT_PROFILE_BLAS=1, blas (the dynamic BLAS / TLAS rebuild timed alone: Metal writes no timestamps between acceleration-structure builds).

        • Measured, w150-v60, along the path's first 50 s at the 0.5 floor:

          • Frame interval p50 / p95 35.9 / 36.5 ms (28 fps). GPU passes p50 / p95 16.2 / 17.9 ms (trace 9.2), plus the dynamic BLAS / TLAS rebuild, 10.1 ms.
          • The frame is CPU-bound: the main thread never waits for the GPU (wait 0).
          • CPU split of the 36 ms (frame log, confirmed by sample):
            • skinning and re-transforming the dynamic triangles (dynamic_tris, tri_attr): 18.1 ms;
            • uploading them (write_buffer, ~100 MB a frame): 8.7 ms;
            • collecting the moved subtrees (World::subtree scans every object for each moved node): ~4.8 ms;
            • the frame script's JavaScript: 4.2 ms.
          • Per-pass profiling (THREERT_PROFILE) slows this scene's frame by ~20 ms (59.8 ms), so the drive runs without it and a separate 10 s run gives the pass split.
        • Scaling curve (the path's first 20 s; frame interval p50):

          walkers / vans 0 / 0 50 / 0 100 / 0 200 / 0 0 / 30 0 / 60 0 / 120
          interval (ms) 16.7 19.2 22.7 36.3 16.9 17.3 23.2
          • A walker costs +0.18 ms of CPU and +0.10 ms of frame interval; its GPU passes stay flat (+0.002 ms).
          • A van costs +0.18 ms of CPU and +0.06 ms of frame interval. Its CPU is mostly the frame script and the change tables, not its triangles.
        • Live against our offline render (lockstep along the path, 2048 spp truths), ΔE / SSIM / luminance. The truths need the offline render to run the frame script at its time (main's 0d01f1c; without it Bistro's take is caught at another moment):

          time w150-v60 static Bistro, same path
          10 s 15.3 / 0.38 / 0.51 8.0 / 0.63 / 0.69
          25 s 8.2 / 0.60 / 0.66 5.6 / 0.75 / 0.77
          40 s 11.4 / 0.49 / 0.57 7.1 / 0.69 / 0.72
          • The van headlights (2500 nits) light the next vans' roofs and the shop fronts far more in the truth than live: moving emitters sit outside the light tree and are proposed by their share of power. Trails behind the vans read 410 px at 10 s.
          • Static Bistro in motion is itself far from its still pose (ΔE 3.4 / luminance 0.92): short histories.
        • Order for step 2, by the measurements:

          1. the CPU per moving object: skinning on the GPU, the moved-subtree scan, uploads;
          2. the 10 ms BLAS rebuild;
          3. moving emitters in light sampling;
          4. quality in motion.
        • Step 2, item 1, the CPU per moving object (2026-11-09, branch crowd-cpu):

          • Moved subtrees through a parent → children index (World::children, subtree_with): O(subtree), where subtree scanned every object for each moved node.

          • Skinning and re-transforming in parallel, one task per object, straight into its own slices of the dynamic tail and of the CPU triangles. Objects whose triangles fall in more than one traversal group (opaque and cutout materials) are done one by one, as before.

          • Measured on main + this item, w150-v60 along the path's first 50 s at the 0.5 floor: frame interval p50 / p95 35.8 / 36.6 → 26.4 / 27.9 ms (38 fps). Skinning 18.3 → 6.0 ms; uploads unchanged (8.1 ms); the JavaScript 4.0 ms.

          • The frame is now GPU-bound: the main thread waits 8.1 ms for it. GPU passes p50 16.0 ms, plus the dynamic BLAS / TLAS rebuild, 10.4 ms.

          • Scaling curve (the path's first 20 s; frame interval p50, ms):

            walkers / vans 0 / 0 50 / 0 100 / 0 200 / 0 0 / 30 0 / 60 0 / 120
            before 16.7 19.2 22.7 36.3 16.9 17.3 23.2
            after 16.7 19.3 22.7 30.7 16.9 17.2 17.8
            • CPU per walker 0.18 → 0.087 ms, per van 0.18 → 0.061 ms.
            • At 50 and 100 walkers the frame was already GPU-bound: the passes plus the BLAS rebuild, which grows by ~0.07 ms a walker (3.5 k triangles). That rebuild is item 2.
        • Step 2, item 2, the BLAS rebuild (2026-11-09, branch crowd-pose): walkers in one pose share one skinned mesh.

          • The game gives each walker one of 8 walk phases, as crowd systems share animation (-p<n> in the room id; p0: every walker its own phase, skinned alone as before).
          • Posed skinned models in the same pose (model, nodes, clip, time) share one model-space mesh (scene::PoseGroup): skinned once per new pose (the groups in parallel) and its BLAS rebuilt, built fast rather than traced fast as the dynamic groups are (8 poses 1.04 → 0.88 ms, the passes unchanged); each model is an instance of it, moved by its transform. Models whose poses part are regrouped by a rebuild. Meshes with glass, emissive or function triangles are not shared.
          • Motion vectors on them: the instance's previous transform applied to the mesh's previous pose. The deforming meshes come first in the instanced pool, so the previous-frame vertices (prev_verts) cover them, as they cover the dynamic triangles. Motion blur now also follows moved instances (it followed re-posed triangles only).
          • Measured on main + items 1-2, w150-v60 along the path's first 50 s at the 0.5 floor: frame interval p50 / p95 26.4 / 27.9 → 17.1 / 18.7 ms (58 fps at p50). The dynamic BLAS / TLAS rebuild 10.4 → 1.8 ms. CPU 18.2 → 8.0 ms: skinning 6.0 → 1.9, uploads 8.1 → 1.5, the JavaScript 4.1. GPU passes p50 / p95 15.8 / 17.4 ms.
          • Scaling curve after (frame interval p50, ms): 16.7 / 16.9 / 16.9 / 17.1 (0 / 50 / 100 / 200 walkers), 17.0 / 17.2 / 17.8 (30 / 60 / 120 vans). A walker now costs +0.002 ms of frame interval and +0.012 ms of CPU; a van +0.009 ms and +0.049 ms.
          • What is left of the rebuild (10 s runs, timed alone): ~0.06 ms a pose mesh plus ~0.4 ms of fixed cost; the vans' dynamic triangles ~1 ms. The vans also add 0.7 ms to the passes (14.6 → 15.3 ms with 60 vans); walkers add nothing there.
          • Tried and dropped: van parts as instances (movable meshes moving a TLAS transform). The rebuild fell only 2.03 → 1.89 ms and the CPU rose 8.0 → 9.1 ms (one instance write per part), the frame interval unchanged.
          • Quality unchanged (measured before the fast build): live against our offline render (lockstep, 2048 spp truths), ΔE at 10 / 25 / 40 s 15.2 / 8.2 / 11.5 (was 15.3 / 8.2 / 11.4), trails 405 / 70 / 131 px (was 411 / 70 / 133); static Bistro 8.0 / 5.6 / 7.1 as before.
        • Step 2, item 3, moving emitters in light sampling (2026-11-09, branch crowd-lights):

          • Moving emitters (dynamic triangles: the vans' lights, the lanterns Bistro's take swings) were outside the light tree, picked anywhere by their share of power. They now have a subtree of their own, the root's right child (the static emitters' subtree, unchanged, its left). After a commit moves them, their subtree is refit around their triangles (LightTree::refit_moving: leaf spheres, then unions up to the root), keeping its topology, so the codes their triangles carry stay (re-skins keep them). Scenes without moving emitters build the same tree as before. Particles still go by their share of power.

          • Measured on main + items 1-3, against our offline render (lockstep, 2048 spp truths), ΔE / luminance:

            time w150-v60 before after static Bistro (its take) before after
            10 s 15.2 / 0.51 15.3 / 0.48 8.0 / 0.69 8.0 / 0.69
            25 s 8.2 / 0.66 7.1 / 0.73 5.6 / 0.77 5.0 / 0.82
            40 s 11.5 / 0.57 9.5 / 0.64 7.1 / 0.72 6.0 / 0.76

            At 10 s the vans queue just in front of the camera: their headlights light the bakery front in the truth, and live it stays dim and blotchy, with sparkles on the van roofs. That is the live filters with many close, bright, moving lights (item 4).

          • Cost: the frame interval unchanged (17.2 / 18.9 ms); the vans' share of the trace 0.83 → 0.15 ms (10 s, 60 vans; 0.47 ms of it was their lights proposed from anywhere); the take's lanterns, sampled through the tree as static Bistro's are, +0.4 ms of GPU on static Bistro with its take; the refit +0.5 ms of CPU.

          • Unbiased check (hardware offline against the software BVH) passes, Zero Day's moving parts now in its tree: mean 1.0006, worst region 1.004.

        • Where step 2 stands after items 1-3 (2026-11-09; first 20 s of the path unless stated, frame interval p50):

          • The crowd costs ~1.1 ms over its static baseline, and that baseline is itself over budget: static Bistro with its take 16.7 / 17.6 ms over 50 s (p50 / p95), w150-v60 17.2 / 18.9. Per 5 s of the path the crowd's GPU passes are 0.5-0.9 ms above static's; the square (15-30 s) is the worst for both (static passes 16.6 ms there).
          • Real costs: 150 walkers in one shared pose +0.32 ms (the TLAS, instance writes), each further pose mesh ~0.06 ms (8 poses +0.73); 60 vans +0.48 (0.25 of it in the passes); motion vectors 0.1. Bistro's take (50 s): static 16.69 / 17.60 → 16.65 / 17.31 ms frozen, the crowd unchanged; its cost is CPU (3.7 ms), hidden behind the GPU.
          • So the budget is the renderer's: the crowd's frame interval p95 ≈ GPU p95 + 1.3 ms, and static Bistro's passes alone reach ~16.8 ms at p95 along the path. p95 ≤ 16.7 needs ~2 ms (12 %) off every frame's GPU.
          • Tried, no gain: one build and one submit for the pose meshes, the dynamic BLASes and the TLAS (A/B within noise); wgpu 30 has no BLAS or TLAS refit (PreferUpdate logs "only rebuild is implemented"). Specular filters off saves 0.55 ms but breaks layer B (Bistro 3.62 / 0.812 → 4.67 / 0.718); caching their taps in a local array doubled their cost (Metal spills it).
          • Quality at the crowd's 10 s pose (vans queued before the camera): the error is the vans' glossy roofs (luminance 0.27 of the truth, which shows a smooth sheen of the string lights; live, sparse sparkles) and the shop front (0.48). Not the sample clamp (raising it changes nothing); 8 / 16 light candidates instead of 4: ΔE 15.3 → 14.5 / 14.0; the reservoir experiment (THREERT_RESTIR=1) is worse (17.5).
          • Held still there (time frozen, 64 frames) the frame recovers half of it: ΔE 15.3 → 12.1, luminance 0.48 → 0.62 (roofs 0.26 → 0.58). Half the loss is motion (specular histories held to 4 frames while the view translates), half survives convergence. The specular filters are not it (off: held 0.62 → 0.64).
          • Item 3 costs this pose a little: held, the pavement under the headlights reads 0.34 of the truth (item 2, moving emitters by their share of power: 0.41; no light tree at all: 0.59). Not the root's split between the two subtrees: a 25 % floor on either side of it changed nothing. Open (item 4); no light tree also means one candidate and no far-node culling, so that comparison is not one change.
        • The GPU time's outliers (2026-11-11, branch crowd-timer): 3–4 % of the crowd's frames read 70–80 ms of GPU while frames came every 16.7 ms.

          • The live view times a frame from its first pass to its post pass's end. A slot of the timer read, in those frames, the post pair of the frame that used the slot next, 4 frames on: the same timestamps, bit for bit.
          • A post pass that begins more than 2 ms after the trace ends (it follows within ~0.2 ms) is now counted by its own length. Every other frame reads as before.
          • w150-v60, 30 s of the path, 3 alternated pairs: frames over 2 × their interval 3.4–4.2 % → 0–0.1 %, GPU max 81–82 → 20.4–20.6 ms, p95 15.3–15.4 → 14.95–15.0 ms. Frame interval p50 / p95 16.65 / 16.9 ms, frame start p95 16.67 ms and scale (the 0.5 floor) unchanged. GPU p50 reads 0.13–0.15 ms higher in every pair (Bistro's perf smoke: +0.14), though the change can only lower a reading; not explained.
    2. Then the costs, in measured order. The method is chosen per measurement. Candidates:

      • GPU (compute) skinning;
      • the dynamic BLAS update strategy:
        • a refit (wgpu 30 has none: a workaround, or through Metal);
        • per-character BLASes against merged ones;
        • an update rate scheduled by distance;
      • character LOD by distance;
      • moving emitters in the light tree;
      • how fast the radiance cache follows moving occluders and lights;
      • motion vectors and the temporal pass for deforming meshes;
      • the frame script's CPU scaling with hundreds of agents;
      • § 1 step 2's rasterized G-buffer for deforming content, only if the measurements show the ray-traced route cannot fit the budget.
      • Item 4, quality in motion, first finding (2026-11-09, branch firefly): the diffuse history's firefly cut (dtemporal) clipped the rare bright samples of small strong lights for good. It is tied to the history's frame count, which is capped (48 frames while the view moves, 24 in scenes with sparks), so it never let them through. Now it acts on young histories only (4-15 frames: after a disocclusion or a lighting change).
        • The reflection resolve's lost share (2026-11-09, branch resolve-share): the trace drops each sample's specular share for the resolve to estimate from the specular-lobe rays around it. A sample that took the diffuse lobe has no such ray; when none of its neighbours had one either (rough surfaces: likely), the resolve returned nothing and the share was lost. It now returns that sample's own share then. Static Bistro's specular 0.84 → 0.89 of our offline render (0.91 with no resolve at all); layer B Bistro 3.55 / 0.810 → 3.50 / 0.811, Zero Day 3.48 → 3.44; bench-crowd ΔE 13.1 / 6.9 / 8.4 → 13.0 / 6.8 / 8.3, static 6.9 / 4.9 / 5.6 → 6.8 / 4.8 / 5.5; ghosting better on every check.
        • Found by splitting live and offline into diffuse / specular / emission and comparing them linearly (render --signals, live .signals snapshots, tools/signals-compare.ts). Bistro crowd at 10 s, time and camera held 256 frames, live diffuse against our offline render: 0.70 → 0.82 overall, the shop front 0.63 → 0.84, the pavement under the vans' headlights 0.49 → 0.70.
        • In motion (bench-crowd --quality, ΔE at 10 / 25 / 40 s): the crowd 15.3 / 7.0 / 9.5 → 13.1 / 6.8 / 8.4, static Bistro with its take 8.0 / 5.0 / 6.0 → 6.9 / 4.9 / 5.5 (luminance at 10 s 0.69 → 0.80). Layer B Bistro 3.62 / 0.812 → 3.56 / 0.813, Zero Day 3.48 → 3.46. Without any cut: about the same (crowd 12.9 / 6.8 / 8.1); the young-history cut keeps restarts from sparkling.
        • The radiance cache's training clamp (2026-11-09, branch train-clamp): training samples were clamped at the indirect clamp, so the voxels near bright small lights stored their light clamped and every pixel reading them inherited the loss. Now at 4 x (CACHE_TRAIN_CLAMP, the headroom the fixed-point sums already have). The Bistro crowd's held frame: diffuse 0.81 → 0.86 of our offline render (the shop front 0.83 → 0.91), specular 0.74 → 0.78. bench-crowd ΔE 13.0 / 6.8 / 8.3 → 12.7 / 6.8 / 8.2, static 6.8 / 4.8 / 5.5 → 6.6 / 4.8 / 5.4 (luminance at 10 s 0.81 → 0.85); layer B Bistro 3.50 → 3.47, Zero Day 3.44 → 3.42; ghosting unchanged.
        • Light sampling at camera hits picks by the BSDF (2026-11-09, branch bsdf-target). The camera hits' light-tree candidates were resampled by emitted luminance × geometry, with a plain cosine on the receiving side. A glossy surface's highlight from one of many small lights (the string lights on the crowd's moving van roofs) was found only when that light happened to be drawn: sparse sparkles, which the denoisers spread thin or kept out. The receiving side is now the surface's BSDF × cosine toward the candidate (eval_bsdf), so the lights in the specular lobe win. Any target keeps RIS unbiased: tools/unbiased-check.ts passes, means within 0.1 %, regions within 0.4 %.
          • Measured on main + mirror-history, sample-ceiling, frame-start. The Bistro crowd in motion (lockstep at 10 s, live / our offline render): specular 0.88 → 0.91, the vans' roofs 0.90 → 0.94, the facades 0.95 → 0.96. bench-crowd ΔE at 10 s 10.95 → 10.61, static 5.94 → 5.82 (25 / 40 s unchanged). Layer B Bistro 3.47 / 0.812 → 3.34 / 0.819, Zero Day unchanged (3.42 / 0.806). bench-ghosting better on every check: turn-mid 0.75 → 0.66, strafe-mid 2.10 → 1.74, turn-return 1.01 → 0.88, strafe-return 1.29 → 1.11, stop + 0.1 s 1.82 → 1.54.
          • Cost: perf smoke drive GPU p50 / p95 +0.04 / +0.07 ms, the still and moving poses −0.01 / +0.05.
          • 8 candidates instead of 4 (branch ris8, RIS_LIVE): with the BSDF in the target, a glossy surface chooses among more of the small lights in its lobe. bench-crowd ΔE at 10 / 25 / 40 s 10.61 / 6.09 / 7.12 → 10.31 / 6.00 / 7.02, static 5.82 / 4.23 / 4.81 → 5.71 / 4.13 / 4.73; layer B Bistro 3.34 / 0.819 → 3.23 / 0.825, Zero Day 3.42 → 3.43; bench-ghosting better on every check (turn-mid 0.66 → 0.56, strafe-mid 1.74 → 1.53, stop + 0.1 s 1.54 → 1.35). No measurable cost: perf smoke drive GPU p50 / p95 −0.02 / −0.28 ms (noise), the crowd's trace 8.59 → 8.53 ms.
        • The other two cuts cost more and stay: without the indirect clamp (clampIndirect, depth > 0) and the per-sample ceiling, the held crowd frame reads diffuse 0.92 / specular 0.75 of the truth (0.82 / 0.67 with them), but in motion the crowd's ΔE rises 13.1 → 15.5 and layer B (64 frames) goes Bistro 3.56 → 4.5, Zero Day 3.46 → 12.2. What is left of the bias is sampling variance under many small strong lights: next, light sampling that finds them more often, not cutting less.
        • The mirror-image specular history, not on moving objects (2026-11-09, branch mirror-history): the temporal pass also reprojects every reflection through its mirror image and keeps whichever history is closer to the 1-spp neighbourhood mean. The camera-only reprojection ignores a moving reflector's motion: on the crowd's vans it landed on other surfaces (a level street passes the normal test) and, picked against a mostly dark mean, replaced the roofs' reflections with darker ones. Moving objects no longer take it.
          • Measured on main (spec-clamp, frame-start). The Bistro crowd in motion (lockstep at 10 s, live / our offline render): specular 0.55 → 0.83, the vans' roofs 0.46 → 0.85 (their total 0.54 → 0.82).
          • bench-crowd at 10 / 25 / 40 s: the crowd's ΔE 11.23 / 6.01 / 7.16 → 10.86 / 6.04 / 7.19, luminance 0.77 / 0.92 / 0.81 → 0.86 / 0.94 / 0.83, trails at 10 s 125 → 77 px; static unchanged (5.96 / 4.24 / 4.86). Layer B unchanged (3.47 / 0.812, 3.42 / 0.806); bench-ghosting unchanged on Bistro (strafe-mid 2.19, stop
            • 0.1 s 1.86) and on Kabukichō (strafe-mid 3.30, 62 px; stop + 0.1 s 2.59).
          • Restricted to near mirrors as well (roughness < 0.2, the first version of this branch), Bistro's glossy surfaces read a little brighter (static luminance at 25 s +1 %), but Kabukichō's wet street lost the history that carries it through strafes: strafe-mid 3.3 → 4.3, trail 62 → 94 px, failing the check. Every static surface keeps it.
      • The frame budget, first finding (2026-11-09, branch cold-fallback): the radiance cache's cold fallback. Pixels whose voxel was cold traced a fresh estimate each frame and inserted the voxel. In steady motion the cold voxels left are mostly where bounce rays land off screen: scattered, sparsely trained. Their traces cost each SIMD group nearly a whole extra trace, and the low-sample entries they inserted kept later frames slower until evicted. Now cold pixels trace only for 30 frames after a reset or a camera cut (COLD_FALLBACK_FRAMES), and without inserting; later they read the voxel as it is.
        • Found after a camera cut (the supervisor's clip: ~30 frames at ~35 ms after a jump): the cost decayed only as fast as the cache evicted, and stayed ~2 ms in the square.
        • Bistro crowd w150-v60 along the path's first 50 s at the 0.5 floor: frame interval p50 / p95 17.16 / 18.91 → 16.69 / 17.25 ms, GPU 15.85 / 17.65 → 15.09 / 15.97 ms; every room of the scaling curve at the 60 fps cap. Static Bistro's drive (perf smoke) GPU p50 / p95 15.33 / 16.04 → 14.42 / 14.92 ms.
        • Quality: bench-crowd ΔE at 10 / 25 / 40 s 13.1 / 6.8 / 8.4 → 13.3 / 6.9 / 8.5 (static 6.9 / 4.9 / 5.5 → 6.9 / 5.0 / 5.6); layer B unchanged (3.57 / 0.813, 3.46 / 0.805); ghosting unchanged. Right after a cut (frames 10 / 30 / 60) the same ΔE as before (9.1 / 7.2 / 6.3).
        • The pacer floors the frame interval's p95: static Bistro reads 16.91 ms with its GPU p95 at 14.9 (wall-clock jitter around 16.67). The crowd now meets the budget on the GPU (p95 15.97 ms); its interval p95 is ~0.35 ms above static's floor.
      • The frame budget read on frame starts (2026-11-09, branch frame-start). The frame log's interval runs from the end of one frame's work to the next's, so it carries the variation of the work itself: static Bistro's drive read p95 16.9 ms with its GPU p95 at 14.9 and every frame starting on its slot. The log now also has start (frame start to frame start: what the pacer sets, the frame rate a player sees); perf smoke reads the budget on it and bench-crowd prints it.
        • Static Bistro's drive (perf smoke): frame start p95 16.67 ms, within the budget (interval p95 16.92).
        • The crowd w150-v60 along the path's first 50 s: frame start p95 17.44 ms (interval 17.46), GPU-bound. The timed passes read GPU p50 / p95 15.09 / 16.27 ms; the dynamic BLAS / TLAS rebuild adds ~2.0 ms outside them, and the CPU waits ~8 ms a frame for the frame in flight. About 0.8 ms of GPU at p95 is missing.
        • Plan, in order:
          1. The trace pass: 8.5 of the crowd's 15 ms. Foliage traversal in the square (static Bistro's trace 8.7 → 10.4 ms there).
          2. The specular filters: 1.3 ms at output resolution, three passes that mostly copy. Not by moving them to the traced grid: the spec-internal prototype (−0.62 ms) lost the sharp reflections and the wet street's ripples for structural reasons (the traced grid's history averages each jittered sample over its 2 × 2 output footprint, and two stacked histories add their lag), not only through the clamp spec-clamp removed. Cheaper passes at output resolution instead.
          3. Pose groups re-skinned at half rate, alternating (animation LOD): measured, small. The crowd's 20 s drive frame start p95 17.75 → 17.60 ms, frames over 17.2 ms 232 → 185 of 1140. Kept as a fallback.
      • The crowd within its budget (2026-11-09, branch emitter-shadow-cutouts), by a bias the user accepted: live emitter shadow rays at camera hits take alpha-cutout triangles as opaque (occluded_emitter, TRACE_ANY_OPAQUE), as deeper vertices already did. The leaves of a tree block them as whole cards.
        • Found by attribution along static Bistro's path:
          • every live cutout opaque: trace −2.1 to −2.5 ms;
          • only camera-hit shadow rays: −1.5 to −2.1;
          • only the emitter ones: ~−0.6 (on the crowd −1.2 ms of GPU p50).
        • What these rays skip is mostly the first hit's alpha test on a leaf; the candidate loop past it is ~0.3 ms.
        • Unbiased tries that did not pay:
          • a roulette past cutouts, per pixel (q = 0.5) or per SIMD group (subgroupBroadcastFirst): no saving;
          • ordered opaque steps instead of the candidate loop: +1.5 ms at the worst stretch;
          • the alpha test without material functions: no change;
          • skipping the first hit's separate alpha test: −0.15 ms.
        • Measured on main + mirror-history, sample-ceiling, bsdf-target, ris8:
          • The crowd w150-v60 along the path's first 50 s: frame start p95 17.39 / 17.19 → 16.67 / 16.67 ms (two alternated runs each), GPU p50 15.1 → 13.9 ms.
          • Static Bistro's drive (perf smoke): GPU p50 14.34 → 13.51 ms.
        • Cost: the live image under foliage loses the light through the leaves' gaps.
          • Static Bistro at 25 s: luminance 0.993 → 0.976 of our offline render.
          • bench-crowd ΔE at 10 / 25 / 40 s: 10.31 / 6.00 / 7.02 → 10.39 / 6.10 / 7.23; static 5.71 / 4.13 / 4.73 → 5.81 / 4.22 / 4.92.
          • Layer B: Bistro 3.23 / 0.825 → 3.30 / 0.823, Zero Day 3.43 → 3.44.
          • Ghosting unchanged. Offline rendering always tests.
        • Follow-up: remove the bias without the cost. Either:
          • an opacity micromap: per masked triangle, cells known opaque or transparent skip the texture and mixed ones test it;
          • or the cutout continuation rays compacted into a pass of their own.
          • (Done 2026-12-02 by the first, in one query: "A cutout's map answers an emitter's shadow ray", below.)
        • The specular filters' luminance edge stop, widened (2026-11-09, branch spec-edge): it weighed each tap by its distance from the local mean at 2 x strength, so a sparse bright reflection was kept out of its neighbours' means and, as a centre far from its own mean, out of its own: its energy was lost, not spread. At 8 x: static Bistro's specular 0.80 → 0.84 of our offline render (layer B pose, 64 frames; 0.85 with no luminance stop at all, which blurred Zero Day's sharp reflections: layer B 3.46 → 3.53). bench-crowd ΔE 13.3 / 6.9 / 8.5 → 13.1 / 6.9 / 8.4; layer B Bistro 3.57 / 0.813 → 3.55 / 0.810, Zero Day 3.46 → 3.48; ghosting a little better on every check (strafe 5.27 → 5.17, stop 4.59 → 4.47).
        • The specular history's neighbourhood clamp, removed (2026-11-09, branch spec-clamp): while the view moved, the temporal pass clamped specular history to 4-8 σ of the nine 1-spp samples around the pixel. Around sparse bright reflections and highlights (string lights on glossy roofs, headlights on wet stone) those nine are mostly all dark, so the box collapsed and clipped converged history every frame: the light was lost, not delayed. The history cap stays (12 frames while the view moves, 4 for 8 frames after it translates), and so does the choice between the surface and the reflection-hit history.
          • The Bistro crowd in motion (lockstep snapshot at 10 s, live / our offline render, linear): specular 0.26 → 0.55; the facades 0.35 → 0.92, the pavement 0.34 → 0.75, the vans' roofs 0.24 → 0.46 (the rest of the remaining loss is on the moving vans).
          • bench-crowd ΔE at 10 / 25 / 40 s: the crowd 12.7 / 6.8 / 8.2 → 11.2 / 6.0 / 7.2 (luminance at 10 s 0.68 → 0.77, trails 298 → 129 px), static Bistro 6.6 / 4.8 / 5.4 → 6.0 / 4.2 / 4.9 (0.85 → 0.91). Layer B unchanged (the view holds still, where the clamp was already off).
          • The clamp was the ghosting guard, yet bench-ghosting is better on every check: each shot is compared with its converged frame, and the clipped (darkened) reflections were most of the error. Excess turn-mid 3.43 → 0.76 (trail 22 → 4 px), strafe-mid 5.14 → 2.19, turn-return 1.40 → 1.01, strafe-return 1.51 → 1.30, stop + 0.1 s 4.41 → 1.86.
        • The per-sample ceiling, 64 → 256 display units (2026-11-09, branch sample-ceiling, SAMPLE_CEILING): with the specular history no longer clipped (spec-clamp, mirror-history), the ceiling was what still cut the light of small strong lights in motion. Measured on main + both: the Bistro crowd at 10 s (lockstep, live / our offline render, linear) diffuse 0.87 → 0.90, specular 0.83 → 0.89, total 0.93 → 0.95; the pavement under the headlights 0.71 → 0.77, the vans' roofs' specular 0.85 → 0.91. 1024: the same within 0.01.
          • bench-crowd luminance at 10 / 25 / 40 s 0.87 / 0.96 / 0.84 → 0.89 / 0.97 / 0.85 (static 0.91 / 0.99 / 0.94 → 0.92 / 0.99 / 0.95); ΔE 10.9 / 6.0 / 7.1 → 11.0 / 6.1 / 7.1 (a little more noise from the brighter samples), static unchanged; layer B and bench-ghosting unchanged.
          • Live snapshots held still (time frozen, N frames) do not repeat run to run: the same binary gave diffuse / specular 0.86 / 0.78 and 0.90 / 0.69 an hour apart. Judge such changes on the lockstep moving phase, which repeats to three digits.
    3. Acceptance:

      • The stress scene, with its walker and vehicle counts stated, along Bistro's path at the 0.5 floor: frame interval p95 ≤ 16.7 ms.
        • Met 2026-11-09 on frame starts (start, what the pacer sets): w150-v60, frame start p95 16.67 ms along the path's first 50 s, with live emitter shadows taking cutouts as opaque (item 2's frame budget notes).
      • Live against our offline render: no notable regression from static Bistro. The number is set once measured.
      • Ghosting on moving objects within the bench-ghosting limits.
      • The scaling curve recorded here.

History: the Bistro night and Zero Day phase (2026-11-08)

The static phase's plan and results, kept as they were measured.

  • The scenes, both from NVIDIA ORCA, CC-BY 4.0, FBX + DDS:
    • Amazon Lumberyard Bistro, exterior: 2.83 M triangles. Night only: gates, metrics, UE references, comparisons and reports use the night version. The small scenes cover daylight.
    • Beeple Zero Day, Measure One: 1.37 M triangles by ORCA's README; the FBX holds 5.87 M (the room 3.14 M, the two instrument groups 1.34 M + 1.32 M). 10,103 emissive triangles; 551 objects move (13.7 s of node animation).
  • Decisions (the user's):
    • Scenes are written in @threert/scene, the three.js-like scene code. The same code runs on both engines: real three.js in a browser through tools/three/engine.ts (degraded), the full effect in ThreeRT.
    • three.js lacks the light that emissive surfaces give in ThreeRT. The adapter adds it by itself: a few point lights from the brightest emissive clusters, capped in number, listed in the adapter's dropped / notes. Scene code states physical intent only and adds no lights for three.js.
    • Kabukichō's roles in gates, metrics and reports pass to Bistro. Its code stays.
    • Tests and reference images use the manual exposure written in the scene. Night auto exposure reads ~4 stops bright; whether that becomes an item is decided after milestone 1.
  • Order: one line of work, serial (one GPU, the same files).
    1. This roadmap rewrite.
    2. The asset pipeline, both scenes at once: FBX + DDS converted offline to GLB.
      • Why GLB: ThreeRT, three.js and UE (Interchange imports glTF) read the same data, and the materials become one PBR model.
      • Textures to PNG / JPEG, resolution capped (e.g. 2K, by GPU memory).
      • Falcor's material texture conventions mapped once, in the conversion script, to metallic-roughness. Emission kept; Zero Day keeps its node animation.
      • Tools: Blender headless + Python, wrapped in a Bun Shell script (brew install --cask blender).
      • Output in agent3d-assets, fetched by scripts/setup.ts; the CC-BY attribution in the docs.
      • If ORCA's download needs a login, the user downloads it; other work goes on meanwhile.
      • Done (2026-11-08, branch orca-assets): bun scripts/orca.ts, run by scripts/setup.ts. No login needed (developer.nvidia.com/bistro and /beeple redirect to the archives). Two minutes on the M5 for both scenes.
        • Output: assets/orca/bistro/BistroExterior.gltf (2.83 M triangles, 1296 meshes, 132 materials, 405 textures, 438 MB) and assets/orca/zeroday/MEASURE_ONE.gltf (5.87 M triangles, 7293 meshes, 166 materials, 352 textures, 434 MB), each with a report of what was converted.
        • glTF with separate .bin and texture files, not GLB: the exporter keeps the converted PNG / JPEG files as they are (no second encoding, no packing pass), and ThreeRT, three.js and UE's Interchange read .gltf as they read GLB.
        • Falcor's conventions as Falcor renders them: the Specular map's G / B are roughness / metalness, which is glTF's metallicRoughnessTexture as is (its R, occlusion, is 0 in every map of both scenes: unused); DirectX normals flipped to OpenGL, BC5's z rebuilt; BaseColor alpha is alpha-tested (MASK, 0.5) where any texel is below 250, else opaque, so Bistro's window glass stays opaque as in Falcor; double-sided only for *.DoubleSided materials; emission = the Emissive texture x 1 (Falcor's factor), the scene scales it to nits (GLTFModel power); the FBX sun is dropped (night = emitters only); meshes without UVs get a zero UV set (Falcor samples (0, 0)).
        • Animation: each FBX take is one glTF clip named after the file, over the whole take (Bistro: the camera path and 15 swinging lanterns / string lights, 154 s; Zero Day 13.7 s).
        • Checked: both render in ThreeRT offline from their FBX cameras (Bistro at power 1000, EV100 2: lamps, string lights, signs light the street; 64 spp in 10 s). Bistro's offline run peaks at 21.8 GB of memory (the 405 textures at <= 2K as RGBA8 pages): a texture budget may be needed in step 3. Dark speckles on Bistro's shaded walls at 64 spp, to look at in step 3.
    3. Bistro night: scenes/bistro.ts, the adapter's automatic lights, a three.js page that opens in an ordinary browser.
      • Done (2026-11-08, branch bistro-scene):
        • scenes/bistro.ts: the converted exterior, emitters x 1000 (street lamp globes 420 nits, ~370 lm each), an urban night sky glow (0.02 nits), the FBX camera's first pose, manual EV100 2, 1280 × 720.
        • ThreeRT: offline 256 spp in 20 s; live at the 0.5 floor 14.75 ms GPU (trace 9.1, temporal 2.0), first frame 5.2 s. Within the 16.7 ms budget before any Bistro work.
        • three.js adapter: automatic point lights (COMPARE.md, rules). By raw power the 16 lights went to the bright square down the street and the near street stayed black; ranked by power / distance² from the camera they light what the view shows (27 % of the emitted power, 4 of them shadowed). WebGL baseline 16.6 ms GPU, 8,792 draws (cube shadows are half of it).
        • node tools/three/open.ts scenes/bistro.ts: the scene in three.js in an ordinary browser (the measured baseline's mapping and post, orbit controls, an overlay with fps, GPU time, lights, dropped, notes).
        • The dark speckles on Bistro's shop-window panes (offline, hardware and software traversal alike; three.js clean) are ours, and not geometry: without the denoiser the 256 spp image is full of bright fireflies there (glossy panes reflecting thousands of small emitters, found by BSDF rays), and the à-trous denoiser leaves dark holes around them. Zero Day's glossy machine tops do the same. Not the normal maps, the glass layers or the alpha masks (each removed in turn). The cure is light sampling for many small emitters (step 8's question).
    4. Bistro's UE reference: the same GLB imported into UE 5.8, the Path Tracer as truth, Lumen as the real-time comparison. Small runs, step by step (UE's volume renders once hung the GPU).
      • Revised (2026-11-08, "How we are judged"): this becomes the milestone audit, UE Path Tracer vs our offline render of Bistro night and Zero Day, with the user present. No Lumen. Branch bistro-ue is prepared, not run.
    5. Milestone 1: ThreeRT live vs three.js (strongest / tuned) vs our offline render, Bistro night and Zero Day (below), shown to the user. It does not wait for UE.
      • Done (2026-11-08, branch judge-offline, node tools/milestone1.ts; sections in docs/COMPARE.md, montages docs/images/milestone1-{bistro,zero-day}.jpg). ΔE / SSIM against our unbiased offline render, frame cost at the still pose and along the first 6 s of the scene's FBX camera move:

        ThreeRT live three.js strongest (WebGPU) three.js tuned (WebGL) reference's own noise
        Bistro night (ref 4096 spp) ΔE 3.8 · SSIM 0.812 · 16.5 ms at 0.57; move p50 16.4 ms (60 fps) ΔE 10.1 · 0.663 · 35.0 ms (29 fps) ΔE 12.1 · 0.613 · 15.9 ms; move 18.3 ms (55 fps) 1024 spp: ΔE 1.8
        Zero Day (ref 16384 spp) ΔE 3.6 · SSIM 0.802 · 16.1 ms at 0.57; move p50 15.7 ms (60 fps) ΔE 14.4 · 0.440 · 180 ms (6 fps) ΔE 16.2 · 0.319 · 79.7 ms (13 fps) 4096 spp: ΔE 2.1

        (Refreshed 2026-11-08 at local-main f2815a1, after item 3 part 2; the first run, before it, read Bistro ΔE 4.0 / SSIM 0.795 at scale 0.5 and 54 fps along the move. The dynamic resolution now settles at 0.57 on both scenes.)

        • ThreeRT live is 2.5–4.5× closer to the reference than either three.js configuration on both scenes. Where it is farthest: Bistro's square (ΔE 7.6; the string lights) and Zero Day's floor (4.9; glossy reflections of small emitters). Its image is 10–12 % darker than the reference (luminance 0.88 / 0.90): the live clamps.
        • Bistro along its camera path was below 60 fps in the first run (GPU 16 → 22 ms as the view opened towards the square; the supervisor's 8 s capture: frame interval p50 18.9 / p95 23.1 ms). The gates measured only the first pose. Item 3 part 2 (below) brought the path to 60 fps.
      • Our side measured (2026-11-08, node tools/compare/strongest.ts --scenes bistro, M5, 1280 × 720). ΔE / SSIM here are against our offline render at 2048 spp in its default configuration (clamped, denoised), not yet the unbiased reference milestone 1 uses:

        renderer GPU ms / frame ΔE SSIM luminance vs reference
        ThreeRT live, 60 fps pacing (dynamic scale 0.52) 15.47 5.76 0.795 0.68
        ThreeRT live, full resolution 39.07 5.11 0.835 0.71
        three.js strongest (WebGPU + SSGI + SSR + TRAA), sky 35.76 10.06 0.676 1.05
        three.js tuned (WebGL, 16 automatic lights), sky 16.27 12.06 0.616 0.81
        ThreeRT offline 256 spp 20 s 1.54 0.959 0.95
      • Found: ThreeRT live is ~30 % darker than offline at Bistro night. Most of it in the square down the street: the 60 m emitter cull dropped its string lights from light sampling (§ 5 item 5, "the view cone"). Fixed on branch view-cull: live raw radiance 0.75 → 0.85 of offline (square 0.40 → 0.70) for +0.5 ms; the table above is from before the fix.

      • UE Lumen and the UE Path Tracer wait for UE runs (branch bistro-ue, prepared, not run while the user is away).

    6. Zero Day, static: its UE reference and the same comparison.
      • Our side done (2026-11-08, branch zero-day-static): scenes/zero-day.ts (Measure One, emitters x 1000, no sky, the FBX camera's first pose; EV100 3: its median radiance is twice Bistro's, 0.24 vs 0.12 nits). Blender, ThreeRT and three.js frame it the same (checked against a Blender render of the converted glTF). node tools/compare/strongest.ts --scenes zero-day, interim ΔE against our offline at 2048 spp:

        renderer GPU ms / frame ΔE SSIM luminance vs reference
        ThreeRT live, 60 fps pacing (dynamic scale 0.6) 15.65 3.13 0.859 0.97
        ThreeRT live, full resolution 35.16 2.80 0.872 0.96
        three.js strongest (WebGPU + SSGI + SSR + TRAA), sky 185.18 13.99 0.463 1.30
        three.js tuned (WebGL, 16 automatic lights), sky 81.26 15.44 0.351 0.95
        ThreeRT offline 256 spp 16 s 2.61 0.910 0.87

        three.js draws 7,293 meshes, and the 4 shadowed automatic point lights render them 6 times each: 37,515 draws a frame. The UE side waits for UE runs, as Bistro's.

    7. The gates move to Bistro:
      • perf smoke and perf suite, baselines measured again (the rain / sparks / smoke combinations on Bistro too);
      • bench-ghosting's camera moves and their UE MRQ references;
      • rain against UE; layer B. The scene names in WORKFLOW and here change with them. Then Kabukichō leaves the gates and reports.
      • Perf gates moved (2026-11-08, branch gates-bistro): tools/perf-smoke.ts measures Bistro night (still at its camera, then 2.5 m down the street with 12° of yaw; --scene kabukicho keeps the old gate); tools/perf-suite.ts measures Bistro dry and in the rain, rain + sparks and rain + smoke on Bistro (tools/perf/bistro-*.ts), and the district drive until Bistro tiled replaces it. Baselines at local-main eb7ee8b (GPU ms at the 0.5 floor, still / moving): Bistro 15.10 / 14.78, rain 16.94 / 16.57, rain + sparks 17.40 / 16.95, rain + smoke 17.20 / 16.86; district p50 / p95 16.78 / 17.31. Bistro in the rain is over the 16.7 ms line (rain costs 1.8 ms).
      • Waiting for UE: bench-ghosting's moves on Bistro and their MRQ references, rain against UE, layer B with Bistro and Zero Day (their UE Path Tracer images).
      • bench-ghosting on Bistro (2026-11-08, branch ghosting-bistro; it compares moving frames with the same build's converged ones, so UE only adds the optional --ue comparison). node tools/bench-ghosting.ts --scene bistro is the default; --scene kabukicho keeps view v1 and its limits.
        • Bistro's moves are smaller (its street is narrow): a 20° turn, a 2.5 m strafe to the left, the same 4 m dolly. Regions: ground (the street), shop (the shop and its lamp), facades (the lamp-lit left facade).
        • --quick limits from three runs of main 87b7ef7, which repeated to 0.01 dE and 1 px. At the 0.5 floor: turn-mid ground 3.95 dE / 29 px, strafe-mid ground 5.70 / 46 px, stop+0.1s ground 5.11 / 31 px, returns 1.6 dE.
        • Sensitivity: with the reflection resolve off, Bistro's check fails on the turn's trail (38 px against 34), Kabukichō's on three shots (wet signs). The R2 gate runs both (WORKFLOW).
    8. Zero Day animated: static and moving parts apart, only what moves in the dynamic BLASes. Measure first, then decide whether light sampling needs another method.
      • Done (2026-11-08, branch zero-day-animated): games/zero-day/zero-day.game.ts plays the take (13.7 s, looped).
        • Measured first: the posed model re-skinned whole each frame (5.87 M triangles on the CPU, all of them in the dynamic BLAS) ran at ~540 ms a frame (CPU 310 ms in the commit, GPU 44.5 ms).
        • Posed rigid models (no skins) are now split by node at build (scene::RigidModel): the nodes the clip leaves alone are static triangles (3.46 M); each moving mesh node is an instance of its own mesh in node space (3,991 instances, 2.40 M triangles, BLASes built once; mirrored nodes keep their winding front-facing); their emissive / glass / function triangles stay flattened and dynamic (9,359, re-transformed in place, the only dynamic BLAS). A new pose samples the clip (0.3 ms for 8,641 nodes), re-places the instances (one buffer write per model) and rebuilds the TLAS.
        • Zero Day animated at the 0.5 floor: frame interval 16.68 ms (p95 17.25), GPU 12.5 ms, commit 2.0 ms; the moving light columns light the room through emitter sampling as before.
        • Light sampling stays as it is for now: the moving emitters are ~10 k triangles and sampled like the static ones. Many small emitters still make fireflies in glossy reflections (step 3's speckles), so a light tree or grid remains the candidate, measured on both scenes when it is taken up.
        • Instances that stop moving catch their previous-frame rows up once per commit now (two updaters in one commit, movable models and rigid models, would otherwise reset each other's).
    9. The C slice (§ 3) on Bistro.
      • Part 1 done (2026-11-08, branch bistro-slice): games/bistro-slice/bistro-slice.game.ts, one 60 s shot from Bistro's camera: four walking mannequins, three potted plants in the wind, Bistro's own lanterns and string lights swinging (its FBX take on the frame clock, through step 8's rigid-node path: 13 moving nodes as instances, 18,400 bulb triangles re-transformed), rain from 15 s, an explosion (fireball, sparks, debris) at 40 s and its smoke after. Frames at 5 / 20 / 41 / 46 s: agent3d-scratch-backup-20261107/pin/bistro-slice-4.jpg.
      • Cost at the 0.5 floor (live, 66 s): GPU 18.4 ms before the rain, 19.5 ms in the rain, with the explosion and the smoke; frame interval 23.1–24.7 ms (the per-frame BLAS / TLAS rebuilds of the walkers and the swinging bulbs are outside the GPU profile). Over the 16.7 ms budget, as the Kabukichō slice was: part 2 takes it down and adds the UE side (waits for UE runs).
      • A van (2026-11-08, branch slice-car; § 3 C lists a car): a plain delivery van (body, cabin, wheels, head and tail lights at 2,500 / 300 nits) drives down the street toward the camera and past it from 25.5 to 34 s, on a lane 1.5 m right of the axis, passing the crossing pedestrian when that one is on the far side. A movable group, as Kabukichō's taxi: moved every frame, no rebuild; its lights are moving emitters. Live at the 0.5 floor the 25–35 s stretch reads frame interval p50 16.91 ms (16.85 without it); the shot 16.80 / 17.28 ms p50 / p95.
    10. The 3 × 3 district (§ 5 item 5) becomes Bistro tiled.
    • Done (2026-11-08, branch bistro-district): games/bistro-district/bistro-district.game.ts, nine copies of the exterior on a 180 × 190 m pitch (25.3 M instanced triangles: one mesh per node shared by the copies; 185,742 emitter triangles, flattened per copy). Driven along Bistro's own FBX camera path through the middle copy (tools/lib/gltf-camera.ts; the first 50 s, ~2 m/s): node tools/bench-district.ts (--scene kabukicho keeps the old district and its straight drive; both drives are tools/lib/live.ts Drives). The perf suite's district lines are now Bistro's ("bistro district ...").
    • At the 0.5 floor: GPU p50 17.7, p95 24.2 ms, frame p99 25.1 ms, no frame over 50 ms, first frame 5.0 s, 11.3 GB footprint (the offline render peaks at 21.8 GB, the same as one copy). One copy alone on the same path: 17.5 / 24.1 ms: the other eight cost 0.2 ms (instancing, the emitter cull). The p95 is Bistro's own: 5–20 s into the path the view faces the square and its string lights (24 ms), the many-small-emitters cost seen in steps 3 and 8 (and the old Kabukichō district reads 16.8 / 17.3 ms on the same build).
  • While the UE runs wait (the supervisor's list of 2026-11-08, in order): 1. light sampling for many small emitters;
    1. the denoiser's dark holes around fireflies; 3. Bistro night's budgets back under 16.7 ms; 4. milestone 1's output as one command.
    2. Light tree — done (2026-11-08, branch light-tree; renderer/src/ltree.rs).
      • What it fixes: emitters were drawn from one power CDF over the whole scene (20,638 triangles in Bistro). The lamp beside a shop window or the string lights over the square had a tiny share of the samples, so their light in glossy reflections came from rare BSDF hits: fireflies, which the clamp cuts (live too dark) and the à-trous denoiser turns into dark holes (step 3's speckles).

      • How: a binary tree over the static emitter triangles (single-emitter leaves, median splits; a node = one vec4: half-float sphere, power, child word). A shading point descends it by importance: power x the best cosine of the node's sphere over its hemisphere / max(distance², radius²). The selection probability of an emitter is the product of the choices down its path (a 26-bit code in its triangle's attrs x.w), and MIS against BSDF rays uses that pmf (emit_mis at the vertex that sampled, kept in mis_x / mis_n). Moving emitters (dynamic triangles, particles) stay in the CDF, after the tree's entries, chosen with their share of power. Scenes with fewer than 256 static emitters keep the CDF alone (byte-identical). Camera hits resample 6 tree candidates offline, 2 live (4 since 2026-11-08, below). Live, the light LOD and the emitter cull are off with the tree (it weighs distance itself); instead nodes wholly beyond 120 m from the shading point are not proposed (never within one Bistro; the district's far copies).

      • Judged against our own unbiased offline reference (raw HDR, clamps and denoiser off, 320 × 180; references at 16 k spp from both estimators agree within ±0.2 % (Bistro) / ±0.6 % (Zero Day) in every region):

        256 spp, 320 × 180 relMSE fireflies dark spots after the denoiser path tracing time
        Bistro, CDF 0.0959 14 555 1.48 s
        Bistro, light tree 0.0406 7 65 1.61 s
        Zero Day, CDF 0.826 394 3,047 0.95 s
        Zero Day, light tree 0.632 282 2,448 1.04 s

        At equal time Bistro is 2.2 x as efficient, Zero Day 1.2 x (its remaining noise is light found only through glossy reflections, which no light sampling reaches). Crops: agent3d-scratch-backup-20261107/pin/light-tree-windows.png.

      • Live (Bistro, 1280 × 720, raw HDR against the offline reference at 1024 spp): energy 0.85 -> 0.95 of the reference (the square 0.70 -> 0.93), relMSE after 16 frames 0.207 -> 0.105, after 128 frames 0.324 -> 0.117, dark pixels 13,932 -> 3,720.

      • Cost at the 0.5 floor (main and branch alternated): Bistro 15.10 / 14.79 -> 16.03 / 15.81 ms (+0.9); the district drive p50 17.7 -> 18.8, p95 24.3 -> 23.9, p99 25.15 -> 24.45 (its worst views, the square's string lights, got cheaper); Zero Day static +0.9 ms, animated unchanged (its emitters move). Perf smoke fails by design (R3).

      • Tried and dropped: stopping the descent after 6 levels at deeper vertices (no saving: the descents at deeper vertices cost nothing measurable, the camera hits' do), leaves of 4 emitters (-0.1 ms, Bistro relMSE 0.052), 2 candidates offline (Zero Day relMSE 0.82), an importance by distance to the sphere floored at 0.25 / 0.1 radii (cheaper in the district but the near lamp lost samples to nodes merely holding the point: live energy 0.92, relMSE 0.155). Without the 120 m cut the district paid +2.9 ms (shadow rays to its far copies).

      • Live candidates 2 -> 4 (2026-11-08, branch live-ris4), from the study of live's brightness against the unbiased render (linear HDR, Bistro's first pose, direct light alone: live with one bounce and no cache against offline with one bounce). Live's light came out lower the fewer the candidates: mid-tones 0.85–0.88 with 1, 0.90–0.92 with 2, 0.94–0.96 with 6. The estimator weights check out (one function gives both MIS pdfs). What loses light is the live filters on noisy signals: bright outliers lose weight in the specular filter's luminance edge-stop (off: +1–2.6 points, but ΔE 4.05 -> 5.15) and in the reflection resolve's ratio estimate (off: +2 points and ΔE 3.95 on Bistro, but bench-ghosting fails on Kabukichō's wet street). Less noise is more light: 4 candidates cost nothing measurable (Bistro's trace 8.20 / 9.93 -> 8.19 / 9.89 ms at 0 / 13 s into its path; the descents overlap the shadow ray). Bistro ΔE 4.11 -> 3.96, luminance 0.871 -> 0.889, SSIM 0.791 -> 0.797; Zero Day ΔE 3.85 -> 3.77 (6 candidates: 3.83 / 3.81). bench-ghosting quick check ok, offline unchanged.

    3. The denoisers' dark holes around fireflies — done (2026-11-08, branch denoise-holes).
      • Both à-trous filters set their luminance edge-stopping width from each pixel's own variance. Among fireflies, a pixel that drew none has a low mean and a low variance, rejects all its neighbours and stays a dark hole. They now take the variance over 3 × 3 pixels (offline: a Gaussian of it, as SVGF; live: the neighbourhood mean the stage already reads, when larger than the pixel's).
      • Offline à-trous, dark spots after the denoiser at 256 spp (320 × 180, against the reference): Bistro 65 -> 54 with the light tree (555 -> 298 with the CDF), at 64 spp 648 -> 319; Zero Day 2,448 -> 1,591. Live (Bistro, 128 frames) 3,720 -> 3,662: what remains live is thin geometry the 0.5 render scale loses against a full-resolution reference (leaves, string-light wires, sign edges), not holes; the shop windows no longer show any.
      • Perf smoke +0.09 / +0.15 ms; bench-ghosting ok; layer B unchanged.
    4. Bistro night's budgets (16.7 ms at the 0.5 floor; the suite at 7249202: rain 16.80 / 16.45, rain + sparks 17.24 / 16.87, rain + smoke 17.19 / 16.85, district p95 24.3, first frame 5.2 s, C slice 18.4–19.5 ms; the light tree since adds ~0.9 ms to every Bistro frame).
      • Part 1 (2026-11-08, branch budgets):
        • First frame 5.2 -> 2.0 s: the glTF loader decodes the images in parallel (the gltf crate decoded Bistro's 405 one after another: load 3.3 -> 0.83 s); the ORCA conversion shrinks power-of-two textures of 512+ by the page gutters itself (2048 -> 2016), which the texture pages did at every load (pages 1.2 -> 0.63 s).
        • Rain -0.57 ms: streaks behind the camera are left out (they only cost the streaks' BLAS), and below full resolution the translucency pass draws per traced pixel and lays the result over the output bilinearly (translucent_up, as UE draws translucency at the screen percentage): translucent 0.99 -> 0.49 ms, its voxel training 0.29 -> 0.21. Bistro + rain 17.85 -> 17.28 ms (17.30 / 17.07 still / moving), + sparks 17.73 / 17.42, + smoke 17.65 / 17.48.
        • Gate (R2): offline 16 / 16 byte-identical, perf smoke ±0.01, ghosting ok, layer B unchanged.
      • Where the rest is (Bistro dry, 16.0 ms at 0.5): trace 10.4 (the light tree ~0.9 of it), and passes that run at the output resolution whatever the render scale: temporal 2.0, specular filters 1.3, à-trous 0.8. Rain costs 1.3 ms now (translucency 0.5, the streaks' BLAS 0.35, training 0.2, wet shading 0.1). Next: the output-resolution passes (the largest fixed cost), the C slice's per-frame BLAS rebuilds, the district's square views.
      • Measured for part 2 (at local-main 878e19c, 0.5 floor):
        • C slice: GPU profile 19.6 ms, frame interval 24 ms (GPU-bound: the TLAS rebuilds are outside the profile). The dynamic BLAS is rebuilt every frame: 2.44 ms, of it the four skinned walkers 1.44 ms (13,744 triangles each,
          • 0.36 ms of tracing) and Bistro's swinging lanterns / string lights 0.4 ms (18,400 flattened bulb triangles). wgpu 30 has no BLAS refit. Levers: a walker LOD (~3 k triangles; Blender's decimation keeps the skin weights), the moving bulbs' emitters inside their rigid instances (emitter sampling through the instance transform) instead of flattened.
        • Output-resolution passes, 4.1 ms at any render scale: temporal 2.0 (several histories, Catmull-Rom), specular filters 3 x 0.44 (real filtering for most pixels: their gate passes almost everywhere at night), à-trous 0.8. The largest fixed cost of every scene; a traced-resolution specular filter or one fused pass is the candidate.
        • Rain: 1.3 ms left (translucency 0.49, the streaks' BLAS 0.35 with 16,000 drops, voxel training 0.21 (not the point count: halving the cap changed nothing), wet shading 0.1). Fewer drops would trade the density UE's rain has.
        • District p95 23.9 ms: Bistro's own square view (one copy on the same path reads the same); light sampling for many emitters is in, what remains is the trace of that view.
      • Part 2a, foliage (2026-11-08, branch foliage-trace). Bistro along its camera path is GPU-bound below 60 fps (the supervisor's capture; the gates now drive the path): per-pass profiles at 0 / 7 / 15 s into it put the growth in the trace (10.5 / 13.3 / 14.7 ms), and nearly all of it in alpha-cutout foliage (285 k masked triangles: leaves 158 k, hedges 53 k, the square's lindens 41 k, ivy 21 k). With the alpha test off the trace is 6.3 / 6.8 / 7.5 ms. The light tree is 0.9–1.3 of it.
        • Rearranging the queries changed little. Each cutout step had been a whole-scene query (up to 16 a ray). Stepping on the cutout instances alone after one opaque query, or one candidate loop on them, or one candidate loop on everything, all came out within ±0.4 ms. The alpha tests and the traversal past the leaves cost it, however the queries are arranged (alpha texture fetches ~1.4–2.2 ms of it). Culling the cutout geometry by its non-opaque flag is slow on Metal (+1.7 ms).
        • Done: live rays past the camera ray and its own light samples, off mirror-like paths, take cutouts as opaque (cutouts_opaque). Leaves are solid cards to indirect light and to later bounces' light samples. Offline rendering always tests: offline renders byte-identical (16 / 16 catalog scenes, Bistro with hardware RT).
        • Cost (perf smoke, 0.5 floor): still / moving 15.98 / 15.77 -> 14.04 / 13.85 ms; the first 20 s of the path GPU p50 / p95 22.2 / 25.8 -> 16.8 / 19.0 ms, frame interval p95 25.8 -> 19.3 ms (39 -> 52 fps). District drive (A/B alternated, twice each): GPU p50 / p95 18.8 / 23.8 -> 15.7 / 18.1 ms, interval p50 16.7 (60 fps).
        • Quality against the unbiased offline render (live, 64 frames, fixed 0.5; live is deterministic, two runs of one build read the same): first pose ΔE 4.08 -> 4.14, luminance 0.873 -> 0.868 (the top-right third, the square's trees, 0.86 -> 0.84); 15 s in ΔE 4.59 -> 4.62, luminance 0.912 -> 0.908. Treating only bounces from the second on as opaque saved half as much (15 s in 19.9 -> 18.3 ms) for the same image.
        • Perf suite at local-main 9093e7d (against 7249202, before the light tree): every line of the supervisor's list is within 16.7 ms at the still and moving poses: Bistro 13.95 / 13.86, rain 14.70 / 14.67, rain + sparks 15.09 / 15.00, rain + smoke 15.71 / 15.20; first frame 1.99 s; district GPU p50 / p95 15.9 / 18.3 (was 24.3). Over: the 50 s path (GPU p95 18.6, interval p95 20.2 ms) and the district's p95.
      • Part 2b, foliage shadows (2026-11-08, branch shadow-cutout). At the path's worst stretch (12–14 s, the square) the alpha cost left was the first hits' light samples: camera rays taking cutouts as opaque saved nothing (trace 11.0 vs 11.1 ms), their shadow rays 2.3 ms. Shadow rays used to step through leaves in order like closest hits: up to 16 whole-scene queries, and past the 16th leaf the ray counted as unblocked.
        • Done: after a first any-hit query finds a leaf its alpha lets through, one query whose candidate loop alpha-tests the cutouts and stops at the first blocker. Revised the same day (branch shadow-determinism, Known issues): the candidate loop made offline renders differ from run to run, so it is live only; offline shadow rays step through cutouts in order, up to 64 (16 before), and match the software BVH within 0.2 %. The candidate loop that lost hits on Metal was for closest hits (ground missing behind foliage); for shadow rays a lost hit would be light in a shadow. Against the software BVH (exact, no step limit; Bistro 15 s in, 16 spp, raw HDR, 4 x 4 regions) the old offline render was up to 2.3 % bright (light through dense foliage), the new within 0.3 %.
        • Perf smoke: path GPU p95 19.2 -> 17.8, interval p95 19.3 -> 17.9 ms (56 fps), still unchanged (13.9). District A/B (alternated, twice): GPU p95 18.4 / 18.5 -> 17.9 / 18.1 ms. Offline renders change where shadows cross more than 16 leaves (Bistro's first pose: luminance 0.999 of before); software traversal byte-identical.
        • Live against the unbiased render: ΔE 4.21 -> 4.25 at the first pose (against a reference rendered the new way), luminance 0.875 -> 0.870: the added (correct) occlusion darkens a live image the clamps already darken.
      • Part 2c, the radiance cache while moving (2026-11-08, branch cache-levels). Driving the worst stretch the trace cost 2 ms more than at the same poses held still (11.7–12.1 vs 9.8–10.4 ms). Voxel sizes follow the distance to the camera in powers of two: a surface the camera approaches gets a new, cold voxel one level finer, and every pixel on it traced a fresh estimate until it held CACHE_WARM samples, while the voxel a level coarser was warm.
        • Done: a cold lookup takes the warmer of the neighbouring levels (coarser, then finer). The training tiles warm the new voxel.
        • Driving 9–17 s: trace 11.7 / 12.1 / 11.7 -> 9.9 / 10.3 / 10.3 ms, as held still. Perf smoke: path GPU p50 / p95 16.7 / 17.8 -> 15.3 / 16.0 ms. District A/B (alternated, twice): GPU p50 / p95 16.0 / 17.9 -> 15.0 / 16.2 ms.
        • Quality in motion (drive 9 -> 13 s, against the unbiased render at 13 s): 1 frame after stopping ΔE 8.06 -> 7.96, 16 frames after 7.07 -> 6.83, luminance 0.80 -> 0.81. A warm neighbour beats a one-sample fresh estimate. Live only: offline byte-identical. Ghosting quick check ok (unchanged).
        • The frame interval did not follow: p95 19.6 -> 21.9 ms with GPU p95 16.0 (next item).
      • Part 2d, the headless viewport's pacing (2026-11-08, branch live-pacing): the supervisor's second question, the gap between frame interval and GPU time. With the GPU now under the frame, live paces by sleeping, and its sleeps overslept by half their length: macOS gives a process that is not a foreground app timer leeway of 50 % (plain Python from the same terminal: sleep 1 / 5 / 11 / 16 ms returned 0.5 / 2.5 / 5.5 / 8 ms late). Frames with GPU 14 ms and CPU 1 ms came 20–23 ms apart. Not App Nap (an NSProcessInfo latency-critical activity), thread QoS (user-interactive) or the timer call (mach_wait_until): each tried, none changed it.
        • Done: sleep_until sleeps 60 % of what is left, again, and yields through the last 1.5 ms.
        • Perf smoke: path frame interval p95 19.96 -> 16.84 ms (59 fps; GPU p95 16.0 unchanged). District A/B (alternated, twice): interval p95 21.3–22.1 -> 16.8, p99 24 -> 17.0 ms.
        • A windowed viewport in the foreground has no such leeway; the benchmarks and the supervisor's capture ran headless, so the gates measured the leeway too.
      • Item 3 status (2026-11-08, after parts 2a–2d): every line of the supervisor's list is within 16.7 ms at the still and moving poses (perf suite at 9093e7d, before 2c / 2d), and Bistro's camera path runs at 60 fps: GPU p50 / p95 15.3 / 16.0 ms, frame interval p50 / p95 16.6 / 16.8 ms (the interval p95 against the 16.7 line is the pacer's own 0.2 ms of jitter). The district: GPU p95 16.2, interval p95 16.8 ms. Left: the C slice (BLAS rebuilds of the walkers and bulbs) and the rain combinations on the path.
      • Part 2e, the C slice's walkers (2026-11-08, branch walker-lod). Measured first at local-main cb80825: GPU 15.0 ms (p95 15.2), frame interval p50 / p95 18.0 / 18.3 ms: the per-frame BLAS rebuilds are not in the GPU profile.
        • Done: the walkers use a level of detail of Quaternius' mannequin, 3.5 k of its 13.8 k triangles, same skeleton and 43 clips (Blender's collapse decimation keeps the skin weights; tools/quaternius/lod.py, made by node tools/fetch-quaternius.ts when Blender is there). At the slice's distances (10 m and more) it reads the same (offline frame at 8 s, side by side).
        • Slice, 60 s live at 0.5: frame interval p50 / p95 18.0 / 18.3 -> 16.8 / 17.2 ms (GPU unchanged). Before the rain (0–15 s) 16.65 ms: 60 fps; in the rain the GPU's whole frame (profile 15.0 + the rebuilds of the bulbs, 0.4, and the rain streaks, 0.35, + the TLAS) slightly passes 16.7. What the LOD saved was mostly CPU skinning (four walkers re-skinned on the CPU every frame), not BLAS time (below).
      • Part 2f, the swinging bulbs (2026-11-08, branch lantern-emitters, measured, not landed). Bistro's 13 moving nodes carry 18,400 emissive bulb triangles, flattened into the dynamic BLAS so light sampling sees them in world space, and re-transformed and rebuilt every frame.
        • Tried: the bulbs in their node instances for rays, with untraced world-space twins for light sampling (a TRI_UNTRACED flag keeps the twins out of every BLAS; a hit through an instance finds its twin for MIS).
        • Same image (offline, 256 spp at 8 s: every 4 x 4 region within 0.2 %); offline trace 18.3 -> 16.8 s.
        • Live, alternated runs: the frame's profile 0.2 ms less (16.4 -> 16.2 dry, 16.85 -> 16.65 in the rain), the slice's frame interval in the rain p50 16.9 -> 16.8 ms; Zero Day animated unchanged (16.66 ms, 60 fps already).
        • The profile's BLAS entry stayed at 1.35–1.6 ms with 32 k or 14 k triangles in the dynamic BLAS: on Metal it is mostly a fixed cost per rebuild, not per triangle. Not landed: too little for a second path through light sampling. The slice stays at 60 fps dry and 16.8 ms (59 fps) in the rain, at the 0.5 floor.
    5. Milestone 1 in one command — done (2026-11-08, branch milestone1-cmd): node tools/milestone1.ts.
      • Reads the UE side when it is there (out/ue/pathtracer/bistro.png, out/ue/lumen/bistro.png, Lumen's frame time and settings in out/ue/lumen/bistro.perf.json, optionally Lumen frames of the camera move in out/ue/lumen/bistro-move/); measures ours (ThreeRT live and full resolution, three.js tuned and strongest, our offline path tracer at 1024 spp); ΔE76 / SSIM / per-region ΔE against UE PT (against our offline render, labelled interim, until it exists); writes the four-way montage (UE PT | ThreeRT live | Lumen | three.js, each with frame rate and ΔE; copied to docs/images/milestone1-bistro.jpg), a side-by-side GIF of Bistro's camera path (ThreeRT live at 60 fps pacing, Lumen, three.js, each with its FPS; shrunk until <= 5 MB: 60 frames, 921 px, 4.95 MB), metrics.json and the docs/COMPARE.md section between its milestone-1 markers.
      • Run now with the UE tiles pending: ThreeRT live 15.72 ms at scale 0.5, ΔE 3.8 (interim); three.js strongest 34.4 ms, ΔE 10.0; tuned 15.9 ms, ΔE 12.1. When the UE runs are done: node tools/ue-bistro.ts (branch bistro-ue), Lumen's perf JSON, then node tools/milestone1.ts --reuse.
      • Revised for "How we are judged" (2026-11-08, branch judge-offline): no UE inputs, Bistro night and Zero Day (--scenes, both by default). The reference is our unbiased offline render (no clamps, no denoiser; Bistro 4096 spp, Zero Day 16384: at 4096 its glossy machine tops left the reference about as noisy as ThreeRT live is far from it), cached by bundle + renderer tree; a render at a quarter of the samples shows the reference's own noise. Montage per scene: our offline render | ThreeRT live | three.js strongest | three.js tuned, each with its frame rate (at the still pose and, where measured, along the camera move) and ΔE / SSIM. The clip is an animated WebP (ThreeRT live | three.js tuned along the scene's FBX camera move, the frame times measured along it; 60 frames at 1280 px in ~3 MB, where the GIF had to drop to 30 frames at 818 px). tools/three/page.ts times each pose of a path; headless Chrome runs without its crash reporter (its crashpad handler outlived Chrome holding our stderr pipe, and strongest.ts never exited).
  • Milestone 1, Bistro night and Zero Day (revised 2026-11-08: no Lumen, no waiting for UE):
    • Conditions: one machine, each scene's own camera, 1280 × 720, the scene's exposure, the GPU otherwise idle.
    • Reference: our unbiased offline render (no clamps, no denoiser, 4096 spp).
    • Renderers:
      • ThreeRT live: 60 fps pacing, dynamic resolution.
      • three.js through the adapter: the strongest WebGPU configuration and a tuned WebGL one.
    • Each reports GPU ms / fps and ΔE, SSIM and per-region numbers against the reference.
    • Images per scene: one montage, our offline render | ThreeRT live | three.js strongest | three.js tuned, each tile labelled with its frame rate and ΔE / SSIM; a side-by-side animation of the scene's camera move (ThreeRT live | three.js) with FPS on each tile, ≤ 5 MB.
    • Delivered as sections of docs/COMPARE.md, the image paths given in the session.
    • The UE audit (UE Path Tracer vs our offline render) follows with the user present; it confirms the reference and does not change the milestone's tiles.
  • Live against the unbiased render, its brightness (2026-11-08, branch live-energy). Milestone 1's live images read 0.87 / 0.90 of the reference's luminance (Bistro / Zero Day). Measured in linear HDR (live .raw snapshots, offline --hdr, Bistro's first pose, 1024 spp, clamps off; 8 x 8 blocks binned by the reference's luminance):
    • Live at the 0.5 floor has 94.5 % of the offline radiance, at full resolution 98.5 %. Display luminance weighs the mid-tones, hence 0.87 there; the same tone map on both HDRs gives the same 0.87, so post-processing is not it.
    • Not the clamps: the indirect clamp (clampIndirect) and the sample ceiling (sample_clamp) off, alone or together, change nothing (every bin within 0.002). Not the radiance cache: off, the image is darker (0.941) and farther (ΔE 4.42). Not the light tree's live cut: the CDF instead is far darker (0.75).
    • Where: of the 5.5 % missing, 2.8 points in 1–53 nit blocks (69 % there) and 1.75 in the emitters themselves. Those are directly seen emissive surfaces (lamp globes, string-light bulbs, signs) smaller than the traced grid. The temporal pass clamped their emission history into the 3 x 3 box of the frame's traced samples, which the jitter fills with them only some frames.
    • Done: on surfaces, the emission is clamped only while something changes (view, object, lighting, animated shading), as the specular is. Bistro 0.945 -> 0.982 of the offline radiance (1–53 nit blocks 0.69 -> 0.89, emitters 0.98 -> 1.00); display luminance 0.873 -> 0.893, ΔE 4.12 -> 4.05, SSIM 0.791 -> 0.792. Zero Day 0.902 -> 0.930, ΔE 3.91 -> 3.85, SSIM 0.785 -> 0.789. Background pixels kept the clamp until the live volume scattering was fixed (Known parity gaps).
    • Left: the mid-tones, 0.87–0.93 at either resolution (the diffuse and glossy light of the street and facades).
      • Their cause, found after: the live filters darken noisy signals (bright outliers lose weight), so the noisier the estimate the darker (more tree candidates: more light; § 0 item 1).
      • Tried and dropped: the specular filter keeping the centre's weight, or edge-stopping against the centre instead of the local mean (Bistro ΔE 3.89 -> 3.90 / 3.94); the existing ReSTIR DI experiment (THREERT_RESTIR=1, not built on the light tree: Bistro ΔE 7.09); alpha-testing the rays that leave leaves (the square's tree, +1.2 ms for ΔE 4.11 -> 4.09).

History: the Kabukichō phase (2026-11-05 → 2026-11-08)

The sections below keep their Kabukichō data as history. Where they name Kabukichō as a gate or a target, the gate is now Bistro night (step 7 above moves them); their numbers stay as they were measured.

0.1 three.js baseline — done (numbers below, rerun 2026-11-06 with the OIDN build and this round's live viewport)

The same scene code drives three.js r187: tools/three/engine.ts implements the engine API on WebGLRenderer, so scenes, games and SceneBinding are unchanged (node tools/bench-three.ts). Mapping: physical light units 1:1, exposure 2^-EV100, ACES, the preset vignette, shadow maps, PMREM image lighting, the Preetham sky scaled to nits by one global constant; a "+ scene probe" variant adds a two-bounce cube capture. Playground: "three.js" A/B split.

Mean ΔE against the UE5 Path Tracer (Kabukichō v1: against UE Lumen of the real level):

scene three.js (better variant) ThreeRT live, 1 / 16 / 256 frames ThreeRT offline (256 spp, OIDN) UE Lumen
cornell-box 13.10 2.12 / 2.33 / 1.44 0.95 3.27
material-grid 5.84 2.21 / 2.02 / 2.04 1.96 1.44
glb-asset 15.13 5.00 / 4.26 / 4.20 4.17 1.85
neon-reflections 5.63 2.72 / 2.24 / 2.19 2.04 2.31
sun-room 18.81 10.14 / 8.32 / 4.49 3.02 4.22
light-room 7.22 2.03 / 1.69 / 1.72 1.58 3.08
kabukicho v1 29.07 12.50 / 10.55 / 10.18 11.32 (reference)
mannequin 9.47 — 3.81 1.51

After 16 frames the live viewport has 2.3–5.6× lower ΔE than three.js on every scene. Where three.js wins: SSIM on the sun room at 16 frames (0.908 with its scene probe vs our 0.781: our image is still noisy there; 0.964 at 256 frames). Full tables: out/bench/three.md.

three.js is 10–40× cheaper on the small scenes (0.4–1.2 ms vs 7–17 ms per frame) but drops to ~10 fps on Kabukichō (99 ms: 147 lights, 4.5 k draw calls). Correction: ThreeRT does not hold 60 fps there either: 18–19 ms of GPU even at the lowest dynamic render scale (0.525), about 51 fps on the M5 (measured with the stall-free timer, § 4).

0.2 UE-comparable mannequin — done (ground truth in UE; live game; merged 2026-11-06)

  • Engine: glTF skins and clips (renderer/src/skin.rs: step / linear / cubic-spline channels, linear blend skinning); GLTFModel.animation = {clip, time, loop} from scene code, per frame from frame scripts. Posed models are dynamic triangles in their own BLASes: a pose or move re-skins them in place (no scene rebuild); 2 ms per frame for one 4.7 k triangle character in the live loop (0.2 ms of it is skinning). Static scenes unchanged (glb-asset bit-identical).
  • Asset: Quaternius Universal Animation Library (CC0): a UE-style mannequin, 13.7 k triangles, 65 bones with UE5 mannequin bone names, 43 clips (node tools/fetch-quaternius.ts).
  • Scene: scenes/mannequin.ts (four poses on a UE default-level setup), rebuilt natively in UE for ground truth (ue5/mannequin.ts: Interchange import of the same GLB, animation assets at the same times, MRQ Lumen + Path Tracer). Poses line up pixel for pixel. Against the UE Path Tracer: ThreeRT offline ΔE 3.81 / SSIM 0.990, three.js ΔE 9.47 / SSIM 0.939 (vs UE Lumen: 3.98 / 0.983 and 9.12 / 0.946).
  • Game: games/mannequin/mannequin.game.ts (mannequin plaza: click to cycle idle / walk / jog / dance / sit; walkers circle). Four animated mannequins: frame script + re-skinning 2.5 ms per frame, clicks commit in place.
  • Requirement for later (decision 1): skinned meshes must work in both paths — the dynamic-BLAS path (secondary rays) and a raster G-buffer path (primary hits); don't make per-frame BLAS rebuilds the only way to draw characters.

1. Real-time pipeline architecture

Targets (2026-11-08): the frame-time and quality gates below that name Kabukichō now apply to Bistro night (§ 0); the Kabukichō numbers stay as measured.

Path tracing stays, in three roles: ground-truth reference, offline renders, and the secondary-ray engine of a hybrid pipeline. The real-time pipeline moves toward Lumen's structure — split signals + caches, not rasterization first.

  • Step 1, split signals + caches. Most direct light deterministic (deferred lighting; round 3's exact unshadowed local lights at camera hits are already this); indirect diffuse from a world-space radiance cache fed by path-traced rays; reflections ray traced, denoised by hit distance.

  • Step 2, rasterized G-buffer for primary hits. Cheaper; dynamic content (skinning, particles, translucency, decals, foliage vertex animation) drawn every frame without acceleration-structure updates; platforms without hardware RT (WebGPU, lavapipe). The material-function contract (MatIn → MatOut) compiles to both a fragment shader and hit-point evaluation. The agent-facing DSL and gameplay API do not change.

  • Decision experiment (before step 2). On Kabukichō, only the primary hit becomes a G-buffer, plus deterministic direct light; everything else unchanged. Measure with bench-temporal: ΔE / SSIM in motion and frame time, against our converged references and UE (2b). Proceed if, at equal or better motion quality vs UE, frame time drops by ≥ 20 %, or motion ΔE vs UE improves by ≥ 15 % at equal frame time.

    • Done (THREERT_RASTER=1: triangle id + depth rasterized at the frame's Halton jitter, the kernel intersects the camera ray with that triangle; cutout triangles that fail the alpha test fall back to tracing). Quality unchanged within noise (move40 / move59 5.76 / 5.92 vs 5.59 / 6.01 traced; stopped 0.5 s 5.05 vs 5.03; vs UE unchanged); GPU −0.75 ms (−3 %) at 60 %, −2.3 ms (−5 %) at 100 %. Deterministic direct light changed nothing here: Kabukichō's 4 shadowed lights were already evaluated exhaustively (RIS starts above 8) and unshadowed ones at camera hits.
    • Conclusion: below the bar; step 1 next. On the M5 with hardware RT, primary rays are cheap; the raster path stays (behind the flag) for dynamic content and platforms without hardware RT.
  • Step 1 acceptance (measured before / after with the same tools; baselines from the 2026-11-06 build):

    • Disocclusion (k = 1, first frame of fresh history, bench-three live rows): sun-room SSIM vs the UE Path Tracer ≥ 0.90 (baseline 0.849, ΔE 10.1); Kabukichō v1 SSIM vs UE ≥ 0.68 (baseline 0.595, ΔE 12.5).
    • Motion: bench-temporal excess_over_ue (§ 2b: our temporal error minus UE's own) at move40 / move59 / stopped-0.5s −30 %: from 3.39 / 3.69 / 3.83 to ≤ 2.37 / 2.58 / 2.68.
    • Lighting changes: closing 4 s excess_over_ue ≤ 1.08 (today), closing 0.3 / 1 s vs converged no worse than 9.79 / 9.44 + 5 % (a cache must not add lag; closing 2 s is too run-dependent to gate on).
    • Frame time: Kabukichō at 1280×720, dynamic resolution, GPU ≤ 16.7 ms (60 fps); today 18–19 ms at the 0.525 floor. Path: at 60 % the trace costs 7.4 ms with one bounce and 14.3 ms with four (THREERT_PROFILE, bounces 1 / 2 / 4: 7.37 / 12.09 / 14.33), so ending paths in the cache after the first bounce saves ~7 ms; budget for the cache: update ≤ 1.5 ms, lookups ≤ 0.5 ms → ~16.2 ms at 60 %, ~13 ms at the floor. Plus: no shader-variant or rebuild hitch (bench-hitches p99 ≤ 26.7 ms baseline).
    • Tests: layer A stays green; new atomic tests for the cache (energy of a one-bounce diffuse box vs the path tracer).
  • Status (2026-11-06): step 1 in progress. Landed: the world-space radiance cache and an albedo-free diffuse history. Not yet: deterministic direct light for the many emissive lights (next).

    • Radiance cache (pathtrace.wgsl, live only; offline renders stay pure path tracing). Spatially hashed voxels sized at 2 % of their distance to the camera (power-of-two levels, ≥ 6 cm) × 6 normal directions; each holds irradiance / π (total, and its indirect part). Live paths end in it at their first bounce: the surface reflects (diffuse + directional specular albedo) × the cached value. Surfaces seen in reflections below roughness 0.4 (where UE traces reflections) get their own direct light at the hit, resampled, plus the cache's indirect part: UE's hit lighting. One in eight 8 × 4 tiles (whole SIMD groups) trains it per frame with two-vertex paths of white-Lambert direct light plus a cosine-sampled ray each, ending in the cache again, so it carries every bounce. Pixels that find their voxel cold trace one vertex and use that meanwhile. Per voxel the history is capped at 256 samples and 32 frames (4 for 45 frames after a lighting edit); voxels unused for 120 frames are freed. 2^18 entries, 13.6 MB, resolve 0.14 ms. THREERT_CACHE=0 turns it off.
    • Diffuse history holds irradiance (lighting / albedo, smooth), remodulated by albedo. Albedo and emission history is resampled with Catmull-Rom and clamped into this frame's 3 × 3 range (TAA: both are noise-free). It is held to 4 frames while the view moves and 16 when still, so texture and sign detail no longer blur through repeated resampling.
      • Bilinear history at 2 frames scores better (move59 excess 2.72) but shimmers, which single-frame metrics don't see.
      • Catmull-Rom costs +0.18 ms.
    • Acceptance so far (before → after):
      • Frame time, met: Kabukichō trace at 60 % 15.5 → 11.9 ms; GPU at the 0.52 floor 18.7 → 16.3 ms. The default view settles at 15.7 ms (bench-three @256). Rain keeps it above: bench-hitches GPU p50 17.0 ms (more mirror pixels). Cost attribution at 60 %: lookups alone 8.1 ms, hit lighting at reflection hits 1.6 ms, cold fallback 0.5 ms, training tiles 0.8 ms. Exact light loops at the hits would cost 3.3 ms (mirror pixels are scattered); two-vertex training for the scattered cold pixels another 0.6 ms.
      • Hitches, met: bench-hitches p99 20.3 ms (≤ 26.7), no new spikes.
      • Disocclusion k = 1 on sun-room, met: SSIM vs the UE Path Tracer 0.849 → 0.916, ΔE 10.1 → 4.0. @16 frames 0.781 → 0.958 and @256 0.964 → 0.972, at 93–100 % scale (was 77–80 %) in 14.4–15.3 ms.
      • Disocclusion k = 1 on Kabukichō v1, not met: 0.595 → 0.612 (target 0.68); ΔE 12.5 → 12.2. @16 0.693 → 0.703, @256 0.733 → 0.741. Its noise is direct light from 138 emissive signs sampled stochastically (RIS, 6 candidates, one shadow ray), which the cache does not touch.
      • Motion, not met: excess_over_ue move40 / move59 / stopped-0.5s 3.39 / 3.69 / 3.83 → 2.69 / 2.86 / 3.20, i.e. −21 / −22 / −16 % (target −30 %).
        • The cache alone changed it by < 0.1.
        • The albedo-free diffuse history and the sharp, clamped albedo / emission history did the rest. Ours vs converged: move59 5.91 → 5.08, stopped 4.95 → 4.32.
        • Switching the specular or diffuse spatial filter off makes it worse (noise), and so does a tighter specular clamp.
      • Lighting changes, met: closing 0.3 / 1 s 9.67 / 9.34 (≤ 10.28 / 9.91), closing 4 s excess_over_ue 1.14 (1.08 before; closing runs through random switch-off orders, ± 0.1 between runs).
      • Tests: layer A 16 / 17 (glass transmission as before). New cache/furnace-box: an albedo-1 open box in a 1-nit sky through the live renderer (serve jobs take live: frames) reads 0.973 after 600 frames (1 is exact). It reaches 0.997 by 4000 frames, so energy is conserved. For comparison: offline at its bounce cap 0.78, live without the cache 0.86. Multi-bounce in deep concavities builds up over seconds: two bounces per 32-frame history turnover.
    • Emitter reservoirs (ReSTIR DI at camera hits: 4 candidates, the previous frame's reservoir at the reprojected pixel + 2 neighbours, one shadow ray). Kept as an experiment (THREERT_RESTIR=1), off by default:
      • Kabukichō v1 k = 1: 0.608 → 0.613. A history reset drops the reservoirs, as a real disocclusion does.
      • Motion: excess_over_ue +0.1 (3.12 / 3.29 / 3.53).
      • Cost: +0.44 ms at 60 %. No global bias (luminance ratio 0.995).
      • Reuse among this frame's reservoirs, which a disocclusion needs, takes a pass of its own after the trace.
    • Measurement correction (2026-11-06, second round). bench-temporal's cached references were stale: rendered by an older build, they differed even from the pre-step-1 build's own converged frame by 3.5 ΔE. Every "ours" ΔE above, and the 3.39 / 3.69 / 3.83 baseline the targets were derived from, carried that static offset (part of it: the change in what each build converges to, which is bias, not temporal error). bench-temporal now keys references by renderer build, bundle and THREERT_* switch, so each build is measured against its own converged frames. Two converged references of one build agree to 0.07–0.16 ΔE. Bias is judged against UE / the path tracer (bench-three @256: Kabukichō v1 0.733 → 0.740).
    • Re-measured, each build against its own converged frames. Baseline (b5566bd, before step 1): excess_over_ue move40 / move59 / stopped-0.5s 3.20 / 3.34 / 3.21. The −30 % targets become ≤ 2.24 / 2.34 / 2.25.
    • Where the remaining error was. Per signal (THREERT_VIEW_MODE 6 / 7, each against its own converged image), move59 vs converged: specular 3.18, diffuse 2.73. Diffuse barely changes from moving to still (2.55 after 4 s still: slow convergence of emitter-lit diffuse). Specular is the motion part, and it was 8 % too dark while moving (luminance ratio 0.918). The 1σ clamp box, built from raw 1-spp reflection samples (mostly dark, sometimes a bright sign), clipped bright history: that is the smear on the glossy facades. UE clamps against its spatially resolved reflections.
    • Specular clamp box ×8 (UE's 1σ × 8; only while moving, as before):
      • Specular alone, move59 vs converged: 3.18 → 2.59 (luminance ratio 0.989).
      • Box ×2: 2.93. Box ×4: 2.71. Unclamped: 2.61, but bright ghosts (ratio 1.031).
    • Fresh history (< 4 frames) gets every specular filter pass and a loose normal test: 1-spp reflections on rippled wet ground are speckle that the normal-map detail otherwise keeps apart. Kabukichō k = 1 +0.02.
    • Results (2026-11-06; run-to-run variation ± 0.1–0.2):
      • Motion, met: excess_over_ue move40 / move59 1.87 / 1.97 (−42 / −41 %).
      • Stopped 0.5 s, borderline: 2.33 (−27 %). Other runs of the same build: 2.19–2.23.
      • Kabukichō v1 k = 1, not met: 0.612 → 0.632 (target 0.68).
      • Hitches p99 20.4 ms.
      • Lighting changes unchanged: closing 4 s excess 0.37.
    • Tried and dropped:
      • Motion history cap 48 → 96 / 192 frames: no change.
      • Fresh history seeded from the radiance cache (a prior worth 3 frames): Kabukichō k = 1 +0.014 only, and it blurs sharp sun patches at disocclusions (sun-room k = 1 ΔE 3.86 → 4.75).
      • ReSTIR DI, re-measured with correct references: no gain (1.87 / 1.85 / 2.25 vs 1.78 / 1.85 / 2.23).
    • What's left at k = 1 is the wet street's first-frame reflections (blotches of neon), not diffuse. That needs a reflection resolve that reuses neighbouring pixels' rays weighted by each pixel's BRDF (Lumen's spatial reuse), not a blur.
    • Reflection resolve (2026-11-06, third round; live.wgsl pass refl, Stachowiak 2015 / Lumen's spatial reconstruction). The trace kernel keeps each camera hit's specular-lobe ray (direction, lobe pdf, radiance it brought back, the hit's specular albedo E); the per-pixel specular signal keeps only light-sampled specular. Each traced pixel then reuses its own and up to 8 neighbours' rays on the same surface, re-aimed at their hits and weighted by its own BRDF over their pdf: E × Σ w·L / Σ w. 0.29 ms at the 0.5 floor.
      • The clamp box tightens toward UE's again. Excess move40 / move59 / stopped-0.5s by box:
        • 8σ: 1.68 / 1.84 / 2.19;
        • 4σ: 1.72 / 1.87 / 2.21;
        • 2σ: 1.75 / 1.92 / 2.24;
        • 1σ (UE): 1.82 / 2.01 / 2.28. Before the resolve, halving the box cost ~0.3 ΔE. Now 4σ.
      • Results with 4σ, three runs (they agree to ± 0.01):
        • Motion, met: move40 / move59 1.71 / 1.86, −47 / −44 % from 3.20 / 3.34.
        • Stopped 0.5 s, met: 2.20, −31 % (≤ 2.25).
        • Closing 4 s excess 0.28.
        • Sun-room k = 1 SSIM 0.915 → 0.950.
        • Kabukichō v1 k = 1, not met: 0.632 → 0.640 (target 0.68).
        • Hitches p99 21.4 ms. Kabukichō GPU at the 0.5 floor 16.4 ms.
      • Why Kabukichō k = 1 stays short. More or wider reuse (16 neighbours, 1.5× radius, looser normal test) moves it by +0.002, and resolution doesn't matter: at a fixed 100 % scale k = 1 is 0.646 vs 0.641 at 55 % (bench-three --scale). The k = 1 error is spread over every edge and sign (one jittered sample per pixel, no history), emitter-lit diffuse (one emitter sample) and reflections together. Closing it means reuse within the frame for emitter samples too (a shading pass after the trace: ReSTIR's spatial pass), the analogue of what makes Lumen's disocclusions clean (deterministic direct light, interpolated probes).
    • Frame time by state (Kabukichō at the dynamic-resolution floor 0.5 = UE's default minimum, GPU timer, 12 s after each change). It is not rain:
      • Within 16.7 ms: rainy night (default) 15.8, rain on / off 15.7 / 15.8, clear 16.2, viewpoints 16.0–16.4.
      • Over it: the fog-heavy moods while they ramp in, mist 17.1 and 3 AM 17.2. A mist timeline reads 17.3 / 17.2 / 17.1 at +2 / 4 / 8 s, then 15.7 at +15 s.
      • Where the transitional cost is: the denoiser. Changing fog keeps anti-lag restarting history where fog-lit light changes, so the wide à-trous stages run there.
      • Tried: a 3 × 3 à-trous kernel saves 1.3–1.7 ms everywhere, but sun-room @1 / @16 SSIM fell 0.915 / 0.957 → 0.831 / 0.885. Only on long-history pixels it keeps quality and saves nothing in transitions. Capping environment ramps at 32 history frames instead of 16: no measurable change.
      • Status: met in steady states; fog transitions exceed the budget by ≤ 0.5 ms for ~10 s.
      • Since the diffuse denoiser runs at traced resolution (§ 5, item 4), the same states at the 0.5 floor: rainy night 14.8, mist 14.9, clear 14.4, rain off / on 14.8 / 14.8, viewpoints 15.3–15.6 ms (the #18 build: 17.2–18.6). The mist ramp reads 15.0 / 15.0 / 15.0 / 14.8 at +2 / 4 / 8 / 15 s (#18: 18.4–18.5). Met in transitions too.
  • Direct light for camera hits in its own pass (MegaLights route; next, before streaming, § 5 item 5). The path-tracing kernel is one megakernel, and code in it costs GPU time even when it never runs. Camera-hit direct light (the exact light loop, emitter resampling) should become separate passes with per-screen-tile light lists (coherent reads) and MegaLights-style sampling, so the kernel shrinks instead of growing.

    • Evidence (2026-11-06): 3 × 3 Kabukichō district, lockstep drive down the middle street (live lockstep, one camera step per frame at 15 m/s), GPU p50 at the 0.5 floor; main 23.75 ms.
      • A light grid plus per-cell light resampling, compiled in but switched off: 25.31 ms (+1.6 ms) for code that never runs.
      • The per-pixel grid-cell lookup itself costs nothing: 25.30 ms with the lookup on and the old loop kept.
      • Resampling 8 candidates from the pixel's cell everywhere: 25.68 ms, 0.4 ms slower than the old loop at the same code size. That loop over all 1,211 lights reads the same light in every thread, so it is cheap.
      • Capping that loop at 150 lights (a one-line change) measured 25.29 ms: the kernel's code generation swings by more than the work saved.
    • What the 3 × 3's extra cost over its middle row (19.34 ms) is: the outer rows' light sources, not their geometry.
      • Removing their analytic lights and emissive triangles, all 37.5 M triangles kept: 19.38 ms.
      • Removing only the lights, only the emitters, only geometry (props, procedural meshes or both): 23.3–23.8 ms.
      • Capping secondary rays at 60 m: 23.57 ms.
      • Far light sources take samples (and long, mostly occluded shadow rays) whichever kind is left.
    • Light LOD (§ 5 item 5) took the district to 19.3 ms lockstep p50 (19.5 on bench-district; about 19.4 was the goal), with no new cost when switched off. Its order and what is left:
      1. Light LOD, unbiased: emitters sampled by distance to the camera, local lights in spatial groups. Done.
      2. UE strafe reference and the sign-band comparison (§ 2c). Done.
      3. Motion blur length and the night auto exposure measured against UE (§ 2c, Known parity gaps). Done.
      4. This pass (moved before streaming on 2026-11-07: the wet street after a strafe is what the user notices most). Not pursued for now (decided 2026-11-07). Inline, the camera-hit direct light overlaps the traversal's memory latency and costs almost nothing; on its own it is paid in full (the split and tile-culling data below). It reopens only when MegaLights-style sampling actually needs a pass of its own.
        • With it, one more emitter sample at near-mirror camera hits, reusing refl_rays (branch glossy-refl-eval, § 2c): reflection rays and emitter sampling both have to halve their noise there.
        • Acceptance:
          • Kabukichō and 3 × 3 district GPU at the 0.5 floor no worse;
          • the street after a strafe +0.5 s ≤ 1.33 (UE50 + 0.3) and the +0.1 s gap to UE50 halved;
          • the sign band's trail no longer.
        • It also covers the rest of the way to 16.7 ms on the district, about 2.7 ms. Geometry LOD does not change the GPU time: 19.23 ms with the outer blocks gone entirely vs 19.38 with only their light sources gone.
      5. Streaming (§ 5 item 5): first frame ≤ 3 s, no frame over 50 ms. The first frame is met without it (§ 5).
    • Tried 2026-11-07, not merged. (The split was taken up again on 2026-11-30 for the resampled lights alone: § 1a, "The samples' noise that is left is direct light".)
      • The split itself (branch direct-pass):
        • What it does: the trace leaves each camera hit's surface in a buffer and skips direct_light there; a pass of its own (direct) lights it with the same estimators.
        • Kabukichō is even (moving 15.42 → 15.35 ms: trace 8.89 → 6.79, direct 2.03).
        • The district is worse: drive p50 19.36 → 20.22, p95 20.87 → 21.42; mid-street 15.95 → 17.17 (trace 9.93 → 8.56, direct 2.58).
        • Taking the camera-hit light code out of the megakernel altogether saves only 0.06–0.12 ms more. The cost is not code size: inline, that work overlapped the kernel's other latency-bound work, and on its own it is paid in full.
        • direct on the district: 0.68 ms fixed (the surface, the moon's shadow ray), local lights 0.89, emitters 0.86 (6 candidates, each a 19-level binary search over 376 k entries).
        • It was to be reconsidered once emitter sampling and the local lights got cheaper:
          • Emitter sampling: done. The CDF search goes through a guide table (§ 5 item 5, #49): district drive p50 −0.4 ms inline. An alias table, the first plan, was slower.
          • Local lights: per-tile culling has nothing to save (next item).
      • Per-tile culling of the camera-hit local lights: measured first, not built. Inline, the light loop's work costs nothing measurable, so tile lists have nothing to take away. 3 × 3 district at the 0.5 floor:
        • The same binary with every light group skipped (data only: no camera-hit local light evaluated): drive p50 / p95 19.30 / 20.57 → 19.54 / 21.38 ms, slower.
        • The same, with the unshadowed lights scaled by 1e-20 in both arms, so the image is the same and only the loop's work differs: mid-street trace 10.8–11.0 → 11.4–11.5 ms, still slower.
        • Without groups (THREERT_LIGHT_GROUPS=0, every light's range tested at every pixel): trace +4.6 ms. The groups already remove what culling would.
        • Shader variants that skip the loop on a runtime condition: trace +0.2–0.7 ms (code generation).
        • In the direct pass the same local lights cost 0.89 ms. Inline, that work overlaps the kernel's latency-bound traversal. Why skipping it makes the trace slower (scheduling, clocks) was not measured.
      • Specular denoising at the internal resolution, UE's structure (branch spec-internal, one time-boxed prototype on top of #54): the specular history, its clamp and the spatial filter on the traced grid (a pass stemporal with the surface and mirror-image reprojections, UE's 4 sigma clamp and frame caps; the three filter steps after it), and the output grid upsampling the result like the irradiance, with a short history (16 frames still, 4 moving) clamped to the four traced values.
        • Time: −0.62 ms on the district drive (specular filter 1.28 → 0.30, temporal 2.00 → 1.78, stemporal +0.35, a final-image copy +0.22 that reordering buffers would remove).
        • Ghosting much worse, every bench-ghosting row fails:
          • turn-mid ground excess 2.83 → 3.55, trail 65 → 123 px;
          • strafe-mid trail 50 → 134 px;
          • stop +0.1 s 2.78 → 2.99, trail 28 → 76 px.
        • The wet street vs UE50 is worse at all three times: 3.27 / 2.67 / 1.62 → 3.56 / 3.00 / 2.03.
        • Converged frames lose the wet street's ripples and the sharp sign reflections.
        • Why:
          • The traced grid's history adds each frame's jittered sample at its pixel centre, so it averages over the pixel's 2 × 2 output footprint. The output-grid history placed every jittered sample where it fell (TSR's reconstruction); now it only sees the averaged input and cannot get the detail back.
          • Two histories in a row (12 frames moving on the traced grid, then 4 on the output grid) add their lag.
          • The traced history reprojects at 2-pixel granularity.
          • The output clamp spans the four traced values, already filtered, so it is wide.
          • The filter steps (1, 2, 4 traced pixels) are twice as wide in output pixels.
        • UE avoids it because TSR accumulates the final lit image on the output grid from the jittered internal frames. Lumen's denoiser output keeps each frame's sample detail; it does not hold a second long history of its own on the internal grid. Doing it our way would mean the output grid accumulating the composed image (TSR proper), a larger restructure. Stopped after the first prototype, as agreed.
      • A second emitter sample at near-mirror camera hits, added to refl_rays' extra reflection ray (branch refl-rays-nee):
        • The trace weights its own emitter sample 1/2 on those pixels.
        • Street after a strafe vs UE50, 3.28 / 2.70 / 1.63 → 3.02 / 2.50 / 1.57, the same as the reflection ray alone.
        • Kabukichō moving +1.07 ms, still +0.12 ms.
        • The two-samples-per-frame ceiling (2.96 / 2.27 / 1.34, § 2c) comes from whole extra path samples, not from NEE:
          • more samples per frame with one reflection ray gained 7–12 %;
          • one more reflection ray alone 3–7 %;
          • both together 9–17 %;
          • a second emitter sample nothing. A second jittered camera hit and everything behind it is the part that helps.
        • Rendering the street with two samples would cost roughly 3–4 ms, beyond the budget. The wet street's +0.5 s line (1.33) stays open; what is left is the research item in § 2c (reprojecting glossy reflections so their history survives a strafe).
      • Biased light culling or merging only if the unbiased LOD were not enough. It was enough. Any far light it drops would still have to reach the image through the radiance cache, as Lumen keeps far emissive objects in its GI, checked against UE.
    • Since then the merge gate reports what pathtrace.wgsl additions cost compiled in but off (docs/WORKFLOW.md).

1a. The frame at render resolution, one upscaler (2026-11-12)

Why: every host held the view at 1280 × 720 and stretched it over the window (a Retina window is 2560 × 1440), and every quality bench compared on the 720p grid, so none saw it. At the window's pixels against our offline render of that size, a still live frame kept 0.32–0.42 of the detail (the regression of its luma gradients on the offline render's; an offline 720p frame stretched keeps 0.48–0.57). Making the view the window's size did not pay as the pipeline stood: upscaling was done per signal on the output grid (nine 80-byte samples gathered a pixel, five output-size histories, the specular filter's three passes), 2.75 ms of Bistro's frame at 720p and 9.9 ms at 1440p.

Now, the structure of UE's TSR after Lumen and of the vendor upscalers after a denoiser (live.wgsl):

  • One sub-pixel jitter a frame for every camera ray (Halton 2, 3; 8 phases at full resolution, 8 / scale² below).
  • Everything noisy at the render resolution: the specular history and its filter moved to the traced grid beside the diffuse irradiance (stemporal, sfilt*); compose makes one colour a traced sample, with its velocity, depth and whether its shading is animated.
  • One temporal upscaler (judge, reject, upscale) with one colour history on the output grid:
    • holding still, the history is not clamped into the frame's range (a full-resolution TAA's rule cut the detail finer than a traced pixel every frame: Thames kept 0.53–0.67); each sample is held against the range of the history around its own point instead, a 3 × 3 mean of what lies outside is the correction, and a disocclusion is found by depth (this frame's nearest among nine against the previous frame's), confirmed by colour;
    • in motion, as the pixel's speed nears a pixel a frame, the history goes from 16 samples to 4 and is clamped into the nine samples' range (TSR's velocity weight clamping, TAA's clamp). An orbit of Thames at 9 pixels a frame against the offline render of the pose (detail / trail px): neither 0.48 / 49, both 0.52 / 31; main stretched 0.31 / 45;
    • animated shading holds 4 samples (a reactive mask, as FSR 2 and UE's responsive AA take one);
    • translucent particles are drawn after it (they have no motion vectors), then depth of field and motion blur.
  • The view is the window's physical pixels (play; live --display-scale k headless): dynamic resolution starts from the points' resolution and goes down to half of it, its steps a point's (LiveCore::set_display_scale).

Measured on the M5 Pro (out/liveq/gpu-runs-std.md; single runs unless said):

as the window runs it, 60 fps both main: 1280 × 720 output, stretched this: 2560 × 1440 output
Bistro 1056 × 594 rays, GPU 15.1 ms, detail 0.32 960 × 540 rays, 14.4 ms, 0.55
Thames (a voxel level) 1280 × 720 rays, 15.3 ms, 0.39 1152 × 648 rays, 14.8 ms, 0.88
Kabukichō 832 × 468 rays, 15.8 ms, 0.42 736 × 414 rays, 14.4 ms, 0.72
  • Bistro's output-grid passes at 1440p: 2.8 ms (the old path 9.9).
  • At 1280 × 720 and the 0.5 floor (the perf smoke's drive, builds alternated on a quiet GPU): GPU p50 / p95 7.07 / 7.38 ms against main's 8.33–8.36 / 8.63–9.19.
  • Layer B, Bistro against the unbiased offline render: ΔE 2.98 / SSIM 0.859 (main 3.62 / 0.812 when its limits were set), luminance 0.994.
  • bench-ghosting: Bistro passes. Kabukichō failed two of its five limits as they stood, the p95 excess 0.5 s after the turn's and the strafe's return (5.1 for limits of 4.2 and 4.5): the excess is taken over the settled frame, whose own p95 fell from 7.9 to 4.2, while the shots' raw p95 are 9.3 for main's 10.8 and 11.3. Those two shots' limits are set again from this build's readings with the margins the old ones had (tools/bench-ghosting.ts); the trails' limits and the other shots' stand.

History lengths (2026-11-12, after it). [Removed 2026-11-24: this passage described an earlier implementation that has been replaced; docs/PROVENANCE.md. The measurements below are that implementation's.]

dE against the offline render or the converged frame main this
the Bistro slice half a second after its explosion (2560 × 1440, scale 0.375) 6.58 6.03
the Bistro slice at rest, 5 s in 2.79 2.82
Kabukichō 2 s / 4 s after its signs close (bench-temporal at 0.5, real time) 6.56, 6.61 / 2.82, 2.86 6.58, 6.70, 7.73 / 2.91, 2.92, 2.95
bench-ghosting excess, Bistro (turn-mid, strafe-mid ground; the two returns; stop + 0.1 s) 1.17, 1.85, 1.38, 1.47, 1.59 1.08, 1.76, 1.25, 1.34, 1.50
the same, Kabukichō 2.46, 3.31, 1.25, 1.29, 2.52 2.42, 3.26, 1.14, 1.20, 2.47
  • What was tried and left out, each measured (out/liveq/gpu-runs-std.md, H1–H31):
    • no bound at all: a long history lags behind what moves (the explosion 5.94 with SSIM 0.809 for 0.832);
    • 64 frames: the explosion reads better (5.72) but a lighting edit is followed a second late (the signs 7.82 / 3.37);
    • the cuts at edits kept beside the new bound: as main (the explosion 6.69): a cut is the whole frame's for a change in one corner;
    • an anti-lag on the specular (its fast mean kept with the moments): at one sample a pixel that mean is noise, and cutting by it cost more than the lag (the slice at rest 2.98 for 2.82);
    • the anti-lag in a settled scene: it finds noise (a still Bistro 2.43 for 2.23). It runs while the lighting changes, as before.
  • A lighting edit is followed a little later than under main's cut, sometimes (the table's third row; the bench runs in real time and its 2 s reading was already too run-dependent to gate on).
  • By day none of this shows (Thames through fifteen explosions: frame to frame the same as main to 0.02): the sun's direct light and the upscaler's own history carry the frame. A geometry edit by night was not measured.
  • Cost: none that shows (Bistro's passes 6.64–6.66 ms a frame in both builds).

Media in the live frame's histories (2026-11-12, after it). The fire of § 6 step 10 b read worse after #30 and #33 (its box, ΔE at 0.2 / 0.5 / 1 s after it starts: 6.90 / 6.61 / 4.36, then 7.18 / 7.53 / 5.25, then 7.32 / 7.81 / 5.71). Until #33 a fire's stand-in light changed every frame and so cut the whole frame's history to 16 frames, which hid two faults of the live path's own:

  • media_composite multiplied the media's transmittance into each frame's diffuse and specular lighting before the denoisers accumulated them, so a surface's history held the medium of the frames before: 16 frames after a medium ends, the wall behind it read 0.88 of its 2 nits (volume/animated-clears-live; now 2.00). The transmittance now goes with the sample (Pixel normal.w) and compose applies it to the denoised lighting, as volumetrics are composed over a denoised surface elsewhere. What the camera ray sees and the deterministic direct light have no history before compose and take it as before.
  • Nothing said a medium changes. A volume function is animated when its code reads i.time (or says so), a simulated grid always (the medium table's a.w); the march gives the share of the pixel such media take (what they hide, or their light's share of it), and the upscaler's reactive mask rises with it to 1 at a quarter (UP_MEDIUM): four samples of history, as for animated shading.
the fire shot (bench-voxel-fire, lockstep, 0.75), the fireball's box ΔE at 0.2 / 0.5 / 1 s with the fire light without
main before 7.32 / 7.81 / 5.71 7.51 / 8.47 / 7.56
the transmittance out of the histories, alone 6.78 / 6.35 / 4.59 6.86 / 6.42 / 5.02
animated media reactive, alone 7.02 / 7.24 / 4.91
both 6.28 / 5.56 / 3.69 6.36 / 5.62 / 4.19
the bound of #33 back at 16 frames instead (what #33 changed for the fire) 7.18 / 7.55 / 5.27
  • The real-time frame against the same moment held: 5.33 / 2.71 / 1.57 (5.74 / 4.65 / 3.52); the held frame against offline 3.64 / 4.32 / 2.70 as before (the march's own picture, not this).
  • Reactive by the share itself, without the quarter: a little worse (6.44 / 5.70 / 3.78).
  • Elsewhere: bench-ghosting passes with the numbers of the table above for Bistro and 2.42, 3.27, 1.17, 1.22, 2.48 for Kabukichō; the Bistro slice half a second after its explosion 6.03 / SSIM 0.832 in both builds (its fireball is a small part of that view). test-render 179 pass.
  • Not done: live GI, reflection and shadow rays still see no media (the stand-in light stays), and a medium has no motion vector (smoke that drifts is reactive, not followed). (Overlapping media: below.)

The specular history per pixel (2026-11-13, after it). [Removed 2026-11-24: this passage described an earlier implementation that has been replaced; docs/PROVENANCE.md. The measurements below are that implementation's.]

bench-ghosting --quick, excess over the settled frame / trail px (turn-mid, strafe-mid ground; the two returns + 0.5 s; stop + 0.1 s) main this
Kabukichō 2.42 / 29, 3.27 / 60, 1.18 / 22, 1.23 / 23, 2.48 / 32 1.97 / 28, 2.86 / 56, 1.10 / 22, 1.10 / 22, 2.07 / 30
Bistro 1.08 / 5, 1.76 / 6, 1.25 / 12, 1.34 / 12, 1.50 / 5 0.84 / 7, 1.60 / 6, 1.17 / 12, 1.26 / 11, 1.34 / 5
  • What was tried and left out, each measured (out/liveq/gpu-runs-std.md, S1–S20):
    • the parallax weighed against the reflection's own blur, the lobe's angle (the history may trail K lobe footprints behind): a wet street's lobe is 27–245 px wide here, the history ran through a forward move, and the stop dragged a 65–112 px trail (limit 35);
    • two thresholds instead of one budget (2 .. 12 frames from 0.25 px of parallax, 4 from 2 px): passes, a little behind the budget on every reading;
    • the pixel's speed taken for the parallax where the frame's sample has no reflected point: a turn then lost its history on rough surfaces (2.14 for 1.97);
    • budgets of 1, 2, 4 and 8 px: no reading tells them apart at these speeds (the floor of 2 .. 4 frames decides); 2 is the tighter trail.
  • bench-temporal (Kabukichō, a 2.5 m dolly with a 12° turn in 1 s, real time, against each build's own converged frames): the move reads 3.97 / 4.16 / 4.21 and the stop 2.92 on average over four runs of this rule (budgets 1 .. 4 px), main's one run of the day 3.92 / 4.07 / 4.12 and 2.88: 0.05–0.09 above main each time, inside the spread of main's own runs across two days (move40 3.88–4.07). Stated as it is: the ghosting bench counts frames and repeats to 0.02, this one does not.
  • Not changed, measured: what makes the scene's lighting "live" for the whole frame. Anything that moves or is edited does, for 45 frames, so a scene with a walker in it is always at the 32-frame bound, and the rule for spark lights adds nothing there (the Bistro slice reads the same without it). The radiance cache's history is cut to 4 frames by the same switch: at 32 the slice reads 2.66 for 2.82 at rest and 5.80 for 6.03 at its explosion, and all of test-render passes; what the 4 frames buy is how fast indirect light follows an edit, which no bench here counts in frames. It waits for a lockstep lighting-edit measure.
  • Gone with it: the frames-since-translation counter, temporal flag 16384 and the Playground's H switch.

Overlapping media (2026-11-13, after it). The kernel took each medium on a ray whole: media_track (offline) and media_march (live camera rays, the cache's gather) in the order the ray enters them, media_homogeneous with its light (live paths through water) in the table's order. A medium inside another was drawn behind all of it: an emitter (2 nits a metre, 1 m) inside an absorber (1/m, 2 m) read 2 e⁻² = 0.27 nits for 2 (e⁻⁰·⁵ − e⁻¹·⁵) = 0.77, offline and live; hence the rule that volumes must not overlap, and no smoke grid around explosions (§ 6 step 10 b). Now the ray is taken a stretch at a time, between the points where it enters or leaves a medium, and the media it is in there are one medium:

  • offline, delta tracking at the sum of their majorants; a tentative collision evaluates each, sums extinction and emission, and a real one is one of theirs by its extinction (its albedo, its phase function);

  • live, the march sums their coefficients a step, at the finest of their steps (a medium's crossing over 8, over 64 with a density grid: the grid's two source patches are in the kernel's source now); the share of the pixel that media changing with time take is summed the same way;

  • homogeneous media with their light the same way, analytically a stretch; their transmittance alone stays a product. Shadow rays' ratio tracking was right already (a product). One medium on a ray draws the random numbers it drew: the fire shot reads 6.28 / 5.56 / 3.69 as before, to the digit.

  • volume/overlap-emission and -live: 0.7674 (8,192 spp) and 0.7668 of 0.7668; main's kernel 0.2708 and 0.2705.

  • A fireball inside a smoke column (a scratch scene, 0.6 s after it starts): drawn dim behind the smoke before, offline and live; in it now. Live against its own offline dE 1.63 / SSIM 0.972 (1.59 / 0.972 before: what is left is the smoke's shadow on the floor, which live shadow rays do not cast).

  • Cost: none that shows. Thames (the river is a homogeneous medium on every path) at 0.5, this build and main's alternated on a machine under load, GPU p50: 22.6, 20.6, 19.7, 18.6 ms (main, this, main, this).

  • test-render 181 pass. Not done: Explosions still refuses a smoke grid and says why in the old words (the voxel line's to change, with the comparison that found it); at most 32 media a scene, as before.

Hiding in place, black lights (2026-11-13, after it). World::set_visible rebuilt the live scene for anything but a particle system, so a pool parked its idle fireballs 10 km below the level and gave its idle lights a 1 mm range (§ 6 step 10 b). And the build placed every light whatever its visibility: hiding a light cost the rebuild and changed nothing (light/hidden: 238 for 39.8). Now, by an object's own visible, in place (Changes::shown):

  • a volume keeps its medium in the table with no shape (MEDIUM_HIDDEN: medium_span gives no crossing). Hidden ones are built while the kernel has room after those shown (32 in all); no media pass runs while every medium is hidden;

  • a light without a card keeps its entry in the light table, black. The kernel skips black lights first in its exact loop, and they are in no group's sphere (a group of them alone holds no point), so a light parked anywhere costs nothing; a hidden ancestor still rebuilds, and the build then places the lights under it black;

  • when a local light moves, or goes dark or lit, the groups are sorted again (Tables::regroup_lights): they were sorted when the scene was built, and lights that drifted apart made their group's sphere as wide as the level. A rect light's card and the sun still rebuild (geometry; the sky's bake).

  • A fireball and a light hidden and shown every half second for 3 s (a scratch game): 6 rebuilds before (1,958 ms the first, 9 ms each after), none now; the frame's CPU p50 4.70 ms, max 18 ms.

  • New tests: light/hidden, light/hidden-in-place-live, light/shown-in-place-live, volume/hidden-in-place-live, volume/shown-in-place-live; test-render 186 pass. Bistro held still, Kabukichō's ghosting and the fire shot read as before.

  • Seen on the way, not this change's: 2 s after a 5,000 cd light is hidden beside a 1,000 cd one the plane under them still reads 6 % high. 45 frames after a lighting edit the long history comes back, and what is left of the old light then averages out as 1 / n. And 0.3 s after a fireball is hidden a faint ring stays where its edge was (the upscaler's history: nothing says a medium went).

  • Not done: Explosions still parks (the voxel line's to change); a mesh hidden by its own visible still rebuilds.

Simulated grids across a rebuild (2026-11-13, after it). A rebuild of the live scene made new grid textures, so any structural change in a game (an object hidden, a texture, an edit's fallback) started every simulated grid again from its data: the smoke vanished (§ 6 step 10 b kept its pool movable and parked for that). Now the scene before hands what its grid programs had simulated to the scene after (Gpu::carry_grids): per grid that is the same grid still (world::DensityGrid::made: its size and its program's name; new parameters keep it), field A (its layers of the atlas) and field B are copied texture to texture, and the programs' step count goes with them. volume/grid-rebuild-live: a grid filled at 1.5 a second for 24 frames, the scene rebuilt after 12, reads 0.6075 of 0.6024 (as without the rebuild); main 0.90. test-render 187 pass. Not carried: GPU particles (a rebuild still starts them afresh), and a grid whose size or program changed.

A lighting edit counted in frames (2026-11-13, after it). The closing signs of bench-temporal run in real time and spread more than what they were asked to tell apart. bench-temporal --shot edit is the measure in frames (tools/light-edit-scene.ts: a closed room; a spot whose pool is on the back wall and whose bounce is on the floor; an emissive sign; each switched off and on at once; lockstep at 0.5, the frame k frames after the edit against the converged frame of the state after, beside the frame k frames after a history reset in that state). Two runs agree to 0.01. Main (cd54c70), luminance against the reference at 1 / 8 / 32 / 128 / 256 frames after the edit:

edit, region the edit ΔE at 32 / 256 a view with no memory, ΔE at 32 / 256
lamp off, its pool 29.8 / 11.2 / 3.33 / 1.36 / 1.17 15.2 / 1.75 0.53 / 0.36
lamp off, its bounce 2.64 / 2.49 / 1.66 / 1.12 / 1.05 3.38 / 0.43 0.46 / 0.26
lamp on, its pool 0.05 / 0.84 / 0.95 / 0.99 / 0.99 1.92 / 0.43 0.43 / 0.25
lamp on, its bounce 0.37 / 0.43 / 0.72 / 0.93 / 0.97 3.00 / 0.53 1.15 / 0.52
sign off, the floor beside it 2.94 / 2.53 / 1.66 / 1.12 / 1.05 12.7 / 1.56 0.73 / 0.46
sign on, the floor beside it 0.35 / 0.48 / 0.76 / 0.95 / 0.97 7.28 / 0.84 0.80 / 0.43
  • The live view's largest fault found so far: a lamp switched off leaves its pool on the wall for seconds, 11 times too bright after 8 frames, 3.3 times after half a second, still 17 % after 4 s, in blotches. The excess falls as 1 / k: the diffuse history is cut once, on luminance, when its fast mean leaves the slow one, and what the cut leaves still holds the old light. Closed below ("The fast-history clamp").
  • The question #39 left: the radiance cache's 4 frames while the lighting is live. At 32 frames the bounce follows later (lamp off: 2.24 for 1.66 at 32 frames, 1.38 for 1.12 at 128; lamp on: 0.50 for 0.72, 0.79 for 0.93). The 4 frames buy what they were said to and stay; the 0.16 ΔE they cost a scene at rest is the price.

The fast-history clamp (2026-11-13, after it). [Removed 2026-11-24: this passage described an earlier implementation that has been replaced; docs/PROVENANCE.md. The measurements below are that implementation's.]

edit, region 8 frames: before → now 32 frames 128 frames a view with no memory, 32
lamp off, its pool 37.2 → 24.0 15.2 → 3.05 3.48 → 0.72 0.50
lamp off, its bounce 6.77 → 6.07 3.38 → 1.32 0.73 → 0.40 0.45
lamp on, its pool 5.68 → 5.12 1.92 → 1.10 0.62 → 0.51 0.43
lamp on, its bounce 6.65 → 6.63 3.00 → 2.73 0.81 → 0.77 1.15
sign off, the floor beside it 23.4 → 15.6 12.7 → 4.72 3.07 → 1.16 0.94
sign on, the floor beside it 18.3 → 12.3 7.28 → 3.77 1.52 → 0.93 0.80
  • Elsewhere: the Bistro slice half a second after its explosion 6.02 → 5.76, at rest 2.82 → 2.83; bench-ghosting (both scenes), Bistro and Thames held still and the fire shot as before (where the lighting is not live the clamp does not run). test-render 187 pass. dtemporal 0.22 → 0.25 ms on the slice.
  • What was tried and left out, each measured (out/liveq/gpu-runs-std.md, A0–A10, B1–B8):
    • what the code seemed to say (the slow mean set to the fast one at a cut; the test waiting for 6 frames): taking both away changed little (the pool 2.7 times too bright at half a second for 3.3);
    • the clamp on luminance alone, a pixel's or the neighbourhood's: the luminance follows and the colour does not (a pink floor after the sign: ΔE 9.6 at 32 frames);
    • a band of 2 standard errors: the edits a little closer (the pool 2.78 for 3.05) and the slice at rest 0.10 worse (2.92: it finds noise);
    • the clamp alone, without the cut by luminance: 0.23 better again at the explosion, 0.11 worse at rest.
  • Left: the first 8 frames (the fast mean itself takes a few frames); the bounce, which is the radiance cache's memory (the raw samples' own luminance 8 frames after the lamp goes: 1.31 on the floor); 3 to 6 times the ΔE of a view with no memory at half a second. The long history on a settled scene is untouched: nothing measured here speaks against it.

The upscaler's tolerance from the samples' own flicker (2026-11-13, after it). The Tokyo clip of the site's reel (the afternoon into night in ten seconds, the camera still) showed every roof and the tower outlined in the sky of seconds ago, a glow ten pixels wide. The raw samples and the denoiser's accumulations are clean there; it is the upscaler's history. judge holds each traced sample against the range of the history's nine pixels around its point, and allowed it half that range outside (a point against means: detail finer than a pixel). The allowance was measured on the history it judges: beside a roof the range runs from the roof to the old sky, so the sky could dim by half of that unseen; the pixel left behind widened the range of the next, and so outward. With the verdicts off the clip is 15 times too bright (a 16-sample blend under a sky that falls 4 % a frame), which is what the outlines were.

  • The allowance is the samples' now (Flicker, kept by compose in the two words the fast mean's buffer had free): how much the composed sample at a surface changes from frame to frame under the jitter, as a share of its level; 2 deviations of it outside the history's range are allowed. The deviation is of the second difference (a steady rise or fall has none), read where the surface was a frame ago, added to and kept by how still the pixel is (none from a pixel a frame on: a pixel that moved earns it again at rest), and a frame counts for 4 deviations at most (a light switched does not earn tolerance). UE's TSR keeps the input's flicker over time for the same decision.
  • Tokyo at dusk, the real-time frame against the same moment held, ΔE / p99 over the skyline at 6, 7, 8 s: 3.82 / 37.6, 3.13 / 37.3, 1.51 / 26.2 → 2.05 / 11.0, 0.93 / 8.3, 0.42 / 5.0; the whole frame 2.70, 1.46, 0.84 → 1.54, 0.70, 0.55. (A session of this clip lands in one of two states a few tenths apart, the same build either way: nothing finer than that is read from it.)
  • Elsewhere, main → now. Held still at 1440p against offline (ΔE; frame to frame): Bistro at 0.5 1.93; 0.54 → 1.85; 0.46, Kabukichō at 0.375 4.98 → 4.85. bench-ghosting, ΔE against each build's converged frames: Bistro settled 0.98 → 0.82, turn 2.33 → 2.22, strafe 2.85 → 2.66, a tenth of a second after the stop 2.63 → 2.48; Kabukichō 1.30 → 1.25, 3.63 → 3.53, 4.26 → 4.01, 3.81 → 3.50 (lower in every shot and region of both). The orbit of Thames against offline: detail 0.52 → 0.57 moving, ΔE 1.51 → 1.34 held. The fire shot's box 6.28 / 5.56 / 3.66 → 5.99 / 5.15 / 3.45; the Bistro slice half a second after its explosion 5.76 → 5.28. The lighting-edit shot as it was or a little under (the lamp's pool at 32 frames 3.05 → 3.02, lamp on 1.10 → 0.99). compose + judge 0.78 → 0.90 ms at 1440p output. test-render 188 pass (upscale/dimming-behind-edge-live: main 1.395 of 1 ± 0.1).
  • What was tried and left out, each measured (out/liveq/gpu-runs-std.md, U1–Z2, F1–J14):
    • no allowance at all: Tokyo as good, a still Bistro three times the flicker (frame to frame 0.54 → 1.57);
    • half the range on each side by that side's own spread: the outlines stay (any measure taken from the history feeds itself);
    • verdicts averaged among samples of the same depth and weighted by how narrow their range was: a tenth off the outlines;
    • the history clamped into the frame's nine samples always (a TAA's rule): the outlines go, and the rest of the frame pays (p99 17.2 for 9.7);
    • the deviation of the first difference: a dimming sky counts as flicker (Tokyo's skyline 1.75 at 7 s, above either state of 1.06 / 1.44); in absolute light, with a switch counted in full: the lamp's pool twice as far off at 32 frames (7.37); read at the place on screen, in motion too: the ground after a strafe worse than main (Kabukichō 2.79 → 3.02);
    • 1 and 3 deviations: Bistro's frame to frame 0.49, 0.38 for 0.42 at 2; Tokyo's skyline p99 at 3 the highest.
  • Left: the pixel at the silhouette itself (in the test, the first pixel beside the edge reads 2.3 times the wall, the second 1.2; in Tokyo a rim one or two pixels thin). That is not the allowance: the sample there lies within a range that runs from the roof to the sky whatever is allowed outside it, and the samples beside it lie between their own history and the stale pixel. Holding still, nothing holds a history pixel against the samples.

Lamps finer than a pixel: the thin feature's lock (2026-11-13, after it). Dragging the view over Tokyo at night, the tower broke up: its legs and most of its lamps gone while the camera turned, back half a second after it stopped. Measured against offline renders, two faults of the upscaler, both older than the change above:

  • Held still, a field of lamps a third of a pixel wide kept a third of its light (0.035 of 0.103). judge takes a surface for gone from in front when what was nearest among the nine samples a frame ago is nearer than what is nearest now and the history's colour is not in this frame; a lamp the jitter hit last frame and missed this one is exactly that, and its history was dropped every frame it was missed.
  • In motion the history is clamped into the frame's nine samples, and a lamp none of them hit is outside them: the tower in a turn lost a quarter of its light (the 4-sample cap in motion is not it: without it nothing changed).

The remedy is the one FSR 2 (pixel locks) and UE's TSR (thin geometry detection) have: where the picture is a thin feature, the rules that hold the history to this frame's samples stand back. Lock in live.wgsl, a half word per traced pixel that the fast mean's buffer had free:

  • made by compose where the sample's emission is thin: no 2 × 2 block of the nine like it (FSR 2's rule), and above or below both of some pair of opposite neighbours; a jitter sequence long, carried with the surface; none on animated shading;
  • in motion a locked pixel's history is clamped into the frame's nine samples only in part (LOCK_RELAX 0.75 of it spared a frame: the lock of any of its nine samples), a locked sample's distance from the history's range is no finding, and nothing is gone where one of the nine is locked.
main now offline
lamps field held still, mean radiance 0.035 0.106 0.103
the same, the camera sliding 1.4 px a frame (see below: this does not exercise the motion clamp) 0.027 0.112 0.103
Tokyo Tower in a turn (0.25° a frame), ΔE / SSIM / luminance against offline 2.81 / 0.867 / 0.77 2.17 / 0.919 / 0.80
Tokyo Tower in a quick orbit of the play window (1.15° a frame about a point 50 m ahead) 5.06 / 0.808 / 0.71 4.15 / 0.872 / 0.86
the tower settled after the turn 1.48 / 0.962 / 0.94 1.39 / 0.965 / 0.99
  • The share spared in motion. All of it (the first form) kept the tower whole in the slow turn (2.23 / 0.928 / 1.05) but, in the play window's quick orbit, drew its lamps out sideways and doubled its beacon (4.86, luminance 1.20): a lamp the samples miss reprojects with what is behind it, and a spared history was a second copy. 0.5: 4.47 / 0.69; none above 16 px a frame: main again (5.11 / 0.56). TSR likewise caps how far it loosens its clamp.
  • What it costs, main → now. Where a view translates past emitters the locked ones trail a little: Kabukichō's signs strafe 6.42 → 6.55, a tenth of a second after it 5.27 → 5.39 (trail 26 → 29 px), at the dolly's stop 6.75 → 6.96 (its ground the same to 0.01); Bistro's whole frame a tenth of a second after a strafe 2.49 → 2.54 (trail 13 → 18 px), else within 0.03; the Bistro slice half a second after its explosion 5.28 → 5.40; the orbit of Thames moving 2.24 → 2.16 (trail 33 → 31 px), held 1.34 → 1.39. bench-ghosting passes on both scenes. Held still: Bistro 1.85 = 1.85 (frame to frame 0.46 → 0.44), Kabukichō 4.85 → 4.86. Tokyo at dusk the same in the mean, the skyline's p99 at 6 s 11–14 → 16–18 (lamps coming on). The fire shot and the lighting-edit shot as they were. compose + judge + upscale 1.73 → 1.80 ms at 1440p output. test-render 190 pass (upscale/lamps-still-live, upscale/lamps-in-motion-live: main fails both). The moving test reads the same with the motion clamp on, off or relaxed (test-render's live path; the cause not found): it guards the camera moving from a frame script, not the motion clamp, which the Tokyo shots above measure.
  • A lamp switched off fades over 4 to 8 frames at full resolution where main drops it at once (a lamp is sampled about once a jitter sequence, the lock's life: nothing tells sooner that it is off).
  • What was tried and left out, each measured (out/liveq/gpu-runs-std.md, K1–X9):
    • variance clipping: a lamp no sample hit is outside any box made of this frame's samples;
    • FSR 2's test on the composed sample: a traced frame carries more than 5 % of noise from sample to sample, most of Kabukichō was "thin", the clamp was off everywhere and the wet street's reflections trailed 78 px for 53; on the sample less its specular part: the same. The test is on what the camera ray saw directly, which has no noise;
    • FSR 2's ridge rule (brighter or darker than every sample unlike it): lamps strung a pixel apart have a brighter neighbour more often than not, and the tower's legs stayed unlocked;
    • the lock of the nearest sample alone: a lone lock is a traced pixel off its lamp half the time;
    • the lock in motion only: after the stop the tower was 7 % too bright for half a second again;
    • gone only where the two depths moved against each other on screen: right for a lamp, wrong for this engine, where a wall blown out uncovers what is behind it with nothing moving (the slice 5.28 → 5.66);
    • the lock ended by depth where something nearer stood a frame ago: that is the test the lamp fails;
    • FSR 2's release of a lock on a change of the scene (its UpdateLockStatus: a coarse mip of the frame's log luminance, the lock killed when it changes by more than 0.1 of its sixth root; the same change as a reactive factor): no effect on any shot here, nor on a probe made for it (lamps on a wall whose light goes out). FSR 2 and TSR take the raw rasterised frame; this upscaler sits behind a temporal denoiser, a change of lighting reaches it over frames and is the denoiser's to follow (the fast-history clamp above).
  • Left: thin things that do not emit (a wire, a lattice by day) are still taken for gone under the jitter; the locked lettering of a still sign comes back from a motion's blur by the blend alone (the 0.2 on Kabukichō's signs); a lamp that comes on arrives over a quarter of a second.

The measurements into the repo (2026-11-13, after the cleanup). What the window's quality work of these weeks was measured by lived in scratch scripts; now tools/bench-window.ts (the still frames, the Bistro slice, Tokyo at dusk, Tokyo turning and orbiting as the play window's left drag does, each against offline), tools/render-identity.ts (the byte gate for changes that must not change a picture) and an orbit move in bench-ghosting (reported, not yet guarded). On the way: the moving lamps test (upscale/lamps-in-motion-live) never exercised the motion clamp. Its lamps float before the black sky, a sliding camera does not move the sky, and a lamp no sample hit takes the velocity of what is behind it: the upscaler saw no motion. Before a black wall 1 cm behind, the lamps keep 0.045 of their 0.1 in motion as merged (no clamp at all: 0.105; before the lock: 0.014). The test changes with the fix of its cause (a missed lamp reprojected by its own depth), so that main does not carry a failing test meanwhile.

Cleanup: experiments and switches that outlived their measurement (2026-11-13, after it). Removed, each off by default, so nothing a scene shows changes:

  • the temporal pass's two round-3 experiment switches (THREERT_TEMPORAL_FLAGS 1: the à-trous stages gated by history length alone; 2: the specular filter on mirror-like surfaces too) and the flag word that carried them;
  • the emitter-reservoir experiment (THREERT_RESTIR, ReSTIR DI at camera hits; measured above: k = 1 0.608 → 0.613, motion +0.1 ΔE, +0.44 ms): its kernel code, the reservoir buffer (group 1, binding 4: the kernel binds 19 storage buffers as written, the merged layout's MergedLive six arrays) and five vec4 of Params;
  • THREERT_NO_MV (no per-object motion vectors), THREERT_LT_DYNAMIC=0 (emitters added in place by power share; bench-voxel-light's third row goes with it), THREERT_EMIT_SYNC, and the overrides of three constants (THREERT_EMITTER_CULL, THREERT_EMITTER_CULL_VIEW, THREERT_LIGHT_LOD).

Kept: the switches the benches and tests use (THREERT_PROFILE, _PROFILE_BLAS, _FREEZE_TIME, _EXPOSURE_SNAP, _NO_GRAIN, _MOTION_BLUR, _EDIT_REBUILD, _INSTANCING), the diagnostics (_EDIT_LOG, _VIEW_MODE, _TL_HIDE, _CACHE, _CACHE_FLAGS), and two that are configuration (_GOVERN_CLOCK; _RASTER, the primary-visibility path kept for devices without hardware ray tracing). Check: test-render, every output a run repeats to the byte, is byte-identical to the build before; with THREERT_MERGED=1 one volume test differs at a relative 2e-6 (the kernel is compiled from a shorter source).

Not done here: filters sized by hit distance, which is what would let a short history stand without noise; the Playground and the page still open a 1280 × 720 view; the live buffers are sized by the output (about 1.7 GB at 2560 × 1440), though the traced grid rarely fills it.

The live passes' buffers by what they hold, and live.rs in files (2026-11-13, after it). The live passes' state had grown by reuse: a pair of buffers named alb held the diffuse fast mean, the upscaler's flicker and lock and judge's findings over one another; the output colour history sat behind the traced grid's diffuse history in one buffer; velocity had a ping-pong partner nothing read; the g-buffer was allocated at twice what it holds; every pair was swapped by binding the other of two bind groups. Now what lasts from one frame to the next has a buffer of its own, named for what it holds, in two halves (this frame's and the last; LiveParams.state says which is which): diffuse_hist, diffuse_mom, diffuse_fast, spec_hist, gbuffer, up_state, color_hist; the transients that share a buffer are listed at the top of live.wgsl with who uses each when. The upscaler's state is one vec4<u32> a pixel with half of z and all of w free: the lock's depth (the fix the moving lamps wait for, above) goes there. Storage bindings 28 → 24, one bind group, 16 bytes a pixel less (59 MB at 1440p); the merged layout binds 21 live buffers. live.rs (4,931 lines) is now live/: mod.rs (LiveCore, its settings, camera, governor, readbacks), targets.rs (pipelines, buffers, bind group), load.rs (a scene loaded, the sky's and emitters' workers), edits.rs (edits in place), frame.rs (one frame), session.rs (the headless runner); no code changed by the move.

Checks: render-identity, native and THREERT_MERGED=1, two runs a side and four on what it flagged: nothing changed, by the buffers or by the move. bench-window (still-bistro, tokyo-turn): within a run's spread with the radiance cache on; with it off 0.03 ΔE between frames against main's 0.01 to itself (a shader compiled from other source rounds differently). The live passes 6.27 → 6.13 ms (Bistro, 1440p at 0.375). On the way: render-identity confirms what it flags on four more runs a side, and leaves out a confirming run without an output (the geometry/grow-live test sometimes fails before its picture: its frame script, adding 1,100 objects, runs past the script's time).

Thin-feature locks carried by their own depth, and spared only at the lamp (2026-11-14, after it). A lamp finer than a pixel that no sample hit this frame went with what was behind it: its lock moved with the background, its history was read where the background had been, and the sky a lamp passed over kept its light, which nothing there contradicted (the history's pixels around a sparse lamp are dark too, and the test for something gone from in front read the g-buffer, where the samples had mostly missed the lamp). The clamp in motion, spared by 0.75 over the nine traced samples around a lock (LOCK_RELAX, #60), bounded the copies. Now (live.wgsl Lock):

  • the lock keeps the view depth of what it is for and where in its traced pixel that is, and a pass before compose (lock_carry, over the previous frame's traced grid) takes each lock to where its point is now, by the two cameras, onto the traced sample it falls in (an atomic max: the longest-lived wins; lock_fwd, per traced sample; in the merged layout it and the exposure histogram share a new atomic slab);
  • in judge a live lock nearer than the samples is a candidate for the nearest surface among the nine, with the motion of its own depth, so the history around a missed lamp is read where the lamp was;
  • lock_carry writes the previous frame's locks' depths into the previous g-buffer half, which only judge's test for something gone reads by then; that test is barred by any live lock among the nine (it was: a lock at half strength, which let a still lamp's own history go at the end of its lock);
  • in motion the clamp spares the history in full within LOCK_REACH (1 output pixel, the reconstruction's reach) of the locked thing and nowhere else: LOCK_RELAX is gone.

Measured against offline (bench-window, the play window's left-drag orbit and a turn, the tower's region at the last moving frame, ΔE / SSIM / luminance): orbit 4.30 / 0.843 / 0.99 → 3.90 / 0.865 / 0.97, turn 2.12 / 0.914 / 0.84 → 2.01 / 0.926 / 0.92, better at every moment until settled, the whole frame too (orbit 2.40 → 2.32, turn 2.55 → 2.44). The reach brackets the truth: 0.5 pixel 4.31 / 0.73 (the lamp's own light cut), 1.5 pixels 4.17 / 1.17 (the halo the history's resampling spreads around a lamp kept). The depth alone, with the old spare, gave 4.14 in the orbit and nothing in the turn; spared in full over the nine the tower was too bright even in the turn (1.10), where nothing moves against what is behind it. A new test, upscale/lamps-parallax-live (lamps sliding before the black sky, which the slide does not move: the light beside the field's edge): main 0.357 of the field's mean, now 0.075 (tolerance 0.1: the rest is the gone test's narrow window, in the test's note). Unchanged: the still shots, the Bistro slice, bench-ghosting on Bistro and Kabukichō (today's main and the branch alike to the last digit), Tokyo at dusk (its 6 s skyline reads 1.70 or 2.31 on either build from one session to the next). Cost: +0.10 ms on Bistro at 1440p and 0.375 (compose, judge, upscale and lock_carry 0.07; alternated, three runs a build; the perf smoke's +1.2 ms was its two levels: the unchanged trace read the same when alternated).

upscale/lamps-in-motion-live is gone: it measured the mean light of lamps sliding before the black sky, which main passed by its trail (the light the lamps left on the sky made up the mean); with the trail gone it reads 0.066 for 0.1. What it was for is open (Known issues: lamps in motion keep half their light).

A sample's noise is no finding against the upscaler's history (2026-11-29). Where a scene's light is sparse (the lit end of a night street, a hall of small lamps and glossy machines) the upscaled picture sparkled in motion, and MetalFX's temporal upscaler given the same denoised frames did not. The measure is the change of the picture's 4 × 4 block means from one frame to the next (luma of 255; blocks, so that neither a pixel's own noise nor the picture's sharpness reads as flicker), beside the scene's own change, which two offline renders a frame apart give (each with two sample sequences: the mean of their product is the change without the renders' noise). At 960 × 540 and half resolution on an M4, built-in / MetalFX / the scene: the street with its crowd, the camera drifting, 1.39 / 0.50 / 0.54; the hall 1.20 / 0.63 / 0.52; a still room of lamps 0.043 / 0.50 / 0. MetalFX's picture is not the softer one (0.54 of offline's detail on the street for 0.51).

Where it comes from, one thing changed at a time: not the history's length in motion nor its clamp (UP_MOVING 16, the clamp off, both: within 3 %), nor animated shading's bound. With every sample four times over (at full resolution, or four a frame) the street reads 0.91, with sixteen 0.68: it is the samples' noise. With reject's correction and drop both off, 0.47 on both: the noise comes in through judge and reject. A path tracer's sample lies outside the range of the history around its point by its noise, a bright one by more than the range, and reject took the mean of the nine nearest for a change from about one standard error.

  • reject takes the mean over 5 × 5 samples (binomial weights) and counts it by its own standard error: not under 2 (UP_FINDING), in full from 4 (UP_CERTAIN). judge's distance of a sample from the history's range stays: the sample less the history's mean around it, tried first, differs by the jitter over whole regions at once, and the still room read 0.50 for 0.043.
  • While the scene's lighting changes a history holds 8 samples (UP_LIVE) for 16, as the denoiser's histories are bounded then (HISTORY_LIVE), and 16 at a thin feature's lock. (The same bound for every history that is resampled, tried first, made a wall behind lamps finer than a pixel change a fifth more than before.)

Before → after: the street 1.39 → 1.01, the hall 1.20 → 0.85, the room 0.043 → 0.033; their detail against offline 0.506 → 0.498, 0.687 → 0.681, 0.838 → 0.837. Eleven clips against offline: ΔE the same or less on each (a city through an afternoon in ten seconds 2.32 → 1.91, the street 3.48 → 3.41, the hall 3.33 → 3.24); whole pixels' change from a frame to the next 2.08 → 1.55 on the street, 2.04 → 1.64 in the hall, 0.44 → 0.20 behind glass, 0.31 → 0.24 walking through a gallery, 0.46 → 0.49 in the city's afternoon. bench-ghosting --quick --check: every check as before or better (turn 0.85 → 0.80, strafe 1.36 → 1.30, after the stop 1.32 → 1.33). bench-object-ghosting: fifteen of sixteen moments as before or better, the thrown lamp 0.3 s after its stop 1.95 → 1.98. bench-temporal --shot edit: the same frames to settle on every row. Frame time, the two builds alternated: from 2.2 % less to 0.8 % more over twelve clips.

The thresholds are a trade. At 3 and 6 the street reads 0.63 and the hall 0.67, and what a moving object leaves behind is 5 to 18 % more (a thrown lamp's trail 105 pixels for 59 a tenth of a second after it stops); at 2.5 and 5, 0.76 and 0.72 for 1 to 9 % more; at 1.5 and 3 the street reads 1.61. Not done: a change keeps its sign from frame to frame and noise does not, so evidence gathered over frames would tell them apart where one frame cannot; and a mean over larger regions would find a change that is slow and everywhere (that afternoon's light), which the bound on the history only contains. Test: a_noisy_picture_holds_from_frame_to_frame (thirty-six lamps a centimetre wide before a wall, the camera drifting: the 4 × 4 means change 1.45 steps a frame before, 1.10 now). Not checked on Vulkan.

The samples' noise that is left is direct light; a camera hit's resampled lights in a pass of their own (2026-11-30). What the two night clips' change still holds was located by switches that take one part of a path sixteen times over and leave the rest (in a clone, none of them merged; the measure and the conditions above; one keyframe pair, which another random sequence alone moves by about 5 %):

as it is the camera hit's direct light (its sampled lights, the emitters its BSDF ray finds) the sampled lights of the vertices past it whole paths the scene
the street with its crowd 1.02 0.66 0.99 0.62 0.54
the hall 0.85 0.89 0.68 0.64 0.52
the still room 0.033 0.033 0.022 0.029

It is direct light in both: the street's at the camera hit, the hall's at the vertices after it (what a reflection shows, the radiance cache's points). Light of more bounces is a few percent of either. Two ways of asking that do not answer, tried first: the denoised signals taken apart before the upscaler (under sixteen paths a pixel their own change falls 5 to 13 %, the picture's 25 to 39 %: before the upscaler the change is mostly the jitter's), and tracing at full resolution for the camera ray's share (the filters are then narrower in the picture: the hall and the room read more).

  • Not merged: more of the light tree's candidates at the vertices past the camera hit, which take one draw where a camera hit resamples 8. With 4 / 8 / 16 there and the one shadow ray the hall reads 0.76 / 0.69 / 0.67, all that sixteen shadow rays gave, and its ΔE goes 3.24 → 3.00. But with 8 a city into the night, a room of neon tubes and a colour lab pay 6.3 / 6.2 / 4.4 % of a frame for pictures that do not change: a candidate is a descent of the tree, a triangle read and a BSDF. At the cache's points alone the hall reads 0.74 for 2.2 to 2.5 % of those frames; at a reflection's hit alone 0.80 for 2.3 to 4.5 %. More candidates there have to cost less than a descent each.
  • The camera hit's resampled lights in a pass of their own (direct; docs/RUNTIME.md "The live architecture"): the emitters and the local lights past those summed exactly, lit after the paths at the surface they leave, by the same estimators. The pictures as before on twelve clips; a frame's GPU time: a night street with its crowd −14.3 %, a city into the night −7.2 %, a hall of small emitters, a room of neon tubes, a colour lab and a gallery −4.1 to −4.2 %, a jeweller's window −1.3 %, a still room of 768 lamps +1.4 %; four without such lights, or with theirs off by day, 0.0 to +1.5 %. It is the split that was left on 2026-11-07 (§ 1 "Tried 2026-11-07, not merged": a district +4 %), taken now only where a scene has something to resample: with every sampled light in it a sunlit garden paid 8.8 %, a house by day 8.6 %, a softbox over glass 5.8 %. It is also where samples kept from frame to frame and shared between pixels would run. Whether those earn their place is not measured: the sixteen- times figures are ceilings, and the one experiment of the kind here (2026-11-06, removed 2026-11-13) gained nothing by its measures, before the light tree. Unit suite 292, render suite 273; bench-ghosting --quick --check, bench-object-ghosting and bench-temporal --shot edit as before. Test: a_camera_hits_lights_in_their_own_pass_are_the_paths (a wall under thirty-six small lamps and fifteen point lights: the pass's picture 0.02 steps of 255 from the paths' own, at the view's size and at half of it, under both traversals). Not checked on Vulkan, nor in a browser.

A finding against the upscaler's history takes two and a half standard errors; the picture while the camera moves (2026-12-01). The clips those thresholds were chosen on hardly move their cameras: one drifts half a metre a second without turning, and the others stand. What the picture does under a player's camera was measured apart, on an M4 at half resolution.

Not the samples. bench-ghosting --quick (Bistro at night, mean ΔE of the whole picture against the converged frame of each pose): settled 0.72, mid-turn 2.04, mid-strafe 2.45, a tenth of a second after the orbit's return 3.15, as the camera stops from 8 m/s 2.54. With a camera hit's sampled lights sixteen times over (a switch in a clone, as above) 0.43, 1.64, 1.85, 2.21, 2.17; with every sampled signal sixteen times over 0.33, 1.49, 1.72, 1.85, 2.06. What a move adds over the settled frame hardly changes (mid-turn 1.32 → 1.16, mid-strafe 1.73 → 1.39, the stop 1.83 → 1.73): in motion the error is the reconstruction's. The same bench under MetalFX's upscaler given our denoised frames and under MetalFX's denoiser, each against its own converged frame: settled 0.84 and 1.16, added by the turn 1.14 and 0.89, by the strafe 1.48 and 1.13, by the stop 1.53 and 1.11.

What is seen. Two scenes recorded frame by frame in lockstep at 60 frames a second (1280 × 720) while the camera plays that bench's moves in the scene's own time (a turn at 40° a second, a strafe, an orbit, a stop from 8 m/s) and then a path of the scene's: Bistro at night, nothing in it moving, and the hall of machines, its 551 parts moving throughout (its moves start three metres into the room with a strafe of 1.5 m: the camera's first pose stands in a passage). The measure of the entry above, the change of the picture's 4 × 4 block means from a frame to the next, over spans in which the camera stands still, so that the scene's own change is the same under every method: built-in / MetalFX's denoiser / MetalFX's upscaler.

before any move the six frames after the turn after the strafe after the stop
the street 0.18 / 0.35 / 0.30 0.63 / 0.64 / 0.38 0.92 / 0.77 / 0.48 1.00 / 0.62 / 0.44
the hall 1.65 / 1.30 / 1.22 1.95 / 1.68 / 1.13 2.78 / 1.88 / 1.88 2.38 / 1.83 / 2.16

Against offline renders of the same instants from the same cameras (the hall, 1024 samples), in that order: mean ΔE with the camera still 3.92 / 3.79 / 4.01, mid-turn 4.81 / 4.71 / 4.88, mid-strafe 4.92 / 4.98 / 4.98, as the camera stops 5.66 / 4.85 / 5.67 and a tenth of a second on 5.25 / 4.23 / 5.31; of their detail the picture has 0.59 / 0.67 / 0.60 still, 0.46 / 0.53 / 0.48 mid-turn, 0.30 / 0.35 / 0.34 as the camera stops. In the hall in motion the built-in picture is as near the offline one as the others' but for a sudden stop, changes the most from frame to frame, and is the softest. What a moving object leaves behind with the camera still (bench-object-ghosting, mean ΔE / trail in pixels), in that order: a dragged device as it stops 1.79 / 29, 5.50 / 262, 1.52 / 27; a thrown lamp 6.91 / 259, 23.75 / 962, 6.52 / 286; a runner 0.46 / 30, 3.75 / 308, 0.57 / 27. MetalFX's upscaler does not pay for its steadiness there; its denoiser leaves long trails (whether that is the denoiser's or an input it is not given was not looked into).

Which rule, one thing changed at a time (in a clone) and both scenes recorded again: a moving pixel's history of 16 samples for 4 (UP_MOVING) changes the spans after a move by 1 to 7 % and takes detail (the hall mid-turn 0.462 → 0.441); 16 for 8 while the lighting changes (UP_LIVE), 0 to 2 %; no clamp of a moving pixel's history, 0 to 8 %. reject's thresholds at 3 and 6: the table's spans 35 to 51 % less on the street and 22 to 33 % in the hall, as steady as MetalFX's upscaler. It is the rule the still clips found, with more to gain in motion.

  • UP_FINDING is 2.5 and UP_CERTAIN 5. The street before any move 0.18 → 0.13, after the turn 0.63 → 0.43, the strafe 0.92 → 0.63, the stop 1.00 → 0.67; the hall 1.65 → 1.41, 1.95 → 1.52, 2.78 → 2.25, 2.38 → 1.96. Against the offline renders of the hall's moves ΔE is within 0.05 at each of nine moments and the picture has 1 to 5 % less of their detail. The three clips of the entry above read 1.04 → 0.75, 0.85 → 0.72, 0.033 → 0.025, their detail 0.497 → 0.485, 0.681 → 0.677, 0.837 → 0.835.
  • What it costs. A moving object leaves 3 to 12 % more behind over bench-object-ghosting's sixteen moments (5.9 % in the mean), its trails as long to within five pixels but for the thrown lamp's as it stops (259 → 275). A light that changes slowly and everywhere is found later: a city through an afternoon in ten seconds reads ΔE 1.91 → 2.04 against offline, and a garden in wind 0.79 → 0.80; the nine other clips with an offline picture are as before or nearer (a house at golden hour 2.89 → 2.86, the hall 3.24 → 3.22). Whole pixels' change from a frame to the next falls on the street 1.57 → 1.23, in the house 1.61 → 1.26, walking through a gallery 0.24 → 0.21, behind glass 0.20 → 0.17, in the hall 1.63 → 1.49, in the still room of lamps 0.078 → 0.071, and by up to 3 % elsewhere; detail is 0 to 0.012 less. Frame time from 0.8 % less to 0.4 % more over twelve clips. bench-ghosting --quick --check passes (after the stop 1.34 → 1.40); bench-temporal --shot edit: the same frames to settle on every row. Unit suite 292, render suite 273.
  • At 3 and 6 a moving object leaves 6 to 22 % more (11.2 %) and the lamp's trail a tenth of a second after its stop is 95 pixels for 64.

Not done. MetalFX's upscaler is as steady as 3 and 6 make this one, without what they cost and with more of the detail: the difference is in what the judging can tell apart, not in where its threshold stands. And at a cut into a view whose lights have just dropped (the hall's loop starting again) every method's first frame is 3.5 to 3.7 times too bright against offline and 2.6 to 2.7 times a tenth of a second on, a denoiser that reads the noisy signal itself included: that is before reconstruction, and was not looked into. The recordings and their measures were made outside the repository. Not checked on Vulkan, nor in a browser.

Which of a reflection's two histories counts is not the frame's samples' to say (2026-12-02). The entry above measured what the picture changes by while the camera moves; this one, the light it holds. The same two recordings (the street at night, the hall of machines; an M4 at half resolution), each frame's display-linear luminance over the offline render's of the same instant: the street 1.00 standing still, 0.97 mid-strafe, 1.02 as the camera stops from 8 m/s; the hall 0.90, 0.85 and 0.87. The hall loses light while the camera moves through it.

Where it goes. The hall's frames taken apart, linear sums against the offline render's, without what the camera ray sees directly (its lamps are hundreds of times the frame's mean, and white on the display either way). The kernel's samples hold the same share of the offline light moving or still (0.90 to 0.99). The histories hold all of the samples' light standing still and 4 to 10 % less in a move. Most of that is the specular signal: 0.86 of the offline one standing still, 0.73 mid-strafe, 0.84 at the stop, 0.76 along the camera's own path, and with no specular history at all in a move 0.92, 0.89 and 0.83: the history held less light than the samples it was made of. It is not the upscaler: its output against its input, 8 × 8 block means compressed as a display compresses them, is within 2 % in every one of those frames, with or without the clamp of a moving pixel's history.

Why. In a move stemporal reads a reflection's history in two places, where the surface point was and where the reflected image was, and each counted by what the roughness says of its place times exp(-e²), e its distance from the mean of this frame's nine samples around in bands of their deviation. One path a pixel is heavy-tailed: nine samples of a reflection that comes by rare bright ones are mostly dark, so of two histories the darker lay nearer them and won, frame after frame.

  • The two count by the roughness alone, the reflection's being a history that was found at its place on surfaces of this normal and roughness; the nine samples' statistics are read only where a history is held to them (animated shading). The hall's specular signal mid-strafe 0.73 → 0.87, at the stop 0.84 → 0.95, a tenth of a second on 0.86 → 0.92, along its path 0.76 → 0.82; standing still and mid-turn as it was (0.86, 0.82: without parallax there is one history). The frame's light mid-strafe 0.85 → 0.89, mid-orbit 0.86 → 0.90, at the stop 0.87 → 0.95 and a tenth of a second on 0.86 → 0.92; how unevenly that ratio lies over forty tiles of the frame, 15 to 26 % less in those; ΔE against offline 4.94 → 4.82, 4.98 → 4.94, 5.67 → 5.64, 5.28 → 5.20 (eight seconds along the path 4.04 → 4.10).
  • What it costs: the hall's change from a frame to the next over the six frames after the stop, 1.97 → 2.04 (after the strafe 2.27 → 2.21).
  • Nothing else measured moved. The street's recording: its change from frame to frame, its detail and its ΔE the same at every moment. bench-object-ghosting: its sixteen readings (the thrown lamp's trail a tenth of a second after its flight 84 → 74 pixels). bench-ghosting --quick --check: its five within 0.02. bench-temporal: the water and the lighting edit to the last digit (a still camera has one history), the street's dolly 1.99 / 2.04 / 2.00 / 1.59 → 2.01 / 2.06 / 1.96 / 1.58. bench-window's turn and orbit over the city against offline: twenty rows the same to 0.01. Twelve clips against offline: eleven within 0.01, a turntable of jewellery ΔE 2.34 → 2.37; frame time 0.0 to 0.7 % more. Unit suite 292, render suite 273.

Also found, and left as it is. The street's walk passes potted bushes and a hedge that read 0.65 to 0.79 of the offline render's light, and still do after the camera has stood there for eight seconds: not motion, and not a history. It is the live kernel's A_CUTOUT_EMITTERS (docs/RUNTIME.md "How live differs from offline": cutouts are opaque to emitters' shadow rays, so leaves shade each other as whole cards). With that bit off they read 0.97 and 0.99, for 18 % more of the frame at the street's first view and 24 % over the walk (15.5 → 18.3 and 16.7 → 20.6 ms). The firefly cut on a young diffuse history takes 4 to 5 % of the hall's diffuse light as the camera stops (0.85 → 0.89 without it) and 1 to 2 % elsewhere. The specular signal mid-turn (0.82 for 0.86 standing still, 0.89 with no history) is not explained. The recordings and their measures were made outside the repository. Not checked on Vulkan, nor in a browser.

A history that moves is resampled with the Catmull-Rom kernel (2026-12-02, after it). In motion both denoisers fetched their histories bilinearly: the mean of four pixels at a new sub-pixel offset every frame, a blur that adds up over a history's length (the bounds on a moving history's length, moving_frames, are there for it).

  • Where the 4 × 4 pixels around the position, less the corners, all show this surface, the diffuse history (from the length at which it is fetched at its pixel's centre, 16 frames) and the specular one (from 8 frames, at either of its two places) are resampled with the Catmull-Rom kernel, held within the range of the four pixels around the position: the kernel's negative lobes ring at a steep edge. Elsewhere, and for the histories' lengths and moments, bilinearly as before. Standing still nothing is resampled and nothing changes.
  • Measured as the entry above and after its change (an M4 at half resolution). Of the offline render's detail the street's picture has mid-turn 0.451 → 0.458, as the turn stops 0.380 → 0.392, mid-strafe 0.454 → 0.461, stopping from 8 m/s 0.374 → 0.382, along its walk 0.351 → 0.364, 0.403 → 0.410 and 0.371 → 0.381; its ΔE at those moments 2.86 → 2.83, 2.61 → 2.54, 3.22 → 3.18, 3.61 → 3.60, 3.94 → 3.86, 4.07 → 3.98, 4.90 → 4.79. The hall: 1 to 2 % more of the detail in its moves (mid-turn 0.453 → 0.461, along its path 0.396 → 0.402), ΔE 0 to 1 % less, its light against offline 0 to 2 % more. The change from a frame to the next after a move: the street's 4 × 4 block means the same, the hall's 0 to 1 % less; per pixel 0 to 1 % more in both.
  • What it costs. Twelve clips against offline: eleven within 0.01 in ΔE; metals and gems on a turntable ΔE 2.37 → 2.32 with 4 % more of the detail (0.298 → 0.311), and their whole pixels' change from a frame to the next 1.35 → 1.46. bench-ghosting --quick --check passes: a tenth of a second after the stop 1.39 → 1.46, mid-strafe 1.31 → 1.28, the others within 0.02. bench-object-ghosting: ΔE the same at all sixteen moments; the thrown lamp's trail a tenth of a second after its flight 74 → 105 pixels at the same ΔE (3.67, 3.66). Frame time over the twelve clips from 1.4 % less to 0.3 % more. Unit suite 292, render suite 273.

Not done: the bounds on a moving history's length were set for the bilinear tap's blur and are as they were. Not checked on Vulkan, nor in a browser.

A cutout's map answers an emitter's shadow ray (2026-12-02, after it). The entry before the last found Bistro's potted bushes and its hedge at 0.78 and 0.71 of the offline render's light, moving or held: to an emitter's shadow ray a cutout was a whole card (A_CUTOUT_EMITTERS, a trade of 2026-11-09). With their alpha tested they read 0.97 and 0.99, for 18 % more of the frame at the street's first view and 24 % over its walk (an M4 at half resolution, as every figure here).

Where that cost lies. Bistro has 285,355 cutout triangles, a tenth of the scene; 3,195 of them have texture coordinates of their own (a few sprites, placed thousands of times). Their longest edge is 2,200 texels in the median and three fifths of their area is hole: whole branches on a card. A shadow ray through a crown crosses dozens of cards, mostly through their holes, and on the hardware path each hole is a new query from where the last one ended. Two measurements said otherwise before they were understood. A coin in place of the alpha's reads, the stepping kept, cost a fifth to a third of the test: but a coin stops a ray at its second or third card, which a real card's holes do not. And one query with the alpha tested in its candidate loop had saved nothing on 2026-11-16 (docs/RUNTIME.md). With maps in place of the reads and the stepping kept, the frame cost what the test costs (18.3 and 20.8 ms for 18.2 and 20.6). Both have to go: the reads and the queries.

  • The maps (renderer/src/cutout.rs). A cutout's triangle is laid over with a lattice of cells about two texels of its base texture wide, 4^7 at most (Bistro's cards: cells of 17 texels), and a cell's state is two bits: nothing there, all there, or a part with which is the larger. They are made where the scene is prepared, in parallel; triangles with the same texture coordinates and material share one. Bistro's are 7.8 MB of the words' heap and its preparation takes what it took (1.5 s); Zero-Day's 126,600 cutout triangles, most of them whole, 2.0 MB.
  • A part cell's larger part is found at nine points inside it. By the six points that say whether a cell is whole (its corners and its edges' middles), three of six counting as solid, a disc's cells came to 2 % more than its area and Bistro's foliage read 0.7 to 1.2 % darker offline than by the alpha test; by the nine, 0.9999 and 0.9994 of it (six levels: 0.9993 and 0.9980; eight: 1.0001 and 0.9997).
  • Hardware traversal. The sections that have maps are not flagged opaque. Every other ray forces opacity, as all did; an emitter's shadow ray at a camera hit does not, is handed each of those triangles in its one query, and confirms it or passes it by its map: its instance's record and three words, no corner, no material, no texture, no second query. The candidate loop had lost hits on Metal when every ray's cutouts went through it with their alpha tested (0.1 % of rays near foliage, differently from run to run). In this form: two offline renders of Bistro's walk, 64 samples, every emitter ray by the maps, differ in 2 of 921,600 pixels (with the alpha tested and stepped, 32), and from the same rays stepped in order in 0.19 % of the pixels, their mean within 1e-5.
  • Software traversal asks the map where it tested the alpha (shadow/cutout-emitter-live and -side-live pass under it).
  • Edits. A material or a texture changed in place drops the maps of the rows drawn with it: the cutout is then opaque to these rays, as before the maps, until the scene is prepared again. An instance placed at run time takes its mesh's. (Found after the merge, the same day: so did an object whose geometry an edit had rewritten where it lies, and an emitter's shadow rays then went by the map of the triangles the mesh had had. A card's texture coordinates mirrored at run time kept its old picture of light and shadow on the ground. A mesh whose triangles an edit wrote has no map now, shadow/cutout-emitter-geometry-edit-live: opaque to these rays, as above. To make its map again where it is edited needs the texture's pixels and room in the maps' stream then: not done.)
  • Measured. The bushes and the hedge beside the walk, the kernel's samples against offline: 0.966 and 0.992, which is what the alpha test reads there (0.966, 0.992). In the walking frame the upscaled picture there has 0.91 and 0.99 of the offline one's light for 0.73 and 0.70. The frame, three alternated runs: the street's first view 15.4-15.5 → 16.0-16.1 ms, the walk 16.7-16.9 → 17.9-18.1 (with the alpha tested 18.2 and 20.6). Bistro's recording against offline renders of the same instants: ΔE standing still 2.15 → 2.05, mid-strafe 3.18 → 3.11, at the stop 3.60 → 3.52, walking 3.86 → 3.77, 3.98 → 3.73 and 4.79 → 4.64; the darkest tenth of the frame six seconds into the walk 0.86 → 0.97 of the offline light. bench-object-ghosting and bench-ghosting --quick --check as they were. Three clips: a night street with its crowd ΔE 3.41 → 3.34 and 4.3 % more of its frame (9.74 → 10.16 ms); the hall and the room of lamps the same. Twelve clips against offline: that street ΔE 3.41 → 3.34 with 4.5 % more of its frame, the others within 0.01 and within 2 % of their frame time; scenes are prepared in the time they took (the hall 1.8 s, a city of 23 million triangles 11 s).
  • Render tests: shadow/cutout-emitter-live (a card cut out everywhere under an emissive panel: the offline value; it read 0.0007 before) and shadow/cutout-emitter-side, -side-live (a card solid on one side: which side is which). Unit suite 296, render suite 276.

Not done. The rays of deeper vertices still take a cutout as a card (A_CUTOUT_PATHS), and the analytic lights' and the sky's shadow rays at a camera hit still test the alpha and step: both could go by the maps. A cell is found to be a part by six points: where the levels' limit makes a cell wide (17 texels on Bistro's cards) a twig thinner than the points' spacing can leave its cell whole or empty. The light is the alpha test's all the same (0.9999 and 0.9994 above); to decide every cell exactly is work at the rate of the texture's texels, for a bake that does not hold up the scene's preparation. In the same walking frame the upper middle of the picture, whose light is its lamps and its string of lights, has 0.67 of the offline light after the upscaler in both builds: small bright things lose light there while the camera moves, and their glow with it. Not checked on Vulkan, nor in a browser.

A mesh that does not deform is held compacted (2026-12-02, after it). A BLAS is built into the worst case its geometry could need, and a build that is done can say what it does need. The scene's upload built every BLAS and kept it as built: Bistro's 2.8 million triangles held 293 MB of them, Tokyo's 23 million 2.4 GB.

  • Gpu::upload. A mesh that does not deform is built once. Its BLAS is made to allow compaction (traced fast, as before), and when its batch's build is done it is copied into a structure of the size the build reported; the one it was built in is freed. The batches are as they were (4 million triangles at most, for the build's scratch room) and a batch is compacted before the next is built: what is held at once is the compacted ones and one batch as built. Deforming meshes (posed skinned models', particle systems') are rebuilt every pose and stay as built; so do the meshes edits make, and the procedural boxes'.
  • The TLAS was built with the last batch, in one call. A compacted copy is a write of the queue's own and goes out with whatever is submitted next. Where several views share a device (the unit suite's tests, side by side) it went out with another's submit, the TLAS was then built over a structure whose copy was not done, and on Metal a TLAS built so loses the instance: five tests failed in one run of the suite, none of them when run alone. The copies are now submitted and waited for and the TLAS built after them, by itself. With that the suite passed five times running; with the wait taken out again it failed in two runs of two (one test, then two).
  • Edits. wgpu builds no compacted structure again (a validation error). A mesh of the build whose geometry an edit rewrites where it lies (the same sections: three.js's dynamic draw usage) takes a new BLAS of the same geometries first, built fast as an edit's, and is built again in that one from then on (Gpu::renew_mesh). The objects that draw it are placed again by that edit, as they are when its vertices outgrow their run and it takes a new one.
  • Measured (an M4, Metal; each structure's size before and after as wgpu-core has them, printed for this). Tokyo's 1,248 structures 2,401 MB → 1,129; Bistro's one 293.1 → 137.1; a small scene's 6.4 → 2.8; Zero-Day's 608.2 → 488.7 (one mesh has nearly all of its 5.9 million triangles). A plaza of skinned mannequins: none to compact. Bistro's offline render with and without is the same in every pixel. Five clips alternated (without, with, with, without), a frame's GPU time: the city's 17.80 → 17.72 ms, the others within 1 % and none slower by more than 0.1 %; their pictures' measures the same to the last digit, and their loading within its own spread. Twelve clips against offline, this build beside main's (main, this, this, main): ΔE the same on every clip to 0.01, which is what two runs of one build differ by; the frame within 0.5 % on eleven, and on the twelfth main's first run was the slow one.
  • tri_blas_mb is what the builds allocate, as it was. wgpu does not hand out a structure's size; a function for it in the vendored wgpu was written and taken out again: the browser's module is built against the released wgpu (renderer/web), and the renderer's source is kept to what that one has.
  • THREERT_BLAS_COMPACT=0 leaves every BLAS as built.
  • Unit suite 297 (one new: a compacted mesh's geometry changed where it lies, twice, each against a build; without the new BLAS it fails with wgpu's error), render suite 276.

Not done. A mesh that comes by an edit (a streamed city's cells are those) is held as built: its copy would have to come some frames after its build, its instances be placed again, and a mesh that is rebuilt every frame left alone. wgpu has no refit (PreferUpdate builds): a deforming mesh is rebuilt. Not checked on Vulkan.

The output is composed from guides of its own (2026-12-04, after it). The entries above found the picture's error in motion to be the reconstruction's, three to four times what it is at rest. Its cause is where the histories live: the lighting's are on the traced grid, and the frame's jitter moves every traced sample over its pixel. At an edge the sample changes surface and under a normal map texel, its histories start again, and the upscaler has the surfaces of an output pixel only as its history gathers them, which a pixel that moves does not let it. Offline, the same frames with the lighting kept at half rate and the surfaces given at the output's (eleven moments of two scenes) had 0.83 to 0.87 of the offline render's detail on the street and 0.72 to 0.80 in the hall, where the upscaler has 0.68 and 0.58 at rest and 0.39 to 0.47 and 0.37 to 0.46 moving.

  • Under a render scale of 1 the frame has two grids (live/frame.rs decoupled; docs/RUNTIME.md "ThreeRT's own: the output composed from its guides"). The kernel's guides pass traces the camera's ray for every output pixel each frame, at one of eight places in the pixel: distance, colour, normal, and the pixel's own light (what it sees directly; the directional lights' direct light with a shadow ray of its own, so a sun's shadow has the output's edge). The traced grid's samples stand still, and their histories are of one place. gcompose gives an output pixel the denoised lighting of the traced samples on its surface, times its colour, plus its light; gupscale keeps the output's history, judged by track, judge and reject as the upscaler's is.
  • A thing thinner than two output pixels is the output grid's to keep (live.wgsl Thin). A guide in nine sees a lamp a third of a pixel wide; the traced samples, which no longer move, see it always or never, so the upscaler's locks say nothing here. A guide nearer than both of some pair of opposite neighbours, with no 2 x 2 block like it, is recorded with its distance and its place, and gcarry takes the record on by the two cameras while the guides of the frames after miss it: the history there moves with the thing, is spared the clamp in motion, and where the thing has gone on and the frame does not explain the colour left, the history is dropped. upscale/lamps-parallax at half scale (compose/lamps-parallax-live): beside the sliding field's edge 0.79 of the field's mean light without the records, 0.003 with them (the upscaler at that scale 0.003); the field in its slide has 1.10 of the lamps' light (held still 1.06), for the upscaler's 0.33 at that scale and 0.79 at scale 1.
  • A setting: reconstruction builtin is this where the traced grid is coarser than the output, and the default; builtin-upscaler is the frame as it was (one jitter for every ray, judge, reject, upscale, the locks), and what builtin runs at scale 1 and in a diagnostic view. With builtin-upscaler the street's measures and its frame's time are main's.

Measured on an M4 at half resolution, main → this.

  • Two scenes recorded in lockstep at 1280 × 720 while the camera turns, strafes, orbits and stops. The street: the change of 4 × 4 block means from a frame to the next 0.138 → 0.046 held still, 0.437 → 0.189 after the turn, 0.636 → 0.302 after the strafe, 0.684 → 0.202 after the stop; per pixel 0.304 → 0.134, 0.543 → 0.262, 0.752 → 0.403, 0.718 → 0.376. Of the offline render's detail 0.681 → 0.776 still, 0.459 → 0.551 mid-turn, 0.467 → 0.578 mid-strafe, 0.387 → 0.477 as the camera stops, along its walk 0.369 → 0.452, 0.412 → 0.539, 0.385 → 0.534; ΔE 2.05 → 1.92, 2.80 → 2.63, 3.11 → 2.94, 3.52 → 3.33, 3.77 → 3.55, 3.73 → 3.43, 4.64 → 3.95. The hall, its machines moving throughout: block means 1.411 → 1.435 still, 1.520 → 1.261, 2.217 → 1.798, 2.032 → 1.933, and a moment after the stop 0.944 → 1.065; per pixel 1.407 → 1.229, 1.763 → 1.090, 2.165 → 1.043, 2.075 → 1.015; detail 0.583 → 0.645 still, 0.462 → 0.538, 0.407 → 0.505, 0.290 → 0.405 as the camera stops, along its path 0.402 → 0.542 and 0.415 → 0.519; ΔE 3.87 → 3.87, 4.76 → 4.59, 4.80 → 4.79, 5.61 → 5.44, 4.87 → 4.62, 4.12 → 3.88.
  • bench-object-ghosting: ΔE over the sixteen moments 20 % less in the mean (the device's slide 1.84 → 1.39, the end of its lift 1.01 → 0.38, the thrown lamp in flight 9.88 → 8.83; the runner 0.41 → 0.43 and, a third of a second after, 0.30 → 0.33). bench-temporal --shot edit: a lamp switched off, its pool settled in 32 frames for 64; switched on, its bounce at 32 frames has 0.925 of its settled light for 0.876; a sign switched off, its floor at 32 frames ΔE 0.99 for 0.79.
  • bench-ghosting --quick --check passes, with more excess than main's: mid-turn 0.79 → 1.10 (trail 5 → 10 pixels), mid-strafe 1.27 → 1.36, half a second after the turn's return 1.03 → 1.30, a tenth of a second after the stop 1.46 → 1.67 (5 → 11 pixels). Not explained.
  • Twelve clips against offline, this build beside main's (main, this, this, main). ΔE: a crowded night street 3.34 → 3.11, the city 2.04 → 1.87, the hall 3.21 → 3.14, coloured lights 1.25 → 1.21, rooms 0.88 → 0.83, foliage 0.80 → 0.75; a neon street 1.51 both; a home 2.87 → 2.92, metals and gems 2.32 → 2.35, refraction 0.88 → 0.89, a museum 1.28 → 1.29 (not explained). Detail: the crowd 0.491 → 0.593, the hall 0.677 → 0.741, the home 0.923 → 0.996, coloured lights 0.886 → 0.953, refraction 0.928 → 0.966, the museum 0.886 → 0.955, rooms 0.836 → 0.876, foliage 0.835 → 0.889; the city 0.906 → 1.152 (more than the offline render's own: the measure is a regression on its gradients, and a picture sharper than the reference's pixels reads over 1); metals and gems 0.311 both; the neon street 0.715 → 0.693. Whole pixels' change from a frame to the next: less on ten (the home 1.256 → 0.574, the neon street 0.137 → 0.063, the museum 0.206 → 0.103, the crowd 1.267 → 1.007, the city 0.482 → 0.364), foliage 1.461 → 1.518.
  • What it costs: a camera ray an output pixel. A frame's GPU time on the twelve clips 7 to 31 % more: the crowd 10.35 → 13.61 ms, the city 18.24 → 20.43, the neon street 12.40 → 13.58, the hall 11.67 → 14.72, a voxel level 16.68 → 19.37, the home 13.57 → 15.79, coloured lights 14.73 → 15.83, metals and gems 13.43 → 15.04, refraction 11.83 → 13.04, the museum 12.50 → 14.60, rooms 5.43 → 6.62, foliage 11.56 → 13.80. The street at 1280 × 720: 16.3 → 20.5 at rest and 18.2 → 22.0 walking, of which the trace 10.3 → 13.6 and 11.8 → 14.8 (the guides), gcompose 0.72, gcarry 0.05 and gupscale 0.87 (1.10 walking) for upscale's 0.67 (1.02) and lock_carry's 0.09. Buffers: 60 bytes an output pixel more, 76 where the scene has media.
  • The guides are an entry point of the kernel of their own. Run as a mode of main they took 6.5 ms on the street and the crowd's frame was 118 % dearer, not 31: main's weight an invocation, not the rays.
  • Under software traversal (THREERT_HWRT=0) the street's picture is within 0.005 of this in detail and 0.04 in ΔE, and the three new render tests pass. Unit suite 298 (one new: a wall's texture of cells two output pixels wide is in the frame after a cut, lit by an emitter and by a sun, where the traced grid alone has half of it), render suite 280 (three new: the upscaler's three at half scale).

Tried and not kept, each measured: the traced samples kept on the frame's jitter (the same detail in motion, none of the steadiness at rest); the history following the composition's level everywhere (the street held still changed 0.41 for 0.046: it follows only while the scene's lighting changes, by 3 % a frame); a rule that takes a frame whole where it differs much (a bright outlier passes for a lamp switched on: 1.09); the frame without track, judge and reject (what a moving object leaves behind 28 % further from its settled frame, a lamp's bounce four times as long to settle); a jitter that keeps each traced sample on its surface, and guides for half the pixels a frame (no better, or dearer than what they save); the lighting's direction kept with it (no gain offline); paths only where the lighting's variance asks (97 to 100 % of them would still be traced). At equal frame time, the lighting's scale lowered to pay for the guides, the picture was a trade (ΔE 5 to 18 % worse; before the guides had their own pass).

Not done. The guides are traced: rasterised they would cost a fraction, and that is what is left of the frame's time to gain here. A lamp or a lit window thinner than a pixel that is part of a larger surface has no record (its distance is its surface's): in motion the clamp cuts its light, as the upscaler's did before its locks. A thing on a surface that moves by itself is not recorded either. Dynamic resolution pays for the guides with a lower scale: not measured. Not checked on Vulkan, nor in a browser (both of its modules build).

Where the trace's time goes, and a bound on it (2026-12-05, after it). The guides of the entry above made the frame a quarter to a third longer (three clips' GPU time 9.7 -> 13.1, 11.2 -> 14.5, 5.4 -> 6.7 ms; two scenes in motion 16.2 -> 21.5 and 20.3 -> 27.4). This entry measures where a frame's trace spends it, and keeps what the measurements bore out. An M4, 1280 x 720, render scale 0.5 unless said.

  • The profile times the trace's passes apart. With THREERT_PROFILE each of the kernel's dispatches of a frame's first sample is a compute pass with stamps of its own (frame.rs KERNEL_STAGES), printed after trace as trace.guides, .first_hit, .paths, .finish, .direct, .rest; the trace's own time is from the first one's begin to the last one's end, as it was (20.36 ms for 20.44). Bistro's street view, at rest and walking: guides 3.33 / 3.02, camera hits 1.34 / 1.02, paths 3.88 / 4.66, finish 2.05 / 2.69, the resampled lights 2.88 / 3.30 of 20.4 / 21.9. Over three render scales each pass is a fixed part and a part by the pixel: the camera hits 0.77 ms + 2.4 ns, the paths 0.36 + 15.3, the lights 0.14 + 11.9, finish 9.8 ns alone. A kernel pass that returns at its first line costs 0.4 ns a thread: the fixed parts are not the kernel's size.
  • They are the trees. Timed over parts of the frame, the camera hits' pass was 0.26 ms on the picture's left half and 1.09 on the right: a ray through a crown passes many cut-out cards, and under hardware traversal each one passed is a ray query started again. With the kernel's switches that take those queries away (every cutout solid to shadow rays, four steps for a camera ray) the frame was 20.5 -> 18.2 ms: 2.4 ms of it are queries past a cutout, 1.5 of them the camera rays', which are five times what they were before the guides.
  • A bound on them: of the cutouts a ray that sees meets, the eighth stands whole (A_CUTOUT_DEEP, a live approximation as the others are, RUNTIME.md's table; software traversal has the same rule). The street view 20.3 -> 19.2 ms (guides 3.35 -> 2.70, camera hits 1.33 -> 0.87). The crowd's clip: GPU 13.1 -> 12.1 ms, ΔE against the offline render 3.11 -> 3.12, its change from frame to frame 1.007 -> 0.922; 0.26 % of its pixels are off by more than 8 of 255, all in the crowns. Render tests cutout/deep (offline), -live (the eighth of ten clear cards is what is seen), -live-exact; all three under either traversal.
  • Against main: two scenes in motion, the frame 21.48 -> 20.27 ms (Bistro) and 27.40 -> 27.27 (Zero Day); mean ΔE over their offline moments 2.82 -> 2.83 and 4.56 -> 4.56, detail the same, the change at rest the same or less; what a moving object leaves behind the same (ratio 1.000), the camera's bench and the ten lighting edits the same. Unit suite 298, render suite 283 (three new).

Tried and not kept, each built and measured.

  • The cutouts' maps for every ray that asks an alpha (a cell all there stops it, one all gone lets it by, a part of both is asked of the texture). In the query's candidate loop the guides' pass was 3.34 -> 5.84 ms and the camera hits 1.35 -> 3.39: every cutout triangle along the whole ray comes back to the shader. In front of the alpha test, the queries as they are: no change. The cost is the query, not the texture.
  • The lighting of a part of the traced pixels a frame (of each 2 x 2 block one, two or three in turn; the others' guides from the first pass's hits, their lighting from the lit ones around them by the surfaces' likeness, counted for a sixteenth of a sample in a history that has one). The frame -5 % at three of four, -15 to -17 % at two, -26 to -29 % at one. At the same frame time a lower render scale is the better picture: in motion, mean ΔE of the two scenes 3.11 / 5.58 at half the pixels against 3.02 / 4.95 at scale 0.42, and 2.94 / 5.04 at three of four against 2.90 / 4.72 at scale 0.46, the detail equal. The output has its guides at its own resolution, so the traced grid already is lighting below them, and its scale lowers every cost of the grid, where lighting a part of it keeps the camera hits and the denoiser whole, adds a pass and halves each pixel's own samples.
  • The cache's training. finish is nearly all of it (an eighth of the tiles 2.05 ms, a sixteenth 0.97, none 12.65: every lookup then finds its voxel cold). Half of it at scale 0.5: the frame -5 to -6 %, Zero Day's ΔE +9 %. And as a budget of paths a frame, what a traced grid of 640 x 360 has, on the reasoning that the cache's voxels are sized by the angle they are seen under and a larger grid has no more of them: at scale 1.0 the two scenes in motion were 58.9 -> 50.7 and 75.5 -> 64.8 ms, Bistro's mean ΔE 2.24 -> 2.27, Zero Day's 3.63 -> 4.10 with its change from frame to frame +14 to +62 %. Where the lighting never rests the cache keeps four frames of samples, and every path is one that counts. Three still clips had shown a twentieth of ΔE there: a change that does nothing at the scale the benches run at has to be judged in motion where it does something.

Not done. The render scale is now the lighting's rate and its slope is gentle (in motion, scale 0.5 / 0.46 / 0.42: the frame 21.2 / 19.1 / 17.1 ms and 27.3 / 24.6 / 22.4, mean ΔE 2.82 / 2.90 / 3.02 and 4.56 / 4.72 / 4.95, detail 0.563 / 0.549 / 0.541 and 0.520 / 0.506 / 0.492): the default scale and dynamic resolution's floor are as they were. The queries past a cutout that are left (about 1.3 ms of that view) want what this renderer does not have: opacity micromaps in the acceleration structure, or a first hit that is rasterised. The twelve clips against offline were not run. Not checked on Vulkan, nor in a browser (both of its modules build).

The live passes from one place (2026-11-14, after it). A buffer and a pass more (the locks' carry, above) took seven edits that had to agree: the declaration in live.wgsl, the bind group layout's entries, the pass list, the buffers' sizes and order, the bind group's entries, the dispatch grid (in two copies), and the merged layout's table. Now live.wgsl's declarations are the layout: build.rs reads them with naga (the compiler wgpu uses; a build dependency, so the browser's build carries none of it) into each binding's name, number, kind and element stride and the bindings each entry point uses, and live/layout.rs holds only what the shader cannot say: what each binding is bound to and how many elements a buffer of the passes' own holds (RESOURCES), and the passes' order and grids (PASSES). layout::check holds the table to the shader (a unit test, and every view as it starts). Natively each pass has a bind group layout and a bind group of its own, of the bindings its entry point uses (one shared group of every binding was the passes' layout before). Measured on 39 passes: 36 bind at most the browser's eight storage buffers; post binds 13 (most of them its debug view modes'), compose 11, dtemporal 10, so the browser's layout is still the merged one, for all passes, until those three are rearranged. Check: render-identity against the build before, native and merged, nothing changed; the passes after the trace 6.03-6.09 ms on both (Bistro, 1440p at 0.375, alternated).

The live passes in a browser as natively (2026-11-14, after it). The three passes over a browser's eight storage buffers, rearranged so that each binds at most eight, and the browser's layout is now the native one, a layout a pass:

  • post (13): the view modes are passes of their own before it, which a frame in the lit picture does not run (view_raw: base colour, normal, history length into the output as they are; view_hdr and view_sample: the signals in place of the image post exposes). An HDR snapshot in a view mode is now that signal (it was the lit image).
  • compose (11): the upscaler's state of each sample (Flicker, Lock) is a pass of its own after it, track.
  • dtemporal (10): the surfaces' compact copy (sb) is written by refl, which reads each sample whole anyway.
  • The sample's parts are read apart (sample_diffuse, _specular, _emission): a pass binds the resolved reflection only if it takes the specular part.
  • merged.rs's live half is gone (the slabs, the offsets' uniform, the live source's rewrite); the kernel's outputs the passes read start at multiples of 256 bytes in its merged buffer (@align(256)), so a page binds those ranges. every_pass_fits_a_browser holds every pass to eight.

Checks: render-identity against the build before, native: 3 of 190 outputs differ by rounding (particles-motion-repose 277 pixels, at most ~3e-6 nits on dark ones; wind-pivot-sway-live and voxel-cut-body-push ~3e-5 relative); THREERT_MERGED=1: 3 (at most 7.5e-5 nits on values of 1 to 4). The view modes 1-8: every PNG identical. tools/web-hello.ts in Chrome: pass. Cost +0.18 ms (Bistro, 1440p at 0.375, alternated: the passes after the trace 6.00-6.08 -> 6.19-6.24; track 0.27 less compose's 0.08; the surfaces' copy in refl +0.02, a pass of its own read the samples again: 0.18).

The kernel's variants by WESL, and the Rust pinned (2026-11-14, after it). The kernel was made for a device and a scene by text patches: the hardware traversal cut in at markers (kernel_base), a device's switches and a scene's source features found and replaced at anchors that were whole lines of code (kernel_switches, kernel_source), an edit of such a line breaking a patch at run time. Now the kernel is one WESL module (pathtrace.wgsl, then trace_units.wgsl, trace_hw.wgsl, translucent.wgsl) and every variant is in it under WESL's conditional translation, @if(flag) on a declaration or a statement (WESL: the community's WGSL extension, Bevy's and Vello's; wesl-rs 0.6, natively and in a browser). The flags: hwrt, the switches (strict, cutout_lite, cutout_lite2, last_direct, light_pick), the source features (vcolor, grid, tint, unlit, units, background); gpu.rs kernel_flags, kernel_wgsl, docs/RUNTIME.md "The kernel's source". Checks: for all 2,304 combinations of the flags the Metal source naga writes is the patched kernel's, two rewrites allowed for (the light pick's blocks take their condition from a local; vertex and instance colours multiply in turn: the same products in the same order); render-identity against main, native, merged, with every switch on and with the uniform tables (below). Left as text, before the variant: a scene's functions in their slots, the merged layout, the uniform tables, the loop guard.

The repository's Rust is pinned (rust-toolchain.toml, 1.100.0; CI's jobs run for it): wesl-rs 0.6 asks for 1.97.1, and it was whatever stable a machine had (1.96 here). On 1.100 the determinism checks give their recorded hashes (voxel, physics sequential and on 2 and 4 threads, the renderer's wasm32 graph), and main built with either compiler renders the same (render-identity, native and merged: nothing changed). One deprecation: fetch_update is try_update.

On the way, WGSL a browser refuses: WESL parses by the specification's grammar, as Chrome's Tint does, and the surface materials' hash (a * b ^ c * d: a bitwise operator's operands must be unary) did not compile through it. naga had taken it, so those materials (and the particle passes, the same three times) never compiled in a browser. Fixed with parentheses in the order naga read them; a unit test holds the other shader files to the grammar.

The kernel's layouts in its source, and the loop guard on its syntax tree (2026-11-14, after it). The browser's merged layout, Android's uniform tables and the loop guard were still made by rewriting the kernel's text: merged.rs scanned the WGSL for every use of thirteen buffer names, followed the locals that shadowed them through their scopes, rewrote each use (MT.materials[, min(u32(i), last)), and put a counter after the { of every loop it found by its keyword. Now:

  • The kernel reads its seven tables and uses its six group-1 buffers only through functions (material_at, light_at, ..., cache_key_claim, cache_acc_add, refl_store, direct_len, ...: 87 reads of the tables, 40 uses of group 1), and each layout is a block of declarations in pathtrace.wgsl that declares the buffers and those functions: @if(merged) { .. } @else { @if(uniform_tables) { .. } @else { .. } } (WESL's blocks; scene data behind an accessor module, as engines keep it).
  • The numbers a variant needs are WESL constants the source imports (import constants::..): the merged arrays' lengths, the uniform arrays', the loop guard's limit. gpu.rs KernelVariant gives a variant's flags and constants.
  • The loop guard's count is put into every loop by a pass over the variant's syntax tree (gpu.rs guard_loops), the scene's functions' loops too; its declarations are in the source under @if(guard).
  • merged.rs's scanner, its rewriter and their tests are gone (637 lines to 302); the numbers the Rust side needs for its buffers stay. What is left as text: a scene's functions in their slots.

A read or write that goes past the functions does not compile in the merged variant, whose block declares none of the buffers by name, and the tests read the merged variants with naga. Checks: render-identity against main, all with the loop guard first (natively, merged, with the uniform tables, with every switch on), then native without it: 0 of 190 outputs changed in any (172-175 byte-identical, the rest within their run-to-run spread), so the tree pass and the text scan guard the same loops; tools/web-hello.ts in Chrome: pass. Cost (1440p at 0.375, alternated, both orders): native hardware traversal equal (Bistro 8.28-8.97 ms against 8.30-8.96, Kabukichō 15.46-16.17 against 15.53-16.25); software traversal -0.2 ms in the layout as written (46.8 against 47.0) and +0.2 ms merged (47.3 against 47.1). The Metal source naga writes is the same in meaning both ways (compared function by function); neither one-field accessors nor main's parameter order moved the merged +0.2, which comes and goes with the layout: the compiler's arrangement around the accessors, +-0.5 %.

What the kernel trusts, held by the data (2026-11-14, after it). The kernel follows indices from buffers and checks none; the loop guard was the only thing between bad data and a dispatch that never ends. Researched against pbrt-v4, Embree, Cycles, three-mesh-bvh, Falcor, the DXR and Vulkan specs and wgpu: they hold the invariants in the builders (children after the parent, a depth cap tied to the stack, forced or median leaves), clean the input where it enters (Embree and Cycles drop non-finite primitives; DXR makes them inactive), and keep the structural checks to debug builds and tests; none checks a tree before every upload, none caps a walk's iterations. The same here:

  • bvh.rs: no deeper than the kernel's stack (48; where the levels left could not finish a split, the median); items whose box is not finite in no leaf, after every leaf's range; check_tree (the units' check, moved here) on every tree in tests and debug builds; each build reports its depth (bvh_depth). Bistro 18, Kabukichō 26, the district 33: no tree of today's scenes changes.
  • ltree.rs: LightTree::check (children after the parent, leaves inside the entries, every entry's code to its leaf) after every build, growth and refit in tests and debug builds.
  • Where data enters: geometry positions finite (World::set_geometry), a volume's majorant a finite number > 0 (Rust and packages/scene: Infinity passed both and its delta tracking never stepped), a world matrix that is not finite places its object at a point (as a hidden instance), the hardware acceleration structures' vertices finite (indexed.rs share).
  • Garbage-input tests for each builder (NaN, infinite and huge values, coincident and collinear items). docs/RUNTIME.md "What the kernel trusts" has the table. Checks: cargo test --release with the loop guard, 138 passed; render-identity against main, guarded natively, merged and in software traversal, then native without it: 0 of 190 changed in each (171-175 byte-identical, the rest within their run-to-run spread); tools/web-hello.ts in Chrome: pass. The district's tree builds in 333 ms against main's 321 (one load each; an earlier load of the same build 338). No shader changed.

A scene's features as FEAT bits (2026-11-14, after it). Vertex colours, density grids, instance colours, unlit materials and the background were @if flags: each combination another kernel source. They are now bits of FEAT (the pipeline-overridable constant the other features use), their bindings and fields always declared, and OBJECT_STRIDE an override from F_TINT. Only units still change the source. render-identity against main (native, merged, uniform tables, guarded and not): 0 of 190 changed; web-hello passes; Bistro's trace the same natively and merged.

The sampler: Owen-scrambled Sobol (2026-11-14, after it). The kernel drew white noise from one PCG stream, its draws' order set by the path's branches. Now shuffled, Owen-scrambled Sobol (Burley 2020, as Cycles), each decision a dimension id (docs/RUNTIME.md "Random numbers"). Offline every draw is Sobol: RMSE x0.29-0.46 at 16-256 spp on the Cornell box, Light Room and Bistro, means within 0.01 %. Live only the camera path's first vertex, a hash elsewhere (as RTXPT; all-Sobol cost 2.1 ms of an 8.4 ms trace): cost and the live shots (bench-window) unchanged. The loop guard now skips counted loops. Next: blue-noise pixel distribution (Cycles 4.2), its own PR.

Local lights guided by light tiles (2026-11-15, after it). The live kernel chose among shadow-casting local lights uniformly: with many of them, most behind walls, few candidates found a light that reaches the point. Now each camera pixel reports the light its shadow ray found, a pass makes each 8 x 8 tile's reports a list, and the next frame's paths take candidates from their tile's list beside the uniform ones (docs/RUNTIME.md "Light tiles"; the scheme MegaLights and RTXPT guide their draws by). Unbiased whatever a list holds. Measured on two new shots (scenes/lamp-rooms.ts, 96 lamps in 12 rooms; lamp-rooms-wide.ts, 768; bench-window still-rooms, still-rooms-wide), dE / flicker: 0.67 / 0.138 -> 0.63 / 0.069 and 1.01 / 0.126 -> 0.58 / 0.081, for 0.65 ms of trace and a 0.22 ms pass (of 9.2 ms a frame). (The wide shot's reference was rendered with a light tree, on another branch: main's offline chooses among the 768 lamps uniformly and is noisy at 4096 samples. Against main's own: dE 0.90 -> 0.71.) Scenes without more than 8 shadow-casting local lights compile and run as before (Bistro, Kabukichō: picture and cost unchanged).

The lists follow the camera (2026-11-15, after it). A camera hit read the list at its own pixel: with the camera turning, another part of the scene's. Now it reads the list of the tile it was seen in when the lists were built (its point, moved back by its motion, through that frame's camera). bench-window rooms-turn (lamp-rooms-wide, the camera turning 2 degrees a frame), the last moving frame, dE / p99: 2.00 / 8.57 without lists, 0.86 / 4.82 with them at the pixel, 0.80 / 3.54 now; 0.19 ms of a list scene's trace (3.57 -> 3.76 on lamp-rooms).

The scene's read-only data in two buffers (2026-11-15, after it). New scene data rode in other data's buffers, since the kernel had no binding to spare (28 of Metal's 29 with the translucency pass): the light tree after the emitter CDF, the light groups after the lights, the procedural geometry after the environment's CDF, the vertex colours after the previous vertices. A browser's kernel had its seven tables a second time as the sized arrays of a struct, copied every frame and compiled again when one doubled. Now the tables are the sections of one buffer of vec4s and the flat arrays the sections of one of 32-bit words (renderer/src/heap.rs; docs/RUNTIME.md "The scene's tables"), each found by an offset in the parameters: what a scene has more of is a section, a table that grows compiles nothing, a browser copies nothing, and the integers that were read through a float's bits (procedural words, vertex colours) are read as integers.

  • Read all from the one buffer, the trace was 3 to 5 % slower natively (Bistro 8.57 -> 8.98 ms): the offset fetched before every read, the records' assembly, and a third no single change explains (seven timing variants). So where a stage has the bindings, the seven tables read at every hit or light are bound again as typed views of their sections, and the light tree and the environment's CDF are their buffers' first sections, read from element 0. Trace against main (1440p at 0.375, alternated, ms): Bistro 8.58 -> 8.65, Zero Day 9.53 -> 9.57, lamp-rooms 3.80 -> 3.72, Kabukichō 16.35 -> 16.10; software traversal Bistro 47.17 -> 47.48, lamp-rooms the same. A browser, with no binding for the views, reads from the buffer whole: in the merged layout natively Bistro 47.2-47.7 -> 46.8, lamp-rooms the same. The count of bindings natively is as it was (22, 28 with the translucency pass); what changed is that new data does not need one.
  • The first build passed the whole suite and render-identity (0 of 192 changed in four layouts) and still drew Bistro wrong live (dE 7.12 for 1.82): the live loader gave the light tree to its tables before the upload read its nodes, and no test had a tree in a live view before an edit rewrote it. What showed it was the timing: a trace a third faster. Fixed, with the tests that see it (light/emitter-tree, -live: 1.4 for 73.6 without the fix).
  • Android keeps four tables' uniform copies until a device has run without them (why its driver misread them is not known).
  • Checks, with the loop guard: the unit tests and test-render (194); render-identity against main natively, merged, under software traversal and with the uniform tables: 0 of 194 changed in any; bench-window's five shots and still-kabukicho as main's to the digit (the moving ones within 0.3 %); offline renders of five scenes as main's (three byte-identical, Bistro and Zero Day within what a build differs from itself).

The kernel's group 1 without lengths in its source (2026-11-15, after it). In the merged layout the buffers the kernel writes were the arrays of a struct whose lengths were constants of the source, so each view size, and an offline render, compiled a kernel of its own (1.4 s in Chrome). Now the radiance cache's atomic words are at fixed places (its size is the kernel's own constant) and the vec4 arrays are the sections of one runtime-sized array, found by offsets in the parameters (heap::Live): one kernel for every view. The light tiles' lists, which rode after the direct buffer's pixels, are a buffer of their own; hardware traversal no longer binds software traversal's trees (a placeholder there), so the count of bindings is as it was.

  • Trace against main (1440p at 0.375, alternated, ms): hardware traversal equal (Bistro 8.64 / 8.64, lamp-rooms 3.71 / 3.71, Zero Day 9.60 / 9.59, Kabukichō 16.11 / 16.10); software traversal Bistro equal, lamp-rooms 4.98 -> 5.03; the merged layout Bistro 46.78 -> 47.12 (+0.7 %), lamp-rooms 5.00 -> 5.03.
  • In the merged layout the cache's keys and sums are always there (9 MB), with the cache off and offline too: the price of plain vec4 reads beside them (all of it as atomic words would have made each vec4 four atomic loads).
  • Checks, with the loop guard: the unit tests and test-render (194); bench-window's shots as main's natively and in the merged layout; tools/web-hello.ts in Chrome; render-identity against main: 0 of 194 changed natively, under software traversal and with the uniform tables. Merged, it flagged voxel/joint-moved: that test has nine outputs over 40 runs, main's own among them differing as much (3e-4, the same pixels), and the new build's output is byte-identical to one main's binary gave; four confirming runs under-read a test whose output holds for a process.

Shared declarations once; the kernel's layouts held to its source (2026-11-15, after it). TriAttr was declared in three shaders, Pixel and the light tiles' constants in two; the particle passes got the object table's stride by gpu.rs rewriting a line of their text; the kernel's bind group layouts were written by hand beside the shader's declarations, with no test between them. Now records.wgsl declares what is shared and is part of each shader that uses it; the stride is a pipeline constant, as in the kernel; the layouts' entries are one function (gpu.rs kernel_layout_entries), and a test holds them to what every variant of the kernel declares, kind and access (it fails on a wrong entry: tried). The kernels' code is the same: render-identity against main 0 of 194 changed in four layouts, bench-window's shots as main's, the trace equal (Bistro 8.65 / 8.64 ms, lamp-rooms 3.71 / 3.72), tools/web-hello.ts in Chrome passes.

The live renderer's shortcuts, named (2026-11-15, after it). An inventory of where a live path gathers other light than an offline one found 16 places: the live architecture (the radiance cache, the clamps, the bounce limit, media marched and composited, depth of field as post), and seven shortcuts taken for speed over the months, each a LIVE check somewhere in the kernel: glass and media on shadow rays, cutouts on later rays and on emitters' shadow rays, the hardware shadow query, far emitters, white noise. The seven are bits of one pipeline constant now (APPROX; docs/RUNTIME.md "How live differs from offline", with what each was measured at), live taking all and offline none as before, and a live view can run without them (THREERT_APPROX=0): Bistro held still then reads ΔE 1.67 for 1.82. No picture changes (render-identity 0 of 194 in four layouts, bench-window's shots as main's) and the trace is equal (Bistro 8.52 / 8.52 ms). Next: a test for each that holds the live picture without it to the offline one, their bias and cost measured again, and the defaults decided from that.

Each shortcut measured; two removed (2026-11-15, after it). A pair of tests holds each approximation: the live view as shipped reads its bias, without the bit it reads the offline value (light under tinted glass 4.3 x, behind a medium e x, the sky under a clear cutout card 18 %, an emitter behind one black, panels 150 m away 3 %). Each was timed with its bit off, the loop guard on, in Bistro, Kabukichō, Zero Day, a glass scene, the fire scene, the Bistro slice, the 3 x 3 district and Tokyo (docs/RUNTIME.md's table). Two did not pay and are gone: the single-query shadow ray past cutouts (Bistro 10.13 ms with it, 10.09 without where its foliage is nearest; it lost hits on Metal) and the switch for white noise (variance only: what live does, not a bit). Two more looked removable on a small scene and were not on a large one: exact media shadows cost the fire scene 0.10 ms and the Bistro slice 0.84 (9 %); the far-emitter cut saves the district 0.15 ms and Tokyo from the air half its trace (4.7 ms for 9.2). Both stay. Against main: the trace Bistro 8.57 / 8.50 ms, lamp-rooms 3.71 / 3.73, Zero Day 9.58 / 9.52, Kabukichō 17.10 / 16.95 guarded, Tokyo at night 4.68 / 4.77 guarded (the query's saving there); render-identity in four layouts changes only the five tests that name bits (renumbered); bench-window's shots as main's, Kabukichō and Tokyo too. Next: a camera hit's light through a cutout loses the BSDF ray's share of its MIS weight (the 18 %); then the cutout bits' defaults.

A light sample through a cutout keeps its light (2026-11-16, after it). Under A_CUTOUT_PATHS a camera hit's shadow rays test cutouts and the ray it sends on does not, but the sample's MIS weight still shared the light with that ray: under a card cut out everywhere a uniform sky gave a Lambert plane 18 % of its light. The sample now takes the share the BSDF ray cannot bring (light_mis; a specular sample off a smooth surface still tests cutouts and keeps its share): 50 for 50. None of our shots shows it (Bistro at night, the slice, Kabukichō, Tokyo: as main's); the trace is equal (Bistro 8.70 / 8.70 ms, the slice 9.29 / 9.32, Zero Day 9.68 / 9.61; guarded, Tokyo 4.79 / 4.84 and Kabukichō 17.02 / 16.95); render-identity changes that one test. What is left of the bit is in the radiance cache: its rays take cards as solid for their own light samples too, so what a cutout lights sends nothing on (sky/cutout-bounce: a quarter of the sky offline, black live). Found on the way, not explained: with no card at all the live view reads that bounce 16 % low (0.21 for 0.25).

A shadow ray's light is a weight (2026-11-16, after it). What a shadow ray kept past glass and media was drawn as one pass / stop decision, the glass's colour handed on beside it to the callers that asked: the sun's light in fog and the lights of volume points did not, and took the glass's largest channel for all three (fog/scatter-glass: 0.915 for 0.365, offline too). The shadow rays' functions now return the transmittance and every caller multiplies by it (shadow_tr, emitter_tr, any_tr); where it can only be 0 or 1 the product folds away, and the kernel is as it was (Bistro 8.62 / 8.62 ms, a glass scene 4.96 / 4.96, the slice 9.11 / 9.11, the fire scene 1.89 / 1.88; guarded, Tokyo 4.81 / 4.80 and Kabukichō 16.97 / 16.75). shadow/glass-tint-live-exact reads 9.13 for 9.17 (8.87 with the decision: its tolerance 5 % -> 3 %). render-identity changes the eight tests whose shadow rays cross tinting glass or media, in noise; bench-window's shots as main's (Kabukichō's flicker 0.68-0.72 over three seeds in both builds). The cost of exact glass shadows is the walk over the glass, which this leaves as it is.

The radiance cache held to numbers (2026-11-16, after it). A live test of one bounce off a lit floor read 0.21 for 0.25: the first number anyone had asked of the cache. Read against how the other caches of its kind are built (SHaRC, GI-1.0, Lumen, NRC), five faults:

  • A lookup that found no voxel read black past a view's first 30 frames (a shortcut, taken for speed, that was in no list): 16 % of that bounce at 160 x 90, 2 % at 1280 x 720, 0.2 % of a Bistro frame. Every training sample is now added two and four levels coarser as well, and a cold lookup reads those; with none it traces, always. The shortcut is gone: with the coarser levels it cost time (Bistro 9.05 ms with it, 8.87 without).
  • A floor on a face of the voxel grid (y = 0) had its hits rounded to either side, two keys sharing its samples: the key is taken just in front of the surface.
  • Where a path ended on a cold voxel its light samples kept their MIS share alone, 18 % of a uniform sky: they stand alone there (nee_alone). A view's first frame read 4.0 for 7.05.
  • The lookup's reflectance had no coat: a surface that reflects by its coat alone reflected nothing.
  • A surface seen in a reflection took the sky's samples afresh against the white-lobe ones the cache had left out, which do not add up on a glossy surface (a white metal ground in a mirror: 0.80 of a uniform sky, now 1.00). The sky's light there is the cache's.

Measured and not taken: ending a path in the cache only past a segment of a voxel or so, as the others do. It makes a slit narrower than a voxel right (cache/slit-live: 14 % bright without) and cost Bistro's trace 15 to 22 %: the pixels that go on hold their SIMD groups. Tracing an absent voxel and inserting it: 7 %, for what the coarser levels do for 1. A table four times the size: what the trace gains (0.13 ms) the cache's own pass spends. Taking a reflection hit's lights as light samples alone, which is the estimator without a bias: fireflies on Kabukichō's wet street (flicker + 22 %); they keep their weights.

Against main: the trace Bistro 8.50 / 8.55 ms held still and 4.48 / 4.58 along its camera path, lamp-rooms 3.69 / 3.75, the fire scene 1.88 / 1.92; guarded, Kabukichō 16.53 / 16.22 and Tokyo 5.85 / 5.50 by day, 4.79 / 4.74 at night (a surface in a reflection sends the sky no shadow ray). bench-window: Bistro ΔE 1.82 -> 1.81, lamp-rooms 0.63 / p99 1.99 -> 0.63 / 1.85, in motion 0.80 -> 0.74, settled after a turn 0.67 -> 0.73 (the one shot that is worse: 0.6 % more light where it was 1.3 % bright already); Kabukichō, Tokyo at night and at 14:00 as main's. render-identity: the live tests that read the cache change, offline ones by a float's last place at most (the sky's light sample became a function). Next for the cache: its training as a pass of its own, as SHaRC's is (training that does not thin out with the resolution, deeper paths, a smaller kernel), and with it the table's size; a pass for the few pixels that go on, which is what the segment test waits for.

One ray query in the hardware trace (2026-11-16, after it). The two cutout shortcuts made Zero Day's and Kabukichō's trace slower, not faster (0.4 to 0.8 ms), and nothing explained it. The cause: trace is inlined at each of its calls, and it held three ray queries, one for rays that take cutouts as opaque (the shortcuts'), one for a shadow ray's first hit, one in the loop of ordered steps; each one written costs every ray, taken or not. They are one query in one loop now (a shadow ray's first step takes any hit; a scene without cutouts keeps its plain query), with the same hits: render-identity 0 changed of 229, bench-window's shots as main's. The trace: Zero Day 9.41 -> 8.41 ms (-10.6 %), Bistro 8.57 -> 8.05 (-6.1 %) and 4.58 -> 4.36 along its camera path, the Bistro slice 9.00 -> 8.29, a glass scene 4.97 -> 4.60, Kabukichō 16.23 -> 14.61 guarded (-10 %); scenes without cutouts (lamp-rooms, the fire scene, Tokyo) as they were. The shortcuts now save Zero Day 0.3 ms where they cost it 0.4.

A second pass for the pixels that go on (2026-11-16, after it). Where a live path ends in the cache most pixels read a warm voxel and are done; some have more to trace: a training path (1 tile in 8), a cold voxel's estimate, a reflection hit's lights (a third of Zero Day's pixels). Traced in main they held their SIMD groups, and their code cost every pixel (main without it: Bistro 8.06 -> 6.54 ms). They leave a 96-byte record now, and the kernel's finish pass traces the records after each sample, one invocation each, and adds the light to the pixel as the epilogue splits it. The estimator is the same: bench-window's shots as main's (Bistro 1.81, lamp-rooms 0.63, the slice 5.40, Kabukichō 4.66); render-identity: no offline picture differs, 13 live ones of 229 at single pixels with the image's mean within 4e-5 (which slot a voxel takes follows the order of inserts), and the build repeats itself to the byte where main did not (its lookups raced its own training). The trace: Bistro 8.16 -> 7.29 ms (-10.7 %) and 4.36 -> 3.98 along its camera path, Zero Day 8.52 -> 7.75 (-9.0 %), lamp-rooms 3.79 -> 3.24 (-14.5 %), the Bistro slice 8.32 -> 7.31 (-12.1 %); guarded, Tokyo 4.74 -> 4.28 (-9.7 %) and Kabukichō 14.60 -> 13.64 (-6.6 %: the pass costs 2.7 ms there, the wet street's material function run again for each record). The layout as written only; the merged one ends its paths in main as before. The records' buffer follows the traced size (50 MB at 960 x 540). It is the kernel's 23rd binding, and the translucency pass, at Metal's 29 a stage already, binds group 1 without it: the next buffer needs a layout for each pass of what it reads. (Kabukichō's profile, for whoever reads it next: the particles' BLAS slot is 0.45 ms when the frame fits a display interval and 1.0 to 1.7 with a spread of 3 when it is between one and two, in main's build too: it times a wait.) Next here: the segment test, whose pixels can go to the pass; a record that carries the surface where its material function is dear.

Glass as a rough dielectric (2026-11-16, after it). Frosted glass was a delta event whatever its roughness: the ray refracted through a sampled microfacet with the weight of smooth glass, so the lobe had no value and no density, lights were never sampled through it, and a ray totally reflected inside took the glass's tint (a grey sheet seen past the critical angle read 0.5 of the sky). It is Walter et al. 2007's interface now (docs/RUNTIME.md "Glass"): reflection or refraction at a visible microfacet by the exact Fresnel reflectance, both with a value and a density; lights sampled on both sides, their shadow rays from the side they light; a delta lobe below roughness 0.05 only; the energy single scattering loses returned from a table (Turquin 2019). Held by eleven glass/* tests against the BSDF's integral (lib.rs glass_energy_tests): one interface in a white sky 0.957 for 0.9573 entering, 0.738 for 0.739 and 0.648 for 0.647 leaving, 0.999 and 0.992 with compensation, a lamp through frosted glass 4.01 for 4.04, a frosted sphere in a furnace 0.999. Pictures without glass are as they were (render-identity: 196 of 239 to the byte, the rest glass and water; Bistro's offline render to the byte, Kabukichō's still 4.66). The glass scene's offline render moved by ΔE 0.36 and its live frame keeps its distance to it (1.16 -> 1.18). The trace: the glass scene 3.95 -> 4.40 ms (+11 %), of which 0.36 ms is the lights now sampled through frosted glass; Bistro, Zero Day, lamp-rooms, Kabukichō, Tokyo as they were. bench-window kept one offline reference a shot whatever renderer made it: a build that changes the offline picture was read against the old one; the reference is keyed by the renderer's binary now, and the tool has a glass shot. Not here: thin walls (a pane is a solid's face), absorption by distance, the shadow rays' share (a Schlick albedo still, on a straight ray). Two things the kernel's shape decided: a shadow ray's origin on the side it leaves from is every surface's rule, but written into every kernel it cost Bistro's trace 4 %, so only kernels with glass have it; and the energy table's vec4 indexed by a variable cost the glass scene 1.5 %, a select chain nothing.

What is not the scene's no longer rebuilds it (2026-11-16, after it). One flag, Changes::structural, sends an edit to a rebuild of the whole GPU scene, and it was set for things no part of the scene is built from: the scene camera's field of view, its depth of field, its exposure's mode, near and far (read by nothing), a camera that is not the scene's, fog appearing or turning volumetric, a background appearing, the preset and its overrides, and an offline render's size and clock. Bistro: a change of lens rebuilt for 884 and 724 ms; now the frame is as any other (15 to 17 ms). Each is applied where it lives: the lens by the view (as a camera's move), depth of field and exposure by the post passes and the kernel's clamp, fog and a background by the kernel's variant with them, the preset by the few parameters taken from it. A GPU test (live::inplace_tests) takes twelve such edits in place on one view and holds each to a view built from the edited world: no rebuild, the kernel's parameters the same whole, the same state after them, the same picture. Found by it: the emitter cull's view cone is made from the lens and was made again only when the camera moved or turned, so a lens changed in place kept the old one (it follows the lens now); and after an edit to the light (fog gone), the radiance cache and the frames' histories keep the old light for hundreds of frames (5 of 255 steps off after 264), here as after a rebuild; the test compares with the histories cleared. Still a rebuild: another sky, and the output's size (a view cannot be resized). The first of the scene model's steps: the proxy table next.

Another sky in place (2026-11-16, after it). A sky's kind or parameters rebuilt the scene too. The build's sky is two functions now, the sky's data from the world (scene::sky_data) and its bake (bake_sky), and the live view calls them for an edit: the environment map and its CDF are written in place when they keep their size, else a new texture and the CDF's section grown, the scene bound again (Gpu::put_env); the parameters that say how the sky is read follow; the atmosphere's sun takes its colour from the bake, and a light that is the sun no longer is a light of its own colour again. The same test holds six sky edits (one colour, a gradient, an atmosphere with its sun, the same as a dynamic sky, one colour again, none) to a view built from the edited world. What the frame that takes one pays is the bake: 0.1 ms for a colour, 6 for a gradient, 47 for an atmosphere (a rebuild paid that and the scene's 0.5 to 0.9 s). No picture changed (render-identity; the live volume tests' own spread is wider than two runs show: five runs a side, none differ).

The view's state and the environment beside the scene's data (2026-11-16, after it). The live view kept the scene camera's lens, depth of field and exposure, the preset, and the sky's state in the struct a rebuild replaces with the scene's data, the fog and the background in the tables beside materials and lights, and wrote each from two places, the load and an edit, which a test held equal (and found apart once: the emitter cull's cone). They are two objects of the view now (live/state.rs): ViewState and Environment, each derived whole from the world by one function, at load and on an edit, and the kernel's parameters each of them says are written by one function that the build calls too (Params::set_preset, EnvSettings::write, SkyBaked::write). Two change flags that came to mean the same (the camera's exposure, its depth of field) are one. No behaviour is meant to change, and one does: after a rebuild that changed the cloud cover, the next commit no longer bakes the sky again. What other engines do was read first: a scene container without camera, size or post state, size-dependent buffers and histories owned by the view, and the environment an object of its own are common to all read; which side the environment hangs on is not (here the scene's, as the scene DSL has it). Still against that: the per-pixel accumulation buffer is made with the scene's data. Resize moves it to the view.

The view at another size (2026-11-16, scene step A3). A view's size was fixed when it opened: the window could not be resized, and the per-pixel samples were made with the scene's data. The view owns every buffer that follows its size now (live/targets.rs: the samples, the passes' own and their bind groups, the output, the kernel's four), and LiveCore::resize makes those again and nothing else: the scene's data, its acceleration structures and the radiance cache stay, the frames' histories start again. Bistro, to 1920 × 1080 or 2560 × 1440: 0.5 ms on the CPU, and the next frame waits for the GPU about half a frame longer, once (a rebuild there is 0.7–0.9 s). The window (play) is resizable and follows its size and its display's density (view.rs fit), and takes each answer of the surface as wgpu documents it (acquire): before, a window the system resized (moved to a display of another scale) reported surface: Outdated on every frame from then on (#101). A covered or minimised window has no present to pace its loop: it configured its surface and printed an error on every turn and took a core (96 %); it says so once now and waits for the next frame's time (3–4 %), the game's frame running as ever. The headless runner takes {"cmd":"resize"}. A test holds a resized view to one built at that size (state, picture; the scene's buffers and the cache the same handles) and fails with each of four steps of resize left out; on Bistro a view resized and back is the view only reset (dE 0.18, SSIM 0.9995 at the same frames). Left: the browser host's view is still fixed; the merged layout keeps the cache in one buffer with the size's buffers, so a resize there empties it; a drag makes every buffer again at each step.

One build above the triangles a commit (2026-11-16, scene step B, first part). Each edit a commit applies in place (moved instances, an instanced object's copies, procedural geometry, a rigid model's pose, a shared pose's mesh, re-transformed triangles, a geometry edit) built the acceleration structures it had touched itself, in its own submit, and was told by an argument whether a later one would build the TLAS for it; a geometry edit always built it, so an edit with a move built it twice. They now write their data and note what is to build (gpu::TopBuild), and the commit builds once at its end (LiveCore::build_top): every BLAS named and the TLAS in one call, or software traversal's top tree; its CPU time is the frame log's build, and edit, instanced, skin and upload no longer hold a build's share (numbers read before this are not comparable there). That call is also the only safe shape on Metal, where a TLAS built apart from a BLAS it references can see it unbuilt and lose its instance, in the next submit too: a shared pose that changed with nothing moving built its mesh in one submit and the TLAS in the next, and in a process that had rendered other scenes before the models were gone. tests/render/skinning-shared-pose-live passed through it (where the old arm was, there was sky: with no model too); it now holds the chest against that place, and fails on the code before. A test holds moves and edits in place, alone and several in a commit, to a view built from the world as it is then (live::inplace_tests::moves_in_place_leave_what_a_build_does: 0.02–0.08 of an 8-bit step; 0.9 with nothing built), with one build a commit. No other picture changes (render-identity: 239 outputs).

One proxy an object (2026-11-17, scene step B, second part). Where what an object draws landed was spread over fourteen maps keyed by the object: nine the build filled (its object-table entry, its card, its dynamic triangles, its instance, whether its moves are the instance's, its rigid model, its pose group, whether its mesh is its own, its emitter mesh, its instanced copies), four the edits kept beside them for what they placed (its record, its value as picks test it, an instanced range, the mesh it draws) and one for procedural objects. They are one table, scene::Retained::proxies: Proxy { object, card, draw }, Draw = Fixed | Dynamic | Instance | Procedural | Rigid | Instanced. A proxy holds the object's record; the record's value is in instances[record] or procs[record - the first procedural record], for what an edit places as for the build's, and a record's slot is inst_base + it for all of them. "An edit placed it" is its record being the room's (EditState::in_room); a mesh a body drives moves as an instance because its proxy says so, whoever placed it. Lights, media and particles keep their tables' own indices (a table a kind). No picture changes (render-identity: 239 outputs), the voxel level's debris and batch routes time as before. Two faults went with the maps, each shown by a test first: an instanced object the build flattened had an entry in none of them, so removing it in place did nothing and it stayed in the picture (it has a proxy now, and is rebuilt out); an instanced object an edit added had an object entry of its own beside its copies', so its node's power or customData wrote over copy 0's. Still two mechanisms in what they can do: what the build flattened or placed as a model's instance is rebuilt to change, what an edit placed is not moved unless a body drives it (step E).

The light list holds its triangles (2026-11-17, scene step D, first part). Light sampling read an emitter's triangle from the triangles' table as world space, so whatever emits had to be stored there in world space: flattened, or a mesh of its own written in world space (Tokyo: 1,627,052 triangles flattened for it). The list has its own copy now, the way real-time engines keep a light list: Table::EmitterTris, one GpuEmitterTri an emitter (v0, e1, e2 in world space; its triangle, for the attributes; its object, for its power; the light tree's path code). The kernel's emitter sampling, light LOD, cull and the BSDF rays' weight (emit_mis) read it; a CDF entry names its emitter, and a triangle's attributes its emitter entry (x.w, where the path code was). The copies follow what moves: those of the emitters the CPU moves are rewritten when they do (move_emitters), those of the emitters edits make are written with their entries (write_emitters). A particle's is still read where its pass places it (F_PEMIT). Nothing is placed otherwise yet. What it costs: 48 B an emitter (Tokyo +78 MB); the trace +0.07 to 0.10 ms where emitters are sampled (Bistro 7.18 -> 7.29 ms, Zero Day 7.52 -> 7.59, the crowd 7.25 -> 7.32, Kabukichō 12.57 -> 12.63, Tokyo 4.41 -> 4.42; nothing in a scene without emitters), not attributed: a typed view of the table times the same, so does reading the rows without the record's struct; the crowd's 21,280 moving emitters take 0.2 ms of CPU a frame to rewrite (commit 4.88 -> 5.08 ms), which a GPU pass is to take over, with the particles' and the instances' (the next parts). Pictures: the big scenes within main's own run-to-run difference; of the suite's 239 outputs, 26 that repeat themselves differ from main's, in the last bits offline (up to 3.7e-7) and by a sample that falls otherwise in a few live ones (up to 2.1e-3 of a value; sums within 3e-5). That is Metal's compiler rounding the new kernel otherwise: on Vulkan (RTX 5090) every one of the 26 is byte-identical to main's, natively and under software traversal.

The light list is filled on the GPU (2026-11-17, scene step D, second part). What moves an emitter after the list was written is copied into it by a pass (emitter_fill.wgsl, what real-time engines call preparing the lights): a run of the list an invocation row, each emitter's rows taken again from its triangle. Two sets of runs a scene (EmitterRuns, gpu::EmitterFills): the emitters of the triangles the CPU reposes, filled after a commit that moved them, in place of the CPU's rewrite (the crowd's commit back at main's: 4.5 ms in a guarded run, 4.9 to 5.0 with the rewrite); and the particles', filled after their passes, so the kernel reads every emitter from the list and its particle case is gone. Pictures: against the first part, 217 of the suite's 239 outputs byte-identical, 19 within their own spread, the two light-sampled particle tests in their last bits (their kernel variant reads other code); Bistro and the crowd within main's own run-to-run difference. Next: emitters on instances, their runs filled by the same pass through the instance's matrix.

Emitters on instances: a mesh of its own (2026-11-17, scene step D, third part). A mesh with its own BLAS whose material only emits was a case apart: its triangles written in world space at an identity placement, never shared, rebuilt to move. It is a mesh as any other now: in model space, shared by the objects of its geometry and material, placed by its instance's matrix, moved by the instance when a body drives it. The light list has a run an instance (Instance::first_emitter: its first, carried in its record; the mesh's triangles are numbered in their attributes, InstMesh::emitters), each emitter with its triangle in world space and the instance that places it (GpuEmitterTri::inst, where the object was): a light sample still reads no matrix, and takes its attributes through the instance as a hit does (the object, the texture LOD's offset). A ray that hits an emitting triangle finds its emitter at the instance's first plus the triangle's number. An instance that moves has its run filled by the pass through its matrix. The edits in place work as before (a mesh added, given other triangles, removed: the instance's run reused or left at no weight). Under software traversal a unit's two flags share a word, and the word freed is every instance's first emitter. Pictures: the tests with such a mesh render other samples (13 of the suite's outputs differ from before, sums within 1e-4, every verdict as before); the voxel night level, whose 192 lamps are instances of shared meshes now, reads the same to 0.15 % over a 4 x 4 grid, with 0.4 MB less BLAS; the voxel level's destruction bench runs as before (no fallback, edit 0.7 ms). No cost: the trace on Bistro 7.17 -> 7.10 ms, the crowd 7.33 -> 7.29, the night level 4.16 -> 4.16. A new test holds the weight of a ray that hits an instance's emitter to its analytic value (geometry/emitter-instance: no test saw that entry). A model's and an instanced object's emitters are still flattened (the next parts).

Emitters on instances: a model's (2026-11-17, scene step D, fourth part). A model's triangles that only emit were flattened at every placement (world space, for light sampling: the reason #147 took away), and a movable or posed model re-transformed them on the CPU every frame. They stay in the model's mesh now, as every real-time engine has them: a static placement's, a movable model's (the instance moves), and a rigid posed model's moving nodes' (repose_rigid fills their runs of the light list through the pass). The mesh's emitting triangles are numbered among its triangles (number_emitters), an instance's are a run of the list. What the build flattens of a model is its glass and its material functions, and one case of emitters: a triangle that emits with a cutout on exactly its vertices goes with the cutout (Zero Day has one such pair: kept in one mesh the decal's pass-through stepped the ray past the emitter, a region 3 % dark; the unbiased check on Zero Day is the guard, and fails without the rule; flatten_coincident, for a still placement and a rigid model's moving node alike). A mesh that deforms (a shared pose, a skinned model) still flattens its emitters; a model with emitters added in place still rebuilds, as before. Flattened a placement: Tokyo 1,800,744 -> 0 triangles, Bistro 20,638 -> 0, Zero Day 10,105 -> 4, the crowd's Bistro's moving nodes 18,400 -> 0. Cost and gain (trace p50, main -> this): the crowd 7.38 -> 7.37 ms and its commit 4.46 -> 3.61 ms (the 18,400 triangles are no longer re-transformed, uploaded and built again each frame); Bistro 7.20 -> 7.13; Zero Day 7.68 -> 7.71; Tokyo 4.47 -> 4.60 (+2.9 %). Tokyo's cost is the emitting triangles' being instanced: with every model flattened (THREERT_INSTANCING=0) both builds read 4.44 to 4.48, and instancing the other 21.3 M triangles costs nothing. Its mechanism is not established (ruled out, each by a build: the record's reads, the attributes' and the list's order, emit_mis's descents, the shadow rays' ends; it grows with the paths' depth). Taken on the user's word (2026-11-17): the mesh whole in its instance is the standard structure, and what direct-light resampling and moving a still model in place need; the way back, if wanted, is merging still geometry whole, as its own measured step, not taking emitters out of their meshes again. Tests: geometry/emitter-model (a model's emitters, analytic; tests/render/data/panel.glb), the readback test with a model still, movable and posed. Still flattened: an instanced object's copies (the next part).

An instanced object's emitters (2026-11-18). The copies of an instanced mesh whose material only emits are instances of its one mesh, as any other copies are, each with its run of the light list (the capacity's, shown or not). A copy not shown (past count, or scaled to 0) has no power in its object entry: its emitters stay in the list and in the light tree at no weight, at their mesh's own area, so showing it needs no new entry; while hidden it bounds nothing there (the refit of the tree's moving subtree skips a hidden instance's emitters). A change in place (update_instanced) takes the copies' triangles again on the GPU and refits the tree's moving subtree; when a copy changed size or power, or was shown or hidden, the emitters are weighed again in the same commit (the CDF and the tree's powers whole, on the CPU, as a power edit without the worker: a scene with such copies has none). Removed in place, its emitters go as an instance's do. Still a rebuild: an emitting instanced object added in place. Still flattened: glass, material functions, mirrored copies (the next parts). Tests: geometry/emitter-instanced (analytic), geometry/emitter-instanced-live (copies moved, scaled up and shown in place), the build's, and the edits in place against a build (a copy moved, larger, shown, hidden two ways, the node's power, the object removed; with and without a light tree).

Material functions and mirrored placements on instances (2026-11-18). Two more reasons to flatten a mesh at every placement are gone. A material function's inputs outside full shading (the alpha test of a candidate hit, an emitter's radiance in light sampling: mat_in_at) read the triangle as world space; they now place it by its instance, as full shading does. A placement with a negative scale (a mesh, a model, an instanced object's copy, a rigid model's node, whose mesh was built with its winding swapped instead) is an instance whose record says that it mirrors (INST_MIRRORED): the kernel's placement takes the sign for the geometric normal's side and the tangent frame's hand. The flattening path (software traversal without units, a model's glass part) swaps the second and third vertex of such an instance's triangles, with their attributes and vertex colours. A copy may become mirrored in place. An emitting instanced object added in place now gets its emitters there (a run a copy at the list's end, by power share where a tree has no place for them, as a driven mesh added in place). What the build still flattens at a placement: glass (the next part). Tests: a function's emission and a function's alpha on a mesh far from the origin, the tangent frame's hand and the geometric normal through a function on a mirrored mesh, vertex colours on one (each natively and under software traversal); the flattening of an instance against the build's flattening, mirrored too; a mirrored model's build; a copy mirrored in place; an emitting instanced object added, changed and removed in place against a build.

A mesh is its geometry's alone (2026-11-19, the material on the instance, first part). A mesh was shared by the objects of one geometry and the same materials, a triangle holding its material: two objects of a geometry with different materials held its triangles and its BLAS twice. Now a scene mesh's and an instanced object's mesh is keyed by its geometry (Retained::own_mesh, scene::section_mesh). Its triangles lie by section, a geometry group or the whole geometry, each a geometry of the BLAS, all flagged opaque, and hold their section and their index in it. An instance has a row a section in the words' heap (scene::Row, heap.rs Stream::Rows; its record has their first): the material with its class, the section's first triangle, its first emitter. The kernel reads a hit's material, whether it is a cutout or glass, and its emitter through the row (material_of, row_word); the trace's test of a hit reads no attribute and no material. Whether an instance casts a shadow, has a cutout or glass, emits: its rows say (rows_cast, rows_bits, rows_emitters). Glass among an instance's other sections is stepped through by a shadow ray, as a cutout that lets it pass is; an instance that is all glass is out of its way by its mask, as before. Vertex colours are the geometry's, and a material says whether it reads them, where they were baked white for one that did not. Software traversal: a unit's cutouts and glass by its rows, asked only of a unit that has some. Models kept their layout until the next part (materials on triangles, a BLAS geometry a class). Edits place what they placed (one section; a row a record of the room). A material that starts emitting gives the instances with a row of it their emitters, and writes no attribute. Still a rebuild: a several-material mesh edited, a material that turns glass or cutout, vertex colours asked of a mesh made without them. Tests: a geometry's sections and an instance's rows; six objects of one geometry with six materials (one reads its vertex colours, cutouts, glass, an emitter) against a geometry an object, at the build, one placed in place, two given another material; a pane and its frame as one mesh against a mesh each, under a sky sampled as a light; the light list's emitters found through the rows.

Every mesh has sections and rows: models too (2026-11-19, the material on the instance, second part). A glTF model's mesh kept the old layout: its materials on its triangles, a BLAS geometry a class. Now it lies by section as a scene mesh does, a section a material of the file (scene::model_sections): a still model's mesh, a posed rigid model's moving nodes, a shared pose's mesh (skinned again with each triangle in its section). Its instances have its rows (Retained::mesh_rows). With one layout left the kernel has no feature for it: an instance's hit reads its material, its class and its emitter through its row, and only world-space triangles hold their material (the still scene's, what is flattened). An instance's rows are a run of the rows' room, as many as its mesh's sections (EditState::rows, take_rows, give_rows): a model of several materials is placed and removed in place, and what is removed gives its rows back. As before: a model is one mesh with one BLAS; a posed rigid model's still nodes are flattened; a deforming mesh's emitters are flattened. Measured: the meshes and their memory as before (Bistro one mesh of 132 sections, its BLAS 390.3 MB). GPU time a frame on twelve scenes, four alternated pairs against main: Kabukichō -1.5 to -2.1 %, a crowd of skinned models +0.1 to +1.5 %, the voxel level +0.1 to +0.6 %, the other nine within 0.8 %. Tried and dropped: a TLAS instance's custom data its rows' first, with the record in the row. About 1 % slower on two scenes, not explained. Not tried: the same with the record from the hit's instance index, which reads no row for it. Tests: a model's sections and rows at the build (a_models_mesh_lies_by_section_a_material_of_the_file); a model of three materials placed, removed and placed again in place, its rows on the GPU; rows apart from records in the in-place tests' world, rows given back; two models in a shared pose posed again in place (tests/render/data/arm.glb, a skinned strip of two materials); geometry/emitter-model-live (a model's emitting section that is not its first, the model a unit under software traversal).

Textures, models, functions and lights come in place; the kernel is made beside the frames (2026-11-23). A game that brought a texture, a model, a material function or a light while it ran had the scene built again from the world, and a feature a scene first used had the next frame wait for the driver's compile. On Bistro (2.8 M triangles, 960 x 540, an M5 Pro), the frame the edit landed in:

before now
fog appears (a kernel variant not compiled before) 0.8 to 2.4 s no long frame (28 ms at most)
a mesh with a new 256 x 256 texture 4.5 to 4.6 s 39 to 56 ms
a mesh with a new material function 2.3 to 4.2 s no long frame (19 ms)
a model the scene has not (15 k triangles, five 2048 x 2048 textures) 4.8 to 5.2 s 223 to 233 ms, then 85 to 138 ms
a point light comes 1.5 s no long frame (19 to 26 ms)
the light goes 1.3 s no long frame (17 to 22 ms)

The texture pages keep where each texture lies (texpack::Atlas) and take another without being packed again, growing by a copy on the GPU; a still model's materials, textures and mesh are made by the code the build and the scene meshes' edits use; functions are numbered in the order they come; a light's entry is added, dropped or sorted within the table as a build lists it. A new kernel variant is made on another thread while the view runs the one it has (docs/RUNTIME.md "What comes in place" has the rules and what still rebuilds). The model's frame is its images' decode, on the frame's thread still. Not freed: a texture or a material nothing uses any more keeps its place until the scene loads again (the allocator's step). Tests: each kind of edit against a build of the edited world, state and picture (textures_come_and_change_in_place, a_model_the_scene_has_not_got_comes_in_place, material_functions_come_and_change_in_place, lights_come_and_go_in_place); a variant made while the frames go on; the atlas's places; the world's rules. Mutations: 26. 25 failed a test there was; one, a texture put on a shelf too low for it, none, and has its case now. Found by review: a translucent particle's material given another function kept the kernel's old dispatch for the translucency pass, which has its particles' functions alone; the kernel is made again where those are others.

An empty slot of the top-level structure is an instance at a point (2026-11-27, after it). The patched build of the top-level structure wrote an empty slot as an instance of a zero transform (renderer/third_party/wgpu-core/ PATCH.md), and a scene with room for edits has a thousand of them. On Metal such a structure lost hits: a scene of one wall was black from everywhere, and a camera at the world's origin saw nothing in others (the cause of eleven render tests that failed between 2026-11-23 and 2026-11-25, while every scene had eight such slots). An empty slot is now the same instance scaled to a point (1e-6 of its size, as an instance placed without size is) where the structure's first instance stood, with mask 0; slots left empty before the first instance came are written again when it comes. Test: the_camera_at_the_worlds_origin_sees_what_it_sees_elsewhere (black under hardware traversal before). Not checked on Vulkan.

The emitters' weights are made on the GPU (2026-11-27). An emitter's weight (its area × its material's emissive luminance × its object's power), the cumulative table, its guide and the light tree's powers were made on the CPU, over every emitter, at each power or material edit: 59 to 74 ms in the frame of a material edit in Tokyo's time-of-day room (1.63 M emitters), and 53 to 58 ms on a worker thread for a lamp switch, which landed three or four frames later. Passes make them now (emitter_weights.wgsl) from the GPU's own records, materials and powers, in the frame after anything they depend on changed: the edit costs the commit nothing, and that frame 3.5 ms of GPU time there (0.1 ms or less at 10 000 to 20 000 emitters). The kernel reads the total and the tail's share from the table's header. The CPU still makes the table's order and the tree when emitters are added; a retired run's records say so, a particle's record has its nominal area. The worker thread and the deferred powers are gone. Scenes whose emitters move make their weights every frame. On the heavy clips the pictures and a frame's GPU time are as before (within 2 %). Left for later: only the changed runs (if a city's dusk needs it), and the emissive map in the weight (tried on the CPU at load: Zero-Day's ΔE 3.32 → 3.09 and flicker 2.06 → 1.80, the crowd's flicker 1.97 → 2.09: not taken as built). Tests: the_gpu_weighs_the_emitters_as_the_cpu_does and its variant without a tree hold the GPU's tables against the CPU's through power and material edits and removals.

A camera ray's fog light is seen directly (2026-11-26). The ambient light height fog scatters towards the camera joins the emission signal, as the aerial haze does: it was part of the surface's diffuse light, which the filters divide by the surface's albedo, so fog before a black surface was lost. The first step of taking fog out of the path's signals; its attenuation and its sampled scattering follow with a volume of their own. Test: the_fogs_ambient_light_is_seen_directly.

A pixel on a mirror has the surface the mirror shows (2026-11-25, after it). The second step of the frame's structure: the first pass follows a camera hit that is a mirror to what it shows, and that surface has the pixel's guides, motion vector and signals (docs/RUNTIME.md "The live architecture"). A mirror's picture changes: what it shows is filtered, reprojected and upscaled as a surface seen directly, where it was the mirror's specular signal. Glass is as it was. Tests: a_pixel_on_a_mirror_has_the_surface_the_mirror_shows.

A live frame's camera rays in a pass of their own (2026-11-25). The first step of the frame's structure: the kernel's first_hit traces the camera rays and leaves each pixel's hit and motion vector, and main starts its paths from the hits (docs/RUNTIME.md "The live architecture"). The pictures are the same. It is there for what comes next: a mirror's first hit replaced by the surface it shows, and light sampling that reads this frame's depth and motion before the paths. Test: the_first_pass_leaves_the_camera_hits.

Nothing reads a world-space triangle (2026-11-25, after it). Nothing made one any more; what read them is deleted. Hardware traversal: the traversal groups and their BLASes, with the feature for a group past 2^24 triangles and the bit that told a model's TLAS instance from a group's (an instance's custom data is its record). Software traversal: the tree over the scene's own triangles and its walk (the kernel's trace is the units' walk, then the procedural objects'; the node buffer starts with the mesh trees). The kernel: a row a triangle, and what a hit without an instance read (the test of a hit's instance stays where its record is read: every hit passes it, and without it a frame is 1 to 3 % longer in some scenes, a crowd under the sky 6.36 -> 6.57 ms). The CPU: Scene::tris and what went with it, posed models as triangles the CPU moved, their emitters, picking over them. A deletion: the pictures are the same, with one exception that is not this step's doing. A TLAS's empty slots are instances without extent at the world's origin (the patched wgpu's, since 2026-11-23), and on Metal a ray that starts there loses its hit, as do a few that pass it: the groups' eight slots were empty in every scene, and with them gone a scene whose TLAS has no empty slot renders such rays right (eleven render tests under hardware traversal, failing since then, pass). A TLAS with an empty slot (an edit room, an instance removed) still has it.

Software traversal has units alone (2026-11-25, after it). An offline render under software traversal flattened every instance into world-space triangles (kept so on 2026-11-11, for its bytes to stay main's while units were new), and so did a scene with a mesh no tree could be made of or with more instances than a top tree holds. Now prepare gives software traversal units wherever it is, an offline render's bytes change once, and THREERT_UNITS, flatten_instances and flatten_deforming are gone: an instance of a mesh without a tree is no unit (a particle system's; a mesh with a vertex that is not a number, which is said). Measured before, offline (480 x 270, this machine): the trace 4 to 5 % longer on the large single models and a crowd of 792 instances, equal on 812 small ones; the tree build 1.2 to 8 times shorter and the triangle data 10 to 80 % less; the picture hardware traversal's (2.4 steps apart a pixel at 128 samples, where the flattened one was 10 from both); a render repeats byte for byte. A kernel with units has the loop guard by default, an offline render's too now: about 10 % of its trace. The rays' test of a prepared scene (a_scene_with_units_is_its_triangles_to_every_ray) holds the walk to every placed triangle tested one by one, where it held it to the flattened scene's walk.

The build flattens nothing (2026-11-25, after them). The last two things it flattened:

  • A posed skinned model with triangles that emit was flattened whole and skinned on the CPU. It is a skinned instance as any other, and the triangles are its instance's emitters: at a new pose the light list's copies are taken again on the GPU from the skinned vertices, the CPU places the emitting triangles alone (the light tree's moving subtree is refit by them) and their weights follow the pose's areas. One placed without size is an instance no ray sees. A cutout on exactly an emitter's vertices is left out of a skinned model's mesh: it is one mesh, where the cutout's holes would take the emitter with them, and what is drawn is the emitter, as where the two are meshes apart.
  • THREERT_INSTANCING=0, the flattened reference of the instancing step, is gone with the build's arms it alone reached (a mesh's, an instanced object's copies', a model's). tools/check-instancing.ts holds software traversal to hardware traversal's render now.

World-space triangles are left under software traversal alone, where an instance is no unit (lib.rs flatten_instances, flatten_deforming); what read them under hardware traversal is not deleted yet.

A light's card, a coincident pair and a model without size are instances (2026-11-25, after it). Three of the things the build still flattened into world-space triangles:

  • A visible rect light's card is an instance of one card mesh, a unit quad: its size is its transform's, its material its row's, and it moves as its instance, under software traversal too. An emitter's entry in the light list says whether it is a card's (it lights one side), where the kernel read the triangle's material. A card of another size is the build's: it was taken in place, and only its material changed.
  • A triangle on exactly another's vertices (a cutout on an emitter, glass on what is under it) alone leaves its mesh, for the model's second mesh, with an instance beside the first: a BLAS apart, as the flattened pair was. A posed rigid model with such a part is hidden and removed in place now. A movable still model with one moves by a rebuild (it was re-transformed on the CPU).
  • A model placed without size is an instance no ray sees, as a mesh is.

Flattened still then: a posed skinned model with triangles that emit, and a scene under THREERT_INSTANCING=0; under software traversal, what has no unit. Which of a pair is drawn is as it was: a scene with the pair near and far renders to main's picture, byte for byte, under both traversals.

Five A/B switches and the uniform tables are removed (2026-11-25). Switches whose question was answered, or that nothing set: THREERT_EDIT_BLAS (an edit mesh's BLAS is built fast), THREERT_LIGHT_GROUPS (measured: +4.6 ms of trace without the groups), THREERT_RIGID_NODES (measured: 4 to 10 % of GPU time with every node apart), THREERT_CACHE_FLAGS (the radiance cache's four experiment bits, read at four places in the kernel) and THREERT_TL_HIDE (a diagnostic of the translucency pass). And the uniform tables, Android's first way round a driver that misread four of the kernel's tables (docs/RUNTIME.md "Android"): since the device reads the tables whole (2026-11-16) no platform had them by default. Their kernel blocks, the per-frame copies, the bounds and their three tests are gone, with GpuOptions::uniform_tables and THREERT_UNIFORM_TABLES. The records that name these switches are of their time. Kept: THREERT_LTREE and THREERT_LT_RIS (the light sampler's kind and its candidate count), THREERT_TABLE_VIEWS.

The raster experiment is removed (2026-11-24, after it). Primary visibility by rasterization (§ 1's decision experiment, THREERT_RASTER=1) stayed in the code after its verdict: a render pass of the world-space triangles, a texture in the kernel's second bind group, a parameter and a branch at every path's first hit. It drew nothing in a scene with a mesh since meshes became instances. All of it is gone; § 1 keeps the experiment's record and figures. The kernel's parameter has the frame's jitter and the "rays off" switch still (jitter). Tests: the "rays off" switch had none and has one (rays_off_is_another_picture_and_on_again_the_first: what was in shadow is lit, on again the picture is the first); three mutations of the parameter's places, one of which the test's first form let through. A live keyframe of a heavy interior reads as before, with and without the loop guard.

A particle system is a mesh and an instance (2026-11-24). Particles were world-space triangles of their own kind: two a particle among the scene's dynamic triangles (the translucent ones after everything else, in a BLAS of their own), a row a triangle, their emitters by a nominal area in the triangles' attributes, every size fixed when the scene was uploaded. Now a system is what any geometry that deforms is: a mesh of the pool (a quad a particle, four vertices), one instance, a BLAS of its own built again after the particle passes. Stateless and stateful systems, those the lights are sampled by (their triangles are the instance's emitters) and translucent ones (an instance of the translucency pass's TLAS each) alike; a particle keeps its own object, which a hit finds from its instance's and its triangle. The world-space form is gone from the build, the layout, the passes and the kernel. The cost is a BLAS build and a TLAS instance a system, where all systems shared four BLASes at most. A frame's GPU time on Bistro with opaque particles added (1280 x 720, an M5 Pro; runs alternated): 16 systems of 1024 particles, 21.25 to 21.48 ms for 21.15 to 21.63 (no difference); 256 systems of 64, 21.44 to 21.55 ms for 21.07 to 21.11 (+0.41 ms, 1.9 %: 0.16 ms of it in the trace). Not changed: a system that comes or goes, a particle function or program, still rebuild the scene. Tests: the build's five kinds of system (a_particle_system_is_a_mesh_of_quads_and_an_instance); a particle's previous positions and the motion at its pixels beside another system; translucent/systems (two translucent systems, their order reversed between the image's sides). Mutations: 28 (the build and the layout, the passes' previous positions, the kernel's object of a particle, the builds after the passes, the translucency pass). One had no test, a pass's first frame taking the build's positions for its previous ones, and has its assertion now, for both passes; the others failed a test there was, one of them by the renderer stopping.

Volumes and density grids come in place (2026-11-23, after it). A volume that came, went or was set again while a game ran, a still volume's first move, a volume function, a new density grid and a grid program each had the scene built again. On Bistro (as above), the frame the edit landed in:

before now
a homogeneous volume comes (the scene's first medium) 1.4 to 1.6 s no long frame (18 ms at most)
a volume with a 32³ density grid comes 1.3 to 1.4 s no long frame (27 ms)
a volume whose 32³ grid a program simulates comes 1.2 to 1.4 s 128 ms, the program's pass compiled; 19 ms once the driver has it
the first volume goes 1.1 to 1.2 s no long frame (21 ms)
the simulated one goes 1.2 s no long frame (18 ms)

Before, a rebuild that needed a kernel variant the driver had not compiled took 5.1 to 5.4 s instead; now the variant is made beside the frames, and the volume is drawn when it is there.

The media table is made whole from the world by the code the build has for it (LiveCore::set_media, scene::MediumGpu::of), volume functions are numbered in the order they come, and the kernel's count of media and its media features follow. The density grids follow the volumes that name them (Gpu::put_grids), stacked by the function the build stacks them with (scene::grid_of): when a grid comes, goes, or has another size or program, or a program's code changes, the atlas and the programs' pass are made again and what the programs had simulated is copied on the GPU to the grids that are the same still; new parameters, and a grid that passes to another of its volumes, make nothing again. Costs that stay: a grid program's pass is compiled in the frame it comes in (the 128 ms above), and one atlas holds every grid, so all are made again when one comes or goes. Tests: volumes_come_and_go_in_place and density_grids_come_and_change_in_place, each edit against a build of the edited world, state and picture, with the cells a program had simulated read back; the world's rules. Mutations: 23. 20 failed a test. Two had none, a media table that grew and was not bound again (the tests had two volumes, the table room for two) and a grid counted the same although its volume was another, and have their cases now. One was no fault: where a grid lies follows from the grids before it, and that comparison is gone. Found by review: a still volume that was moved left its grid's program running in the box where it had stood; a volume edit in place did not hold the lighting's histories short for the frames after it, as a rebuild did (nor had a volume shown or hidden in place before this).

A tangent is a vertex's (2026-11-23). A triangle had one tangent, its first corner's, and a model whose file had none had its frame made a triangle at a time where it was hit: a normal map's detail turned at every edge of a curved surface. Now each corner of a file's triangle carries its own through the build, corners that differ in tangent are vertices apart, and the kernel takes a hit's tangent from its three vertices at the hit (the hand from the first). A primitive of a file with UVs and no tangents has them made where it is loaded, as the glTF specification says, by MikkTSpace (tangents.rs, on bevy_mikktspace, a crate without dependencies), a corner each. Made for every such primitive, not only where a material reads a frame: 1.4 to 2.9 M triangles a second on one thread, and 0 to 0.4 % more vertices on the files measured, so a material that starts reading a frame needs no rebuild. Against the tangents two sample files carry themselves, 897,150 corners: 3 more than a degree off, none of the other hand. A scene's own geometries, which have no tangent attribute, keep the frame made at the hit. Pictures: offline at 8 samples against the build before, three scenes without normal-mapped models are the same bytes; the home showcase (models without tangents under normal maps) differs in 5.4 % of its pixels, by 0.08 steps in the mean; the museum in 1.2 %. A frame's GPU time in twelve scenes, one run against the build before: between -1.2 % and +0.6 %, which one run does not tell from none. Tests: a quad whose file has a tangent of its own on each side, by the gradient a function draws of it (material/function-vertex-tangents: 1 with one tangent a triangle); two quads whose file gives one hand each, by the side their bitangent points to (material/function-file-hand); the tangents made for a quad, upright and mirrored, and for a primitive whose texture mirrors along an edge (the edge's vertices twice, their joints and weights with them); corners apart by tangent or by hand, a skinned mesh's too; a model's triangles, its skin's corners and a placed triangle each with a tangent a corner, under a mirroring placement too. Mutations: 18 (15 of the build, 3 of the kernel). 15 failed a test there was; one, a hand never read at a hit, none, and has the hand's test now; one, a corner without a tangent that says it has one, none, and is asserted now; one changed nothing: a branch of the generator that its last pass repeats, removed.

The kernel's loops are bounded (2026-11-23). The kernel was the one shader compiled without wgpu's loop bounding (every loop given a count its compiler can see the end of); every other pass has it. Its loops end on sound data, which is no promise to a compiler that they end. Without the bound, the kernels Metal's compiler made lost the state of whole SIMD groups (8 × 4 pixels) on the home showcase, a scene with cutouts, one build and not the next. Nine builds of this kernel that differ by a statement that changes nothing (a counter, a branch never taken), under the loop guard: in six the guard stopped 14 to 43 invocations a run; with the bound, in none. Five builds of the next change's kernel (triangles as vertices and indices) drew 94,000 to 112,000 of the picture's 518,400 pixels wrong without the guard; with the bound each drew the right picture. Bounds checks and ray-query tracking, turned on alone, changed nothing and stay off. THREERT_CHECKED=0 is the kernel as it was. What it costs: under hardware traversal a frame's GPU time in twelve scenes, alternated twice with the kernel before, is -1 % to +4 % (Zero Day +4.0, the neon street +3.8, the colour room +3.6, the crowd +2.9, the others under 2, Tokyo -1.0); under software traversal, whose tree walks are loops, the trace of a crowd of 3.3 M triangles is 85.3 -> 90.6 ms (+6 %). The pictures and the suites are the ones before. Triangles are vertices and indices (2026-11-22). Every triangle carried its own three vertices (48 bytes), its shading attributes (96) and, under hardware traversal, its positions again as the BLAS's input (36). Now the scene has vertices, a record of 48 bytes each (position and u; normal and v; tangent), and a triangle is three indices (renderer/src/indexed.rs; docs/RUNTIME.md "The scene's triangles"): one layout for both traversals, and the BLASes are built from the same vertices through the indices. A mesh's vertices are a run of their own: the skinning pass skins a vertex once (it skinned every corner), the particle passes and the light list's fill write and read vertices, the previous frame's are kept a vertex, and an edit in place takes a run of vertices with its triangles. The kernel binds one buffer fewer. A mesh's triangle has no data of its own besides. Its hit says which section of its mesh it is in (the BLAS's geometry; under software traversal its tree's leaf); the section's row of its instance has the material, the instance's record the object and whether the mesh deforms; the light list's record (64 bytes, was 48) has an emitter's section. A triangle no instance places keeps a row of four words. Software traversal's trees keep their triangles in their leaves, their own copy as an acceleration structure has one (48 bytes a triangle: v0, the edges, its section and its index there): a candidate's test read through the indices and the 48-byte vertices cost its trace 6 % (a crowd standing still, 85 -> 90 ms); from the leaves it is 81 ms. A pass takes a posed mesh's leaves again from its vertices. On the GPU, data and BLASes together: Tokyo (23 M triangles) 6.4 GB -> 3.9, Zero Day 1.6 GB -> 0.95, a small scene 15 MB -> 7.5. The BLASes themselves are as large as they were. A frame's GPU time under hardware traversal, twelve scenes alternated twice with the kernel before: the home showcase +4.2 %, the colour room +2.0, the museum +1.9, the crowd -2.5, Tokyo -1.2, the others within 1 %. What changes in a picture. A triangle's tangent frame, where its file gives none, is made where it is hit, not at the build: rounding (offline, software traversal, against the build before: two scenes the same bytes, one with 411 of 921,600 pixels off by 2 steps at most). Under hardware traversal the driver's tree over indexed geometry is another tree, and a few rays at shared edges meet the other triangle: five scenes at 8 samples differ in 3 to 2,408 pixels, by 3 steps at most but for single samples (8 steps; in one scene one sample, 22 steps over the 11 x 11 pixels the denoiser spreads it to). A skinned vertex whose position is not finite is at its mesh's origin now; its triangles were left out before. The build finds the sharing again, 1.2 s on Tokyo (a file's indices are flattened before: historical, a later step). Tests: indexed.rs's own (sharing; a seam or a crease; a first corner's tangent; a triangle that is not finite); the build's triangles through their indices against the scene's; the in-place tests read every triangle they check back through its indices (the light list's emitters with their sections; a skinned mesh's corners, normals, UVs, tangents and previous positions against the CPU skin, its record's deforming bit, each triangle's section and its index there); a mesh changed in place to more vertices; a moved card beside another, a drifting particle and a drifting GPU particle, by their motion vectors; a skinned primitive without normals, by the normal the camera sees; emitters in a mesh's second section against the same triangles a mesh each (live, and offline for the weight of a ray that meets one); a first frames' bounce off a mesh's second section and off a particle, which the kernel's second pass shades; a cutout particle; an emitting particle's two sides beside a light's card; material/function-file-tangent (a file's tangent is the one a function is given); the rasterized first hit (THREERT_RASTER, which had no test and is off in any scene with a mesh since meshes are instances) against the traced picture. Fixed on the way: a still mesh that emits, moved for the first time, had the pass that places moved emitters run over the emitters the move had just made, which the light list did not hold yet (its write landed on the list's last record); they are made where the mesh stands and the pass leaves them alone. Mutations: 28 of the first form (20 failed a test there was, 8 none and have their tests above), 27 of this one (17 and 8; one changes nothing, no deforming instance has its materials' classes remade in place; one is reached only by a live view without units, THREERT_UNITS=0, and has no test) and 17 of the trees' leaves (15 failed a test, one the walk's transcription alone, one none until the emitters' test had three at right angles). Next: tangents a vertex, interpolated (generated where a file has none); vertices packed to 32 bytes; a file's indices carried through the build.

A triangle's texel density is the hit's to compute (2026-11-22). Every triangle carried a constant for its mip choice, half the log of its UV area over its area, made when the scene was built; an instance added an offset for its scale, the skinning pass and the particle passes wrote it again each pose and frame. Now the kernel takes it from the triangle where it is hit, from its two edges as it stands in the world and its UVs (mesh_density), and nothing stores or writes it: the attributes' first x word and the record's third info word are spare. A level is one division and one logarithm (mesh_lod: the density, a footprint's square, what else divides); it was three logarithms. With a logarithm a term the frame cost up to 1.7 % more on the clips with textures or cutouts. What changes in a picture: nothing under a uniform scale but rounding (five scenes offline against the build before: four the same bytes, one with 21 of 921,600 pixels off by 6 steps at most). An instance scaled otherwise has its triangles' own density now; its offset was the cube root of its volume's scale. A fault found on the way: a shadow ray through glass on a scaled instance added the instance's offset twice, so a pane's colour or transmission map was read some levels off (a pane scaled to 1 / 32: five too high). The cutout test of a candidate hit reads its triangle's edges now too, where its material has an alpha map. Tests: the kernel's own mesh_density and mesh_lod, their text run on the GPU for 512 triangles (a millimetre to a hundred metres, UVs a hundredth of the texture to a hundred repeats, ones without area) against 64-bit values; a checker on an instance scaled 32 times, a square's inside reading its colour (a level five too high reads grey); the checker in a cutout's alpha on one scaled 256 times; a shadow through a pane with a colour map, the pane scaled 1 / 32 and 32 times (the first fails on the build before). Not held by a test: the density a light sample, a material function's input and a translucent particle read, and the ray's angle a surface's level is divided by (a wrong level there changes noise, or sharpens: no mean sees it). 12 mutations: eight of the two functions fail the unit test, four of the places that use them fail a render test. One did not at first: a cutout three levels too high still has each square's middle on its side of the test, so that test's instance is scaled 256 times.

A posed skinned model is posed in place under software traversal (2026-11-22). Under software traversal a mesh that deforms was written out into the still scene's tree, so every pose rebuilt the scene. Now it is a unit as any mesh. Its tree has the shape of a tree built once over its model's bind pose, one shape for every placement of the model (the pass's corners and each such mesh's triangles are in that tree's order), and the boxes of its pose. A new pose places the model's corners on the CPU, takes the boxes again (units::refit), writes the nodes where they lie and gives the top tree the unit's new bounds; the skinning pass writes the triangles and attributes as under hardware traversal, without the BLAS input. Hidden, shown and removed, it goes as any unit. Why the boxes alone: a tree made again for a pose costs sixty times as much (a character of 13,744 triangles, one core: 3.0 ms against 0.05) and walks 4 to 11 % shorter by its nodes' areas; the clip's first pose is no better a shape than the bind pose. Still a rebuild under software traversal: a skinned model added (its triangles and its tree need room, which a scene has there only with geometry of its own to edit, and which does not grow there). Measured, software traversal. A game with a character posed every frame: every frame rebuilt the scene, 30.6 ms of CPU; now none does, 3.2 ms. A crowd of 150 walkers: 2.0 s a frame; now no rebuild, 7.6 ms of commit. What a frame's trace pays, nothing moving, at 1280 x 720: four characters filling the view, 4.67 ms before and 5.20 now (+11 %), of which 6.5 % is the scene having units at all (its kernel had no unit walk) and 4.9 % the kept shape (the same units with trees built for the pose: 4.97); the crowd standing in a street, 85 ms either way. What a pose costs the CPU there: the corners' positions (0.2 ms a character of 13,744 triangles, one core) and the boxes (0.05). The crowd's commit is 7.6 ms, against 3.3 under hardware traversal, whose BLASes the GPU builds. Tests, under both traversals: four models of two files, each mesh's triangles, attributes and previous vertices on the GPU against the CPU skin; under software traversal each mesh's tree read back (its model's links, a leaf's box its triangles', an interior node's its children's), its bounds its root's, its unit's leaf of the top tree; the motion vectors of a pose no longer than the furthest a corner went; one hidden, posed while hidden, shown; one removed. A unit test of the boxes taken again (corners that are not finite too). 22 mutations of the new logic: 20 fail a test under software traversal, one natively (the pass bound again when the scene's buffers grow, which they do under hardware traversal alone), and one is equivalent (the pass writing the BLAS input under software traversal: the writes fall in a spare word no one reads; the constant saves the work). Three lines that told the traversals apart where no test could were taken out: the pose path is one for both.

A posed skinned model is added and removed in place (2026-11-21). A character that comes or goes while the game runs rebuilt the scene. Now one of a model the scene has is added as the build makes one: a mesh of its own in the room for edits, its triangles skinned on the CPU once for the pose it comes in, a job of the skinning pass for its next poses (the pass's table grows), skinned from the model's one copy of its corners. Removed, its instance is out (the build's or an edit's); one an edit placed gives back its triangles, its record and rows, its previous vertices and its job's slot, and the next one placed takes them. A mesh that deforms has its previous frame's vertices where its instance says (scene::Instance::prev, in its record): the kernel found them by the triangle's place among the dynamic triangles, which a mesh in the room does not have. Their buffer grows as the triangles' does. The kernel's read is a feature of its own (F_DEFORM: a scene with a mesh that deforms): in every kernel, a scene without one paid 0.6 % of its GPU frame for it (a flight over a city, five pairs of five). A fault found on the way: what a batch changed of an object (a pose, a move, its visibility) stayed when the same batch removed it, and the renderer rebuilt for an object it could not find. It goes with the object now. Still a rebuild: a skinned model the scene has not (its materials and textures load with one), one whose pose mirrors other primitives than the scene's, one added hidden and shown later, one added in a scene with particle systems (the rooms for edits do not grow there, for any edit: the particle passes hold the scene's buffers), and any under software traversal. Measured, hardware traversal, a game that spawns a character every half second and takes the oldest away (twelve at most): each spawn and each despawn rebuilt the scene, 31 times in 16 s, 46 ms each (the longest frame 79 ms); now none does, a frame that spawns or despawns commits in 3.5 ms (4.9 at most) and the longest frame is 21 ms. The frame between is the same: eight spawned and then none, at 1280 x 720, the GPU's frame is 10.6 ms either way (the trace 3.5, the BLAS builds 0.58). Tests: one added against the CPU skin (triangles, attributes, BLAS input, previous vertices) and a build's picture; its motion vectors at a new pose against a built one's, none longer than the furthest a corner went; moved, hidden, shown; 40 added at once (every room grows), posed on, half of them hidden and shown; 24 more in a commit that grows the pass's buffers alone; previous vertices kept mesh by mesh (a model removed before a frame is drawn, two whose triangles are neighbours and whose previous vertices are not, one posed twice between frames); one removed and the next added in what it had; a built one removed (shown, hidden, posed in the same batch); the three that rebuild. The pictures are compared with the build's frames counted from the live view's (a frame's samples go by its number: at another count a picture of many thin models is two thirds of a step from itself). 36 mutations of the new logic: 33 fail a test natively, two under software traversal, and one is equivalent (the CPU's copy of an added model's triangles: a fallback no path reads while the model loads). Eight did not at first: the scenes had no moving triangles before the meshes, motion vectors were compared with a build's alone (wrong alike in both), other rooms grew in every commit that grew the pass's, and no frame was skipped between two edits.

A posed skinned model is a mesh of its own (2026-11-21). Models in the same pose (the same clip and time) shared one mesh, found by the build; one of them taking another pose had to leave it, and that rebuilt the scene (and a rebuild grouped whichever models then happened to be in one pose). A model alone in its pose was no mesh at all: world-space triangles, skinned on the CPU. Now every posed skinned model is an instance of a mesh of its own (scene::Skinned), skinned by the pass at each new pose, never shared: another clip or time is in place whatever the others do, and the model is hidden and shown in place by its instance (hidden, a new pose skins nothing; shown, it is skinned as it is posed then). What the pass reads of a model is still one copy for all its placements. The grouping, its key and the switch that turned it off are gone. Still a rebuild: a skinned model added or removed; one hidden when the scene was built, shown; every pose under software traversal (the next step). Still world-space triangles skinned on the CPU: a model with emitting triangles. Measured, a crowd of 150 walkers (8 walk phases), hardware traversal, the builds in turn at 60 fps: a frame's commit 3.3 ms with a mesh a walker, against 2.1 with the 8 shared meshes and 2.9 before the pass; the BLAS builds 0.6 ms against 0.24. With the CPU skin the same 150 meshes cost 20 ms of commit (40 fps): the reason the pass came first. Tests: two models in one pose are two meshes skinned from one copy of the model's corners, posed again in place, and one posed alone in place; one hidden, posed and moved while hidden, shown (under software traversal, hidden and shown by a rebuild); four models of two files, each mesh's triangles, attributes and BLAS input on the GPU against the CPU skin, one posed alone and the others' left as they were, one moved alone. 10 mutations of the new logic: nine fail a test natively, the tenth (a model hidden where it has no instance to mask) under software traversal.

Meshes that deform are skinned on the GPU (2026-11-21). A new pose of a shared pose's mesh was skinned on the CPU and every triangle of it sent again: 180 bytes each (its vertices, its shading attributes, the BLAS's input). Now the CPU sends the pose's matrices (48 bytes a joint) and a compute pass skins the mesh where it lies (shaders/skin.wgsl, Gpu::skin): a triangle an invocation, from its model's corners as the file has them (skin::SkinCorner: position, normal, tangent, four matrices and weights; one copy a model, whatever its poses, Scene::skin_sources) and the pose's matrices (skin::Model::palette: a skin's joints, and the nodes of primitives beside it), into the triangles, the attributes' normals, tangent and texel density, and the BLAS's input. The commit builds the mesh's BLAS after it, as before (a BLAS is built again: wgpu has no update yet). The CPU keeps no triangles of such a pose: a click or a query skins the mesh when it asks (LiveCore::mesh_tris). A pose that mirrors other primitives than the one the mesh was made for has its triangles in another order: a rebuild's. An authored tangent of a skinned vertex follows its joints now (it was placed by the object alone). Still on the CPU: a posed model alone in its pose (world-space triangles: the next step makes it a mesh of its own), and every pose under software traversal (a rebuild there). Measured, a crowd of 150 walkers in 8 shared poses, hardware traversal, alternated: a frame's commit 2.9 ms -> 2.1 (the upload 0.82 -> 0.18, the skin 0.45 -> 0.30); the trace the same. With every walker a mesh of its own (a switch of the experiment, not in the tree): the CPU's frame 24 ms with the CPU skin (15 ms of upload: 40 fps), 7.4 ms with the pass (60 fps), against 7.1 with the 8 shared poses. A fault found on the way, older than this: a posed model the scene did not call movable was moved by skinning it again where it stands, so its move was recorded as a new pose. One that is an instance of a mesh that deforms was then not moved at all (no pose had changed), and nothing rebuilt. A posed model's move is a move now (World::note_move): the renderer moves an instance, and skins world-space triangles again. Tests: the pass's output read back from the GPU and compared word by word with the CPU skin after each new pose, for two model files in two poses (tests/render/data/skin-blend.glb: more triangles than a block of the pass, vertices two joints hold, weights that do not sum to one, a primitive with tangents, one without normals, a joint turned about an axis that is neither the normals' nor the tangents', a mesh on a node beside the skin that mirrors it, materials in an order the mesh does not keep), with world-space triangles before the meshes'; the previous frame's vertices, the mesh as the CPU has it when asked, the picture against a build's; a model moved alone, posed and moved at once, posed after the scene's buffers grew; a pose that mirrors other primitives, by a rebuild; the corners placed by the palette on the CPU against the model's triangles. 27 mutations of the new logic: each fails a test (two did not at first: the mesh's triangles were in the model's order and first in the GPU's, in every scene the tests had).

A posed rigid model is edited in place (2026-11-20). As a mesh and a still model are. Hidden, its parts are instances no ray sees, their emitters at no weight, and it is posed and moved on; shown, it is placed where it stands (show_meshes, repose_rigid). Removed, its instances are no object's (edit_geometry). One the scene has is placed again as an instance of each of its parts' meshes (Retained::rigid_meshes), a part a record of the room, in a run. Its pose update goes through what is above the instances under either traversal (the TLAS, or the units' top tree): under software traversal a new pose or a move was a rebuild's. An edit places an instance by one function now (place_instance: its rows, its emitters, its record, its place above the triangles), for a mesh, a still model and a rigid model's part alike. With it a still model whose mesh emits is placed again in place, where that was a rebuild's. Its parts are the nodes any clip of the file moves, not those of the clip it plays (skin::Model::moving_nodes), and the nodes its pose names: another clip is posed in place. Until now the parts were the playing clip's, and a model given another clip, or a pose that named another node, was posed in place with the wrong parts (the nodes the new pose moves stayed in the part merged for the old one). A pose that names other nodes is a rebuild's (RigidModel::pose). Still a rebuild: one with triangles flattened beside its parts (flatten_coincident's) hidden, removed or placed again; a pose that names other nodes than the last; a model hidden when the scene was built, shown; a skinned model added, hidden or removed; a model the scene has not, added. Measured, software traversal, an interior of 7,300 nodes whose clip plays (4,181 units): every frame rebuilt the scene, 2.9 s a frame; now none does, a frame's commit is 1.2 ms and the frame 19 ms (1280 x 720 at half scale). Tests, natively and under software traversal, each against a build's light list and picture: a posed rigid model hidden, posed and moved while hidden, shown, removed; a still and a posed rigid model with emitters placed again, the latter then posed, moved, hidden, shown and removed, its records and rows the room's again and the next one's; one with flattened triangles hidden and removed by a rebuild; one given another clip of its file, in place (tests/render/data/two-clips.glb); one whose pose names a node no clip moves, by a rebuild.

A posed rigid model is its parts' instances (2026-11-20). A model posed by a clip that moves nodes, without skins, was built in two ways at once: the nodes the clip leaves alone flattened into world-space triangles a placement, each node it moves an instance of a mesh made a placement. Now the model is parts (scene::RigidModel), each an instance of a mesh every placement of the model with the clip shares: the nodes left alone merged into one mesh in the model's space, each moved node a mesh in its own. Nothing of it is flattened (but what flatten_coincident takes out). A movable one moved in place left the nodes its clip does not move where they were built: they move with the object now (repose_rigid), and one that is not movable moves in place the same way. The part left alone has still emitters, in the light tree, until the object first moves; that move makes them moving ones, as a still mesh's first move does (emitters_start_moving). Measured: every node an instance of a mesh of its own (no part merged; THREERT_RIGID_NODES=all) costs 4 % of GPU time a frame on a street of 1,300 nodes and 8 to 10 % on an interior of 7,300, four alternated pairs each, so the nodes that do not move relative to each other are merged. With them merged, against the build before: the street +0.2 to +1.1 % (six pairs), the interior -0.5 and -0.7 %, ten other scenes within 1.0 %. The two scenes hold 2.8 M and 3.5 M triangles fewer in world space; meshes, instances and memory otherwise as before. Tried and set right: the part left alone with moving emitters from the build where the object is movable. An interior's six thousand emitters were then sampled without the light tree: 7 % faster and worse against its reference (two pairs). Still a rebuild: such a model hidden, shown, removed or placed a second time; a pose change under software traversal. Two nodes of one mesh of the file do not share it. Tests: the parts' meshes shared by two placements, the part left alone in the model's space; a new pose, a move, both at once, a move of one that is not movable, each against a build's light list and picture; a new pose of a model under two groups (the build's product of its transforms and an update's differ in their last bits: it is not taken for moved); the floor under a panel on a node its clip leaves alone (geometry/emitter-rigid), and under one moved 300 m in place with its clip playing (geometry/emitter-rigid-moved-live: it read nothing before).

Materials are edited through the rows (2026-11-19, the material on the instance, third part). With a material on its instances' rows, what changes one is no longer the triangles' business. In place now, each a rebuild before:

  • a mesh of several materials added, re-created, given another geometry or other materials: its mesh made with its geometry's sections, placed by the code that places a mesh of one material (edit_geometry);
  • a material that turns glass or stops being glass, becomes a cutout or stops being one: the rows, the record's bits and the shadow mask of every instance with a row of it (Tables::reclassed, live/edits.rs remake_classes);
  • a material of any class made after the build (Tables::add_materials);
  • a material that starts emitting on any instance, a mesh's or an instanced object's copies, one made after the build too (add_material_emitters, by the instances' rows);
  • an instanced object given another material: its copies' rows (update_instanced);
  • a mesh an edit places while it is hidden or has no size: an instance no ray sees, as the build has it. The sets that said which materials were triangles' go (fixed_mats, mesh_mats). Software traversal keeps each pool triangle's section and its index in it (LoadedScene::pool_place: a unit's tree orders them), where an edit made the mesh again to find them. A geometry rewritten where it lies needs the same sections, not only as many triangles (a BLAS's geometries keep their sizes). Still a rebuild: a class change or emission starting for a material of world-space triangles (still ones are grouped by whether they are cutouts, dynamic ones as particles' carry their class); the scene's first cutout, first material function on an instance, first vertex colours, first shadow caster with glass among its sections (kernel features); a texture or a material function that comes or goes. An instanced object is drawn with its first material only. Tests, each against a build's light list, weights and picture, natively and under software traversal: a mesh of three materials added, given others, shared, its geometry changed with and without its sections, removed; an alpha test that comes and goes on a mesh, a mesh of two materials and an instanced object's copies, and the scene's first cutout; a material turned glass and plain again; materials of every class made after the build; emission starting on an instanced object's material, with a copy that is not shown; an instanced object given a material that emits, a cutout, glass, a plain one; a material turned glass that takes its instance's shadow with it; what still rebuilds. (A model's materials are the file's: no edit names them.)

Meshes are edited in place (2026-11-18, scene step E, second part). With every mesh an instance, what the scene does to one is a change of its instance, not a rebuild. Hidden or shown (itself, or a group above it): the instance's mask; a hidden mesh is built as an instance no ray sees, its row without power (Instance::masked, show_meshes). A still mesh's first move: its instance moves from then on, and one that emits has its emitters as moving ones, a new run of the light list (Changes::started, start_moving). Its geometry changed, the mesh re-created or removed, a group of meshes removed, a movable mesh added: in place whether or not the scene said it edits the mesh (world::edits_in_place; dynamicGeometry now only keeps room for it at the build). A placement without size is an unseen instance everywhere: built so, moved so, a posed rigid model's node too. A still model whose instance is all of it is hidden, moved and removed the same way (whole). Still a rebuild: a mesh of several materials changed or added; a mesh shown after its geometry changed while it was hidden; a model hidden when the scene was built, or with triangles flattened beside its instance; an animated model's first move; a hidden mesh under software traversal without units. Tests, each against a build's light list, weights and picture: meshes hidden and shown (still, emitting, hidden at the build, a group, moved while hidden); a still mesh's first move (emitting, plain, a group, one built without size); meshes changed without the scene's word (a shared geometry, a re-creation, a movable one added, removals); a still model hidden, removed and moved. volume/grid-rebuild-live rebuilds by adding a group.

A mesh is an instance of its geometry's mesh (2026-11-18, scene step E, first part). A mesh was an instance only where scene code asked (dynamicGeometry) or a body drove it; every other one was flattened into the still scene's world-space groups, a movable one re-transformed on the CPU at each move. Now every shown mesh with a size is an instance: its triangles once in model space in the pool, one BLAS, shared by the objects of the same geometry and materials. A mesh of several materials (a geometry group each) is one mesh, its triangles ordered by class, a BLAS geometry a class (scene::own_mesh). A movable mesh's move is its instance's transform (InstanceRef::moves): no vertex is written again, and under software traversal it moves in place too. A material that starts emitting gives each instance of its meshes its emitters in place (Tables::mesh_mats, live/edits.rs add_material_emitters: the mesh's emitting triangles numbered again, a new run of the light list an instance, the old one at no weight); one a model or an instanced object has too still rebuilds. Room for edits in place stays where the scene said a mesh is edited or driven (Retained::edits_meshes). A moved instance whose placement has no size (scene code hides by scaling to 0) stands at a point, hidden, and comes back in place (scene::placed_world, as an instanced object's copy does). Still flattened: a mesh without size, THREERT_INSTANCING=0, a light's card, particles, triangles on the same vertices (flatten_coincident), deforming meshes. Still a rebuild, the next part: hiding a mesh, a still mesh's first move, removing or changing the geometry of one the scene did not say it edits. Not the common structure, a step of its own after this one: a mesh is shared by geometry and materials, the material being a triangle's attribute (two objects of one geometry with different materials hold its triangles twice); the common one has the material on the instance. Tests: a mesh of three materials whose geometry has the glass first (shadow/glass-groups, -frame, -cutout, -live-exact); a several-material mesh's order and counts; a material that starts emitting, against a build (a shared mesh, a movable one moved after, a mesh of two materials one of which emitted already, a mesh added in place; one an instanced object has too rebuilds); a movable mesh scaled to nothing and back. Under software traversal wind/pivot-sway-live passes now.

Glass is a part of its mesh (2026-11-18). The last reason to flatten a material's triangles at every placement goes. A mesh's glass is a geometry of its BLAS beside the opaque and the cutout one, the only one not flagged opaque (InstMesh::parts; a hit's triangle from its geometry and primitive by two starts in the instance's record). A shadow ray passed glass by the still scene's masks, and passes an instance of a mesh that is all glass the same way (InstMesh::casts). Where a mesh mixes glass with other triangles it culls the geometry that is not opaque (kernel feature F_IGLASS; software traversal: a flag a triangle). glass_tr weighs what the glass lets through as before. Measured first on Metal with every geometry flagged opaque: the same pictures, at most 0.5 % of a frame's GPU time; the cull flag's old cost (Bistro +1.7 ms) was its use for cutouts. With the cull in every pane's own BLAS a scene of 400 panes traced about 15 % slower under the loop guard; by the mask it does not. Which side of a surface a ray meets goes by the instance's sign (a mirrored glass instance). What still leaves a mesh: triangles on exactly the same vertices (flatten_coincident: a cutout on an emitter, glass on whatever lies under it), and the emitters of a mesh that deforms. A mesh that is all glass is added in place, the mask needing no kernel feature; a material of instances' triangles that turns glass, or stops being glass, rebuilds. Tests: a shadow through an instance's glass (a mesh of its own, offline and live; an instanced copy; a model whose one mesh has an opaque, a cutout and a glass part, with the other two parts' shadows, offline and live), a mirrored glass instance, the model's build, a glass mesh added in place.

An emitter's probability is what the picker used (2026-11-18). An emitter that changed size in place (a movable model or mesh scaled, a skinned one) kept the weight it was loaded with, while the kernel took its probability from formulas that assumed the weight was the triangle's: scaled three times larger as a scene's main light it read 3 to 8 % dark, three times smaller 12 % bright (a move alone was right; older than step D). Now a candidate is weighed by the density it was drawn with (its pick's probability over the triangle's own area), and a BSDF ray's hit takes the same probability from where the picker reads it: the tree's path, or the emitter's entry in the CDF, which its code names (emitter_codes). A weight that is out of date costs noise, not light. Gone with the formulas: the particles' case apart (a nominal area), the cull test at a hit, "MIS by power alone". Test: an emitter scaled in place, a model and a mesh, with and without a light tree, against a build's picture.

2. Temporal fixes

Targets (2026-11-08): bench-temporal, bench-ghosting and their UE MRQ references move to Bistro night (§ 0 step 7); the Kabukichō shots below are history.

2a. Reflection temporal parameters at UE 5.8 defaults

[Removed 2026-11-24: this passage described an earlier implementation that has been replaced; docs/PROVENANCE.md.]

  • Today live.wgsl clamps only in motion, at 2–3σ in RGB, with 8–48 frames of history.
  • Also: at long history the live image is the raw accumulated average (all à-trous stages gated off by history length since round 3: Cornell box at 256 frames SSIM 0.912 vs the UE Path Tracer, 0.98 on Nov 4). Gate on the remaining variance instead.
  • Acceptance: bench-temporal motion ΔE / SSIM (vs converged and vs UE) no worse, closing 0.3–2 s better, crops of reflective surfaces in motion attached; GPU cost ≤ +0.5 ms at 1280×720.
  • Status: done (d100b57). bench-temporal at 100 % on Kabukichō vs our converged references: motion move40 / move59 5.76 / 6.22 → 5.59 / 6.01, stopped 0.5 s 5.34 → 5.03, closing unchanged within noise; GPU +0.23 ms at 60 %. Grain: the Cornell box at 256 frames vs the UE Path Tracer SSIM 0.912 → 0.978 (ΔE 1.68 → 1.44): the à-trous stages 0–1 now run while the accumulated mean is visibly noisy (the wide stages keep their history limits: +1.9 ms otherwise).
  • Deviation from UE's defaults, kept on purpose: the specular neighbourhood clamp applies only while the view moves. UE clamps against Lumen's spatially resolved specular; ours comes from nine raw 1-spp samples, and a static 1σ box kept resetting converged history (stopped 0.5 s ΔE 6.05 with the static clamp vs 5.03 without; closing 4 s 5.19 vs 4.10). The 12-frame cap also lifts when the view holds still (UE's TSR does that accumulation; our temporal pass is both). THREERT_TEMPORAL_FLAGS switches each piece back for experiments.

2b. UE motion references

The same camera move (v1: 2.5 m forward and 12° right over 1 s) and the closing sequence rendered in UE (Sequencer + MRQ at one temporal sample per frame, or the editor's real-time viewport) as a second bench-temporal reference.

  • Acceptance: out/bench-temporal/refs-ue/ for all eight shots; bench-temporal prints vs-UE columns.
  • Status: done. ue5/temporal.ts: one 60 fps Level Sequence on the UE level (MRQ, 1 temporal sample per frame, TSR / Lumen / eye adaptation history as in real time, 3 s lead-in), the camera keyed per frame to bench-temporal's pose(k); closing time driven per frame (the Director has no closing function) on the same groups as our "lights" handler with the same delay / flicker distribution. --refs-ue columns in bench-temporal.
  • Measurement fix (2026-11-06): compared directly, every variant sat at the port's floor (our converged frames vs UE ΔE 10.7–12.7: our own gate, UE ~10 % darker), and subtracting that floor left only +0.0–0.5 ΔE (errors don't add on top of an 11 ΔE difference), too flat to judge by. Now each renderer is measured against its own converged frame: the UE sequence also holds poses 20 / 40 / 59 for 3 s (settled frames), and bench-temporal reports ue_self (UE's motion frame vs UE's settled frame) next to ours (our frame vs our converged reference) and excess_over_ue = ours − UE's. Baseline (r5-step1-baseline): move20 / 40 / 59 ours 5.22 / 5.55 / 5.91 vs UE 2.29 / 2.16 / 2.22; stopped 0.5 s 4.95 vs 1.12; closing 0.3 / 1 / 2 / 4 s 9.79 / 9.44 / 8.45 / 4.03 vs 10.36 / 8.70 / 5.69 / 2.95. In motion our temporal error is ~2.5× UE's, 4.4× just after stopping. Closing 0.3–2 s run through random switch-off orders in both renderers, so they vary between runs (closing 2 s: 7.61 and 8.45 in two runs of the same build); judge closing by 4 s.

2c. Ghosting and trails while the camera moves (bench-ghosting)

Reported 2026-11-06: trailing (拖影) is very obvious when playing. Measured where it is played: the 0.5 dynamic-resolution floor, 60 Hz camera input.

  • tools/bench-ghosting.ts, Kabukichō view v1. Three moves:

    • turn 40° away and back (a pure rotation, which reprojects exactly);
    • strafe 3 m at 7.5 m/s and back;
    • a sudden stop after 8 m/s forward.
  • Each shot is compared with a converged frame of the same pose, per region (whole frame, the wet street, the sign band, a facade). Metrics: mean dE, p95, p99, and trail_px (p95 over rows of the longest horizontal run of pixels off by dE > 10; threert-render compare --region). Each is reported as excess over the settled frame, the live noise floor.

  • Animation is frozen (THREERT_FREEZE_TIME: shader time and the frame script's clock, so signs do not switch between the shot and its reference) and exposure snaps to its target (THREERT_EXPOSURE_SNAP), so neither reads as error.

  • Findings (0.5 floor):

    • The trail that jumps out during fast turns is the motion blur. With UE's real-time defaults (on in Kabukichō since § 5 item 4) the sign band mid-turn is +7.2 dE over the floor (p95 +41), +11.5 mid-strafe: neon text smears unreadably. With it off: +0.4 / +3.2.
    • Decided (2026-11-06): keep UE's default. The supervisor's rule was "on if ours matches UE". It does.
      • node tools/bench-motion-blur.ts measures what blur adds to the sign band of move v1 in each renderer, the same frame with vs without it. UE: MRQ refs-ue-mb vs refs-ue. Ours: lockstep, 1/60 s frames.
        • Ours over UE, dE: 0.96 / 1.12, 0.83 / 1.00, 0.75 / 0.95 at frames 20 / 40 / 59, ratio 0.79–0.86.
        • p95 is a little lower; the trail is the same 3 px.
        • Ours is slightly weaker than UE's, not stronger.
      • bench-temporal --motion-blur --region signs (excess_over_ue, sign band, 100 %, wall-clock paced):
        • 2.87 / 2.91 / 2.60 with blur on both sides;
        • 3.26 / 3.29 / 2.81 with it off;
        • both within the mid-move limit of § 2c (3.2).
    • UE reference for the strafe (2026-11-06). MOVE=strafe bun ue5/temporal.ts (MB=1 with blur) renders bench-ghosting's strafe: 3 m right in 24 frames, 30 held, back in 24, then the midpoint held 3 s. It is MRQ at 60 fps, 1 temporal sample per frame, 100 % screen percentage, 26 s.
      • bench-ghosting --quick --ue out/bench-temporal/refs-ue-strafe (--mrq-blur --ue …-mb) puts each renderer's moving frame against its own converged frame of the pose, per region.

      • UE's own floor (two still frames 10 apart): 0.63 dE overall, 0.54 ground, 0.76 signs, 0.31 facades.

      • At 50 % screen percentage, as ours runs at the floor (MOVE=strafe bun ue5/temporal.ts <project> 50 -> refs-ue-strafe-sp50): street excess 2.61 / 1.92 / 1.03 at mid / +0.1 s / +0.5 s (floor 0.45), against 2.15 / 1.28 / 0.50 at 100 %.

      • Excess over each renderer's floor, motion blur off, ours / UE:

        shot all ground signs facades ground trail
        strafe-mid 2.81 / 2.38 3.82 / 2.15 2.94 / 3.57 1.04 / 1.36 65 / 49 px
        return+0.1s 2.06 / 1.16 2.79 / 1.28 1.99 / 1.63 0.69 / 0.39 62 / 38 px
        return+0.5s 1.11 / 0.34 1.65 / 0.50 0.87 / 0.36 0.44 / 0.12 18 / 36 px
      • The sign band mid-strafe is closer to converged than UE's: UE's TSR softens the whole frame while it moves, ours stays sharp. After the return ours takes longer to settle, about 0.5 dE more in the sign band at +0.5 s.

      • The wet ground is the gap: 1.7 dE over UE mid-strafe and 1.2–1.5 after the return, the same reflections item as below.

      • Motion blur at the strafe midpoint adds +0.23 dE overall / +0.77 in the sign band to ours and +0.57 / +1.31 to UE's. So ours adds about half of what UE's does here (0.79–0.86 on move v1). Part of that is UE's softer frame without blur. Crops (docs/img/strafe-mid-signs-ours-ue.jpg: ours off / on, UE off / on): ours shows little visible blur at 7.5 m/s. A direct blur-length measurement is needed before changing ours.

    • Blur length, measured (2026-11-07). The 居酒屋 sign's left edge at the strafe midpoint moves 7.3 px per frame: 88 px over UE's 1.5 m of travel between its settled start and midpoint frames. With MRQ's 0.5 shutter that is a 3.7 px smear.
      • Measured with threert-render edge-width <png> 353 379 70 200 (red channel, 10–90 % rise across the edge, median of 130 rows), blur off → on:

        off on added added in quadrature
        ours, 0.5 floor 1.50 2.26 +0.76 1.69
        UE, 50 % 2.83 3.58 +0.75 2.19
        ours, 100 % 1.49 2.23 +0.74 1.66
        UE, 100 % 2.61 3.53 +0.92 2.38
      • At the floor the game runs at, our blur adds as much as UE's. Taken in quadrature, since UE's edge is softer to start with, ours is 23 % shorter.

      • At 100 %, ours is 20 % shorter by the direct difference and 30 % in quadrature.

      • Under the 25 % rule at 0.5, borderline at 100 %: unchanged. If blur comes up again, a synthetic bar at a known speed in both engines would separate the edge's own softness from the blur.

    • The wet street after a strafe (2026-11-07). Ours vs UE at 50 % screen percentage, as both run at the 0.5 floor (UE at 100 % in brackets); street excess at mid / +0.1 s / +0.5 s:
      • Before: 3.73 / 2.81 / 1.65 vs 2.61 / 1.92 / 1.03 (2.15 / 1.28 / 0.50). Acceptance for this item: +0.5 s ≤ UE50 + 0.3 (1.33), the mid and +0.1 s gaps at least halved, the sign band and still-frame noise no worse.
      • Where it is lost:
        • All of it is specular: without specular the street's excess is 0.44–0.55.
        • Nothing stale is left: after the strafe the street converges exactly like a fresh start with history reset (dE vs converged at 6 / 18 / 30 / 60 / 120 frames: 3.63 / 2.81 / 2.45 / 2.05 / 1.73 after it, 3.44 / 2.90 / 2.52 / 2.11 / 1.78 fresh; UE50 after it 2.37 / 1.78 / 1.48 / 1.13 / 0.93). The 4-frame hold while the view translates is a restart.
        • It is noise: two independent fresh runs differ from each other as much as from the reference (2.77 at 30 frames). It falls slower than 1 / √N (×0.68 from 30 to 120 frames), as the spatial filter is strongest on young history.
      • What did not help (street excess mid / +0.1 / +0.5 against 3.81 / 2.79 / 1.66 then):
        • Longer specular history while translating (8 or 12 frames at 4σ; 12 at 2σ or 1σ; no hold): all worse, 4.0–4.2 / 2.8–3.6 / 1.9–2.2. Glossy reflections do not reproject under translation, and the kept history smears.
        • 4 samples per frame: −10 %. Twice the resolve neighbours or radius, a filter twice as strong: under 0.1.
        • The radiance cache's total at reflection hits: −10 %.
        • Tracing at 100 %: −24 % at 30 frames fresh (GPU cost not yet measured).
      • Done: mirror-image reprojection through the resolve's BRDF-weighted hit distance on near-mirror surfaces (roughness < 0.2). It was a pixel's own single lobe sample, so the mirror image landed anywhere along the ray.
        • Street: mid 3.73 → 3.28 (the gap to UE50 1.12 → 0.67), +0.1 s 2.81 → 2.70; +0.5 s unchanged (1.63).
        • Trail 66 → 49 px; sign band unchanged (on the signs, roughness 0.22, it cost +0.1 dE: hence the limit).
        • Crops: docs/img/strafe-mid-street-resolved-distance.jpg (main | this | converged).
      • Tried next, not merged (2026-11-07):
        • A variance-guided spatial filter for young specular history (σ = 4 × the local standard deviation; also with doubled steps or a 16-frame threshold) made it worse: 6 frames after a reset 3.42 → 3.71, and two independent runs then differed by 4.19 instead of 3.62. The street's noise is sparse bright speckle, the signs' reflections, and a wider filter smears each speckle into a blob instead of averaging it away.
        • More reflection rays. The ceiling, with every sample of a frame giving its reflection ray to the resolve (rays per traced pixel 1 / 2 / 4, street excess mid / +0.1 / +0.5 s): 3.27 / 2.67 / 1.62, 2.96 / 2.27 / 1.34, 2.71 / 1.95 / 1.17 (UE50 2.61 / 1.92 / 1.03). Tracing everything at 100 % instead costs Kabukichō 45–48 ms (the path-tracing kernel 34–36 ms against 8.5–8.9).
        • A pass of its own, refl_rays (branch glossy-refl-eval):
          • What it does: one more specular-lobe ray per near-mirror traced pixel (roughness < 0.2) while the view translates and for 1 s after. It starts from the trace pass's g-buffer, and its hit is shaded from the radiance cache's total or, as an option, with hit lighting.
          • Street: 3.28 / 2.70 / 1.63 → 3.04 / 2.55 / 1.58; with hit lighting 3.02 / 2.51 / 1.55.
          • Cost: Kabukichō moving +0.56 ms (the pass 0.39, the resolve +0.12). Still frames and the path-tracing kernel are unchanged.
          • Why it falls short: the ceiling above doubled more than the reflection rays; every sample also brought its own emitter sampling, whose specular part (signs reflected through NEE) is the street's other noise source. Halving either alone gains 3–10 %, both together 16–30 %: the two variances add.
          • Its +0.5 s stays at 1.58, short of the 1.33 acceptance line, so it is not merged.
          • The option left: a second emitter sample at near-mirror camera hits in the same pass. It needs the camera hit's surface (a primary ray and a material evaluation), an estimated +0.6–1.0 ms more, so Kabukichō moving would be ~16.6–17.0 ms.
        • UE 5.8's temporal rules for reflections, as an earlier implementation had them (docs/PROVENANCE.md), applied while the view moves (2026-11-07):
          • What changed: no hold after translating; 12 frames; a clamp at 1 σ, doubled for samples reconstructed from neighbours (all of ours below 100 %), also tried at 4 and 8 σ; the reflection-hit history only for narrow lobes (GetSpecularDominantDirFactor > 0.5). Still frames kept accumulating, uncapped.
          • Street excess vs UE50, mid / +0.1 / +0.5 s: 3.59–3.75 / 3.14–3.20 / 2.07–2.08, against 3.28 / 2.70 / 1.63 with the hold.
          • Trails get longer: turn-mid street 65–108 px (65 with the hold), stop+0.1s 48–59 px (30). bench-ghosting --check fails.
          • Why: without the hold, the history a translation misplaces survives (neither reprojection is exact for a glossy lobe). Our samples (1 spp at the 0.5 floor, one lobe sample each) are too noisy for a σ box to reject it: the box admits the misplaced history, which smears. UE clamps against its spatially resolved reflections and TSR finishes after it.
          • The hold stays. Temporal rules alone do not reach the +0.5 s line at our sample density.
      • Research, later: reprojecting glossy reflections correctly under translation, so that their history survives a strafe. Planar-mirror reprojection is exact for mirrors only; a glossy lobe's reflection moves somewhere between surface and mirror image depending on roughness and distance.
      • Not to be done: capping the specular history while the view holds still, as UE's ~12 frames effectively do. bench-ghosting measures each renderer against its own converged frame. UE gets back to its steady state within ~0.5 s, but that steady state is noisy (two still frames differ by 0.45 on the street). Ours converges for seconds toward a cleaner image. A cap would bring our metric down by making every still image noisier.
    • Reflections: the wet street is 3–4 dE off while moving and after a stop, and almost all of it is specular (diffuse +0.1–0.2).
      • A single frame of reflections at quarter resolution is very noisy (dE 5.4 vs 0.58 converged), so they need many aligned frames.
      • A rotation reprojects them exactly (one jump, history only: dE 1.07).
      • A translation does not, for glossy reflections: under a strafe they are back to single-frame quality.
      • History that lands wrong passed the loose clamp (8σ below 100 %) and smeared into streaks that stayed after a stop, because the specular clamp switched off with the motion.
    • No effect: Catmull-Rom instead of bilinear specular history, counting only disocclusions as fresh history, picking one of the surface / mirror-image histories instead of blending them, a 4σ box everywhere.
  • Fix: for 8 frames after the view last translated (the stop included), the specular history is clamped at 4σ and held to 4 frames; a rotation keeps the long history (THREERT_TEMPORAL_FLAGS=16384 switches it off). (2026-11-13: the whole frame's rule and its switch are gone: each pixel's history is bounded by its own reflection's parallax, § 1a "The specular history per pixel".) Excess mean dE / trail, old → new:

    • strafe mid, street: 4.10 / 79 px → 3.82 / 58 px;
    • strafe back + 0.5 s, whole frame: 1.47 → 1.13;
    • stop + 0: 3.85 / 68 px → 3.24 / 38 px;
    • stop + 0.1 s: 3.19 / 40 px → 2.69 / 26 px;
    • stop + 0.3 s: 2.57 → 2.10;
    • turn mid unchanged (2.94 → 2.88).
    • After a stop the smeared streaks are gone (crops: docs/img/ghosting-stop.jpg, old | new | converged).
  • Costs nothing: Kabukichō at the 0.5 floor 15.04 ms still, 15.86 moving. bench-temporal at 100 %: excess move40 / move59 / stopped 1.75 / 1.75 / 2.01 → 1.65 / 1.69 / 2.09.

  • Middle loop: node tools/bench-ghosting.ts --quick --check (0.5 floor, references from 256 frames at that scale; every move five times, medians checked; ~75 s, ~100 s when a new build renders its references). It fails above these limits (excess mean dE / p95 dE / trail px), which the previous renderer fails on the strafe and stop shots:

    shot region mean p95 trail
    turn-mid street 3.2 12.5 80
    strafe-mid street 4.1 17.5 75
    turn-return+0.5s all 1.3 4.2 30
    strafe-return+0.5s all 1.35 4.5 28
    stop+0.1s street 2.95 11.2 35
  • Made load-independent (2026-11-06), because it is a merge gate now. Shots and waits were timed by the wall clock and camera commands paced at 60 Hz, so a busy machine (the user working on it) rendered fewer frames per move and per wait. The return shots then caught less converged history, and identical code read 0.97–1.87 excess (turn-return), failing the check about half the time.

    • The camera now steps once per rendered frame (live sync command: answers after the n-th frame).

    • Shots and waits are frame counts (snapshot frames): +0.1 / 0.3 / 0.5 / 2 s = 6 / 18 / 30 / 120 frames; startup 150 frames, settle 240.

    • Mean dE is then stable to ~0.1 between runs, but trail_px (a longest-run statistic) still moves by ±20 px per shot (turn-mid 52–96 px on one build). The first turn after startup often reads ~96 px.

    • --quick therefore does every move five times and checks the median: 75 s instead of ~50.

    • Lockstep (2026-11-06): commands still raced the frames. A snapshot or sync sent right after a camera step could land in the next frame's batch, capturing a frame the camera had not moved in (no blur, one more frame of history), and the free-running renderer could hold or merge steps.

      • live now has a lockstep mode ({"cmd":"lockstep","dt":1/60}): it renders exactly the frames the commands ask for, at that frame time.
      • A camera step carries its sync / snapshot in the same command.
      • bench-ghosting and bench-motion-blur run in it, and two runs of either now agree to 0.01 dE.
      • The five repeats of a run still differ from each other (each starts from another history state), so the median stays.
      • stop+0.1s reads 2.84 now (2.62 before): the old timing included held frames after the stop.
    • Medians on a busy machine, all checks passing:

      shot excess trail limits (excess / trail)
      turn-mid 2.85 69 px 3.2 / 80
      strafe-mid 3.73 63 px 4.1 / 75
      turn-return 0.94 20 px 1.3 / 30
      strafe-return 1.06 21 px 1.35 / 28
      stop+0.1s 2.62 25 px 2.95 / 35

      Three runs with three repeats gave turn-mid trail medians of 60 / 75 / 64 px.

  • Next (the remaining 3–4 dE on the street in motion): reflections with fewer, better frames. Either a stronger spatial resolve at quarter resolution (more and wider neighbours for glossy surfaces while the view moves), or reflections traced above the diffuse resolution. A UE reference of the same moves at 50 % screen percentage to calibrate the limits against.

2d. The diffuse history's reprojection (2026-11-08, branch dtemporal-centre)

  • Found while tracing the live image's dark mid-tones (§ 0, live energy). Measured in linear HDR: Bistro's first pose, live at the 0.5 floor after 512 lockstep frames, against the offline render at 1024 spp. 8 x 8 blocks were binned by the reference's luminance and split by whether directly seen emission makes up more than 30 % of the block.
    • Emitter blocks read 0.996–1.0. Lit surfaces were darker the brighter they were: 0.1–1 nit 0.908, 1–10 nit 0.732, 10–53 nit 0.458. The worst blocks were the facade around a lantern 31 m away: the offline render shows a warm glow there of up to 19.6 nits, nearly all of it direct light (18.3 with one bounce); live showed 6.9.
    • Ruled out, each made no difference: the à-trous and specular filters, the reflection resolve (some), the firefly cut (some), the emission clamp past glass, the bounce count (2 / 4 / 8), the emitter cull, the light LOD, the radiance cache, opaque cutouts on secondary rays, and 512 vs 2048 frames. The undenoised history read as low as the final image.
    • It depended on screen size: 3.5 m from the same lantern live read 0.90–0.95. An offline render at half resolution matched full resolution in every bin.
    • Cause: dtemporal fetched the traced grid's history where the jittered sample's hit point was the frame before. That is a bilinear resample at a random sub-pixel offset every frame, even holding still. The blur grew with the history: light bled from lit surfaces into the shadow beside them (dark blocks up to 9x too bright), and a small lamp's steep glow flattened.
  • Done: once a pixel has HIST_CENTRE (16) frames of history, its history is fetched where the pixel's centre was, moved by the sample's motion. A young history keeps the old blur, which denoises it: always fetching at the centre read Bistro ΔE 5.43 at 16 frames against 4.34 before. Thresholds 8 / 32 read worse at 16 / 64 frames.
    • Layer B real scenes (ΔE / SSIM against the offline render, live at 0.5 after a reset; frames 16 / 64 / 256):

      before after
      Bistro 4.34 / 0.776, 3.89 / 0.799, 3.99 / 0.806 4.34 / 0.776, 3.72 / 0.806, 3.44 / 0.819
      Zero Day 3.73 / 0.790, 3.77 / 0.790, 4.11 / 0.789 3.73 / 0.790, 3.46 / 0.805, 3.27 / 0.818

      Before, both scenes got worse after 64 frames as the blur grew; now they keep converging.

    • Linear radiance (512 frames): lit 1–10 nit 0.732 -> 0.785, 10–53 nit 0.458 -> 0.723. Shadow beside lit surfaces no longer gains bled light: the 0–0.1 nit bin reads 0.992 -> 0.931, because before, the bleed had offset losses elsewhere in that bin.

    • C slice against the offline render, ΔE: 5 s 4.43 -> 4.34, 20 s 4.49 -> 4.52, 41 s 6.06 -> 5.96, 46 s 4.36 -> 4.25, 55 s 4.34 -> 4.23 (SSIM up in every segment).

    • Ghosting quick check, Bistro (excess / trail): turn-mid 3.55 / 23 -> 3.37 / 22, strafe-mid 5.38 / 33 -> 5.15 / 32, turn-return 1.52 / 18 -> 1.34 / 13, strafe-return 1.55 / 18 -> 1.43 / 14, stop 4.56 / 24 -> 4.47 / 27. Kabukichō ok.

    • Other gates: perf smoke within 0.1 ms; test:render 90 / 90.

    • Left: the lit 1–10 nit blocks at 0.785 (0.85 at full resolution) and 0.1–1 nit at 0.91. The traced grid's upsampling and the young-history blur are next to look at.

  • Follow-up (2026-11-08, branch dtemporal-normals): the centre fetch made histories restart.
    • Holding still, the centre lands on one history pixel exactly. Its stored normal is another jittered sample's, and on normal-mapped stones and facade detail it often failed the 0.8 cosine test, so the history restarted. The history-length view at 256 frames showed Bistro's street speckled and its facades at 8–30 frames; before #78 the street was uniform (bilinear between four pixels, one of which usually passed).
    • Done: the centre fetch accepts 0.5 (depth test unchanged).
    • Also tried: falling back to the sample's own position. It was better on Bistro but brought back the resampling blur on Zero Day (+0.06 ΔE at 1024 frames).
    • Also tried, on top: when none of the four pixels shows the surface (foliage, where the jitter alternates leaves and what is behind them), take the history of the nearest 3 x 3 pixel that does. Bistro at 256 frames 3.27 -> 3.14, but Zero Day 3.28 -> 3.33 (SSIM -0.007). Limiting it to cutout surfaces needs a cutout flag in the samples, which they do not carry yet.
    • Layer B real scenes, frames 64 / 256 / 1024, ΔE / SSIM: Bistro 3.72 / 0.806, 3.44 / 0.819, 3.45 / 0.813 -> 3.62 / 0.812, 3.27 / 0.828, 3.23 / 0.827; Zero Day 3.49 / 0.804, 3.30 / 0.818, 3.20 / 0.824 -> 3.47 / 0.805, 3.28 / 0.819, 3.18 / 0.825.
    • Ghosting quick check ok on both scenes. Bistro's return shots read 1.34 / 1.43 -> 1.47 / 1.58 against their own converged frames, which improved too. Against the offline render the return shot itself got better (turn-return+0.5s ΔE 4.35 -> 4.22, luminance 0.849 -> 0.865), as did the settled frame (3.47 -> 3.27).
    • Other gates: perf smoke within 0.11 ms; test:render 90 / 90.
    • Measurement note: a "frames after a reset" snapshot is only fair if every accumulation honours the reset. A per-output-pixel raw diffuse accumulation (PR #79, closed) did not; it read back the 6 s warm-up and faked a 0.4 ΔE gain. Measured honestly, it gained nothing over these histories.

3. Rendering test suite (Test262-style)

  • A, atomic tests: 60–100, one feature each. Header metadata: id, features, reference, metric, temporal. Result: pass / fail / unsupported. ~300 ms each; the whole layer under one minute.
  • B, composite scenes (2026-11-08): the Khronos glTF Sample Assets, Bistro night and Zero Day. Earlier the list was Khronos, Bistro, Kabukichō.
  • C, a GTA-like slice: one block with day / night, rain, a drivable car, pedestrians, foliage, a waterfront and an explosion; a 60 s fixed-camera shot. Output: a side-by-side video with UE plus per-segment metrics. Since 2026-11-08 it is built on Bistro (§ 0 step 9); the Kabukichō version below (part 1) is history, its general fixes kept.
    • Status, part 1 (2026-11-08): our side of the shot, games/slice/slice.game.ts, without day / night yet.
      • What it is: Kabukichō Ichiban-gai at night seen across a canal cut into Yasukuni-dori in front of the gate. The Kabukichō game builds the street and runs its frame script; the slice adds the waterfront (a WaterBody between embankments, railings), potted plants in the wind, four walking mannequins, and an explosion (fireball, sparks, debris, rising smoke).
      • Timeline: taxi at 10 s, rain at 15 s, explosion at 40 s, 60 s shot. It is a function of the frame script's clock that hands Kabukichō's frame script the state its handlers would set; lockstep captures repeat exactly.
      • docs/img/slice-shot.jpg: 5 / 12 / 20 / 40.8 / 44 / 55 s.
      • Live at the 0.5 floor over the 60 s:
        • GPU 18.0–18.5 ms a frame (profile total), interval p50 18.1–19.4 ms (52–55 fps), one frame over 50 ms (the explosion's first frame); frame script 6.7–7.3 ms.
        • With the movable plants as TLAS instances (§ 5 item 1): GPU 17.0–17.4 ms, interval p50 17.1–18.3 ms (55–58 fps), BLAS rebuild 2.1 ms. Still ~0.5 ms over in the rainy segments.
        • Over budget by ~1.5 ms. Against Kabukichō alone (15.2–15.5): the moving triangles' BLAS rebuild +2.7 ms (3.1 against 0.42; ~100 k triangles: four skinned walkers, four swaying plants, debris, the taxi), the trace +0.6, the waterfront ~1.2 of it (water surface and body).
      • Found on the way:
        • Object3D.lookAt recomputed the whole scene's world matrices: 12 ms per call on Kabukichō (the frame script 19.0 → 6.8 ms). It now updates the ancestors only, as three.js does.
        • Dynamic BLASes are built with PREFER_FAST_BUILD: 4.14 → 3.1 ms, trace unchanged. wgpu 30 has no BLAS refit ("only rebuild implemented").
      • Stopped on 2026-11-08: the slice moves to Bistro (§ 0 step 9). Not pursued on Kabukichō: day / night (a WIP branch sun-move, sun moves without a rebuild, is kept unmerged), the walkers' BLAS rebuild, the UE side.
    • Per-segment metrics on Bistro (2026-11-08, branch slice-eval; our offline render as the truth, "How we are judged"): node tools/slice-eval.ts. Live plays the shot in lockstep (dynamic resolution) with snapshots at 5 / 20 / 41 / 46 / 55 s; the truth is an offline render of each moment (1024 spp, no clamps, no denoiser, cached in out/cache/truth). Writes out/slice-eval/{metrics.json, montage.jpg}.
      • Found on the way: an offline render at a scene time (render --time t) ran shaders and sway at t but not the game's frame script, so the slice's walkers, smoke and rain stood at 0 s in every frame. The frame runner now has seek(t) (its clock set, the scene shown settled at that moment); render seeks to the job's time (0 without one), serve's live jobs to their first frame. Renders without a time are byte-identical (the four catalog games with frame scripts); bundles built before seek skip it.
      • At c690e06 (live with 2 tree candidates): ΔE / SSIM / luminance 5 s 4.64 / 0.743 / 0.85, 20 s (rain) 4.78 / 0.735 / 0.83, 41 s (explosion) 6.02 / 0.706 / 0.98, 46 s (smoke) 4.50 / 0.739 / 0.88, 55 s 4.53 / 0.739 / 0.86; GPU p50 15.9–16.1 ms. Above the still scene (3.9) by the moving content's short histories and the truth's own noise at 1024 spp (Bistro: ΔE 1.8). Live's smoke reads denser and brighter than offline (Known parity gaps).
  • A "feature × pass rate" table, run once per release.
  • Reference source: test assets are glTF + a small JSON sidecar, imported into UE via Interchange. Only for test assets: games and scenes stay code; no scene IR comes back.
  • Status: A layer skeleton running (npm run test:render, tests/render/*.ts): 21 tests (light units, Lambert, furnace, Fresnel, shadows, sky light, the sky's horizon, sRGB decode, fog transmittance, rect / point / spot / directional, skinning, the live radiance cache, glass transmission, clearcoat): 20 / 21 pass + 1 depending on an asset (animation/skinned-pose needs the Quaternius mannequin, assets/quaternius/ual/UAL1_Standard.glb, which the default workspace's asset root does not have yet; with it, 21 / 21), under 3 s for the layer. Tests can run in the real-time renderer (live: frames in the test metadata).
  • Layer B started (2026-11-06): three Khronos glTF Sample Assets.
    • The models: TransmissionTest, ClearCoatTest, MetalRoughSpheres (node tools/fetch-khronos.ts), as scenes/khronos-*.ts.

    • The setup: the plaza's neutral daylight studio (sun + sky atmosphere, grey ground, EV 14.6), which three.js, UE and ThreeRT all express.

    • UE 5.8 references come from node tools/ue-glb-scene.ts: Interchange scene import, path tracer + Lumen through MRQ, ~2 min per scene. Reading the GLBs needed KHR_materials_transmission / _ior / _clearcoat factors in the renderer, and grey + alpha PNGs decoded as such.

    • three.js r187 comes from bench-three as for the other scenes.

    • npm run test:layer-b judges them against the UE Path Tracer. Pass: ThreeRT offline and live @256 frames both ΔE ≤ 5 and SSIM ≥ 0.90; three.js is the baseline.

    • Results, ΔE / SSIM vs UE Path Tracer (ThreeRT is 1.4–1.8× closer to UE than three.js on all three):

      scene three.js (best tonemap) ThreeRT offline ThreeRT live @256 UE Lumen
      ClearCoatTest 7.27 / 0.929 4.22 / 0.964 4.41 / 0.947 1.85 / 0.976 pass
      MetalRoughSpheres 9.00 / 0.872 4.92 / 0.921 4.85 / 0.912 3.03 / 0.923 pass
      TransmissionTest 7.84 / 0.892 5.32 / 0.929 5.60 / 0.922 3.21 / 0.931 fail
    • What separates us from UE there:

      • All three, before 2026-11-06: the horizon. Beyond the 2 km ground plane, a fraction of a degree below the horizon, ours was black; UE's path tracer fades there over one texel of its sky light's cubemap (below). With that: MetalRoughSpheres offline / live ΔE 5.01 / 4.97 → 4.92 / 4.85 (passes), ClearCoatTest 4.32 / 4.43 → 4.22 / 4.41, TransmissionTest 5.73 / 5.75 → 5.69 / 5.79.
      • UE's MetalRoughSpheres are faceted (its import of the GLB doesn't keep the smooth normals); ours are smooth. That costs us more ΔE there than anything left in our renderer; not ours to copy.
      • TransmissionTest (2026-11-08): the transmissionTexture is read now (it stripes the red spheres, as in UE), and shadows through glass are tinted by the glass's colour offline, as UE's path tracer tints them. Offline ΔE / SSIM / PSNR 5.66 / 0.918 / 23.59 → 5.32 / 0.929 / 24.89 dB, live @256 5.67 → 5.60. What is left is mostly not glass: the top third of the frame (the sky) reads ΔE 6.7, the middle 5.9, the bottom 3.1. Live shadow rays still pass glass unattenuated.
    • Feature × pass rate, layers A + B (npm run test:layer-b prints it): clearcoat A 2 / 2, B 1 / 1; transmission and refraction A 1 / 1, B 0 / 1; fresnel A 3 / 3, B 1 / 1; metal-rough B 1 / 1; sky-atmosphere A 2 / 2; every other layer-A feature passes; animation / skinning 0 / 1 (asset missing).

    • The Khronos models sit outside the default asset root for now, like the mannequin (§ 3 status above, waiting on the asset-root decision): --assets points the tools at them.

  • Layer B, real scenes (2026-11-08, branch layer-b-real; ROADMAP "How we are judged"): Bistro night and Zero Day, ThreeRT live (the 0.5 floor, 64 frames after a history reset, the scene's camera held still) against our unbiased offline render (no clamps, no denoiser; Bistro 4096 spp, Zero Day 16384), in npm run test:layer-b after the Khronos rows (--no-real skips them).
    • The truth renders are cached in out/cache/truth by bundle content and TRUTH_VERSION (bump it when the offline estimator changes what it converges to): once, ~5 / ~15 min. Then a run takes ~19 s.
    • Limits: a regression guard, live not being within the composite scenes' absolute bar. Set at main e98236f, whose runs repeat exactly (Bistro ΔE 3.89 / SSIM 0.799, Zero Day 3.77 / 0.790), at + 0.1 ΔE / - 0.005 SSIM. The build before #69 and #70 (4.12 / 0.791, 3.91 / 0.785) fails both.

3a. Standard material library (2026-11-06)

  • packages/scene/src/materials.ts: nine Three-like constructors (WetGroundMaterial, FacadeMaterial, TriplanarMaterial, PaintMaterial, NeonSignMaterial, LedScreenMaterial, LightPanelMaterial, ShopWindowMaterial, RoadMarkingMaterial), each one of Kabukichō's nine master materials taken line for line as a MaterialFunction. Metres and three.js parameter names; neutral maps bound for empty slots; set() for later edits.
  • Kabukichō builds its materials from them. Offline renders at three viewpoints match the previous ones within the renderer's own repeat noise (dE 0.01 / 0.02 / 0.04, the same as rendering the old bundle twice). GPU unchanged (0.5 floor 14.94 ms still, 15.90 moving).
  • Layer A: six atomic tests (std/*):
    • sign emission = intensity;
    • a blinking light's off phase is dark;
    • LED screen picture = intensity;
    • a road-marking mask cuts out;
    • grime darkens paint by 30 %;
    • dry wet-ground = the standard material. Layer A 25 / 25.
  • Built-in material fields moved into the library (2026-11-06). wet, puddles, grime, windows and mapping are SurfaceMaterial: the kernel's code moved line for line into a material function, with its noise and hash helpers. emissiveAnimation maps onto NeonSignMaterial (flicker, scroll, new blink), LightPanelMaterial and LedScreenMaterial.
    • Removed from the renderer core: the fields on MeshStandardMaterial and in the engine's material description, 96 bytes of the GPU material (288 instead of 384), five kernel feature bits (no wet-street kernel variant compiled when scene.wetness first rises above 0), and 276 lines of WGSL (17 added in their place).
    • Material functions get i.near (camera hit or mirror-like reflection), so library code can keep fine detail where it shows, as the kernel did.
    • Pinned first: five layer-A tests measured on the built-in code (world mapping, wet, puddles, grime, windows). They pass unchanged on the library port, to every printed digit (surface/*).
    • Combined check beyond the pins: scanned maps with normal maps, world-mapped, wet ground with puddles and rain ripples (t = 1.3 s), grime and windows on two walls. The old fields on the old build and SurfaceMaterial on the new one render the same image (PSNR 95 dB, dE 0.0).
    • Found on the way, in the old code as well as the port: lit windows seen in a mirror or glossy reflection with no other emitter in the scene came out at ~1e31 nits. The BSDF hit's MIS weight divided by the total emitter power, which is 0 when only material functions emit. Fixed (the BSDF ray gets the full weight); surface/windows-mirror guards it.
    • Two more tests: a sign's scroll at t = 1 s and its blink (std/sign-*). Tests can set the scene time (time). A ratio test whose reference region is black now fails instead of passing 0 / 0. Layer A 33 / 33.
    • Kabukichō doesn't use the fields. Renders at three views match the previous build within its repeat noise (dE 0.01 / 0.03 / 0.04). GPU at the 0.5 floor is unchanged: 14.88–14.89 ms still, 15.64–15.69 moving (the previous build in the same runs: 14.86–14.90 / 15.62–15.65).
    • Left as it was: rain ripples on a material function don't mark pixels as animated (the kernel's built-in did), so the live history smooths them, as it already did on WetGroundMaterial. A MatOut flag for animated non-emissive output would fix both.

4. Dev loop (the 300 ms rule)

  • Throughput benchmarks size their load from a time budget so one measurement takes ~300 ms. Hitches are measured separately: frame-time p95 / p99 and spikes (first compile of a shader variant, the 0.7 s structural rebuild).
  • Drop warm-up frames, use GPU timestamps, cache reference images by scene hash + renderer version, never benchmark while the GPU runs something else.
  • Three loops: inner < 1 s, middle 30–60 s, outer minutes. Every benchmark prints one summary line "×N vs baseline". Middle loop, every change to the live passes: node tools/bench-ghosting.ts --quick --check (§ 2c).
  • Gate tiers (2026-11-07, WORKFLOW.md): before merging, each PR runs only its tier's checks (D docs, T tools, R1 feature-gated renderer, R2 changes existing scenes, R3 hot path or perf claim) plus a ~30 s perf smoke against the cached main baseline. Full A/B timing only for R3. The full perf suite runs on main every ~3 h or after 4 renderer merges, with a bisect; the UE-parity suite every ~12 h. Next tooling: tools/perf-smoke.ts, tools/perf-suite.ts.
  • Status: started. tools/lib/bench.ts (quiet-GPU guard, renderer-version reference cache, p95 / p99 / spikes, time-budgeted runs, "×N vs baseline" lines in out/bench/baselines.json); tools/bench-hitches.ts (frame-time percentiles while game events play, spikes attributed to events; live --frame-log). First finding: the live loop drained the GPU twice a second to time a frame (a 53 ms hitch every 0.5 s on Kabukichō); GPU time now comes from timestamp queries read back without waiting. Two more pacing faults followed: a fixed 60 Hz sleep made a GPU-bound loop alternate long and short frames, and the two-frames-in-flight limit waited for all GPU work (the GPU idled while the next frame recorded). Kabukichō, dynamic resolution, events lights / mood / rain / viewpoint: frame p99 44.7 → 26.7 ms, interval p50 = GPU time 19.4 ms, no spikes (bench-hitches).

5. GTA gaps, in order

  1. Movable nodes — done (2026-11-06; TLAS instancing not needed so far).
    • Object3D.movable is UE's Mobility "Movable": scripts move the object, and everything under it, every frame without rebuilding the scene. Its triangles go to the dynamic BLASes with the posed models, and a move re-transforms them on the CPU, uploads the touched span and rebuilds the dynamic BLASes + TLAS (hardware RT; the software BVH still rebuilds).
    • Lights move in place through the light table; a visible rect light's card moves with its group.
    • A fixed object that moves becomes movable at its first move: one rebuild and a log line naming it. Placing a newly created object is not a move.
    • Moved surfaces keep a short history, like posed models: there are no per-object motion vectors yet.
    • Acceptance, bench-hitches:
      • Kabukichō with a taxi driving down the street (T / traffic; parked under the street when off, so the default views are unchanged): frame p99 769.8 ms → 18.3 ms. Before, every frame rebuilt the scene (767 ms); now there are no spikes.
      • Mannequin plaza with a car driving a loop behind the mannequins (a movable group of 9 meshes, wheels turning): p99 21.6 ms. The previous build manages 19.7 ms there only because the small plaza rebuilds in ~2 ms (interval p50 18.4 ms then, 16.7 now).
      • The same car not marked movable: one rebuild at its first move (22.8 ms), then p99 22.3 ms, no spikes.
    • Step 1's numbers are unaffected: bench-temporal excess 2.70 / 2.86 / 3.18, hitches p99 21.3 ms.
    • Movable glTF models as TLAS instances (2026-11-08, hardware RT).
      • A movable model that is not posed, and has no triangles flattened per placement (glass, emissive, material functions), is placed as an instance. A move rewrites its kernel record, its object pivot and its TLAS transform, and rebuilds the TLAS. No triangles are re-transformed, no BLAS is rebuilt.
      • The record keeps the previous frame's transform, so the kernel's motion vectors follow it. A fast sway (0.4 rad, 2 Hz): moving vs converged ΔE 1.86 with them, 1.98 without.
      • The C slice: BLAS rebuild 3.1 → 2.1 ms a frame, frame script 7.0 → 3.7 ms. The skinned walkers are what is left.
      • Meshes (scene-code geometry) and posed models still re-transform / re-skin their triangles. Software traversal flattens instances and rebuilds, as before.
      • Kabukichō perf smoke −0.03 / +0.02 ms. District drive GPU p50 / p95 16.75 / 17.28 → 16.77 / 17.29 ms: the record grew from 112 to 160 bytes.
  2. Skinning — done (0.2): glTF clips sampled on the CPU, linear blend skinning, posed models re-skinned in place (dynamic BLASes), the plaza game.
  3. Glass refraction and car paint — first version done (2026-11-06).
    • Glass: MeshPhysicalMaterial transmission / ior. The transmitted share replaces the diffuse lobe and is sampled as a delta event: refraction through the shading normal, or through a VNDF-sampled microfacet normal above roughness 0.05 (Walter et al. 2007); total internal reflection reflects. F0 comes from the IOR.
      • Seen through glass counts as seen directly: exact lighting, no indirect firefly clamp, the live viewport's specular signal.
      • Glass lets shadow rays through. Offline (since 2026-11-08) each glass surface keeps its transmission share and tints by its colour, as UE's path tracer does; live they pass unattenuated (no caustics, like UE's raster translucency shadows). transmissionMap / glTF transmissionTexture scale the transmission.
      • Live paths don't end in the radiance cache on glass.
    • Car paint: clearcoat / clearcoatRoughness (UE ClearCoat). A GGX coat with F0 0.04 over the base; the base gets what the coat's directional albedo lets through, so energy is conserved.
    • Both are feature bits: scenes without them compile them out (Kabukichō's cost is unchanged).
    • Tests (layer A):
      • material/glass-transmission 91.86 vs 92.31 analytic (it failed before: transmission was ignored);
      • new material/clearcoat-f0 0.0400 vs 0.04;
      • new furnace/clearcoat 1.000.
    • The mannequin plaza's car now has clearcoated paint and a glass cabin with seats inside.
    • Not yet:
      • Thin-walled glass: a single-plane pane refracts as if solid.
      • (Rough glass as a BSDF with a value and a density: done 2026-11-16, § 1.)
      • Tinted shadows.
      • Light through windows in the radiance cache: it treats glass as a surface, not a window.
      • glTF KHR_materials_transmission / clearcoat.
      • Metallic flakes.
      • A UE reference shot of glass and paint.
  4. Motion blur and depth of field.
    • Per-object motion vectors first: done (2026-11-06).
      • The renderer keeps the previous frame's vertices of the dynamic triangles (posed models, movable objects; prev_verts).
      • The trace kernel writes each camera hit's world-space offset to where it was. The temporal pass reprojects moving objects through it, so their history is no longer cut short.
      • THREERT_NO_MV=1 restores the short history.
    • tools/bench-motion.ts measures moving objects: the plaza's movers freeze; the frame right after (history built while moving) is compared against the same pose converged. With motion vectors vs without:
      • ΔE 1.30 vs 1.28, p95 5.81 vs 4.96, SSIM 0.962 vs 0.957.
      • The movers are a small part of the frame. They are visibly cleaner (no grain on the walking / jogging mannequins), but their lighting lags a little as they turn.
      • Their shadows smear on the ground either way.
      • Both come from the sun's direct light riding the long diffuse history.
    • Directional lights' direct light in a signal of its own: done (2026-11-06).
      • It holds the camera hits' direct light from the sun (a tiny disk, so nearly deterministic). It bypasses the denoisers.
      • Its history: Catmull-Rom at the motion-compensated position. While anything changes (view, object, lighting) it is clamped to this frame's 3 × 3 range and held to 4 frames; otherwise it accumulates like the diffuse.
      • bench-motion ΔE / p95 / SSIM: 1.30 / 5.81 / 0.962 → 0.73 / 1.87 / 0.982. The moving shadows are crisp and the movers' lighting follows them.
      • The exact local-light loop went there too at first and was taken out again. On Kabukichō its sphere lights' soft shadows are noisy, and sign flicker keeps the history short, so without a denoiser:
        • excess move40 / move59 / stopped 1.71 / 1.86 / 2.20 → 1.92 / 1.95 / 2.33;
        • k = 1 SSIM 0.640 → 0.620.
      • Directional only, on Kabukichō (after fixing stale direct light in pixels that turned to sky, which drew trails of moving figures across the sky):
        • excess 1.81 / 1.79 / 2.14 (step 1 targets still met), closing 4 s excess 0.27;
        • k = 1 0.637, @256 0.738;
        • sun-room k = 1 0.950 → 0.959; mannequin still @16 / @256 0.987 / 0.983; bench-motion 0.73 / 1.78 / 0.980.
      • Cost: +0.9 ms on Kabukichō at the 0.5 floor (trace 8.46 → 8.90, temporal 1.93 → 2.23 ms). The trace's share is the kernel as a whole (register pressure / occupancy), not the work: switching the write or the bookkeeping off at run time changes nothing. So Kabukichō is 17.3 ms at the floor, over the 16.7 ms budget again (16.46 before).
      • The structural way back: the à-trous (3.7 ms) runs at output resolution whatever the render scale. Running the diffuse denoiser at traced resolution, as UE denoises before upscaling, saves ~2.7 ms at the floor.
    • The diffuse denoiser at traced resolution: done (2026-11-06).
      • The diffuse temporal accumulation (dtemporal) and the à-trous stages run on the traced grid, on irradiance, with edge stops from each sample's own surface. The temporal pass then upsamples per output pixel (joint bilateral on depth and normal) and remodulates by the sharp albedo. UE also denoises before it upsamples.
      • Edges. Each frame the upsampled irradiance is that of the surface the pixel's nearest jittered sample hit; at an edge that flips with the jitter while the albedo history holds a blend of both sides, so edges dithered and stair-stepped. The temporal pass keeps a short history of it (clamped into the range of the traced values around; 16 frames still, 4 moving), like the albedo's.
      • Bandwidth. The stages first read the 80-byte samples for their edge stops and cost twice as much per pixel; dtemporal now keeps a compact copy of each sample's surface in a buffer that is free until the specular passes.
      • Kabukichō GPU at the 0.5 floor 17.37 → 14.95 ms (trace 8.93; dtemporal 0.41, à-trous 0.69 for five stages, was 3.68; temporal 2.23 → 2.03; the compose moved into the last specular pass, +0.34). Every mood and viewpoint is within budget, fog ramps included (§ 1).
      • Above about 0.85 the separate pass costs more than it saves: sun-room at a fixed 0.93 is 18.2 vs 17.1 ms. Dynamic resolution absorbs it (sun-room settles at 0.85 instead of 0.93, with better SSIM, below).
      • Quality, same tools against the #18 build:
        • bench-temporal at 100 %: excess move40 / move59 / stopped 0.5 s 1.79 / 1.79 / 2.14 → 1.75 / 1.71 / 1.98; closing 4 s 0.27 → 0.25; closing 0.3 / 1 s vs converged 9.06 / 9.00 (limits 10.28 / 9.91).
        • bench-temporal at 0.5: move20 / move40 / move59 / stopped 2.61 / 3.09 / 3.20 / 3.17 → 2.67 / 3.03 / 3.07 / 3.00; closing 4 s 1.00 → 1.10.
        • Sun-room vs the UE Path Tracer at a fixed 0.93, k = 1 / @16 / @256 SSIM: 0.958 / 0.959 / 0.970 → 0.960 / 0.970 / 0.971. Dynamic resolution (0.85): 0.958 / 0.970 / 0.972.
        • Kabukichō v1 vs UE Lumen at a fixed 0.5: 0.633 / 0.708 / 0.738 → 0.633 / 0.721 / 0.726. @256 is the one regression: irradiance detail finer than the traced grid. The old output-resolution history super-resolved it from the jittered samples, but needed two output-resolution à-trous stages to hide its noise (the cost removed here). A raw output-resolution accumulation that takes over at long history stays visibly grainy at 256 frames (@256 0.663); a longer edge history changes nothing (0.726).
        • Mannequin vs offline @16 / @256 0.987 / 0.983 → 0.988 / 0.983; bench-motion ΔE / p95 / SSIM 0.73 / 1.78 / 0.980 → 0.74 / 1.91 / 0.980; hitches p99 25.0 ms; layer A 18 / 19 + 1 asset-dependent.
    • Motion blur at UE's defaults: done (2026-11-06).
      • Parameters: amount 0.5, max 5 %, target 30 fps. The presets switch it off for their stills; Kabukichō and the mannequin plaza switch it on, as UE's level has it.
      • Velocity: the temporal pass computes each pixel's motion from the camera and the motion vectors.
      • Reconstruction: a gather after McGuire et al. 2012 on the HDR image before bloom. A moving object smears over a static background; a static foreground stays sharp.
      • Length: from the amount, the frame's motion and the target frame rate (docs/RUNTIME.md, "The post chain"). At 60 fps that is one frame of motion in total, capped at 5 % of the width.
      • Camera cuts (a jump of 2 m or 30° in one frame) don't blur. Without that check, Kabukichō's viewpoint switch smeared the whole frame (horizontal gradient energy 102 vs 363).
      • Cost at the 0.5 floor, Kabukichō:
        • 0.44 ms while anything moves: 15.78 ms total vs 15.36 with it off.
        • 0.01 ms while nothing moves: the pass is skipped and the last specular pass composes straight into the final image.
        • A separate copy pass (0.33 ms) is gone: the last specular pass composes into the buffer the blur reads.
        • Within budget either way.
      • UE reference: bench-temporal --motion-blur against UE renders with the same settings (MB=1 ue5/temporal.ts). Movie Render Queue replaces the amount with its shutter fraction (0.5) and the target FPS with the output rate (60), which is half the real-time blur. Ours at UE's real-time defaults read about twice UE's blur against those frames. Ours at what MRQ rendered (THREERT_MOTION_BLUR=0.5,5,60):
        • excess over UE move20 / move40 / move59 / stopped 1.23 / 1.51 / 1.60 / 2.01 (unblurred 1.43 / 1.75 / 1.75 / 2.01);
        • strong vertical edges widen by +0.03–0.10 px (UE +0.06–0.21).
        • Both blurs are short: the move turns 0.2° per frame, about 2.4 px.
    • Depth of field at UE's defaults: done (2026-11-06).
      • UE's default is off: no focus distance on the camera. A camera's dof (focus distance, f-stop, sensor width; UE's defaults f/4, 24.576 mm) switches it on.
      • CoC: a thin lens (docs/RUNTIME.md, "The post chain"), capped at 2.5 % of the width.
      • Live: a gather on the composed HDR image, before motion blur as in UE.
        • The CoC is computed in the compose pass.
        • A 16 × 16 tile maximum bounds each pixel's search.
        • 48 Vogel-disk samples, scatter as gather. A foreground layer (samples in front, coverage from their spread) is composited over the rest. Samples behind count only as far as the pixel's own CoC reaches, so blurred background doesn't cover a sharp edge.
      • Offline: the path tracer's thin lens (unchanged).
      • Cost: 1.67 ms at 1280 × 720 while on (tiles 0.11, gather 1.56); off, 0.01 ms. Kabukichō at the 0.5 floor 15.03 ms still, 15.83 moving (motion blur included).
      • UE reference: scenes/mannequin-portrait.ts, the mannequin scene through a portrait lens (CineCamera, 36 mm filmback, 20° vertical FOV = 57 mm, f/1.2, focus 5.9 m on the dancer), and PORTRAIT=1 bun ue5/mannequin.ts in UE (Lumen + Path Tracer). The plaza's F key swaps the same lens in.
        • Ours vs the UE Path Tracer: live @256 ΔE 3.34 / SSIM 0.982 (the unfocused scene: 3.94 / 0.982), offline thin lens 3.31 / 0.987, UE Lumen 1.58 / 0.991.
        • Blur widths (10–90 %) of the blocks behind the dancer, ours live / ours offline / UE Lumen / UE PT: tall block 2.3 / 3.0 / 3.1 / 3.5 px, low box 4.2 / 3.8 / 4.7 / 5.4 px.
        • UE's horizon is softer still: its haze below the horizon (next item).
      • Fixed on the way: a camera description change (lens, DOF) rebuilds the scene, and the view kept its old camera. It now takes the scene's camera when that changed.
    • The atmosphere's haze below the horizon followed in #22 (see Known parity gaps).
  5. LOD and streaming. In progress: steps 1 and 2 done (#30, #31), light LOD added (below); 3 and 4 next.
    • Since 2026-11-08 the district becomes Bistro tiled (§ 0 step 10); the Kabukichō district numbers below are history.

    • Bistro district against the targets below (2026-11-08, local-main f2815a1, node tools/bench-district.ts, the first 50 s of Bistro's camera path at the 0.5 floor): GPU p95 16.2 ms (≤ 16.7: met, was 24.2 when the district landed), frame interval p99 17.0 ms with no frame over 50 ms (≤ 25 / 0: met), first frame 2.1 s (≤ 3 s: met), footprint 11.3 GB for nine copies, the same as one (≤ 1.5 x one: met). What got it there: the light tree, live secondary rays taking foliage cutouts as opaque, shadow rays' single candidate-loop query, the radiance cache's neighbouring levels, the viewport's pacing (item 3 of the supervisor's list, § 0). Geometry LOD and streaming (implementation steps 3 and 4) are not needed for these targets on Bistro; the "invisible" criterion applies when they are taken up.

    • Scene: games/kabukicho/district.game.ts, the Kabukichō district.

      • Nine Kabukichō streets on a 3 × 3 grid (175 m along, 90 m across), each from its own seed (4..12): different buildings, shops, signs, props and lights. No two blocks alike.
      • The night sky, fog and rain of the game.
      • About 37 M triangles: one block ~4.1 M; the middle row alone, district-row.game.ts, is 12.27 M triangles and 254 textures.
      • Textures come from the same Poly Haven pool in every block. The implementation PR widens the pool per block, so streaming has to handle textures too, not only geometry.
    • Drive (node tools/bench-district.ts [--row] [--scale 0.5|auto]): eye height, down the 520 m middle street at 15 m/s, back at 30 m/s, camera commands at 60 Hz; live --frame-log per frame; physical footprint at the end.

    • Targets. "Before" is the renderer without LOD or streaming; "now" is the 3 × 3 district with light LOD (2026-11-06, bench-district.ts):

      target goal before now (3 × 3)
      the 3 × 3 district loads yes no: Tlas … invalid custom index (more than 24 bits), triangle offsets cap a scene at 2^24 = 16.7 M triangles yes (#30, #31)
      GPU at the 0.5 floor, p95 along the drive ≤ 16.7 ms row: 20.6 ms (p50 19.7, p99 20.9) 21.2 ms (p50 19.5); 24.6 without light LOD; 18.5 ms (p50 17.9) with far emitters culled; 17.9 ms (p50 17.4) with the temporal and specular passes lighter (2026-11-07): the current limit, 1.2 ms short
      GPU at dynamic resolution, p95 (scale ≥ 0.5) ≤ 16.7 ms row: 21.8 ms at 0.50..0.75 21.2 ms at 0.50..0.80
      frame interval p99 / frames over 50 ms ≤ 25 ms / 0 row: 21.0 ms / 1 (51 ms); dynamic 23.2 ms / 1 (85 ms) 22.1 ms / 0; dynamic 22.8 ms / 0
      first frame ≤ 3 s row 6.5 s; one street 5.4–6.1 s 5.8–6.0 s; 2.7–3.0 s since 2026-11-07 (decoding in parallel)
      memory (physical footprint) 3 × 3 ≤ 1.5 × one street one street 8.6 GB, row 9.8 GB, 3 × 3: does not load 7.2 GB (instancing)
      LOD / streaming invisible 5 poses along the drive vs everything resident at full detail: dE ≤ 1.0, SSIM ≥ 0.98; while driving, popping within the bench-ghosting limits (§ 2c) (no LOD yet) light LOD: see below
    • Where the far blocks' GPU time goes. Variants of the district, lockstep drive (x −10 → 465 m, 0.5 floor), GPU p50:

      • 23.75 ms for the full district.
      • 23.08–23.83 ms with the outer blocks' meshes, props, geometry, local lights alone or emitters alone removed, or rays capped at 60 m.
      • 19.38 ms with the outer blocks' local lights and emitters both removed (geometry kept); 19.23 ms with the outer blocks gone entirely.
      • So the cost is far light sources, not geometry, and only both kinds together. Every camera-hit pixel tested all 1174 unshadowed local lights' ranges (the row has 391), and emitters were drawn by power wherever they were. Making either cheaper alone did not help: culling the light loop alone made it 25.1 ms.
    • Light LOD (live, 2026-11-06):

      • The emitter CDF weighs emitters by power × (d0 / max(d, d0))², d = distance to the camera, d0 = 10 m. It is rebuilt every 15 m of travel (1.2–1.5 ms CPU for the district's 376 k emitters).
      • Emitter draws (2026-11-07) search the CDF through a guide table (the cutpoint method, 64 k buckets): a draw u only searches between the entries where u's bucket and the next one begin. It finds the same entry as the full 19-level search (unit test), so the estimator is unchanged.
        • GPU at the 0.5 floor, main → guide table: district drive p50 / p95 19.35 / 20.97 → 18.93 / 20.30 ms (4 k buckets: 19.02 / 20.38); Kabukichō still / moving 14.64 / 15.42 → 14.39 / 15.14 ms.
        • An alias table (Vose's method, O(1) per draw, same distribution) was slower: district drive p50 21.6 ms, 20.05 with the keep probability and the alias packed into one 8-byte slot; Kabukichō even. Each draw starts at a uniformly random slot of the 376 k-entry table, nearly always a cache miss. The binary search's reads stay in few cache lines: every thread shares its top levels, and light LOD concentrates the draws on the nearby emitters. Branch emitter-alias.
      • The weighting only decides which emitters are proposed. Every surface vertex resamples the proposals (RIS: 6 candidates at camera hits, 2 deeper) toward power × geometry term, and every MIS weight uses power alone. So the split of each light between emitter sampling and BSDF rays is the same as without light LOD.
      • A first version put the light LOD into the MIS weights and drew single samples at deeper vertices. It was unbiased offline, but live it moved far signs' reflections onto the BSDF rays and made the radiance cache's training samples heavy, which the live clamps cut. Kabukichō's street came out 2 % farther from the truth.
      • Local lights at camera hits are sorted into spatial groups of 16, each with a sphere bounding the lights' reach; a point outside the sphere skips the group. Same result as testing each light.
      • THREERT_LIGHT_LOD=0 and THREERT_LIGHT_GROUPS=0 switch the two parts off for A/B. THREERT_SEED gives another sample sequence for noise floors. Renders repeat exactly only with software traversal (Known issues).
      • GPU at the 0.5 floor, main → light LOD:
        • District, lockstep p50 / p95: 23.91 / 24.27 → 19.30 / 20.61 ms.
        • Middle row, lockstep p50 / p95: 19.55 / 19.92 → 17.84 / 18.30 ms.
        • Kabukichō, still / moving: 15.00 / 15.83–15.89 → 14.59–14.62 / 15.42–15.51 ms.
        • Both parts compiled in but switched off: district 23.30 ms, Kabukichō 14.88–14.90 / 15.69–15.71 (faster than main).
      • Against the truth (criteria below; 480 × 270; regions sign band / street / facades / sky):
        • (a) Offline with every clamp off (16 k spp), LOD on vs the truth (two LOD-off seeds): within 0.32 % in every region of the district and Kabukichō. The two seeds differ by up to 0.57 %.
        • (b) Live converged frames (1024 frames) vs that truth, off → on:
          • District: −18.4 → −17.5 / −16.7 → −16.3 / −0.1 → +0.3 / −48.6 → −34.1 %.
          • Kabukichō: −6.2 → −5.5 / −6.9 → −6.8 / −1.2 → −0.4 / −21.8 → −15.5 %.
          • Closer or equal everywhere. The district facades' 0.2-point difference is inside their seed spread.
          • The live pipeline itself sits well below the truth: on Kabukichō's street the radiance cache alone accounts for −6.6 % (−0.25 % with the cache off).
        • (c) Live seed spread, the same build with two seeds: 0.1–0.3 % on the street and facades; 1–5 % in the sign band and sky.
      • Temporal, Kabukichō (bench-temporal at 0.5, medians of 3 runs, dE vs our converged frames, main → LOD):
        • Closing 0.3 / 1 / 2 / 4 s: 9.84 / 9.78 / 7.64 / 4.06 → 9.79 / 9.62 / 7.48 / 3.88.
        • Moving: move20 / 40 / 59 4.89 / 4.87 / 5.10 → 4.87 / 4.97 / 5.02; stopped 3.93 → 3.91. move40 is worse: sign band +0.28 dE, sky +0.46.
        • Excess over UE moves the same way.
      • bench-ghosting: turn 2.90 → 2.86, strafe 3.82 → 3.73, returns equal, stop+0.1s 2.87 → 2.83.
      • It needed #41 first: emitter shadow rays had skipped castShadow = false geometry (Known parity gaps). The light LOD's larger share for near emitters turned that leak into +16 % on the near facades.
    • Still open against the targets:

      • GPU p95: 20.6 → 18.5 ms (bench-district, 0.5 floor) by culling far emitters (2026-11-07, below); 1.8 ms short.
        • Far emitters cost, not far analytic lights (lockstep drive p50 / p95, main 18.87 / 20.17): the outer rows' emissive meshes removed 17.96 / 18.38, their analytic lights removed 19.02 / 20.41, both 17.52 / 17.93. Light LOD still proposes many far emitters (summed over the district, (d0 / d)² is mostly far mass), and each candidate reads a triangle, its material and an emissive texel somewhere in the district: incoherent misses, though RIS rarely picks them.
        • Live emitters farther than 60 m from the light LOD's reference are not proposed (emitter_lod, weight 0; THREERT_EMITTER_CULL = metres, 0 = off). BSDF rays that hit them get their whole light (emit_mis returns 1 for them), so every emitter's MIS weights still sum to one and the estimator stays unbiased; their light just arrives by BSDF rays (and so the radiance cache) alone. The one bias: fog in-scattering finds emitters only by sampling them, so the culled ones' glow in the fog is missing (the far signs below).
        • Lockstep drive p50 / p95 by radius: off 18.89 / 20.13, 120 m 18.16 / 18.64, 60 m 17.84 / 18.26, 30 m 17.54 / 17.95.
        • Invisible (5 poses along the drive, x = 20 / 120 / 250 / 380 / 480, 1600 still frames at the 0.5 floor):
          • vs the same render without culling, same seed: dE 0.62–1.01, SSIM 0.986–0.992. Two seeds without culling differ by dE 1.32–2.37, SSIM 0.94–0.96, so most of that is noise.
          • Region means vs the offline truth (16 k spp, clamps off), culled − exact: far street +0.14 to +0.70 %, far signs −0.06 to −0.66 %, sign band, near street and facades within ±0.25 %. The live seed spread is 0.07–1.0 %: on average about 1 ×, at most 4.4 × (far street at x = 250). Live itself sits 12–31 % below the truth there.
        • Kabukichō even (still / moving 14.35–14.43 / 15.07–15.08 ms, main 14.36–14.38 / 15.09–15.10); compiled in but off +0.07 ms. Wet street after a strafe vs UE50 the same (street 3.28 / 2.67 / 1.61 vs 3.28 / 2.68 / 1.62).
        • Where the rest goes (drive, mean per pass): trace 11.06 ms, temporal 2.07, specular filter 1.78, à-trous 0.70, the other passes ~1.5. Culled, the district is at the middle row's level (row alone 17.4 / 17.8 ms lockstep): what is left is the street's own content. The temporal and specular passes run at output resolution, so the render scale does not shrink them.
        • The view cone (2026-11-08, branch view-cull, found on Bistro): the cull keeps emitters ahead of the camera. Culled emitters' light arrives by BSDF rays alone, which is unbiased but rare; the firefly clamp cuts those rare rays, so a lit region whose emitters are all culled goes dark. Bistro's square (40–90 m down the street, lit by its own string lights) had 40 % of its offline light in the live image, the frame 75 %. Now emitters inside a cone around the view (the frustum's half-diagonal + 20°, rebuilt after a 15° turn as after 15 m) are kept out to 2 × the radius (120 m; THREERT_EMITTER_CULL_VIEW = the multiple, 0 = the old cull); the kernel's emitter_culled makes the same test.
          • Bistro, live raw radiance / offline 1024 spp (99th-percentile cap): frame 0.75 → 0.85, square 0.40 → 0.70, street 0.91 → 0.95, left facade 0.94 → 0.97 (= no cull at all). GPU at the 0.5 floor 14.62 → 15.1 ms.
          • Reach: 1.5 × / 2 × / 4 × give Bistro the same (square 0.69 / 0.70 / 0.70); the district drive (GPU p50 / p95, cull alone 16.6–16.7 / 17.1–17.2 ms) pays nothing / +0.1–0.2 / +0.4–0.5 ms. 2 × keeps margin for Bistro views down its longer streets.
          • Kabukichō perf smoke +0.14 / +0.09 ms (+0.03 / +0.01 at 4 ×: run noise; its far emitters are out of view or occluded); offline unchanged (16 / 16 catalog scenes byte-identical).
          • Measured, not taken: light LOD d0 20 / 30 m on top: frame 0.87 / 0.88, square 0.76 / 0.79, +0.25 / +0.4 ms; LOD off: square 0.81. The rest of the live deficit (~12 %, everywhere) is the live estimator's: fewer bounces, the clamp on noisier samples, temporal clamping.
      • The temporal and specular passes, lighter (2026-11-07): p95 18.5 → 17.9 ms (p50 18.0 → 17.4), 1.2 ms short.
        • Measured first (district drive, timing-only switches): the specular filter's three passes cost 0.35 of their 0.48 ms copying (memory traffic), spec2 mostly read four buffers to compose the image; in the temporal pass the Catmull-Rom albedo / emission / sun history 0.38 ms, the 3 × 3 gather 0.25, the irradiance upsample 0.15, the mirror-image fetch 0.15, the rest mostly its output-grid histories (~104 bytes written per pixel).
        • Kept: the temporal pass writes the composed rest (diffuse, emission, sun light; w: depth) so spec2 reads one vector (0.83 → 0.71 ms); the specular ping-pong in f16, 8 bytes per pixel (−0.27); the output-grid g-buffer in 8 bytes with roughness (octahedral normal, f16 depth and roughness: −0.2 over the passes). Temporal 2.08 → 2.00, specular 1.78 → 1.28, dtemporal 0.41 → 0.38 ms. Converged frames at 5 poses vs main: dE 0.05–0.09 (two seeds of main: 1.3–2.4); bench-ghosting and the wet street vs UE50 unchanged; Kabukichō −0.55 ms still and moving.
        • Tried, no gain: one exp per tap and pow by squaring in the filter (latency-bound on its loads, not math); loading its 3 × 3 once into per-thread arrays (spilled: 0.43 → 0.79 ms); the three steps fused in one pass through workgroup memory (16 × 16 tiles with a 7-pixel halo, 25 KB: occupancy fell, 25 ms).
        • The histories that accumulate long (specular, diffuse, sun light: up to 4096 frames still) need f32; the live bind group is at Metal's 29-buffer limit, so new typed buffers need old ones merged first.
        • What is left at 17.4 ms (mean): trace 11.05, temporal 2.00, specular 1.28, à-trous 0.70, dtemporal 0.38, refl 0.27, the rest ~0.7.
      • 17.9 ms is the current limit (decided 2026-11-07), 1.2 ms short of 16.7. Tried and not pursued further:
        • the camera-hit direct light in its own pass (§ 1): the district +0.86 ms;
        • per-tile light culling (§ 1): the loop it would cull costs nothing inline;
        • an alias table for emitter sampling: slower than the guide table that replaced the search;
        • specular denoising at the internal resolution (§ 1): −0.62 ms, ghosting and the wet street worse.
      • Candidate structural project, not scheduled: full TSR, the output grid accumulating the composed image instead of each signal's history. The gain is uncertain, since our per-signal histories already accumulate at the output resolution, and it touches every ghosting acceptance.
      • First frame: met on 2026-11-07 (5.8–6.0 → 2.7–3.0 s; Kabukichō 4.8 → 1.7 s), without streaming.
        • Where the 5.8 s went (3 × 3 district, launch to first frame):
          • the game's setup in the script runtime, 1.25 s;
          • decoding images one after another, 2.0 s: ~200 texture files, and 53 models with 219 embedded images, all 2 k;
          • packing the texture pages, 0.9 s, nearly all of it resizing each 2048² texture to 2016² so its gutters fit; the image crate's horizontal pass walks a whole-image f32 intermediate column by column;
          • copying the 32 pages to the GPU, 0.3 s. Building the BLASes and the TLAS takes 0.13 s.
        • What changed:
          • scene::build decodes up front, in parallel: the texture files the materials use, and the models with their images converted to RGBA;
          • texpack::resize_triangle gives the image crate's Triangle resize bit for bit (unit test), a row at a time and in parallel.
          • Renders are bit-identical to before (software traversal, district and Kabukichō).
        • So streaming by distance is not needed for the targets yet: memory is met, and nothing on the GPU side (BLAS builds, 0.13 s) is worth spreading across frames. It becomes necessary once the texture pool widens per block (§ 5, the scene above), since decoding grows with it.
        • Left on the way to the first frame: the setup script (1.25 s), the page copies (0.3 s), the rest of scene::build (0.5 s).
      • Frame interval in dynamic resolution: the controller acted twice a second. At the drive's far end the camera looks out of the district, the scale rises to 0.85–0.88, and on the turn back the GPU took 35–48 ms for up to 30 frames (p99 22.2–28.6 ms, 0–21 spikes). Fixed in #52: two frames well over the frame time act at once; p99 21.5–21.7 ms, no spikes.
    • Order (decided 2026-11-06, from the numbers above; the far blocks' GPU time is their light sources):

      1. Light LOD. Done.
      2. UE strafe reference with the sign-band comparison (§ 2c). Done.
      3. The direct-light pass (§ 1) for the GPU p95, with one more emitter sample at near-mirror camera hits for the wet street (moved ahead of streaming on 2026-11-07).
      4. Streaming: first frame ≤ 3 s, no frame over 50 ms. Memory is met already. The first frame was met by decoding in parallel instead (2026-11-07, above); streaming waits for a wider texture pool.
      • Simplified meshes and impostors (step 3) come later. They help neither the GPU time nor memory here.
    • Which "invisible" criterion applies:

      • Unbiased estimator changes (light LOD): judged against the truth, not against the image without them. a. Offline with every clamp off, the region means with and without the change are within the noise floor. b. Live converged frames are no farther from that offline truth with the change than without it, per region (sign band, street, facades, sky); compared with UE too. c. The noise floor is the same build run with two seeds (THREERT_SEED). d. bench-ghosting and closing 0.3 / 1 / 2 s no worse than main.
      • Biased geometry LOD (simplified meshes, impostors): dE ≤ 1.0, SSIM ≥ 0.98 at 5 poses along the drive vs everything resident at full detail, as in the table above.
    • Implementation order:

      1. Lift the 2^24 cap: per-instance offsets in a table instead of the TLAS custom index.
      2. Instance repeated props: one BLAS per model, TLAS instances. Each block places ~350 GLB props from a shared set.
      3. Distance LOD: simplified meshes for far blocks (meshoptimizer), impostors beyond.
      4. Streaming by distance: block BLASes and texture mips made resident ahead of the camera, built and uploaded across frames so no frame goes over 50 ms.
  6. Particles, volumes, foliage wind, water. Plan (2026-11-07); one sub-item per PR, in this order.
    • Rules for all of them:
      • Agents write Three-like DSL; the mechanisms are the existing engine paths (material functions, the standard library, movable nodes, instancing, frame scripts).
      • No built-in effect fields in the kernel. Where the kernel needs something new, it is a generic contract with WGSL bodies, like material functions, and the PR reports its cost compiled in but off.
      • Every PR: the full gate, crops for visual changes, and the gate scene (Kabukichō then; Bistro night once § 0 step 7 lands) at the 0.5 floor ≤ 16.7 ms with the effect on (now 13.9 still / 14.5 ms moving: ~2.2 ms for effects).
      • UE references come from the same tools as before:
        • ue5/capture.ts stills of a level;
        • ue5/temporal.ts MRQ sequences at 60 fps (frames for side-by-side videos);
        • scratch projects built natively from a script (ue5/glb-scene.ts, ue5/mannequin.ts) for test scenes.
    • Order and why:
      • Rain first. Kabukichō's rainy night has wet streets and ripples but no falling rain, and the UE level has it (below). It is also the C slice's rainy night street.
      • Then sparks and debris (the C slice's explosion), on the same particle path.
      • Volumes next, for smoke and the explosion's fireball, and because water's body needs a medium.
      • Water after that (the C slice's waterfront).
      • Foliage wind last: no current scene has foliage; it is for the C slice only.
    1. Particles: rain.
      • How agents use it: new Particles({ count, emitter, material }), a node in the scene like a Mesh.
        • The emitter is a ParticleFunction: a WGSL body under a small fixed contract. From (particle index, time, camera, seed, its parameters) it returns a quad (centre, axes, size) and a per-particle vec4 for the material.
        • The standard library has presets: RainCurtain({ drops, box, speed, length, wind }) and a RainMaterial (streak texture, alpha-tested, lit by the scene).
        • Particles are a function of time and camera, so they stay deterministic and need no game state (the scene is a function of the state).
      • Mechanism:
        • A compute pass evaluates the particle function into a dynamic triangle span (this frame's quads and last frame's for motion vectors), and the dynamic BLAS is rebuilt on the GPU: the posed models' path, no CPU or script cost.
        • The material is a material function; the per-particle vec4 reaches it as a new MatIn field (the generic per-instance data channel, as UE's PerInstanceCustomData), so no effect fields.
        • Why not frame scripts moving 16 k instances: QuickJS per frame, and wgpu builds TLAS instances on the CPU.
      • UE reference:
        • The level's own rain, AKabukichoRain (~/code/KabukichoNight, read only): 16 000 streak quads that M_Rain's world position offset wraps into a 32 × 32 × 22 m box around the camera, drops and billboards. Our preset takes the same numbers.
        • The captures hide it today (KabukichoRain in the hide lists): stills and MRQ sequences with it shown, rain on.
      • Metrics:
        • Rain is random, so per-pixel ΔE against UE means nothing for the streaks themselves.
          • Rain on vs off: the added luminance per region (sign band, street, facades, sky) against UE's same difference.
          • Streak density, length and angle against UE's frames.
          • Behind the rain, ΔE / SSIM to our rain-off image ≤ the two-seed noise floor.
        • In motion:
          • bench-ghosting with rain on: the scene's rows no worse than without rain;
          • streaks leave no trails: residual luminance one frame after a streak passes ≤ its 1-spp noise.
        • GPU: Kabukichō with rain ≤ 16.7 ms at the 0.5 floor; the particle pass and BLAS rebuild reported.
        • Layer A:
          • particles/quad-placement: a particle function's quad at an analytic position and size covers the expected pixels;
          • particles/instance-data: the per-particle vec4 reaches the material.
      • Status (2026-11-07): the mechanism is in, without rain (docs/MATERIAL_FUNCTIONS.md, "Per-instance data and particles").
        • Per-instance data: customData on any node, i.custom in any material function (objects table stride 3 vec4). Layer A material/custom-data.
        • ParticleFunction / Particles, the particle pass and the BLAS rebuild; THREERT_PROFILE times both, and the frame timer starts at the particle pass. Layer A particles/quad-placement, particles/instance-data and particles/lit-normal (the quad's own shading frame).
        • Existing scenes are unchanged: the 15 catalog scenes render byte-identical to main offline with software traversal (4 spp).
        • Compiled in but unused: Kabukichō 13.76 → 13.84 ms still, 14.51 → 14.53 ms moving; district drive p50 17.31 → 17.36, p95 17.74 → 17.78 ms (0.5 floor, two alternating runs each).
        • With 16 000 particles over Kabukichō: particle pass 0.12 ms, BLAS + TLAS rebuild 0.6 ms.
      • Status (2026-11-07): rain is in. RainCurtain (standard library) on Kabukichō, key P toggles the streaks.
        • The translucency pass (docs/MATERIAL_FUNCTIONS.md, "Translucent particles") draws transparent particles over the image:
          • depth: each pixel's ray stops at the opaque surface it shows;
          • overlap: ordered blending, the 4 nearest hits front to back, not weighted OIT;
          • lighting: the radiance cache's volume voxels at the hit (live), a fresh estimate per sample (offline). They are absent from reflections, shadows and GI (Known parity gaps).
        • Layer A:
          • translucent/order: 2.5 nits, against 1.5 for the reversed order;
          • translucent/depth: live, a quad behind a wall stays hidden while one in front shows (ratio 10);
          • volume/lighting (live, 1.021) and volume/lighting-offline (0.997), against the analytic 1: a white particle in a cube with one lit wall.
        • Rain against UE50 at the bench start pose, 60 frames:
          • added luminance:

            region UE ours
            all +0.15 % +0.17 %
            facades +2.04 % +1.86 %
            right facades +0.49 % +0.47 %
            signs +0.03 % +0.00 %
            street +0.08 % +0.25 %
          • streak angle: −1.1° (UE −2.6°);

          • run length: 9.1 px (UE 10.9);

          • streak coverage: 0.98 % of pixels, against UE's ≈ 0 (below).

          • Crops: docs/img/rain-facade-ue-ours.jpg and docs/img/rain-street-ue-ours.jpg (UE on | off | ours on | off).

          • Our on / off frames come from one run (THREERT_TL_HIDE=odd hides the layer on odd frames). Shader time follows the wall clock even in lockstep, so separate runs differ in sign flicker and rain phase: ±2 % on the facades between runs.

        • Behind the rain: the layer hidden vs rain off is within the two-seed noise floor in every region (ΔE / SSIM, 10 frames):
          • all: 0.78 / 0.981 against a floor of 2.54 / 0.934;
          • street: 1.12 / 0.960 against 1.77 / 0.928;
          • facades: 0.46 / 0.994 against 0.69 / 0.987. The layer has no history, so a streak leaves nothing behind once it has passed.
        • bench-ghosting --quick --check: every row equals main's.
          • Under THREERT_FREEZE_TIME the frame script gets dt 0, so the bench's "rain off" event never fades scene.rain: the bench has always run with rain at 1 (ripples).
          • It now runs with the streaks as well, static in time.
        • Volume voxels after a light switches off (cube with one lit wall, white walls): the particle drops below 10 % in 4 frames and below 5 % in 7. The floor and walls of the same view (surface cache + temporal filter) take 48–52 frames to drop below 10 %.
        • GPU at the 0.5 floor with rain:
          • Kabukichō: 15.22 ms still, 16.1–16.2 ms moving (≤ 16.7);
          • the particle pass 0.09 ms, the BLAS rebuild 0.42–0.49, the translucency pass 1.05, volume training 0.09.
          • Streaks past the 15.5 m fade are left out of the BLAS (−0.15 ms).
          • Offline: 124 ms for 32 samples.
        • Compiled in but unused (main 1791358 vs this, alternating):
          • Kabukichō without rain: 13.80 / 13.81 vs 13.80 ms still, 14.49 / 14.56 vs 14.48 / 14.54 ms moving;
          • district drive p50 17.32 vs 17.33–17.35 ms, p95 17.75 vs 17.77–17.78 ms;
          • the 14 catalog scenes without rain render byte-identical offline with software traversal.
        • Streak coverage, open. UE's streaks are invisible frame by frame; its +2 % is a veil.
          • UE draws translucency before TSR, without velocity: TSR spreads a thin streak that moves 10–50 px a frame thin over time.
          • Ours draws each frame's streaks after the temporal filter: crisp, about as bright on average.
          • Tried and reverted:
            • A history for the layer, reprojected with the opaque surface's motion and clamped to the current 3 × 3 neighbourhood (no trails). Weight 0.5 / 0.25 / 0.1: coverage 0.73 / 0.44 / 0.16 %, facades +1.85 / +1.32 / +1.16 %. The clamp throws the streak's light away with its contrast.
            • Thin-line anti-aliasing (streaks at least 1.5 px wide, as much fainter): coverage unchanged (wider streaks are still detected).
          • Matching UE would take a history without the clamp, a veil as TSR makes, which trails by definition.
    2. Particles: sparks and debris.
      • How agents use it: the same Particles with burst emitters. Presets SparkBurst({ count, speed, gravity, drag, life }) (emissive streaks that cool from white to red) and Debris (small meshes; few, so movable nodes moved by a frame script are enough).
      • Mechanism: the particle function gets the burst's start time and origin as parameters. Sparks are emitters: light LOD and the emitter table already handle moving triangles (EmitterTri::moves).
      • UE reference: a Niagara burst built from UE 5.8's own templates (Sprite Burst / Fountain, sparks) in a scratch project, captured as an MRQ sequence.
      • Metrics:
        • Burst statistics against UE (count over time, spread, light cast on the ground: luminance added per region).
        • No trails after the sparks die out.
        • GPU at the 0.5 floor during the burst.
        • Layer A: particles/emissive-spark (an emissive particle lights a white floor by the analytic amount).
      • Status (2026-11-07): in.
        • Particles as lights: emitterArea puts a particle's triangles in the emitter table with a nominal area.

          • The emitter entry carries it negated, and the triangle attribute x.z holds it.
          • The kernel samples the actual quad and corrects the area pdf for the nominal one in the RIS sampler, emit_mis and the reservoir evaluation.
          • Particles without it are marked: their BSDF hits get full weight. Before, any other light-sampled emitter made their light vanish: 0.002 instead of 2.418 nits in particles/emissive-unsampled.
          • Existing scenes stay byte-identical offline (software traversal, all 15 catalog scenes). Forms of the same code that kept the static path identical were chosen after a bisect: an extra early return in sample_emitter, or a reordered emit_mis, changed Metal's fast-math codegen by 1 LSB in emitter scenes (PSNR 92–112 dB).
        • The emitter node's customData reaches its particle function as i.custom, set live by the game (no rebuild): a burst's start time.

        • Live scene time is now the game's clock.

          • LiveCore::advance_time, with the dt the frame script gets, replaces wall-clock time since start. A burst fired at f.time starts then.
          • Lockstep runs now repeat exactly: before, sign flicker and rain phases differed per run, ±2 % on region means.
        • Scenes with light-sampled particles cap the diffuse history at 24 frames. Fading sparks darken the floor too gradually for anti-lag: the floor glow was 0.0033 (display) 30 frames after the last spark, 0 with the cap.

        • SparkBurst and Debris in the standard library (docs/MATERIAL_FUNCTIONS.md).

        • Against UE: bun ue5/burst.ts captures UE 5.8's SimpleExplosion template, unchanged, in a scratch project ("a sprite core, velocity aligned sparks, and oriented meshes"). node tools/bench-burst.ts renders tools/burst-scene.ts, the same floor, camera and exposure, with SparkBurst set like the template's sparks, and compares the sequences frame by frame:

          ours UE
          burst pixels, peak 13.7 k at frame 19 16.5 k at frame 21
          below 5 % of peak frame 87 frame 90
          separate sparks, frame 20 83 108
          top (px above the base), frame 45 478 477
          RMS spread, frames 20 / 60 175 / 257 px 186 / 264 px
          • Mid-flight (frames 30–45) ours shows fewer burst pixels (3.6 k vs 13.5 k): our streaks fade with age and cool to red, UE's stay grey.
          • Crops: docs/img/burst-ours-ue.jpg (frames 15, 30, 60; ours | UE).
          • Light on the floor: ours up to +0.0027 (display), UE 0. UE's burst templates (DirectionalBurst, RadialBurst, SimpleExplosion, UpwardMeshBurst) have no light renderer, so their sparks light nothing; ours are emitters (UE: a Niagara Light Renderer). Known parity gap.
          • No trails: the floor is back at the background (0.0000) from frame 90.
        • The kernel's particle-emitter code sits behind a feature bit (F_PEMIT, scenes with opaque particles).

          • Compiled in, it cost Kabukichō's trace 0.12 ms (8.20 vs 8.08 ms).

          • Behind the bit, the compiled-in but unused cost (main vs this, alternating) is:

            main this
            Kabukichō still, ms 15.20 / 15.23 15.22 / 15.22
            Kabukichō moving, ms 15.02 / 15.00 15.01 / 15.02
            district p50, ms 17.34 / 17.31 17.33 / 17.35
            district p95, ms 17.79 / 17.75 17.77 / 17.77
        • GPU during bursts: Kabukichō with its rain and a SparkBurst firing every 1.5 s ahead of the start pose (sparks always in the air, the worst case) is 15.86 ms still and 16.68–16.70 ms moving at the 0.5 floor.

          • The sparks add 0.24 ms of rebuilds: opaque particles rebuild the scene's dynamic BLASes and TLAS every frame.
          • They add 0.3–0.4 ms of trace.
          • Spark streaks are plain quads: an alpha-tested outline (an any-hit test on every ray crossing one) cost another 0.05 ms and was dropped.
        • Layer A:

          • particles/emissive-spark and -nominal: 1.579 / 1.576 against the analytic 1.586;
          • particles/emissive-unsampled: 2.399 against 2.418;
          • particles/node-custom: live.
    3. Volumes: local fog, smoke, the explosion's fireball.
      • How agents use it:
        • new FogVolume({ shape: "box" | "sphere", density, falloff, albedo }), UE 5.8's Local Fog Volume.
        • new VolumeMesh(boundsGeometry, volumeFunction): a VolumeFunction is a WGSL body under a small fixed contract. At a point and time it returns extinction, albedo and emission.
        • Presets SmokeColumn and Fireball (procedural noise density, emission from temperature); a particle system can place them.
      • Mechanism:
        • The kernel's fog path becomes bounded media: rays find the volume's bounds as flagged triangles, ratio tracking for shadow transmittance, delta tracking for scattering (Novák et al. 2018), emission accumulated along the path.
        • A generic contract like material functions, not an effect field. A feature bit compiles it out where no scene uses it; the PR reports its cost compiled in but off (Kabukichō and the district).
      • UE reference: UE 5.8 Local Fog Volumes with Volumetric Fog (Lumen) and Heterogeneous Volumes (path tracer). A scratch-project test scene: a fog box lit by a point light, and a smoke column.
      • Metrics:
        • Stills vs the UE Path Tracer: ΔE / SSIM;
        • in motion: bench-temporal-style convergence in the smoke while the camera moves;
        • GPU with a volume in Kabukichō's street at the 0.5 floor;
        • layer A: volume/box-transmittance (Beer–Lambert through a homogeneous box, analytic) and volume/box-single-scatter (a point light's in-scattering vs the analytic integral).
      • Status (2026-11-07), part 1: the media integrator and the contract.
        • VolumeFunction / VolumeMesh (box or sphere under the node's transform, majorant, HG anisotropy) and FogVolume (UE's Local Fog Volume) in the standard library (docs/MATERIAL_FUNCTIONS.md, "Volume functions").
        • The kernel holds a media table (binding 18), with the volume functions spliced in like material functions.
          • Paths: delta tracking per segment, with emission at every tentative collision.
          • Real collisions: phase-function NEE (directional, local, emitter, environment lights, MIS against phase sampling), then a Henyey-Greenstein sample.
          • Shadow rays: blocked with probability 1 − transmittance (ratio tracking); only occluded() changes.
          • All behind F_MEDIA: the 15 catalog scenes render byte-identical offline (software traversal).
          • Compiled in but unused (main vs this, alternating):
            • Kabukichō: 15.20 / 15.22 vs 15.22 ms still, 15.06 / 14.99 vs 14.98 / 15.00 ms moving;
            • district p50 17.34 / 17.32 vs 17.31 / 17.33 ms, p95 17.77 / 17.75 vs 17.73 / 17.75 ms.
        • Layer A against the analytic values:
          • volume/box-transmittance: 0.7362 vs 2e⁻¹ = 0.7358;
          • volume/box-emission: 1.264 vs 2 (1 − e⁻¹) = 1.264;
          • volume/box-single-scatter: 6.349 vs the single-scattering integral 6.349.
      • Status, part 2: the live estimator and the presets.
        • Live media are marched (docs/MATERIAL_FUNCTIONS.md, "Volume functions"); delta tracking stays offline.
          • Camera segments: 8 steps of transmittance, emission and in-scattering from the volume voxels (jittered lookups), into the signal of what the camera sees directly.
          • Later segments: 4 steps of transmittance.
          • The voxels are trained by media_train, 4096 points a frame, a pass of its own. Inlined in the kernel, point_radiance copied surface shading and all of Kabukichō's material functions into it: the first frame took about a minute.
          • With delta tracking out of the live kernel, Kabukichō with a volume reaches its first frame in 2.0 s (1.9 s without).
        • Live layer A, the same analytic values:
          • volume/box-transmittance-live: 0.7354 vs 0.7358;
          • volume/box-emission-live: 1.265 vs 1.264;
          • volume/box-single-scatter-live: 6.25 vs 6.35, −2 %, voxel quantization;
          • volume/follow-node and volume/node-custom (live pose and customData edits): 0.7355.
          • volume/box-sun-scatter-live (new, a 1000-lux sun): 13.4 vs 13.72, −2 %; offline 13.72.
          • volume/box-transmittance-lit-live (new, a lit wall behind the absorber): 0.7361 vs 0.7358.
        • Two bugs these tests found, fixed:
          • Live, the camera hit's direct light (a signal of its own) did not carry the transmittance to the camera, so lit surfaces behind media were not attenuated (2.00 for 0.7358). Height fog went through the same split: fog/transmittance-lit-live (new) reads 2.0 on main for 0.7358, now 0.7354. Cost: Kabukichō (height fog) +0.05 ms still (15.26 / 15.32 vs 15.22 / 15.24 ms; without this fix 15.21 / 15.21).
          • Volume-voxel training clamped direct light with the firefly clamp, cutting bright suns and lamps (21 % low in volume/box-sun-scatter-live); now only the sphere ray is clamped. Translucent particles share it.
        • SmokeColumn and Fireball in the standard library; tools/volume-scene.ts shows them with FogVolume. Its smoke column in front of the wall, lit by the moon alone, reads +5.7 % live over offline: two thirds from the isotropic phase (the smoke's is HG 0.2), a third from the 8-step march's transmittance; a lamp inside fog is a soft disc live (voxel detail), a peak offline.
        • GPU, a 2 × 5 × 2 m SmokeColumn in Kabukichō's street at the 0.5 floor:
          • rain off: 15.89–15.90 ms moving (14.86–15.01 without the smoke);
          • with Kabukichō's rain as well: 16.06 ms still, 17.01–17.02 ms moving, over 16.7.
          • The smoke costs about 1.0 ms (trace), from the march and from shadow rays through the smoke.
          • Tried: 12 → 8 camera steps and transmittance-only later segments (kept, −0.4 ms); three noise octaves instead of four (kept, −0.03 ms); no media in the surface cache's training shadows (−0.08 ms with a bias: dropped).
        • Next (part 3): UE references and the motion metric; cheaper media shadow rays to fit rain + smoke.
      • Status, part 3a: UE references.
        • [Removed 2026-11-24: this passage described an earlier implementation that has been replaced; docs/PROVENANCE.md.]
        • UE references, bun ue5/volumes.ts: tools/volume-scene.ts in a scratch project, path-tracer and Lumen stills as linear EXR.
          • Every preset is a Heterogeneous Volume: a Volume-domain material whose Custom nodes are our volume functions in HLSL. The path tracer renders no Local Fog Volumes, and a Local Fog Volume through Lumen's volumetric fog hung UE 5.8 on this Mac twice (the whole GPU, until a reboot).
          • Measured UE conventions:
            • a Heterogeneous Volume's extinction and emission are per local cm, before the actor's scale;
            • its phase function in the path tracer is isotropic;
            • point and spot lights shadow through volumes only with Cast Volumetric Shadow, which is off by default. Without it, a lamp inside a sphere of medium read 11.3 against the analytic 4.23 for single scattering; with it, 4.07.
        • Against the UE Path Tracer (256 spp), at 1280 × 720 through the same display transform (docs/img/volumes-ours-ue-pt.jpg). Ours is offline at 1024 spp, with isotropic phase like UE's.
          • Mean ΔE 1.89, luminance ratio 0.995. SSIM is 0.77, but neither image is denoised.
          • Regions, ours / UE: wall 1.01, floor 0.99, smoke 1.01, fireball 0.99, and the fog 0.94 outside the lamp's own sphere (UE's path tracer shows it).
          • The fog's −6 % has a counterpart in a lamp inside a sphere of medium (σ 2 / m, albedo 1, 64 bounces): 23.8 ours, 24.9 UE.
        • Next: Lumen and motion comparisons; the rain + smoke budget (part 3b).
      • Status, part 3b: rain + smoke fits the budget.
        • Live media are a pass of their own after the trace (media_composite):
          • the camera-to-first-hit march, as before, applied to the pixel's signals;
          • live, reflection, GI and shadow rays do not see media; offline paths still track them;
          • the media voxel training keeps media in its shadow rays, so smoke still shadows itself.
        • The megakernel holds no media code any more. Kabukichō + rain with a smoke column, trace pass:
          • 8.16 ms (rain alone), 8.58 with the column 50 m underground, 9.01 with it in view.
          • So 0.42 ms was inlined code no ray used, and the column's shadow-ray tracking cost 0.35 ms more.
          • Tried and not kept:
            • 2 fixed steps instead of ratio tracking on shadow rays: −0.1 ms;
            • 1 step on later segments, or 4 on camera segments: −0.05 ms each;
            • media shadows from directional lights only (one inlined copy): 16.70 ms moving, right at the budget.
        • Perf suite, local-main → this:
          • rain + smoke 15.99 / 16.96 → 15.53 / 16.48 ms still / moving (≤ 16.7);
          • every other line within the noise floor;
          • offline renders byte-identical, the volume scene's too.
        • Live multiple scattering: the media voxel training's sphere ray crosses the media (attenuation and in-scattering from the voxels), so the voxels converge to every scattering order.
          • volume/lamp-inside{,-live} (new): a lamp inside a sphere of albedo-0.9 medium reads 6.607 offline and 7.61 live (+15 %). Single scattering alone had read 1.44 live, 22 % of it.
          • volume/furnace{,-live} (new, energy conservation): 0.999 offline, 0.963 live.
          • The volume scene's fog: live / offline 0.58 → 0.81, the lamp's surroundings 0.61 (voxel detail).
          • Against the UE stills (1280 × 720, same display transform; live with isotropic phase like UE's), live before → after: mean ΔE to the Path Tracer 2.54 → 2.20 and to Lumen 1.54 → 2.02.
          • The fog: 0.52 → 0.73 of the Path Tracer's. It is now 1.59 of Lumen's, whose fog lacks multiple scattering too (0.37 of the Path Tracer's 0.81 there). UE's Lumen against its own Path Tracer: mean ΔE 3.16.
          • Cost: within noise (rain + smoke 15.56 / 16.52 ms vs 15.54 / 16.57).
        • Motion, node tools/bench-temporal.ts --shot volumes --region fog|smoke|fire:
          • the volume scene at frozen time, the camera strafing 3 m in 1 s;

          • live frames against the same build's converged ones, mean ΔE / p95:

            region moving stopped + 0.5 s
            smoke 0.51–0.81 / ≤ 2.84 0.50
            fog 1.21–1.40 / ≤ 4.52 1.15
            fireball 0.89–1.75 / ≤ 5.92 0.60
          • No trails: the media are the pixels' emission signal and follow the surface behind them.

        • Known gap: live, media cast no shadows on surfaces and do not show in reflections (homogeneous media, water, do since item 4 part 1). docs/img/volumes-live-composite.jpg: offline | live before | live after. A shadow-friendly structure (transmittance toward the main lights, cached per voxel) is left for later.
    4. Water: the waterfront.
      • How agents use it: new WaterMaterial({ absorption, scattering, ior: 1.33, waves }). A water body is a Mesh with it, plus a homogeneous VolumeMesh below the surface for the water itself.
      • Mechanism:
        • The surface uses the existing glass path (transmission, IOR) with animated normals from summed waves and scrolling normal maps in the material function.
        • The body is a medium from item 3, so light is absorbed and scattered along the refracted rays.
        • No geometric waves: material functions have no world position offset, and normal waves are what UE's Single Layer Water uses at street scale.
      • UE reference: UE 5.8 Single Layer Water (Water plugin) in a scratch-project canal at night: a pier, lights, a sign reflected in the water.
      • Metrics:
        • Stills vs UE Lumen and the Path Tracer: ΔE / SSIM;
        • reflections in motion with bench-temporal;
        • GPU with the canal in view;
        • layer A: water/fresnel (reflectance 0.020 at normal incidence for IOR 1.33) and water/absorption (transmittance through 1 m of water vs Beer–Lambert).
      • Status, part 1 (2026-11-08): the water itself, offline and live (local branch water-part1).
        • Landed: WaterBody (a WaterMaterial surface over a HomogeneousVolume box), WaterMaterial (glass of IOR 1.33, four summed wave normals), HomogeneousVolume (a VolumeMesh of constant coefficients that live reflection, refraction, GI and shadow rays see, behind feature bit F_HMEDIA). tools/water-scene.ts: the night canal (pier, two lamps, a neon sign on a wall), the scene the UE reference will rebuild.
        • Layer A, offline / live: water/fresnel 0.0202 / 0.0200 (0.0201), water/absorption 1.192 / 1.190 (1.189), water/furnace 0.997 offline (1), water/scatter 0.1336 offline, 0.1279 live (−4.2 %). test:render 86 / 86.
        • Found and fixed along the way:
          • Live smooth glass lost its reflections. The reflection resolve dropped them and rebuilt them from neighbours that had almost all refracted: a glass sheet in a uniform sky read 0.762 at grazing incidence (offline 1.0). Transmissive camera hits now keep their reflections in the specular signal.
          • Offline, light under glass was counted twice. Shadow rays passed glass unattenuated, and the paths that refracted found the same sky at full weight. A white furnace through water read 1.53, then 1.25 with the MIS fixed (paths through glass that does not bend keep their vertex's MIS weights; behind glass that bends, the sky is theirs alone). With shadow rays now attenuated by each glass surface's transmission share, it reads 0.997. TransmissionTest against the UE Path Tracer: offline ΔE 5.69 → 5.66, PSNR 23.44 → 23.59 dB; live @256f 5.68 → 5.67. Offline it takes 3.9 → 6.1 s: one more trace per shadow ray in scenes with glass. The 14 other catalog scenes are byte-identical; mannequin-plaza moves −0.01 %.
          • Live, the volume voxels never learned water. They were trained only where camera rays cross media before their first hit, which for water is its top layer, and their sphere rays stopped at the surface. Single scattering read 2.5× offline, then 0.79× with points down to the first opaque surface. With the sphere rays passing or reflecting at the surface and two lookups per crossing, it reads −4.2 %.
          • The radiance cache's training paths skipped homogeneous media (now attenuated and lit on every segment).
        • Canal, live against offline (frozen time, mean luminance by region): walls, walkways, pier, far water, under the pier and the sign's and wall's reflections within ±4 %. GPU at the 0.5 floor 13.1–14.1 ms, the same as the canal without water. Kabukichō perf smoke +0.02 / +0.04 ms still / moving; rain + smoke equal. docs/img/water-canal.jpg: offline | live, time frozen | live, waves moving.
        • Known gaps, for part 2:
          • The lamps' glints read 11 % of offline live: each lighting sample is clamped at 64× white, so a small light's mirror image is white but carries little energy for bloom.
          • Dark water near the camera reads +20 % live. Half of it is the missing Fresnel on live shadow rays through glass (+11 % with it; one more trace per shadow ray in glass scenes).
          • Live multiple scattering converges an order per training generation. Light trapped by total internal reflection needs many: albedo-1 water in a uniform sky reads 0.70 after 480 frames, 0.81 after 1920. Real water's albedo (0.1–0.3) converges within a few.
          • Extinction is achromatic (one coefficient, the colour from the albedo). Water's red absorption needs spectral tracking.
        • Next, part 2: the UE 5.8 Single Layer Water reference of the canal (Lumen and the Path Tracer, small careful runs), stills ΔE / SSIM against it, and reflections in motion with bench-temporal.
      • Status, part 2a (2026-11-08): reflections in motion (local branch water-part2).
        • bench-temporal --shot water: the canal with the camera still and the waves moving. At T = 6, 7 and 8 s, frames are compared with a reference converged 1024 frames at T. The live runner's new time command plus lockstep makes the scene time exact.
        • Before: long history smeared the reflections into streaks. Moving waves read ΔE 6.9 on the water and 20.6 on the reflections, SSIM 0.48 there; 240 frames held at T read 0.7 / 1.2.
        • Material functions now say where their shading moves with time (o.animated; the wave function sets it while its waves move), and the live view keeps 4 frames of history there, as for animated emission. Moving reads 3.7 / 9.6 (SSIM 0.83 / 0.64): −47 % / −54 %. Its cost is noise: held still, 1.9–2.1 / 3.8–4.1. docs/img/water-waves-motion.jpg.
        • Not a detection of i.time in the code. Kabukichō's wet ground reads it for rain ripples, and a short history there would change the whole street. Catalog 16 / 16 byte-identical; Kabukichō perf smoke +0.00 / −0.03 ms.
        • Left for later: the excess over UE needs UE's water in motion (part 2b, with the stills).
    5. Foliage wind.
      • How agents use it: windSway(model, { strength, frequency, stiffness }) from the standard library, on placed plant models.
      • Mechanism:
        • First, rigid sway: each plant (or branch node) is a movable node rotated about its pivot by a deterministic wind function. The existing path, cheap for street-scale counts.
        • Per-vertex bending (UE's WPO wind) only if that falls short. It would be a VertexFunction contract deforming the dynamic span before the BLAS rebuild, the posed models' path.
      • UE reference: UE 5.8 foliage with SimpleGrassWind / Pivot Painter and a Wind Directional Source, in a scratch project with the same plant models.
      • Metrics:
        • Sway amplitude and frequency vs UE (tracked points in MRQ frames);
        • ghosting on the foliage with bench-ghosting-style trails;
        • GPU with plants at the 0.5 floor;
        • layer A: wind/pivot-sway (a rigid plant's displacement at time t matches the wind function).
      • Status, part 1 (2026-11-08): rigid sway (local branch foliage-wind).
        • Landed:
          • windSway(plant, { strength, frequency, stiffness, direction, phase }) sets a node's sway. The renderer leans it about its origin with scene time: every live frame, and for an offline still at its time.
          • The lean is A (0.6 + 0.4 sin(w t + p) + 0.2 sin(2.7 w t + 2 p)), A = strength / (1 + stiffness), w = 2 pi frequency sqrt(1 + stiffness). The phase p comes from the world position unless given.
          • The live runner's serve jobs take time as the last frame's scene time.
          • tools/foliage-scene.ts: a shop front in afternoon sun with potted plants (the pot fixed, the plant leaning about the soil) and ferns, Poly Haven CC0 models.
        • Layer A: wind/pivot-sway and -live read 10 of 10, the marker where windAngle puts it.
        • Cost: ~52 k swaying triangles, re-transformed in place on the CPU, take 2.4 ms of CPU a frame. GPU at the 0.5 floor is within noise (10.4–10.7 ms swaying, 9.9–11.7 held); the scene stays at 60 fps.
        • Motion (bench-temporal --shot foliage): moving vs converged at the same time, ΔE 1.68–1.71 (plants) and 1.60–1.67 (ferns), against 1.41–1.43 / 1.19–1.20 with time held. Motion vectors carry the history.
        • Found on the way: the hardware traversal's candidate loop lost hits near cutout foliage (black ground pixels). Fixed separately (cutout-trace, Known issues); it was also why hardware renders did not repeat.
        • Next: the UE reference (SimpleGrassWind / Pivot Painter in a scratch project), sway amplitude and frequency against it. Branch-level sway for trees, if rigid plants fall short.

6. Voxel engine (2026-11-09)

The rule (what goes into ThreeRT, what stays in the engine), the benchmark level, the research and the design are in docs/VOXEL.md. One PR per step. [ThreeRT] steps take their tier's gate (R1 for a new contract: catalog scenes byte-identical, perf smoke on Bistro with the contract compiled in but off). [engine] steps are measured on the benchmark level. The order follows the dependencies; a step that meets a further gap in ThreeRT inserts it here.

  1. [ThreeRT] Procedural geometry. AABB geometry plus a game-supplied intersection body (WGSL, like material functions) that returns t, a normal and a material, in both traversals (hardware: AABB BLASes and rayQueryGenerateIntersection; software BVH: AABB leaves). A hit kind of its own, and a surface() path that yields the same Surface. Instances move by transform, with motion vectors from the previous transform.
    • Acceptance:
      • Layer A: analytic spheres and boxes against their triangle versions.
      • The unbiased check passes on a procedural scene (hardware against software).
      • Existing scenes byte-identical; Bistro perf smoke within baseline + 0.3 ms with the feature compiled in.
    • Status (2026-11-09, branch proc-geometry): in, measured on the M5 Pro; the perf line is open (below).
      • The contract (docs/MATERIAL_FUNCTIONS.md, "Geometry functions"): GeometryFunction (WGSL gf_<name>(GIn) -> GOut: t, object-space normal, material index), ProceduralGeometry (object-space boxes and the game's u32 data), ProceduralMesh (its materials). Behind F_PROC; THREERT_FEATURES_ON forces bits in.
      • Hardware: one AABB BLAS per mesh, a TLAS instance after the model instances. On Metal the AABB candidates come up under RAY_FLAG_FORCE_OPAQUE (a probe: 479 k of 1 M rays had one pending after the first proceed), so every query runs a candidate loop under F_PROC. One AABB-only loop repeats run to run (0 of 1 M rays differ in three runs); mixing cutout-triangle candidates into it does not (697–1,164 differ), the cutouts' own known issue.
      • Software traversal: each mesh's bounds, then its boxes in order, not AABB leaves in the BVH (the reference path; a voxel level needs a BVH over its bricks there, step 2).
      • Hit unchanged: tri = PROC_BIT | material << 23 | box, (u, v) the octahedral object-space normal, inst the record; surface_proc does not run the function again. No new binding (Metal allows 29 with the translucency pass, all taken): records in instances, boxes / materials / data after the environment CDF (Params::procs).
      • Moves rewrite the record and TLAS transform (motion vectors from the previous rows); raster primary visibility is off with procedural meshes; a click picks the boxes. Procedural surfaces: opaque, untextured, not light-sampled.
      • The geometry function is game code in a kernel compiled without bounds checks: its gdata / gdataf read only its own object's data (i.data, i.count; 0 outside). The same kernel splices material and volume functions, which can index any binding directly; that hole predates this step and stays open here (the PR's Open list).
      • Acceptance:
        • Layer A procedural/*, 11 tests, both traversals: sphere and box against SphereGeometry / BoxGeometry (halves 1.000), furnace 0.5005 (0.5), materials 2.5, customData 2.499, shadows, no-cast, with glass, a live move, data reads clamped (data-bounds: fails without the clamp), data bits kept (data-bits: 0xFFFFFFFF, 0x7FC00001, 0x7F800001, 0xFF800000, 0x80000000, 0x00000001 through the f32 binding). test:render 103 / 103 (main 92 / 92).
        • unbiased-check --scenes procedural (hardware 4096 spp against software 16384): mean 1.0001, worst region 1.001.
        • Catalog offline, software traversal: 20 / 20 byte-identical with main 132ca2c. A guard inside glass_at, compiled out, still changed Metal's code for the glass path (0.08 % of khronos-transmission's values): it sits in a wrapper (glass_hit). Hardware traversal: 14 / 20 byte-identical, the 6 others (cutouts) differ from main no more than main from itself (Bistro 0.05 % / 0.05 %, Zero Day 0.58 % / 0.80 %).
        • Bistro perf smoke with F_PROC forced in: not settled. Other applications kept the shared GPU at 20–56 % for hours (two runs: +0.36 / +0.25 ms forced, +0.23 / +1.42 ms not forced, whose code paths are main's). In the quietest window (2026-11-09 ~09:00 UTC, main 132ca2c re-measured, three configurations alternated, GPU lock held, quiet checked before and after each; 3 of 9 measurements discarded at 18–21 % busy) every measurement still fell on one of two levels, ~7.7 or ~9.6 ms still / moving, main's too: desktop compositing during the runs. On the low level: not forced = main (still 7.67 vs 7.69 / 7.73, moving 7.60 vs 7.52); forced +0.2 to +0.6 (still 7.95, moving 7.74 / 8.13), at the line. Drive GPU p50 on the low level 8.61 / 8.34 / 8.60 (main / not forced / forced).
          • The A/B the user settled on (one round, no quiet rule, GPU lock held; 2026-11-09 ~09:40 UTC): main 132ca2c against the branch with F_PROC forced in. Still 8.03 → 7.95 (−0.08), moving 7.38 → 7.78 (+0.40), drive GPU p50 11.54 → 9.90, p95 12.15 → 42.03, frame interval p50 / p95 16.65 / 16.92 → 16.65 / 16.89. Other processes' GPU time over the runs: mean 9.9 % / 11.4 %, peaks 76 % / 79 %. Read as over the +0.3 ms line (moving, drive p95) at first; withdrawn after the A/A below.
          • A/A, main 132ca2c against itself (the same binary, the same measurement, alternated, ~10:00 UTC): still 9.38 / 7.71 / 7.82 / 10.86, moving 11.04 / 7.70 / 8.35 / 10.71, drive GPU p50 8.12 / 11.49 / 8.09 / 9.60, p95 8.12 / 12.36 / 12.05 / 12.22; other processes' GPU time mean 14.7 / 13.9 / 14.3 / 14.8 %, peaks 75 / 78 / 69 / 76 %. One program spreads ~3 ms (still 3.2, moving 3.3, drive p50 3.4): on this machine, as it is used now, the measurement cannot resolve the 0.3 ms line.
          • Settled (the user's decision, 2026-11-09): R1. Existing scenes pay nothing: F_PROC is compiled out where no procedural geometry is (Bistro's code paths are main's) and the catalog is 20 / 20 byte-identical. The cost with F_PROC compiled in (+0.40 ms in the one A/B, inside the noise) is measured in step 2.
          • Step 2d (2026-11-09, 10:30–10:48 UTC; no dev servers running, screen not locked): one binary, main a6c2b8e (it has step 1), A = main, A' = main again, C = main with THREERT_FEATURES_ON=262144, alternated over 5 rounds, GPU lock held, nothing discarded. Medians, still / moving / drive GPU p50 / p95 ms: A 8.48 / 7.55 / 11.16 / 11.83, A' 7.76 / 8.49 / 10.25 / 12.85, C 9.92 / 9.99 / 8.72 / 11.34. The A/A difference, the noise: 0.72 / 0.94 / 0.91 / 1.02, above the 0.3 ms line; C against A and A' goes up on still and moving (+1.8, +2.0) and down on the drive (−2.0, −1.0), noise again. Other processes' GPU time 13.5–19.3 % on average per measurement, peaks 70–88 % (the desktop). Not resolvable here: medians of 5 still carry ~1 ms.
  2. [engine] Voxel objects and the benchmark level, static.
    • Sparse 8³ bricks, palettes and .vox import.
    • The benchmark level (docs/VOXEL.md).
    • Measure first, too: step 1's cost with F_PROC compiled in (Bistro, THREERT_FEATURES_ON=262144 against main), with the screen locked or off, main and branch alternated over several rounds, judged by the medians against the +0.3 ms line; an A/A of main beside it gives the noise (step 1's status: ~3 ms with the desktop in use).
      • 2d, run (step 1's status): 5 alternated rounds with an A/A, the desktop in use; the A/A medians differ by 0.7–1.0 ms, so the 0.3 ms line cannot be judged from them. What could: the screen off (the desktop's GPU time gone), or many more rounds (the medians' spread falls only as the square root of the rounds: ~50 for 0.3 ms at this noise), or a measurement of the trace pass alone that the desktop does not reach.
    • 2a-1 (branch proc-data-assets, 2026-11-09): procedural data from asset files, and kept on the GPU through rebuilds.
      • The check this step asked first, measured (tools/proc-data-scene.ts, 256 MB of data, bench-hitches with a sky change every 3 s): every change was a 88–91 ms frame (73 ms of CPU); the same scene without data 28 ms.
      • Now each distinct geometry is stored once (SHA-256 of its boxes and data), and a rebuild with the same geometries copies their data GPU to GPU from the last upload's buffer; only the CDF and the headers are sent: 33 ms (17 ms of CPU). Every upload still owns its buffer (the scene being replaced, or another room's on a render node, may still read the last one), so the CDF stays first and the env-sampling code is untouched; a different CDF length only moves where the copy lands. A first build with no matching geometries writes the data once into the new buffer's mapping (no intermediate copy).
      • ProceduralGeometry.fromAsset(fn, uri): the boxes and data from a file the scene build reads (format and checks in docs/MATERIAL_FUNCTIONS.md, "Procedural geometry files"; written by tools/lib/proc-asset.ts), so the level's data never passes through QuickJS. Malformed files are refused (unit tests: magic, version, byte order, length both ways, counts against a short file, reserved bytes, hash, boxes).
    • 2a-2 (branch proc-geometry-2, 2026-11-09): the contract's improvements from step 1's review.
      • One AABB BLAS per distinct geometry, a TLAS instance per mesh, the BLASes kept across rebuilds by hash (a sky change builds none of them again).
      • GOut.attr (vec2; in the hit's v as two half floats rounded to 15 bits, exact integers up to 1024; the normal in u as two 15-bit components): the material function's i.uv. Both inside ordinary floats (exponent bits 01xxxxxx): the first packing put raw snorm bits in u, and the +Y normal, 0x7FFF0000, is a NaN pattern WGSL does not promise to keep through a bitcast (Bugbot; procedural/normal-up).
      • Software traversal: a BVH over each geometry's boxes (bvh::build_boxes, the triangle BVH's SAH; the triangle path unchanged), built only when a software render needs it, and its nodes and leaf order in the blob.
      • Materials: one per material object already (a palette shared by every mesh is sent once; binding test).
      • Layer A: procedural/attr-uv, normal-up, shared-geometry, many-boxes (2048 boxes, both traversals 0.9991 for 1; a software BVH that tests one box per leaf reads 0.27).
    • 2b (branch voxel-package, 2026-11-09): packages/voxel, the engine's voxel objects on the contract (TS and WGSL, no Rust; docs/VOXEL.md, "Voxel data").
      • VoxelGrid: sparse 8³ bricks, a byte per voxel (0 empty, 1..255 a palette entry); its layout: a dense brick grid, per brick 16 words of occupancy and a material word (uniform bricks: the material; else 128 words of bytes).
      • VOXEL_BRICKS: a DDA over the bricks inside the box the ray entered, then over the voxels of each non-empty brick; one body for boxes per brick, per 32³ region or per object (step 2's experiment switches Granularity).
      • .vox: parseVox (SIZE / XYZI / RGBA, every length checked), voxGrid (z up to y up), encodeVox, paletteMaterials; tools/voxel-build.ts writes a file's models as procedural geometry assets.
      • Found on the way: the voxel DDA's summed step times drift from the brick's exit time, so a step could leave the brick unnoticed and read another voxel's bit: phantom bricks outside a cuboid (voxel/cube-mesh 0.9938, granularity pairs 0.995). It now stops on the cells themselves; a JS port of the body against a cuboid's slab test, 10⁵ rays per granularity from outside: 0 missed, 0 extra, 0 wrong t (and 0 phantoms in 2 × 10⁵ rays from anywhere).
      • Also found (Bugbot): a ray with a zero direction component missed every voxel (the hit test's entry and exit used the reciprocal's 1e20 stand-in on that axis): ~91 % of axis-aligned rays in the port; voxel/shadow-axis (a point-like sun straight overhead) read 0.50 for 0. Such an axis now never bounds the hit test.
      • Layer A voxel/*, both traversals: cube against BoxGeometry 1.000, shadow rays exactly along +y 0 (0), object and region boxes against brick boxes 0.9997, per-voxel materials in one brick 2.5, a single-voxel checker 0.9995 (1), a .vox file through the scene runtime 2.5. unbiased-check --scenes voxel (tools/voxel-scene.ts): mean 1.0000, worst region 1.002.
    • 2c-1 (branch voxel-level, 2026-11-09): the benchmark level, generated (docs/VOXEL.md, "The benchmark level").
      • 4172 objects (1600 terrain tiles, 172 buildings in 688 parts, 1884 props over 14 shared geometries), 514.8 M voxels in 1.32 M bricks: 440.6 k exposed, 888.7 k full; 270 MB; generated in ~4 s per box granularity; loaded in ~0.7 s (offline render's load).
      • Box granularity is one switch for every object (generate.ts --granularity, level[-brick|-object].game.ts): 1.32 M / 46.9 k / 4172 boxes. The three render alike (overview at 32 spp: mean 0.99999 / 1.00000 of region's, 99.8–99.9 % of pixels identical).
      • Not yet: software traversal walks every procedural object per ray (4172 here), too slow for a reference render of the level; a top-level BVH over the objects comes before one.
    • 2c-2 (branch bench-voxel, 2026-11-09): tools/bench-voxel.ts, the level's measurements (docs/VOXEL.md, "Measured: the box granularities").
      • Per variant: GPU memory (procedural BLASes at Metal's own sizes, proc_blas_mb; procedural data, proc_data_mb), distinct geometries / instances, load and first frame; live at the 0.5 floor along the 60 s camera path, trace pass and frame GPU p50 / p95 and frame start p95.
      • The trace pass per frame from the frame timer's timestamps (frame log trace): no THREERT_PROFILE stalls, so every variant is timed alike and frame start is the real one.
      • Variants alternate over rounds with an A/A of the first; other processes' GPU time is recorded per run, nothing is discarded (--merge puts runs together).
      • A control: every prop its own geometry (--distinct-props; 4100 distinct geometries instead of 2230), as BLAS sharing flatters the props.
      • Found on the way: 72 of the level's 2302 geometry files are byte-identical, and the GPU holds each once; the generator now reports distinct geometries and their data.
      • Measured, 4 rounds (medians; trace p50, frame start p95): region boxes 30.1 / 42.1 ms (A/A 30.2 / 43.3), brick 29.0 / 47.4, object 20.1 / 28.5, all props distinct 33.6 / 45.1. None is within 16.7 ms yet.
      • Step 1's F_PROC compiled in, on Bistro night's trace pass (20 s of its path, 5 rounds with an A/A): 4.40 → 4.62 ms (+0.22 ms, every round 4.61–4.67 against 4.37–4.42; the A/A 0.01 ms). Only scenes with procedural geometry compile it in.
    • 2c-3 (branch voxel-greedy, 2026-11-09): greedy-meshed triangles (docs/VOXEL.md, "Measured: greedy-meshed triangles").
      • greedyMesh in packages/voxel: exposed faces merged per plane and material; generate.ts --granularity mesh writes a GLB per geometry (23 s; 1.90 M triangles, 13.25 M as placed); level-mesh.game.ts places them as models. The renderer reports the triangle BLASes (tri_blas_mb, Metal's sizes and the vertex buffer) and their data (tri_data_mb).
      • Measured, all five representations in one run (4 rounds, A/A of region; trace p50, frame start p95): region 29.2 / 41.6 ms (A/A 29.4 / 41.6), brick 24.9 / 33.6, object 17.3 / 23.9, distinct props 31.5 / 42.5, mesh 2.19 / 16.67: the only one within the frame budget. Its cost: 258 MB of BLAS against 3.6, and re-meshing on edits.
      • Follow-up (branch voxel-dedupe, 2026-11-09): 2c-3 found 72 geometry files with the same contents (building parts alike, the narrow tiles at the far edge), separate meshes since models are shared by file. The plan now names them alike (buildingGeometry, tileGeometry) and the generator writes each once, checking every instance gives the same file: 2230 files; the mesh 1.89 M distinct triangles (−11 k), BLASes 256.4 MB (−1.5); images unchanged.
    • The intersection experiment: AABB per object, per 32³ region, per 8³ brick; greedy-meshed triangles (2c-1 to 2c-3). The compute DDA is deferred (2026-11-10): triangles trace 8× faster than the best box split for a static level, but only with ray-tracing hardware (native builds). Players play in the browser, and WebGPU has no ray queries: whether the browser traverses triangles or walks a voxel DDA in compute waits for the user's decision on a browser feasibility experiment. What decides the native representation now is what an edit costs.
    • 2c-4, the cost of destruction (the user's decision, 2026-11-09; replaces the compute DDA probe): the level under explosions, triangles against object boxes. Two PRs (the user's rule: one PR per step or feature, split only for a ThreeRT contract with its own gate):
      • The level's targets (docs/VOXEL.md, "The benchmark level"; the user's, 2026-11-10): ΔE ≤ 3 and SSIM ≥ 0.9 against our offline render, overall and by region, ghosting within bench-ghosting's limits, emissive voxels lighting their surroundings, no seam leaks, per-voxel colour; memory ≤ 2 GB per level (BLASes, triangle and procedural data together), which the benchmark level is accepted against (today: 516 MB as meshes, 267 MB as region boxes; nearing it brings compressed attributes, BLAS compaction and LOD forward).
      • A [ThreeRT, R1; part of step 5 brought forward], with this plan and the look's targets in docs/VOXEL.md: replacing, adding or removing one object's geometry at run time without rebuilding the GPU scene (until now every geometry change was structural: the whole scene was rebuilt).
        • Status (branch geometry-edits, 2026-11-10): done.
          • The world records geometry edits apart from structural changes: geometries replaced, objects added (or re-created with other geometry or materials) and removed, for objects with their own BLAS: procedural meshes, and meshes with the new dynamicGeometry (instanced like a model placement, shared by objects of the same geometry and material). Everything else stays structural.
          • The upload reserves room past each buffer's own data (triangles, kernel records, object entries, procedural words, TLAS instances; a quarter of the scene's, THREERT_EDIT_RESERVE scales it) for scenes with editable geometry under hardware RT only: other scenes' buffers are unchanged. An edit writes the touched objects' data into it as the build would (the build and the edit share the per-object code), builds BLASes for new geometry only (procedural ones kept by hash), sets the TLAS instances and rebuilds the TLAS: one submit. What an edit replaces stays until the next rebuild.
          • It falls back to the rebuild, and the frame log says why (fallback, fallbacks): software traversal, the room full, a kernel feature the scene lacks (its first procedural or instanced object, first cutout), an emitting / glass / function material, a new material, an object the build flattened, a move of an object added in place. Frame log edit / rebuild (CPU ms); with THREERT_PROFILE_BLAS=1, blas times the edit's builds on the GPU.
          • Checked: layer A geometry/edit-live (a box removed, a mesh's geometry swapped, a box and a mesh added, all in place; analytic 0.5) renders byte-identical in place, with every edit rebuilt (THREERT_EDIT_REBUILD=1) and with no room (falls back).
          • On the level (bench-voxel --edits: one object replaced every half second, camera still; 3 rounds, medians): a procedural tile (region boxes) 0.55–0.57 ms of CPU in place, its frame as any other (27.2–27.4 ms), its BLAS and the TLAS 0.9–1.25 ms on the GPU, against 702–716 ms rebuilt; an 8192-triangle dynamicGeometry mesh on the mesh level (13.25 M triangles) 0.7–1.5 ms, its frame 17.2–17.8 ms (60 fps), 1.7–1.9 ms on the GPU, against 483–530 ms rebuilt. No fallbacks.
      • B [engine and the experiment], one PR: what was planned as B, C and D.
        • Status (branch voxel-destruction, 2026-11-10): done. The choice: triangles only, pieces batched (docs/VOXEL.md, "Measured: destruction").
          • renderer/voxel-core (builds for wasm32, CI checks it): bricks, layout decode / encode, carve, binary greedy meshing (the same rectangles as greedyMesh), split. renderer/src/voxel.rs: voxelLevel / voxelExplode / voxelFrame. Loaded as triangles, the level has the TS generator's 13,251,212 triangles. Meshing a terrain tile 0.57 ms median, a building part 0.37–0.44 ms.
          • Batched pieces: an explosion's pieces one mesh per material, rebuilt every frame (a geometry of the same triangle count is rewritten in place, its BLAS rebuilt: a ThreeRT generic contract, three.js's dynamic draw usage), merged back into their objects 1.5 s after.
          • One explosion, frame p50, batched / each piece an object / boxes: 0.5 m 28 / 24 / 17 ms, 1 m 26 / 32 / 17, 2 m 29 / 38 / 18, 4 m 38 (max 43.5) / 59 / 24. Sustained and peak, frame start p95: batched 16.67 / 16.67 ms (every run), each piece an object 16.67 / 16.67, boxes 20.1 / 18.9 (their trace alone 14–15 ms). Stress (one a frame): the batched route falls back from the 176th explosion (the triangle room).
          • The lines (≤ 50 ms for the 4 m explosion's frame, sustained and peak frame start p95 ≤ 16.7 ms): the batched route meets both. A piece as its own object costs ~23 µs of edit CPU and ~13 µs of GPU builds a mesh; batching pays that once per material.
          • Considered and dropped: the hybrid (pieces and what was just broken as boxes until settled): two representations to maintain, the browser's web/ cannot draw WGSL boxes, and it leaves the cost per piece.
          • Fixed on the way: World::set_geometry scanned every object for a new id too (44 ms of a 4 m explosion); an edit that fell back left an unbuilt procedural BLAS cached (the rebuild failed wgpu validation); the frame log's edit / rebuild / fallback were reset by a frame's second commit.
        • Native voxel objects in renderer/src/voxel/ (bricks from the .tpg files) with carve (a sphere; the changed bricks), binary greedy meshing (64-bit column masks) and a first split (carved voxels grouped by 4³ into pieces). Scene code sends commands; QuickJS never touches voxels.
          • Acceptance: the same faces as greedyMesh (the TS tests' grids); meshing time, median and maximum, of a 64³ terrain tile and of a building part (published binary meshers: 50–200 µs per 62³ chunk).
        • The experiment (level-destruction.game.ts, tools/bench-destruction.ts), at the 0.5 floor, with the GPU lock, ≥ 4 alternated rounds and an A/A.
          • Scenes: one explosion of radius 0.5 / 1 / 2 / 4 m (thousands to tens of thousands of voxels, across several tiles and building parts); sustained, 5–10 explosions a second for 10 s; a peak, 20 explosions within a second (a chain). Each explosion leaves tens to hundreds of new pieces, each its own geometry, at rest (bodies are steps 7 and 8); pieces under 8 voxels become no object. One explosion every frame is kept as a stress limit, to find where it breaks.
          • Triangles: the touched objects meshed again and their BLASes rebuilt; pieces meshed, a BLAS each. Object boxes: only the changed bricks uploaded (an object's BLAS rebuilt when its box changes); pieces as procedural geometry.
          • Figures: the explosion frame's time and frame start p95 while it goes on; split into the edit, meshing, upload, BLAS / TLAS rebuild and CPU wait; per touched object its meshing and BLAS time; per piece its cost; the scene's object count over time; the fallbacks to a full rebuild.
        • The results and the choice.
          • Lines: the explosion frame ≤ 50 ms; sustained, frame start p95 ≤ 16.7 ms; memory within the level's 2 GB.
          • Triangles meet both at 4 m: the engine renders triangles throughout.
          • Triangles miss and object boxes meet them: a hybrid. The static world as triangles; objects just broken or still changing, and pieces, as boxes; meshed on a background thread once they stay unchanged and swapped in (the swap measured too).
          • Neither: the split names the bottleneck and the next step; the largest radius that meets the lines is recorded as what the engine affords today.
    • Acceptance:
      • The experiment's table: GPU ms of the trace and of the frame at the 0.5 floor along the level's camera path, p50 / p95.
      • The choice is recorded here with its numbers, and frame start p95 on the level is measured. 2e. [ThreeRT] InstancedMesh. Many copies of one geometry as one object (the user's decision, 2026-11-09; started once step 2c is done).
    • Why:
      • ThreeRT's DSL follows three.js, where InstancedMesh is the standard way to draw many repeated objects (vegetation, crowds, debris, props, particles): agents write it, and the DSL lacks it.
      • N separate objects cost far more in QuickJS than one object and N matrices: memory, setup time, and the per-frame change tracking.
      • It meets the rule: every kind of game needs it, and it is a generic contract, not a voxel one.
    • Scope:
      • As in three.js: new InstancedMesh(geometry, material, count), setMatrixAt / getMatrixAt, setColorAt, instanceMatrix.needsUpdate, count lowered at run time.
      • Triangle geometry and ProceduralGeometry alike.
      • Picking returns the instanceId.
      • Optional customData per instance.
      • The renderer: one shared BLAS, N TLAS instances; moving instances changes only the instance table, no rebuild.
      • Not BatchedMesh.
      • Step 5 (incremental structure) is the general case, any object added or removed; this item is the instanced object's API and its updates.
      • What three.js's usual instancing code needs besides (dummy.position.set(...); dummy.updateMatrix(); mesh.setMatrixAt(i, dummy.matrix)), missing from the DSL today (only updateMatrixWorld and Matrix4.compose exist): Object3D.matrix, updateMatrix(), matrixAutoUpdate; Matrix4.makeTranslation, makeRotationX / Y / Z, makeScale, invert, setPosition.
    • Acceptance:
      • The typical code of three.js's official instancing examples runs unchanged, tools/three's comparison renders included.
      • 10 k instances against 10 k separate meshes: setup time, and CPU and frame time with every instance moving each frame.
      • A scene: small debris (pieces under the voxel engine's threshold, step 2c-4) as instances of a unit cube.
      • The catalog's renders byte-identical; R1.
    • Status (branch instanced-mesh, 2026-11-10): done.
      • DSL: InstancedMesh(geometry, material(s), count) (triangle geometry or ProceduralGeometry), InstancedBufferAttribute, setMatrixAt / getMatrixAt, setColorAt / getColorAt, setCustomDataAt / getCustomDataAt (four numbers for i.custom), instanceMatrix.needsUpdate, count (up to the constructor's), DynamicDrawUsage; Object3D.matrix / updateMatrix() / matrixAutoUpdate; Matrix4 makeTranslation, makeRotationX / Y / Z, makeScale, invert, setPosition, set, equals, fromArray / toArray; Color copy, equals, getHex, fromArray; Quaternion.random. The binding sends one object and the instance table (Engine.instances: count, matrices, colours, data, each only when new or flagged).

      • Renderer: the build places one shared mesh (one BLAS) and every instance of the capacity as a TLAS instance with its own object entry (pivot, bounds, data, colour). Past count, or at a scale of 0 (three.js code hides instances so), an instance is a point with TLAS mask 0. A change rewrites the drawn range's records, object entries and TLAS transforms (one write per buffer) and rebuilds the TLAS: no rebuild of the scene. Scenes with instance colours get a 4th vec4 in each object entry and a kernel patched to multiply the base colour by it (F_TINT, gpu.rs tinted_source); every other scene keeps the object layout and the kernel source as they were. Picking returns instanceId (the click event's field). Flattened instead, and rebuilt on change: glass / emissive / function materials, mirrored instances, software traversal.

      • Checked: layer A geometry/instanced (colours), geometry/instanced-procedural (procedural boxes with per-instance data), geometry/instanced-live (moved, hidden by count and by scale 0, recoloured: in place, byte-identical to every change rebuilt); three.js's official instancing code in packages/scene's tests and in games/instancing/instancing.game.ts (catalog "instancing": 1,000 instances turning every frame, a click recolours one; 60 fps, CPU 3.6 ms), which tools/three also renders on three.js; the catalog byte-identical.

      • 10 k instances against 10 k meshes (tools/bench-instancing.ts, 4 rounds, medians; 0.2 m cubes, every one moving each frame the usual three.js way):

        setup (game) first frame moving: frame start p50 / p95 CPU QuickJS renderer
        InstancedMesh 10 ms 106 ms 16.7 / 16.7 ms 11.8 ms 9.9 ms 1.0 ms (instance table)
        10 k meshes (movable) 145 ms 262 ms 52.0 / 53.6 ms 52.0 ms 42.7 ms (syncing 10 k transforms) 7.3 ms (triangles)

        GPU and trace the same (4.7 / 1.3 ms). The instanced frame's QuickJS time is the game's own loop (dummy.position.set, updateMatrix, setMatrixAt 10 k times: 6.3 ms, 19.8 ms before the DSL's fast paths: one change report per set, updateMatrix without accessors, setMatrixAt by Float32Array.set, the change trackers in an array).

      • Found and fixed on the way: generated names searched from 1 for every unnamed object (10 k meshes: 8.06 s of setup, now 145 ms); World::note_move scanned every object for each move (now only where it decides).

      • Debris (games/voxel-level/level-destruction-debris.game.ts): voxel-core's split hands the voxels too few to make a piece to scene code (voxelDebris); the game throws them as instances of a unit cube coloured from the palette, which fall, bounce and go after 4 s. Against the batched route alone (bench-destruction --routes batch,debris, 2 rounds with an A/A each, medians): one explosion of 0.5–4 m throws 30–617 (929 in flight at most), its frame p50 29.6 ms against 30.3 (max 44.6 / 39.9); 7 a second for 10 s throw 3,506 (up to 1,677 in flight), explosion frames 20.1 / 19.6 ms, frame start p95 16.67 ms in every run; no frame over 50 ms, no fallback. The instance update 0.05–0.11 ms of CPU a frame (the batches' edit builds the TLAS for both), 1.9–5.1 ms when it builds the TLAS itself (the level's ~20 k instances).

2f. [ThreeRT] three.js compatibility. The DSL shares three.js's class names and constructors, not yet its everyday API (the user's decision, 2026-11-09; after 2e).

  • Missing today (packages/scene, 2026-11-09):
    • BufferGeometry: setAttribute, BufferAttribute, Float32BufferAttribute, getAttribute, setIndex, addGroup; translate, rotateX, center, computeBoundingBox, dispose.
    • Object3D: clone, attach, removeFromParent, getObjectById, rotateX / Y / Z, rotateOnAxis, translateX / Y / Z, localToWorld, worldToLocal, getWorldQuaternion.
    • raycast and Raycaster.
    • Mesh with an array of materials (with geometry groups).
  • Method: a compatibility test set of typical three.js snippets (official examples, the code LLMs usually write), with the share that runs unchanged recorded. The gaps are filled in order of how often they occur, and the share is recorded again after each.
  • Two semantics the user set:
    • Shadows stay on by default: the physically correct behaviour of a path tracer, documented as a deliberate difference from three.js. An explicit castShadow = false is still honoured. renderer.shadowMap.enabled / .type and the like are accepted and do nothing (no error).
    • Materials stay PBR only, mapped in the DSL, each mapping noted once on first use:
      • MeshLambertMaterial: standard, roughness 1, metalness 0.
      • MeshPhongMaterial: standard, roughness ≈ √(2 / (shininess + 2)).
      • MeshBasicMaterial: a surface showing its own colour only and lighting nothing else, which needs a generic kernel switch "emissive, not light-sampled" (R1).
      • MeshToonMaterial, MeshNormalMaterial, MeshDepthMaterial: standard, with a warning.
    • Order: Lambert and Phong first (TS only), then Basic.
  • Geometry that changes at run time (2c-4's PR A): three.js's attribute.setUsage(DynamicDrawUsage) maps to dynamicGeometry (its own BLAS ahead of the change). And without it, a mesh whose geometry changes at run time is promoted automatically, as a first move promotes to movable: its own BLAS from then on, that first change rebuilding once (frame log fallback "promote").
  • Acceptance: the test set's pass rate, recorded at the start and after each gap filled; the catalog's renders byte-identical.
  • Status (branch three-compat, 2026-11-10): done.
    • The set: tests/three-compat, 34 snippets (official examples' core code and LLM-typical code: geometry, Object3D, materials, lights, raycasting, the renderer's set-up, instancing), run by tools/three-compat.ts. A snippet passes when it runs unchanged (bound, synced, its frame stepped), its own check of the three.js behaviour it relies on holds, the DSL noted nothing unsupported, and the renderer draws it (not black, not flat, colourful where colour is the point). packages/scene's tests run every snippet too (without the render).
    • Pass rate: 1 / 34 at the start (27 snippets stopped at AmbientLight, the most frequent gap; then HemisphereLight 5, MeshPhongMaterial 4, MeshLambertMaterial, DoubleSide, Vector2, Raycaster 3 each), 31 / 34 after the DSL's gaps (run only), 32 / 34 at the end with the renders. Still open: Shape / ExtrudeGeometry (polygon triangulation) and vertex colours (the renderer has none yet).
    • Filled: BufferAttribute / Float32BufferAttribute and the geometry's attributes (setAttribute, getAttribute, setIndex / getIndex, addGroup, setUsage), translate / rotateX / scale / center, computeBoundingBox / Sphere, toNonIndexed, clone, dispose; CircleGeometry, RingGeometry, LatheGeometry, CapsuleGeometry, the polyhedra; box groups. Object3D: clone / copy, attach, removeFromParent, getObjectById (three.js's number id until scene code sets a stable one), rotating and translating on axes, localToWorld / worldToLocal, getWorldQuaternion / Scale / Direction, the is* flags. Raycaster (scene code's own geometry, as three.js: meshes, groups, instances with instanceId, procedural boxes; it runs wherever the game runs, the browser too). Mesh material arrays (geometry groups, in the renderer). Vector2, Box3, Sphere, Ray, Color.setHSL. AmbientLight / HemisphereLight (the environment of a scene without one: radiance colour x intensity / pi; not seen), scene.background, Fog / FogExp2 (uniform exponential fog), the lights' shadow settings and WebGLRenderer (accepted, ignored), the materials as the user set them, flatShading, DynamicDrawUsage and the automatic promotion.
    • Kernel: two switches compiled only into scenes that use them, the kernel source patched at checked anchors (gpu.rs kernel_source, as 2e's instance colours): MeshBasicMaterial (unlit: its colour to camera rays and mirror-like paths, albedo 0, in no emitter list) and the background (camera rays and paths bent straight through glass that miss see it, Params::background). renderer/shaders is as on main: every other scene's kernel is main's. Layer A: material/unlit, material/unlit-lights-nothing, environment/background, environment/background-lights-nothing, geometry/groups.
    • Chosen here (the user's semantics aside): in a scene lit by ambient lights the camera takes three.js's fixed exposure (EV 0) unless scene code set one, and the background defaults to black (three.js's clear colour); background and fog colours are shown at the level of the scene's light (its ambient and directional lights' irradiance / pi); light decay is always 2 (physical), noted as a mapping. 2g. [ThreeRT] Vertex colours. three.js's color attribute and material.vertexColors (planned after step 4; the supervisor's, 2026-11-10), and the voxel meshes' palette as vertex colours where that saves meshes.
  • Status (branch vertex-colors, 2026-11-10): done.
    • DSL: the geometry's color attribute (RGB; RGBA's alpha dropped; normalized integers to 0..1) goes to the engine with the geometry, vertexColors with the material; neither is noted unsupported any more. The compatibility set: 33 / 34 (geometry-official-buffergeometry now passes, its render coloured; Shape / ExtrudeGeometry still open).
    • Renderer: the build keeps three sRGB 8-bit colours per triangle of a mesh whose material has vertexColors (scene::tri_colors; the palette's colours exactly), prepare lays them out as the GPU's triangles. The kernel switch F_VCOLOR (gpu.rs kernel_source, as 2e's instance colours) interpolates them in linear at the hit and multiplies the base colour of surfaces and glass. They ride after the previous vertices in prev_verts (from vec4 Params::procs.w): the layout has no binding to spare (the translucency pass is at Metal's 29). Scenes without them: prev_verts, Params, the object table and the kernel source as on main. In-place edits write an added mesh's colours into the edit room (white where it has none); a scene's first coloured mesh rebuilds (a kernel feature it lacks).
    • Layer A: material/vertex-colors (0 .. 1 across a quad: 0.5 at its centre, 0.5012), material/vertex-colors- instanced (x an instance colour of 0.5: 0.2506), geometry/vertex-colors-live (added in place: 0.4992, byte-identical to every edit rebuilt and to no room).
    • Voxels: voxel_core::merge_by_class and voxelLevel({ colors: "vertex" }): one mesh per class of palette entries alike in all but their colour, each vertex its voxel's colour. On the benchmark level it saves little (docs/VOXEL.md, "Measured: vertex colours"): the same 13.25 M triangles and the same image, 9,916 meshes placed instead of 10,459, 27 MB of colours, the trace within the A/A's noise. The level keeps one mesh per entry; vertex colours are there for palettes of many colours in one material (.vox models) and the browser.
  1. [ThreeRT] Dynamic emission. Any geometry, procedural included, can start or stop emitting without a rebuild, with light-tree entries for non-triangle emitters.
    • Acceptance: toggling emitters in Bistro costs no rebuild; ΔE against our offline render unchanged where nothing toggles.
    • Status (branch dynamic-emission, 2026-11-10): done for triangles; procedural geometry's emission is not done (procedural surfaces are not light-sampled at all yet: that needs non-triangle light-tree entries, later).
      • Emitting own_blas meshes (scene code's dynamicGeometry) are emitter meshes: their own BLAS, triangles in world space at an identity placement (never shared), so light sampling reads them as flattened triangles. The build gives them emitter entries (in the light tree with the static emitters); the live view's in-place edits add, replace and remove them: a placed mesh's entries go to area 0 (their weight; the tree keeps its shape and is refit), new ones are appended to the CDF's power-share part (path code 0, as the tree's moving emitters). (Since 2026-11-17 such a mesh is a mesh as any other, in model space and shared, and each instance's emitters are a run of the light list: § 1, "Emitters on instances".)
      • A material that starts emitting gets emitter entries in place from its flattened static triangles (prepare keeps each material's runs of them); one that also covers pool (instanced) or dynamic triangles still rebuilds.
      • The emitter buffer grows (and the scene's bind group is made again) only when entries are added past it: a scene that adds none keeps its layout. Intensity and power edits were in place already.
      • No kernel change: renderer/shaders as on main.
      • Bistro with a scene-code sign switched on (tools/bench-emission.ts, 2 rounds): its frame 18.6–19.1 ms, CPU 2.9–3.3 ms, in place, against 615–618 ms when it rebuilt (THREERT_EDIT_REBUILD=1: 601 ms rebuild).
      • Layer A: geometry/emitter-added-live, material/emitter-started-live (0.49 against the analytic 0.5, in place and rebuilt alike), geometry/emitter-removed-live.
  2. [engine] Lighting on voxels. Voxel surfaces through the live pipeline, emissive voxels as emitters.
    • Acceptance: ΔE ≤ 3 and SSIM ≥ 0.9 against our offline render on the level, overall and by region (the level's targets, step 2c-4), plus a layer B entry and ghosting within the bench-ghosting limits.
    • When to give emitters added in place a light-tree subtree of their own (the supervisor's rule, 2026-11-10; the crowd's moving emitters, sampled by power share alone, looked clearly worse): the same lamp measured in the static tree and after an edit moved it to the CDF's power-share part, at the same spp, against the offline reference over the region it lights. If after the edit ΔE is higher by more than 0.5, or the per-pixel variance by more than 50 %, step 4's PR adds the dynamic subtree (rebuilt with each edit, as the moving one is refit).
    • Status (branch voxel-lighting, 2026-11-10): the lighting is in; two of the acceptance's items are open, the quality by region and ghosting's trail length (below; docs/VOXEL.md, "Measured: lighting on voxels"; tools/bench-voxel-light.ts).
      • Open, the user's decision (2026-11-10): the voxel line goes on; these two are left to later work on the shared live pipeline (its temporal and denoising passes are § 0's, not changed here). Not met: the worst 3 × 3 region ΔE 2.87–5.0 and SSIM 0.79–0.89 (target ≤ 3 / ≥ 0.9; the floor and dynamic resolution, three shots and the exploded world), and ghosting's trail 51 / 34, 94 / 53 and 80 / 26 px (turn-mid, strafe-mid, strafe-return +0.5 s against the bench's limits). Why: the live pipeline smooths away voxel-scale detail, through its half-resolution floor, its temporal and denoising passes, and radiance-cache voxels coarser than the level's 10 cm ones.
      • threert-render render (and serve) load the native voxel level the scene asks for (voxelLevel): the offline reference. The palette takes emission (emissive, nits): the lamps' voxels, as own-BLAS meshes, are emitter meshes (step 3), 2304 triangles of 192 lamps in the light tree. games/voxel-level/level-night.game.ts: the level at night, lit by them (and a faint sky glow).
      • Explosions in setup are queued until the level loads and done then, with their pieces' flight (voxelFrame in setup): the live view and the offline render start from the same exploded world. Batched pieces fly (flight: thrown out, gravity, a damped bounce on the terrain below them), so glowing ones light what they pass; an emitter mesh rewritten in place takes back its entries (the CDF does not grow frame by frame).
      • The rule above, measured (4 live shots of 64 frames each, over the ground and the first 3 m around the lamp's foot): the lamp moved to the power-share part by an edit read ΔE +0.92 and variance × 1.46 of the static tree's, over the line. So the dynamic subtree is in: in scenes the live view can edit (EditRoom::editable), the light tree's root holds the static subtree and one for emitters added in place (ltree::build_slotted), grown again at every such edit (set_dynamic; their entries right after the static ones in the CDF, their codes in their triangles' attrs); no kernel change. With it the edited lamp reads ΔE −0.08 and variance × 0.93. Offline renders, and live scenes that cannot edit geometry, build the tree as before (THREERT_LT_DYNAMIC=0: by power share, the A/B). Layer A geometry/emitter-added-tree-live (320 static emitter triangles, a panel added in place: 0.492 against 0.5, 0.4914 rebuilt).
      • Lamps: the ground around the lamp ahead of the camera reads 12.45 nits lit, 0.006 with the lamps off; blown up, its pieces 0.3 s into their flight light it at 12.81.
      • Destruction (the lamp blown up live, 4 runs): the explosion's frame 20.3–25.0 ms, frame start p95 16.67 ms in every run, no frame over 50 ms, no fallback or rebuild; its pieces' flight 2.7–3.0 ms of in-place edit CPU a frame.
      • Quality, live 64 frames after a reset against our offline render at 16384 spp (4096 still differs from 16384 by ΔE 0.83 / SSIM 0.966), three shots and the exploded world: overall ΔE 2.34–2.68 / SSIM 0.887–0.907 at the 0.5 floor, 1.92–2.26 / 0.906–0.928 at the dynamic resolution the game runs at; the worst region ΔE 3.8–5.0 / SSIM 0.79–0.84 at the floor, 2.9–4.4 / 0.81–0.89 at dynamic resolution. Overall met at dynamic resolution; by region not. Where the error is: the trees' canopies (voxels with holes, per-voxel shading) and the edges of voxel steps, which the live view blurs (half resolution at the floor, the temporal and denoising passes, the radiance cache's voxels coarser than 10 cm ones), and live reads 4–5 % darker than offline (the firefly clamp is not it: without it 1 % brighter and noisier, ΔE 2.10 -> 2.63). Open (above).
      • Ghosting (bench-ghosting --scene voxel-night --quick, against the bench's limits): the excess over the settled frame is within them everywhere (turn 0.74 / 4.25, strafe 2.24 / 6.0), but the trail length is over at three shots (turn-mid 51 / 34 px, strafe-mid 94 / 53, strafe-return +0.5 s 80 / 26): the wall beside a lamp and the canopies are still off by ΔE > 10 half a second after the camera stops. Open (above).
      • Layer B: voxel-night (shot 0, its limits from this branch: 2.52 / 0.893 -> ≤ 2.62 / ≥ 0.888), a regression guard; the level's target stays the bench's.
  3. [ThreeRT] Incremental structure. Instancing of any object with a TLAS that grows; adding, removing or replacing an object's geometry without the full rebuild (today ~0.7 s on Kabukichō).
    • Acceptance: bench-hitches with objects spawned and removed every frame has no frame over 50 ms; Bistro unchanged.
    • Brought forward in 2c-4's PR A: objects with their own BLAS (procedural meshes, dynamicGeometry meshes) are replaced, added and removed in place, within room reserved at upload.
    • Status (branch incremental-structure, 2026-11-10): the rest, but flattened meshes, new materials and textures, and moving objects added in place.
      • Objects added in place are drawn: their new BLASes and the TLAS in one build (it was missing in most runs; Known issues). Clicks pick what is drawn: an object removed or hidden in place no longer, one added in place too.
      • Past the room: when no hole fits, the room's buffers (triangles' vertices, attributes and BLAS vertices, vertex colours; kernel records with the TLAS; object entries; procedural words) are reallocated at twice the room (the scene's own data before it as it is), copied on the GPU and submitted at once, the scene bind group made again; not with particles (their pass binds those buffers: a rebuild).
      • What edits leave behind: reused at once, not moved. Triangle ranges, records (a record's TLAS instance is inst_base + it) and object entries are taken from holes first (first fit, neighbours merged), the room's end after; a mesh that no object draws any more is freed (its triangles a hole, its slot and BLAS reused by the next new mesh), a removed object's record and entry go back. No pause: each edit pays for its own allocations.
      • New at run time, in place: an InstancedMesh (its mesh, records, TLAS instances and object entries from the room, contiguous; its instance updates as the build's), a copy of a static glTF model already in the scene (another instance of its mesh). A model new to the scene (materials, textures), animated or movable, or with glass / emissive parts, still rebuilds. Instanced meshes and static models are removed in place too (a model the build placed: a rebuild).
      • Layer A, each byte-identical in place, with every edit rebuilt and with no room (the room grown): geometry/added-live 0.4992, procedural/added-live 0.4992, geometry/grow-live (1,100 objects and 72,200 triangles past the room) 0.4991, geometry/instanced-added-live 0.4989, geometry/instanced-removed-live 0.4991, geometry/model-added-live (ratio to the build's copy) 0.9984; unit test picks_follow_in_place_edits.
      • Endurance (bench-destruction --endurance: the level, batched pieces flying, one 1 m explosion every frame for 60 s of game time, the default room): 3,599 explosions, no fallback (before: from the 151st–176th). The room grew once (at 10 s, triangles 2.36 M -> 2.84 M held), then held: 2.16–2.25 M triangles in use, 159–214 holes, buffers 491.6 MB and live BLASes ~230 MB (at most 722 MB with the rest of the room's buffers; the level's line is 2 GB). Frame start p95 36.0 ms, the worst explosion frame 87.3 ms, 14 frames over 50 ms: the stress is CPU bound, 31 ms a frame (rebuilding every live batch natively 11.7 ms for up to 68 batches, their in-place rewrite 10.3 ms; the trace 1.9 ms), as one explosion a frame keeps ~90 batches flying.
      • bench-hitches with objects spawned and removed every frame (tools/perf/voxel-level-spawn.game.ts: three boxes, an InstancedMesh of 16 and a glTF copy a frame on the level, each removed a second later): 796 frames, interval p50 / p95 / p99 / max 16.4 / 17.9 / 19.0 / 20.3 ms, none over 50 ms, no rebuild.

5a. [ThreeRT] Stateful GPU particles. Particles emitted, updated and retired on the GPU, with collision, including against a voxel occupancy grid; the same compute in the browser's WebGPU. A prerequisite of steps 6 (debris, dust) and 10 (effects). It meets the rule: every kind of game has particles, and the contract (emit, update, collide, retire, with a collision source a game supplies) is not voxel-specific.

  • Status (branch gpu-particles, 2026-11-10): done; collision with triangle scenes is later.
    • GpuParticles and ParticleProgram (docs/MATERIAL_FUNCTIONS.md, "Stateful particles"): the state (position and age, velocity and life, colour, size) in a GPU buffer, a ring of capacity slots; one compute pass a frame (renderer/shaders/gpu_particles.wgsl) emits, updates, collides, retires and places them as camera-facing quads of dynamic triangles, the dynamic BLAS rebuilt after it. The CPU keeps no particle: it sends each frame's birth counts and the game's spawns (node.spawn, 8 numbers a particle).
    • The contract is generic: an emit and an update function as WGSL bodies with $Name parameters, as material functions are; the engine integrates, collides and ages. WGSL compute only, so WebGPU can run it as it is.
    • Collision: a ground plane and the voxel level's occupancy grid (voxelLevel({ occupancy: 0.2 }): one bit a 0.2 m cell, 32.9 MB on the level, built in 0.87 s at load; the cells in an explosion's box and a settle's box set again and their rows uploaded). Restitution along the normal, friction across, the particle put against the surface at its half size.
    • Lit like any surface; emissive materials glow (emitterArea as for sparks); the particle's colour is the material function's i.custom. Opaque or alpha-tested materials only. Particles, SparkBurst and the other stateless effects are unchanged.
    • Demo: games/voxel-level/level-destruction-dust.game.ts, the voxels too few to make a piece turned to dust (4 particles each, their voxel's colour), thrown out from the explosion, landing on the road and the voxels.
    • Layer A: gpu-particles/plane (a particle dropped 2 m bounces and rests on the plane, its quad over it: 5.000 nits against 5; fallen through or resting at its centre it reads 0 or 2.5), gpu-particles/voxels and its live twin gpu-particles/voxels-live (the same on a voxel slab), gpu-particles/voxels-side (thrown into the slab's side: stops against it). All four read 5; with collision off, or before it lands, they read 0.
    • GPU time on the level (tools/bench-gpu-particles.ts, a fountain on the voxels, 2 rounds, ms a frame): 10,000 particles 0.14 (the pass) + 1.15–1.19 (BLAS); 100,000: 0.57–0.60 + 2.70–3.12. Frame start p95 16.67 ms in every configuration, none over 50 ms.
    • Explosions with dust (bench-destruction --routes batch,dust, each with an A/A): singles, sustained (70 explosions, 14,024 dust particles) and peak, frame start p95 16.67 ms and no frame over 50 ms in every run, the explosion frame's p50 within 0.8 ms of the batch route's, the worst settle 25.9 ms (24.7 without dust). One refresh of the occupancy grid per settle (one per piece first gave a 4 m explosion's settle 58 ms).
    • Layer A also: gpu-particles/beside-particles (with a stateless Particles node in the scene). 5b. [ThreeRT] Density-grid volumes. Besides procedural volume functions, a volume that stores a 3D density grid (simulated smoke and fire). A prerequisite of steps 6 and 10. It meets the rule: smoke and fire are in every kind of game, and a stored grid is a generic medium.
  • Status (branch density-volumes, 2026-11-10): done; the smoke does not collide with geometry.
    • DensityGrid (docs/MATERIAL_FUNCTIONS.md, "Density grids"): a grid of four numbers a cell across a box VolumeMesh, from the game (data, changed in place with needsUpdate) or simulated. The volume function reads it with vgrid(i, lp) and makes extinction, albedo and emission of it, so what the numbers mean is the game's.
    • On the GPU: every grid's field in one 3D texture of half floats (stacked along z), the kernel's binding 19 (a texture: the buffers are at Metal's limit). Kernel switch F_GRID (kernel_source: the binding, vgrid, 64 live steps through a medium with a grid instead of 8): scenes without grids keep main's kernel.
    • GridProgram: a WGSL body run per cell, two half steps a frame (renderer/shaders/grid_sim.wgsl, WGSL compute only). It reads both fields as they were anywhere (ga, gb), so advection, diffusion, forces and the game's sources (grid.emit) are the program's code: the contract is a cellular update, with no effect built in.
    • SimulatedSmoke (standard library): advection, a pressure relaxation (one Jacobi step a half step, kept), diffusion, buoyancy, turbulence, wind, cooling. Without the pressure, a puff in still air did not rise: it thinned where it was (the first version).
    • Lighting as every medium's: delta and ratio tracking offline; live, the camera rays' march and the volume voxels' in-scattering.
    • Demo: games/voxel-level/level-destruction-smoke.game.ts (bench-destruction route smoke): every explosion leaves a puff in a grid of 88 x 56 x 144 cells (0.25 m) over the streets, which rises and drifts with the wind.
    • Layer A: volume/grid-uniform (against HomogeneousVolume: ratio 1.002 offline, 1.011 live), volume/grid-transmittance 1.212 of 1.2131 (live 1.211), -dense 0.4457 of 0.4463, volume/grid-data-live 0.7355 of 0.7358, volume/grid-program 0.6075 of 0.6024, volume/grid-advect 2.726 of 2.718, volume/grid-source 0.602 of 0.6024 (a source reaches one half step: added once), volume/grid-smoke (the puff rises: a regression value).
    • GPU time on the level (tools/bench-density-grid.ts: a 12 m box of smoke fed every frame, 2 rounds, ms a frame; THREERT_PROFILE now times the grid pass, gridsim, and the media passes, media, apart from the trace): 64³ the simulation 0.13–0.21 and the rendering 0.79–0.91; 128³ 0.89–0.99 and 0.61–0.87. Frame start p95 16.67 ms in every configuration, none over 50 ms.
    • Explosions with smoke (bench-destruction --routes batch,smoke, each with an A/A): singles, sustained and peak, frame start p95 16.67 ms and no frame over 50 ms in every run; the trace pass (which holds the media passes) 2.6–2.7 ms against 1.8 without smoke, the grid 709,632 cells.
  1. [engine] Edits and destruction. (Rewritten 2026-11-10 for the triangle route chosen in step 2c-4.)
    • Connectivity decides what falls. After an edit, what no chain of voxels sharing a face (six-connected; one voxel is enough; no structural stress) joins to an anchor is cut loose: a new object that falls. Anchors are the terrain and objects marked so. Connections cross objects (a building's parts, a building and the ground). The removed voxels themselves are debris (instances, dust particles), no longer pieces by 4³ cell.
    • Deterministic. Edits, the split and the world-to-grid transforms are integers or fixed point: the same commands give bit-identical voxels on two runs and natively against wasm32, checked in CI by a hash.
    • Edits: explosions by material hardness (soft, medium, hard, indestructible), cuts (box, line), paint (soot) without a change of shape, added voxels.
    • Loose objects fall ballistically and rest where they land, static again; rigid bodies are steps 7 and 8.
    • Remeshing and re-uploading only the changed chunks of a large object: split off (below).
    • Acceptance:
      • What loses its support falls: unit tests, a level test, connections across objects included.
      • The same commands give bit-identical voxels on two runs, and natively against wasm32.
      • On the level, single explosions of 0.5–4 m, the sustained and the peak tier: the explosion's frame (the split included) ≤ 50 ms, frame start p95 ≤ 16.7 ms, no fallback; with an A/A.
      • Within the level's 2 GB; catalog byte-identical; scenes not involved keep main's kernel.
    • Status (branch voxel-connectivity, 2026-11-10): done, but the chunked remesh.
      • voxel-core's Level (renderer/voxel-core/src/level.rs): every object stands in one world lattice of the voxel size (Placement: quarter turns, whole voxels). An edit is a shape in world fixed point (1 / 256 voxel; Shape: sphere, box, capsule), a voxel inside when its centre is.

      • Connectivity (lattice.rs): the destructible static voxels' occupancy in world bricks of 8³ cells, whatever object a cell belongs to. Each brick keeps its components (bit operations on 8 words) with their cells on the six faces and whether they touch an anchor. An edit recomputes the bricks it changed and searches the components from them: a group that reaches no anchored component is loose. On the level: 277,681 bricks, built in 0.62–0.68 s at load, 98 MB of CPU memory (the GPU's is unchanged: 259 MB of triangles, 323 MB of BLASes).

      • Loose parts take their voxels out of every object they span and become one new object, falling under gravity in fixed point, a tick 1 / 60 s (voxelFrame); it rests when a cell under it is static, and is static there. Fewer than 8 voxels: debris. Drawn by its own mesh, written again in place each tick it moves.

      • Edits (packages/voxel): voxelExplode (each material within its hardness's share of the radius: 1, 0.7, 0.4, 0), voxelCarve (box, capsule, sphere), voxelPaint, voxelAdd, voxelHash.

      • Determinism: tools/voxel-determinism.ts (CI): voxel-core's script of edits natively and as a wasm32 module, hash 733db9ab69f495e9 both. tools/voxel-determinism-level.ts: the whole level twice in lockstep (explosions, a saw cut that drops buildings, a 4 m crater): the same three hashes.

      • The level changed for it (version 2, its own asset directory): by six-connectivity the generator's pitched roofs were 59–83 strips each, touching by edges only, and each tree crown held loose single voxels (4,552 floating groups, 247,430 voxels). Roof steps are three voxels deep now and props are one connected piece: no floating group. 515.3 M voxels (514.8 M), 13,231,484 triangles (13,251,212).

      • Layer A: voxel/cut-falls (a cut through the lower of two stacked posts: its upper part and the post on it, two objects, fall as one and close the cut: 5.002 of 5), -top (the top they left: 0), -live (the same live, in place: 5.002), voxel/cut-holds (half the section cut: nothing falls, ratio 1).

      • Frames (bench-destruction --routes batch, with an A/A; others at 12–17 % of the GPU; main's in brackets):

        scenario explosion frame p50 / max, ms frame start p95 over 50 ms fallbacks
        singles 0.5–4 m 22.6 / 22.8, 22.5 / 28.3 (27.0 / 34.5) 16.67 0 0
        sustained (70) 20.7 / 28.9, 20.6 / 31.0 (19.1 / 26.3) 16.67 0 0
        peak (20 in 1 s) 19.1 / 23.0, 20.1 / 22.9 (19.9 / 26.2) 16.67 0 0
        topple: 8 trees' trunks, each crown cut loose 20.9 / 25.9, 19.6 / 25.0 16.67 0 0
        crater: 4 m on open ground, 140,785 voxels 29.5, 31.9 (48.3–53.4) – 0 0

        The crater on main cut its voxels into 2,695 pieces; now they are debris, and nothing there is loose.

      • The limit (fell: a saw cut of 30 x 30 m that frees 20 parts of 199,426 voxels, buildings among them): its frame 88 ms (the cut and split 23 ms, the parts' meshes 9 ms, uploading 397,120 triangles 35 ms), then 26–28 ms a frame while 280,572 triangles fall (written again every tick). No fallback. A falling object should move as an instance, not be rewritten: step 8's bodies.

      • Chunked remesh: split off, not done. Measured first, as asked: for the 4 m crater's 8 terrain tiles, meshing them again 7.4–9.3 ms, the upload 1.0–1.2 ms, their BLASes 4.0–4.9 ms on the GPU; the frame is 29–32 ms. (The "10 ms of re-uploading whole tiles" I reported before was the upload of main's 2,695 pieces.) To cut it there are two ways with different risks: a per-object cache of chunk meshes (helps only an object's second edit; quads no longer merge across chunks) or a BLAS per chunk (changes the trace cost of the whole level). It needs its own measurements and gate.

  2. [ThreeRT] Physics and scene queries. Rigid bodies, contacts, joints; ray, overlap and sweep queries for game code. Native, a shape interface the engine can extend. On Rapier.
    • Acceptance: stacking and joint tests against expected results; zero cost to scenes without bodies; the CPU split in the frame log.
    • Done (branch physics). A contract of ThreeRT for every kind of game; the voxel shape and debris bodies are step 8.
      • The world is the engine's. Rapier 0.36 behind renderer/physics-core (its own crate: no GPU, file system, clock or thread; CI builds it for wasm32-unknown-unknown and runs its 34 tests): dynamic, fixed and kinematic bodies; box, sphere, capsule, convex hull and static triangle-mesh colliders; fixed, hinge, slider, ball and rope joints with limits and motors; contact events; ray (first hit or all), overlap and sweep queries; a shape trait for the engine's own colliders (CustomShape: step 8's voxel shape). It is stepped at a fixed 1 / 60 s, at most 5 ticks a frame, after the frame script; scripts cannot step it and never see Rapier.

      • The bridge (physics-core/src/bridge.rs, also wasm32): scene code's calls (JSON; ids chosen by the caller) and the scene objects that bodies drive, against a Scene trait the renderer's World implements. A body's move goes from the world to the object's transform to its TLAS instance without passing through the script: a mesh a body drives is an instance of its own BLAS (move_instances), one added while the game runs is placed in place and moves the same way (no rebuild), and so does a new material without textures.

      • The script's surface is three.js's (packages/scene). mesh.physics = "dynamic" (or { type, shape, density | mass, friction, restitution, damping, ccd, sensor, contacts }); in the scene the object has its body, out of it none, whether the scene began with it or a script adds it. The collider is the geometry's: a box, a sphere, a capsule, else the convex hull, or the triangles for a fixed body. position / quaternion / rotation read the body's pose when read (one typed array for every body a frame, then each object its own seven numbers, on first access); writing them moves the body (a kinematic one is driven there). applyImpulse, applyForce, setLinearVelocity, ... are methods of the object. HingeJoint, SliderJoint, BallJoint, RopeJoint, FixedJoint are objects that hold while they and their two objects are in the scene. Raycaster.intersectPhysics() and Shapecaster (overlap, sweep) ask the world. Contacts come once a frame as a batch: contactstart / contactend on the objects, contacts on the scene.

      • Expected numbers (physics-core's tests): free fall by Rapier's own law (a tick in 4 substeps: g dt² (n² / 2

        • n / 8) after n ticks, within 1 mm); five 1 m boxes rest as a column within 2 mm a contact; a box on a 20° slope holds at friction 0.6 and slides at g (sin - mu cos) at 0.1; a weight on a hinge passes the bottom at sqrt(2 g L) within 2 % and stays 1 m from it within 5 mm; a hinge stops at its limit (0.5 rad within 0.03); a slider keeps its axis, reaches its motor's 1.5 m/s and stops at its limit; a rope holds at its length (2 m within 2 cm), ball and fixed joints keep their anchors; joints join bodies as they are turned (a bar turned a quarter is not wrenched into line); contact events; queries; kinematic bodies push. The bridge's: a body drives its object (under a parent too), poses by slot, a force lasts its frame's ticks, impulses at a point, what a call refuses, limits. Layer A: physics/box-rest (5 nits where the box rests; also live), physics/stack (the strip above a three-box column: 0), physics/hinge (5 nits at the limit), physics/instance-live (a body's box against a still one: 1.005).
      • What a script can do to it (2026-11-10, after a review of physics-core: game scripts are untrusted and call __engine.physics directly, so the checks are in the world, not the binding; a panic in a tick is a crashed renderer natively and a trap in wasm32).

        • Every number of a body, collider, joint, call and query has a bound (physics_core::limits; the table is in RUNTIME.md), and what is outside is refused with its reason. Rotations and axes of any finite size are directions (1e20 squared overflowed into a zero quaternion).
        • A trimesh is for fixed bodies and static colliders (an open one gave a dynamic body 60 mg with its centre of mass far away); a joint joins two different bodies; a capsule under 1 mm long is its sphere; a hull with no volume is refused.
        • After a tick, a body whose pose or velocity went non-finite (Rapier disables it, and a joint on it would panic a later tick), one whose collider did, and one past 1,000 km are taken out of the world with their colliders and joints. The call faults reports each once with its kind, state answers { removed: why }, and the binding leaves the object in the scene without a body. A body that left the world is an ordinary thing in a game (it fell off the level: 42 minutes of free fall, Rapier capping a body at 400 m/s): its object gets an outofworld event and nothing is thrown. One that went non-finite is an error: the next sync throws once, naming it.
        • A frame script or sync that throws no longer costs the world a frame: GameSession::frame makes the frame's ticks and commit all the same and returns the error after (before, both were skipped and the frame's time was lost), and the node host syncs the scene as the script left it, so the binding knows the world stepped (the next frame reads fresh poses). A serve job with frames still fails with the error, as with any script error.
        • A call that is refused changes nothing: everything is checked before any of it acts.
        • Memory: contacts nobody takes are held to 8,192 (the oldest go, counted); a trimesh to 1 M triangles, the world's shapes to 4 M points and triangles; queries take no trimesh.
        • Also: objects are placed at the body's own pose (not the call's numbers); a frame owing exactly 5 ticks keeps its remainder (12.5 fps made 562 ticks in 10 s); a body asleep when its object is removed goes with it.
        • The review's fuzz (random calls, ordinary and absurd numbers; a small version is in the crate's tests): 611 panics in 120,000 runs at its two mildest levels before, none in 210,000 runs at all five after.
      • Determinism: the same bits natively and in wasm32, in physics-core's own build and in the renderer's, on what is checked: the script (113d50eb06a47636), 1,200 random worlds (tumbling convex hulls, bodies of several colliders, hinges and sliders with limits and motors, a rope; and, added with the world handlers, continuous collision detection on a triangle mesh, a kinematic body, fixed and ball joints, with the answers of rays, sweeps and overlaps folded in; check::case, folded hash 6fd1eba4551b8d39, 9e16a6771fa8f317 for the first 1,000), each compared (tools/physics-determinism.ts, CI), and 32,000 runs of the review's random calls. It takes three things:

        • Rapier's enhanced-determinism (on in physics-core): without it none of the 1,000 worlds agree (the script: dfdc13fb0be5cd0b natively). It costs 1–3 % on the script (0.029 ms a tick) and 3–5 % on a pile of 1,000 boxes (0.35 → 0.36 ms a tick), natively.
        • A patched glamx (renderer/third_party/glamx, PATCH.md). Rapier 0.36, parry 0.31 and glamx 0.3 call sin, cos and acos with method syntax, which on an f32 is the type's own method, the platform's libm, in every crate graph with std in it (any dependency that turns on num-traits/std: the renderer has several), whatever enhanced-determinism or their own std feature say. The eigen decomposition behind the mass properties of convex hulls and of bodies of several colliders is the one that showed: 48 of the 1,000 worlds ended in other bits natively (macOS arm64, whose acos differs from libm's on 8.8 % of inputs, its sin and cos on 0.012 %) than in wasm32. The first version of the check passed because its one hull happens to agree. Rapier is also built without its std (it needs alloc only), which costs nothing measurable natively (ms a tick, best / median of 30 runs, two rounds alternated: the script 0.0285–0.0287 / 0.0290–0.0292 without std against 0.0287–0.0288 / 0.0290–0.0294 with; a pile of 1,000 boxes 0.349–0.355 / 0.353–0.357 against 0.351–0.356 / 0.354–0.358). It is enough for physics-core's own build and not for the renderer's: the check now runs both ways (std-in-graph), and the renderer has a test of its own. [patch.crates-io] is read from the manifest of the crate being built only, so every crate that depends on physics-core repeats it and has that test (PATCH.md): the web build's wasm crate will be the next.
        • Hinge limits centred. Rapier takes the sine and cosine of a quarter of (min + max) the same way; the world hands it limits about 0, [-h, h] (of 0 they are exact), and turns the centre into the joint's frame with libm.
        • The other such calls on a 3D world's path are tested to change nothing on the platform the tests run on: the broad phase's BVH optimizer takes a log2 that depends on the collider count alone (every count checked), a convex hull's feature lookup the sine and cosine of one constant.
        • Platforms measured: macOS arm64 natively (where the hashes were recorded), Linux x86-64 natively (CI: tools/physics-determinism.ts there compares Linux's native build, wasm32 and the hashes recorded on macOS, all three equal), and wasm32 under Node's V8 on both. Not measured: Windows, Linux arm64, a browser's own wasm engine (the same wasm32 module; wasm's float arithmetic is specified, so no difference is expected), and iOS / Android natively.
        • What this does not give: a proof for platforms the tests have not run on, or for another version of Rapier, parry or glamx (the calls were found by reading their sources: an update repeats that, and the recorded hashes show a change). The complete fix is theirs: those calls made through simba. Step 9's replay rests on this for one build of the engine.
      • Hello world (games/physics/hello.game.ts, catalog physics-hello; threert-render play to click in a window, tools/physics-hello.ts for the same game with scripted clicks): a click's ray is cast into the world (Raycaster.intersectPhysics); on something fixed (a triangle-mesh ground and rock, a wall, a ramp) a box with physics = "dynamic" is added off the surface and falls onto what is there; on a box, the box is kicked. The scripted run adds 4 boxes (three end as a column at 0.250, 0.748 and 1.248 m), kicks one at 3 m/s (it slides 0.913 m; v² / 2 mu g = 0.917) and ends with every box asleep. A click's chain: the pick 0.001–0.004 ms, the script (handler, frame script, binding) 0.30–0.54 ms of which the world's calls 0.007–0.053 ms, the commit 0.39–0.57 ms in place, the next frame submitted 3.8–4.1 ms after the click. The first box of a scene without instances rebuilds it once (15–22 ms here: the kernel variant with instances).

      • What the boundary costs a frame (tools/bench-physics.ts; every body moving every tick, the most it can cost; M5 Pro, means of 120 frames, one run):

        bodies step (Rapier) sync to objects commit (records, TLAS) script, reads none script, reads all
        0 0.007 ms 0.0001 0.001 0.085 0.097
        100 0.035 0.011 0.116 0.090 0.141
        1,000 0.258 0.173 0.780 0.166 0.741
        10,000 2.126 1.696 4.518 0.217 5.445

        A script that reads nothing pays nothing for the bodies (the same scene without bodies: 0.079 / 0.090 / 0.339 ms at 100 / 1,000 / 10,000 meshes). Reading a body's position and quaternion costs 0.5 µs, of which 0.28 µs is reading the two properties of any object in QuickJS. Bodies asleep cost nothing natively (a pile of 10,000 at rest: step 0.03 ms, sync 0.0003 ms, commit 0.003 ms).

      • The frame log has physics: { ticks, step, sync, bodies, moved } and commit.

      • Open: the first instance of a scene rebuilds it; a sleeping body does not follow a parent of its object that moves; reading every body's pose every frame at 10,000 bodies is 5 ms of script (the typed array itself is not handed to scripts yet); a body made anew (physics set again, the object re-parented or rescaled) starts at rest; where physics is authoritative, the node or the room, is step 9's.

      • Open, before game code from outside runs here: a tick has no time bound. The limits are on counts (20,000 bodies), not on what a tick costs: N one-metre dynamic boxes made at one point take 62 ms for their first tick at 250, 0.46 s at 500, 2.8 s at 1,000 and 45 s at 2,000 (M5 Pro, one run). It belongs to the security review before the cloud opens.

    • World handlers (2026-11-10, branch world-handlers; the user's decision of that day, with the runtime's shape: three.js-style scripts, Rust as the main runtime, four channels across the boundary, layout C on the web. docs/RUNTIME.md has the decisions, the layouts considered and the probe's measurements).
      • on[type](world, ev) (packages/gameplay/src/world.ts): an event's handler on the node that owns the scene and the physics world. It runs as the event arrives, before the next tick, and what it changes goes to the engine through the scene binding when it returns: no commit, no frame script run for it. Before, a handler could only write the JSON state (it may run in a room, where there is no scene), so a click that adds a body was recorded by a handler and acted on by the frame script.
      • With handlers[type] too: the world handler first, on the state before the event; then the transaction; then what the world handler emitted (world.emit, a state transaction). keys map to either; a game of world handlers needs no handlers. One that throws does not stop the world (its changes are synced, the error is in the event's log). In a room they do not run: an event with a world handler only is an error there.
      • Only local authority. Who owns the physics when a room is the authority is a product question, not decided. What a world handler adds is not in the game state, so a restored state does not have it (step 9).
      • Queries see what the engine was told, with or without a tick since. Rapier's broad phase is the last step's: a collider added since was not found, and a body moved by a call was found where it had been. Two events with no tick between them (a frame rate above the tick rate) are where an author meets it. Colliders added, or moved by a call, since the last step are now tested one by one beside the broad phase's answer (Physics::fresh; nothing of Rapier's state is touched; with none, a query is what it was). What the running script itself changed reaches the engine when it returns, so a handler's own query does not see what it just added: the one rule left, in RUNTIME.md.
      • Events without a frame script. The node host's frame now runs every frame for a game with a frame script, with world handlers, or whose scene has a physics world, so contacts and outofworld reach their listeners every frame (before: only when a handler committed). A scene with none of the three pays nothing.
      • Hello world is rewritten: on.click casts the ray and adds the box; no state, no handler, no frame script. tools/physics-hello.ts is unchanged and passes. A click's script time, two runs each on one build: 0.33–0.62 ms before (0.30–0.54 ms in step 7's table), 0.16–0.37 ms now; the commit and the first frame after a click as before (0.29–0.53 ms in place, 3.9–4.0 ms). The frame's script time with no frame script is 0.083 ms mean (0.094 ms with the old frame script): the host's call, the events and an empty sync.
    • The engine's library for wasm32 (2026-11-11, branch wasm32-engine; the first half of layout C, after a probe of what a browser can run).
      • The probe (measured on an M5 Pro, Chrome 157, the real GPU): the kernel itself, with software traversal and the native renderer's scene data, costs 0.98–1.08 × its native time in Chrome (hello 4.19 ms against 3.9 ms a full-resolution sample pass, Kabukichō 70.3 against 66.8–68.0), and draws the same image. WebGPU's limit on storage buffers a stage (8 by default, 10 in that Chrome) is under what the kernel (20) and the live temporal / post / dtemporal passes (19 / 13 / 11) bind: the web build gets a merged layout generated from the one source. What stands in the way is software traversal itself: one flat BVH, so every added or moving object rebuilds the scene (hello: 9 ms a frame while a body moves; the voxel level: 7 s an explosion), and it holds 2.1 GB of triangle data for the voxel level.
      • This step: the library builds for wasm32-unknown-unknown with the native shell left out, the GPU from futures, web_time, and file reads behind one module (docs/RUNTIME.md "The engine's library in a browser"). Natively the renders are byte-identical.
    • The engine in a browser (2026-11-11, branch web-hello; the second half of layout C: the physics hello world runs in Chrome to the native run's numbers).
      • renderer/web: the wasm module (the engine API's 35 exports, one for one with the native __engine, on the same code, renderer/src/api.rs; the session's), the page (__engine over the exports, the node host called as GameSession calls it, the canvas' clicks) and tools/build-web.ts. The game bundle is the native one.
      • The merged binding layout (renderer/src/merged.rs): the browser's shaders written from the one source with 8 storage buffers a stage (the kernel as written binds 20, the live passes 28), guarded by a test that reads them with naga; THREERT_MERGED=1 runs it natively.
      • A GPU job that did not end took the machine's display down (2026-11-11 01:42, WindowServer's watchdog) while the atomic tests ran under software traversal: at geometry/instanced-procedural in the layout as written, then at environment/background in the merged one. Neither scene has a triangle. The likely cause, by reading: the tree over no triangle was one node with count: 0, an interior node to the kernel, whose children were itself and the bytes after its 32-byte buffer; zeros end the walk, an earlier scene's bytes need not. Fixed in bvh.rs (a leaf of the empty vertex buffer's zero triangle), with a test that walks the kernel's loop on the CPU. Not confirmed as what hung: the same sequence on a build without the fix, with the guard, passed (both scenes alone, with the fix and the guard, give their tests' answers). And a loop guard (merged::guard): every loop of the kernel bounded and what it stops counted and read back; always on in a browser, THREERT_LOOP_GUARD natively (since step 7b a native kernel with units has it with nothing set).
      • tools/web-engine.ts (CI): the module in Node with the page's __engine and the native bundle runs the physics hello world's script to the native test's numbers.
      • In Chrome 157 on the machine's GPU (tools/web-hello.ts, Playwright; docs/RUNTIME.md "Measured in a browser"): the scripted test passes at 1280 × 720 and its report is the native run's number for number. A still frame is 6.6 ms of GPU and 0.3 ms of the page (natively under software traversal 6.9–8.0 ms of GPU). Every frame in which a body moves rebuilds the scene: 16.5 ms in the page (9.0 natively), and a click that adds a box 17–24 ms: what hello world ships with until software traversal edits in place. The view opens in 1.13 s, 1.08 s of it the sky's bake on one thread; a kernel the browser has not compiled takes 1.4 s before the first frame, 26 ms after that. Engine calls cost 40 ns (a scalar) to about a microsecond (a descriptor), 10,000 poses 0.3 ms. The module is 7.3 MiB (1.5 MiB with brotli).
      • Open, first: a frame in which a body moves costs the page 16.7 ms, 16.4–16.6 of it the rebuild (9.0 natively under software traversal, nothing under hardware traversal): in-place edits under software traversal, the two-level tree, the next step (step 7b: 0.84 ms now, no rebuild). Then: the browser's image is not bit-identical to the native one (the guard changes the kernel's last bits; natively it is off and the catalog is byte-identical to main); 1.4 s for a kernel's first compile and 1.09 s of sky bake on the page's thread before the first frame; a scene larger than hello world in a browser, and the merged layout's cost on one natively; what hung on 2026-11-11 is not confirmed; other browsers.

7b. [ThreeRT] In-place edits under software traversal (a two-level tree). Decided by the user on 2026-11-11, before step 8: a browser has no ray queries, and under software traversal every added object and every frame in which a body moves rebuilds the scene (hello world in Chrome: 16.5 ms of the page's 16.7 a frame; the voxel level: 7 s an explosion; its triangle data 2.1 GiB because instances are written out). Design: docs/RUNTIME.md "Software traversal with units".

  • The still scene stays one flat tree; what can move or be added (an instance of a mesh: a body's box, a voxel chunk) is a unit with a tree of its own in model space, found through a top tree walked after the still one. A scene without units gets the kernel it has today, byte for byte.
  • Acceptance: the two walks transcribed to the CPU and run against brute force over random scenes and random add / move / remove sequences (no read outside a range, always an end, the same closest hit), before any GPU run; scenes without units unchanged (the sources handed to wgpu, the catalog's bytes); hello world's two checks that fail under software traversal pass, and in Chrome a frame in which a body moves no longer rebuilds; the voxel level under software traversal: triangle data, load, an explosion, a still frame; overlap measured on a pile of debris.
  • Every GPU run of the new walk has the loop guard, natively too (what hung on 2026-11-11 is not confirmed, so another path that does not end may exist); whether software traversal has it by default natively is decided with its measured cost.
  • Decided 2026-11-11, after the first GPU runs (docs/RUNTIME.md "Software traversal with units"):
    • Units are a live session's and a browser's. An offline render under software traversal flattens every instance by default, its kernel and bytes main's; THREERT_UNITS=1 gives it units, THREERT_UNITS=0 flattens a session. Why: the offline render under software traversal is the reference render and what the catalog's byte gate compares, with no variable set; memory, load and edits in place are what a session and a browser need; no catalog scene with models but Kabukichō has been rendered with units.
    • A native kernel with units has the loop guard with nothing set (65,536; THREERT_LOOP_GUARD=0 takes it out). A native kernel without units has none by default, as before: no existing byte changes. What a stop does is unchanged (an offline render fails, a session logs it, test-render fails the run). Whether all of native software traversal has it by default is not part of this step.
  • Status: runs natively and in Chrome on the machine's GPU (branch sw-two-level, 2026-11-11; every run with the loop guard, which stopped nothing). The figures and their tables: docs/RUNTIME.md "Software traversal with units", "Measured".
    • Done: renderer/src/units.rs (mesh trees, the top tree, where they go in the node buffer, the checks made where a tree is written), shaders/trace_units.wgsl (spliced into software traversal by a source feature, F_UNITS; pathtrace.wgsl not edited), prepare_live keeping a session's instances as units (prepare, an offline render's, flattens unless THREERT_UNITS=1), and the edits in place through gpu::Top (the TLAS or the units), so move_instances, update_instanced and edit_geometry are one path under both traversals. THREERT_UNITS=0 flattens, as before. The guard's default for a kernel with units (gpu::loop_guard_of).
    • The acceptance:
      • The CPU tests pass (the walks transcribed from the shaders and compared with their lines; random scenes under random edits against brute force; a prepared scene with units against the same scene flattened; broken and stale trees refused), before the first GPU run.
      • Scenes without units: the sources handed to wgpu are main's (the_default_sources_are_untouched, hardware traversal's among them); offline with nothing said about units the catalog's 23 bundles are byte-identical to main under software traversal (both builds with the guard at 65,536, as every GPU run here); under hardware traversal 18 are, and the other five (Bistro's three, Zero Day's two) differ from main as two runs of main differ from each other ("Known issues": hardware traversal's ties).
      • Hello world: tools/physics-hello.ts passes under software traversal with nothing else set (units and the guard by default; it stopped nothing), the two checks that failed among them. In Chrome a frame in which a body moves costs the page 0.84 ms (was 16.7) and none rebuilds the scene (295 did); a click that adds a box commits in 0.6–0.8 ms (18–24) after the first.
      • The voxel level under software traversal: triangle data 310.9 MiB (2,098), first frame after 5.2 s (11.6), an explosion 2.5–4.5 ms in place (6.9–7.9 s); a still frame's trace 7.85 ms (4.58): 71 % longer.
      • Kabukichō (352 units): triangle data 55 MiB (634), first frame 1.55 s (3.3); the trace 13.9 ms (12.0): 16 % longer, and with it the view misses 60 Hz on this machine (17.2 ms a frame).
      • The guard on Kabukichō, main's kernel: +1.23 ms of trace (11 %); the merged layout +0.13 ms.
      • The atomic tests under software traversal, as written and merged: 147 of 170 pass; the 23 that fail fail on main's build too, with the same values: 13 particles/*, the 5 gpu-particles/*, translucent/depth, translucent/order, volume/lighting, volume/lighting-offline (all particles, which software traversal does not draw) and surface/windows (not explained). The names: docs/RUNTIME.md; "Known issues".
    • Two faults the GPU runs found, fixed, each with a CPU test since: a scene of units alone drew a mesh's first triangle at the origin (the still tree's leaf named triangle 0); a mesh written again in place kept its units' old boxes (voxel/cut-falls-live: a falling part cut off).
    • Not run, one by one (none was among the GPU runs agreed for this step; each is asked for before it is made):
      • a kernel with units without the loop guard (every run of one had it);
      • a catalog scene with units, offline (THREERT_UNITS=1) or live, but Kabukichō;
      • explosions on the voxel level until the edit room is full (V4): how many fit before a rebuild;
      • a pile of debris (V5): overlap where it is worst;
      • anything but hello world in a browser.
    • Open:
      • First, what the next item is for: a still frame costs more with units (software traversal, live, 1280 × 720 traced at half, the guard on in both columns):

        scene the trace, units / flat frame GPU, units / flat 60 Hz
        hello world (natively) 1.40–1.42 / 1.01–1.04 ms, +37 % Chrome: 6.59 / 6.60 ms held by both
        the voxel level 7.85 / 4.58 ms, +71 % 11.2 / 7.9 ms held by both
        Kabukichō 13.88 / 12.01 ms, +16 % 17.18 / 15.35 ms missed with units (a frame every 17.2–17.5 ms; flat 16.65)

        Against main's session on Kabukichō under software traversal (flat, no guard: 14.11 ms of GPU a frame) the default now is 3.1 ms more, 1.2 of it the guard. Nothing was tuned: the top tree is built by median splits, every unit's ray is transformed, and every ray enters the top tree. An SAH top tree and a path for units whose transform is the identity are the first things to try; until then a session that only stands still is cheaper flattened (THREERT_UNITS=0), at its memory and load time.

      • The edit room and the tree ranges do not grow under software traversal: an edit that finds them full rebuilds the scene (seen: 1,100 instances added to a room of 1,024 records). How many explosions that is on the level is not measured.

      • Procedural edits, posed models and rigid groups' poses still rebuild under software traversal; a scene with more than 2^18 instances is flattened, as before.

      • Whether all of native software traversal has the loop guard by default (not this step's; it costs 11 % of Kabukichō's trace, and what hung on 2026-11-11 is still not confirmed).

      • The 23 atomic tests that fail under software traversal on main ("Known issues"): the other line's.

7c. [ThreeRT] What a still frame costs with units. Before step 8 (which adds units): step 7b's units made the trace 37 % / 71 % / 16 % longer on hello world, the voxel level and Kabukichō, and Kabukichō missed 60 Hz under software traversal, a browser's only path. Design and every figure: docs/RUNTIME.md "Software traversal with units" ("The stack", "How the top tree is made", "Measured: the still frame").

  • Status: done on this machine (branch units-still-cost, 2026-11-11; every GPU run with the loop guard, which stopped nothing). The trace, units as in 7b → now / flat, live, 1280 × 720 traced at half: hello world 1.42 → 0.73 / 0.99 ms; the voxel level 7.83 → 4.17 / 4.54; Kabukichō 13.98 → 11.8 / 12.2, its frame 15.2 ms of GPU: 60 Hz again. No picture changed for it: the atomic tests with units pass, the catalog's models with units are their flattened pictures (ΔE 0.01–0.03 on the small ones), and the offline catalog with nothing set is main's bytes (24 of 24).
  • What it was, in the order of what it gave: arrays set to zero for every ray (a walk's own stack: now one for an invocation, the kernel module's); a unit's walk as a loop inside the top walk's, where a ray waited for its group (now one loop); a top tree by median splits (now by surface area, and kept: the settled units' tree with its boxes brought up to date, a small tree built for the units that come or travel).
  • Measured with it, as step 7b left open: the catalog's scenes with models live with units; explosions until the room is full (0.5–0.6 s for the rebuild, right after it); debris as units (8,192 in flight: +2–4 % of trace, 2.3 ms of CPU a frame), and from it and a CPU count of piles: step 8 has room for a few thousand debris bodies; the CPU's instance update bounds it before the trace does.
  • Open:
    • A flattened scene still sets its walk's 48 words to zero for every ray: with units hello world's trace is 0.73 ms and flattened 0.99, the voxel level 4.17 and 4.54. A kernel without units is pathtrace.wgsl as it is (its trace declares the stack; the file is shared and was not edited here). The same change there (the stack a private variable of the module; trace_procs has one too) should give every scene without units under software traversal what it gave these (0.36 / 1.1 / 1.5 ms on the three scenes), in a browser too. Not measured on a kernel without units; it changes that kernel's source, so the default sources' hashes and possibly the catalog's software-traversal bytes: its own step.
    • zero-day (+13 %) and bistro (+4 %) with units: one unit of millions of triangles whose transform is not a translation. Such a scene loses nothing flattened (it has one copy of the triangles either way); units for it only when it is edited.
    • The loop guard's 1.2 ms on Kabukichō (11 %): two other forms of the count gave nothing; not explained.
    • Bodies at rest on one another have no GPU number (no game makes a pile yet): step 8's first measurement.
    • Under software traversal a rigid group's pose still rebuilds the scene every frame (zero-day-animated: 2.6 s a frame), as before step 7b.
  1. [engine] Voxel bodies. The level collides, and what an edit leaves hanging on nothing is a rigid body (it replaces step 6's fall through the lattice). Native first: the acceptance is under hardware traversal; software traversal has to work (bodies are units, no rebuild) and gets one set of figures; a browser is not part of this step. Design: docs/VOXEL.md "Voxel bodies"; docs/RUNTIME.md "Physics" (the voxel shape, the engine's own bodies).
    • Scope:
      • The collision shape, on step 7's Shape: parry's Voxels, for the level's objects (fixed) and for the loose parts (moving), chosen against a compound of boxes, a triangle mesh and a convex hull by measurement.
      • The level collides by default: every object a fixed collider of its voxels, edited by the cells an edit cleared; rays and shape casts of the physics world meet it. physics: false on the level is step 6 as it was; collide: false on an object leaves it out. Ordinary meshes still declare physics.
      • Loose parts are rigid bodies: mass from their voxels and each palette entry's density; they tumble, land on the level and on one another, and sleep; they move as instances (no vertex is written again).
      • Debris: parts under 8 voxels stay the game's particles; at most 300 voxel bodies (maxBodies). At the cap a new part takes the place of the body that matters least (asleep before awake, then the fewest voxels, then the oldest; never one the same edit carved or made: a body being cut keeps its larger part), if that body is no larger than the part; else the part is debris. What goes is debris.
      • A body stays a body when it has settled (asleep it costs no tick; turned, it does not fit the lattice, and writing it back would lose voxels). The cap bounds them.
      • Edits reach bodies: a carve cuts a body where it is, as it is turned; what is cut off is a body of its own.
      • Determinism and robustness as in step 7: wasm32 builds in CI; a class of voxel worlds in check::cases and the adapter's own script, native against wasm32; a fuzz of calls on voxel shapes.
    • Acceptance (hardware traversal): a 4 m explosion's frame ≤ 50 ms and 60 fps after it; a building cut loose falls, lands and sleeps within 16.7 ms a frame; about a hundred bodies with room to spare, and the number at which 60 fps is lost; the CPU split (physics step, placing, meshes, colliders) recorded; scenes without voxel bodies unchanged (the catalog's bytes, renderer/shaders, step 7's physics tests and hello world).
    • Status: done (branch voxel-bodies, 2026-11-11), measured natively under hardware traversal on this Mac (M5 Pro; the benchmark level at 1280 x 720 at 0.5; tables in docs/VOXEL.md "Voxel bodies").
      • Acceptance, as measured:
        • A 4 m explosion's frame: 18.4 ms of CPU (walls and ground), 21.9 ms for a 4 m crater of 140,785 voxels (target 50 ms); the frames after: CPU p50 5.2 ms, GPU 5.2 ms.
        • A building cut loose (the cut of 30 x 30 m: 20 parts, the largest 32,680 voxels): while they fall and land a frame's CPU is p50 5.3–5.5 ms, p95 8.1 ms, none over 16.7 ms; the physics step 0.28 ms, at worst 0.52 (step 6: 26–28 ms a frame for as long as it fell); 17 of 20 asleep after 9.5 s.
        • About a hundred bodies: yes, with room to spare. Natively the world is stepped by Rapier's parallel solver on 4 threads (decided 2026-11-11 on these figures). The number of bodies moving at once at which 60 fps is lost (large ones: slabs and columns of buildings in one heap): about 450–500 on 4 threads, about a hundred on one (THREERT_PHYSICS_THREADS=1: at 100–149 moving the step is 10–14 ms and a frame's CPU 14–18 ms; from 150 every frame is over). What takes the frame is Rapier's step; placing the parts is under 0.2 ms, the GPU's frame does not change. The bodies are the same in every frame either way.
        • The cap is 300 bodies, measured: a scenario that makes more than 500 holds the count at the cap, and with every one of 300 in the air a frame's CPU is 10.7–10.9 ms at the median, 12.8–13.2 at p95, and no frame of 1,094 is over 16.7 ms on account of the physics (two runs; one stray frame each with a step under 1 ms). At 400 the frame holds in two runs of four and goes over in the others on 2 and 3 frames of 1,094 (17.0–19.3 ms, with 320–400 moving); at 512 a frame is 16.3 ms at the median with all moving, 5 of 22 such frames over. With the parallel solver off the cap to set is 128 (about at the frame: 7 frames of 1,095 over, the worst 22.0 ms).
        • The CPU split of an edit (the 4 m crater: carve 2.4, colliders 6.5, meshes 7.5, commit 3.9 ms; the cut: carve 21.6, colliders 15.3, meshes 5.3, parts and bodies 27.8, commit 37.7, the first physics step 5.6).
        • Scenes without voxel bodies: the catalog's 25 bundles are byte-identical to main's under software traversal; renderer/shaders has no diff; test-render 173 of 173 (the 170 of main and three new voxel/cut-body*, a fourth since); step 7's physics tests and hello world give the numbers they gave. The perf smoke was not measured (it refused: the GPU was 20 % busy with other applications).
        • Software traversal (works, not optimised): bodies are units added and moved in place, no rebuild, guard count 0; the 4 m explosion's frame 18.6 ms, the cut's 194 ms (the parts' trees are built on the CPU), after it a frame's CPU p50 8.1 ms, none over 16.7 ms.
        • Determinism: 300 voxel worlds and the adapter's script end in the same bits natively and in wasm32 (the physics job in CI); step 7's worlds end in the bits they did; the level run twice through explosions, the cut and a crater gives the same level and physics hashes.
      • Done: Shape::Voxels, Physics::edit_voxels and the world's own ray at voxel shapes (physics-core); the bridge's engine bodies and colliders (ids from 2^30 up: scene code names them and cannot make or remove them); voxel_core::Edit::cleared and Level::take; in renderer/src/voxel.rs the level's colliders, the bodies, their sync, the carve of bodies, the cap; voxelBodies() and voxelImpulse in packages/voxel; physics hits on the engine's colliders carry their ids. The time the engine spends inside a voxel call is not counted against the frame script's 50 ms (a cut through a hundred bodies takes that long, and the script was ended after it).
      • From scene code (voxel/cut-body-push, a live test): a ray of Raycaster.intersectPhysics meets the level (hit.object is engineColliders, whose physics is null; no body) and a voxel body (body), and voxelImpulse(hit.body, ...) throws it. Writing that test found two faults the Rust tests had stepped past: the scene package asked the engine's world only once a scene object with physics existed (a voxel level makes none: voxelLevel now binds the queries), and an id read out of an answer came back from the script engine as a double and was refused (the bridge reads a whole number as the id it is).
      • Three faults of Rapier 0.36 / parry 0.31 with voxel shapes, each with a test and a way round in physics-core (none patches the crates): the solver panics on a ball against voxels (parry's function for that pair keeps no workspace; the pair now goes through its general voxel function); parry's ray misses voxels along a lattice plane (the world walks the cells itself); a shape edited where it sits keeps stale contacts (the collider is taken out and put back).
      • A fourth, in the parallel step: it can hang for good (found by the review's fuzz on this PR's head, 2026-11-12: one run of fifty; a world of six bodies stepped back to back hangs after 30,000 to 500,000 steps). Rapier hands the broad phase's tree optimisation to rayon::spawn and later waits for it with a channel's blocking recv. Stepped on a pool's worker, the job is on that worker's own deque and the wait is outside rayon, so only another worker can run it, and rayon does not promise one comes: waking for a job in a worker's deque is best effort (no store-to-load barrier between the push and the pusher's read of the sleep counters; shown by adding one fence to a scratch rayon-core: 15 million steps without a hang against a hang in five runs of five). When every other worker is just falling asleep they all miss it. Rapier's own configure_thread_pool has the same hole. Way round, in renderer/src/physics.rs in_pool, nothing patched: the thread that waits for the step injects an empty job into the pool every 0.5 ms until the step returns; an injected job always wakes a worker, and a woken worker looks through every deque. A hung step costs 0.5 ms once. Why nothing met it before: the determinism check steps from a thread outside the pool (the job is then injected, the path that always wakes), and the level's frames are milliseconds apart (the workers are long asleep and are woken outright); it takes steps microseconds apart. Checks, on the CPU: renderer/examples/physics_fuzz.rs (the fuzz, and the six-body world stepped back to back, with a watchdog: a step that does not return in 30 s is a failure): 500 fuzz runs in a row and 20 of its many-bodies variant with every check held, and 26 million back-to-back steps, none hung; with the kick off (THREERT_PHYSICS_KICK=off) the stress hangs in three runs of three. CI's renderer job runs it on the physics' threads as the renderer steps: the recorded hashes at 2 and 4 threads (the determinism check steps from outside any pool, which is not the renderer's path), 10 fuzz runs and a million steps.
      • What the same review found besides, fixed here (out/review-24/review.md):
        • The time budget of a script: each voxel call moved the deadline by a millisecond at least, so a frame script looping on cheap calls (or on ones that throw) never ended. The engine's time is now lent as measured and at most 250 ms an entry (the 30 m cut, the largest single edit measured, is 115 ms); a voxel call made after the deadline throws at once (the script engine checks its deadline only every so many operations, and a loop of calls of some milliseconds makes few). Edits and frames asked for before the level is loaded are at most 4,096 (they are outside the script engine's memory limit).
        • A hole in the level's collider where a crater crosses a terrain tile's border: a neighbour that lost cells of its own had its shell made whole only around those, not over the crater the other tile bared. Each object is now made whole over its own box and every carved neighbour's (checked against brute force, with the review's rays).
        • At the cap, a cut retired the remainder of the body it was cutting and kept the chip (no body was asleep, so the oldest was the one being cut): every id gone after a cut through 400 bodies. Now nothing the edit carved or made is retired while it runs; the body that goes is the one that matters least (asleep, then fewest voxels, then oldest), and only for a part at least as large; else the part is debris.
        • A carve took bodies with another shape than the level: the radius now clamped to 128 voxels and to 0 below as the level's, a box whole for every class it reaches (it was shrunk by the class's share).
        • Smaller: the physics' threads not made is a sequential step, said once (it was a panic every step); an unknown THREERT_PHYSICS_THREADS is said; a level collider the physics took out on an error is forgotten; no powi in a body's density; CI's physics job runs on changes to api.rs and world.rs.
    • Open:
      • The parallel solver's independence of the thread count is checked as far as this, and no further: on this machine at 1, 2, 4, 8 and 15 threads (the determinism check's script and 1,500 random worlds of five kinds, each small; heaps of up to 1,000 voxel pieces; 20,000 voxel worlds without a panic: these on the process's pool, stepped from outside it), on the physics' own threads as the renderer steps (the script and the 1,500 worlds again, and the voxel adapter's script, at 1, 2, 4 and 8 threads; the benchmark level's hashes through explosions, the cut and a crater, equal to the sequential build's), and in CI on Linux at 2 and 4 threads on every change to the physics (native parallel = native sequential = wasm32 = recorded; 7–11 s of the physics job with a warm cache). Not checked: other machines and CPU families beyond CI's, worlds with joints and thousands of bodies at once, long runs of large heaps. wasm32 stays sequential (no threads here), and the bits agree. Step 9's checkpoints are what would find a difference in the field.
      • The cap of 300 is this machine's (an M5 Pro's four threads): a slower machine holds fewer at 60 fps, and nothing adapts it. A level can set maxBodies. Asleep, bodies cost nothing, and a game's bodies seldom all move at once.
      • A large cut's own frame is over 50 ms: 117 ms for the cut of 30 x 30 m (the scene's commit of the new parts' meshes 38 ms, the parts' meshes and bodies 28, the carve 22, the colliders 15); a cut through a heap of a hundred bodies 19–21 ms (p95 32–36). Explosions are within the target, which is what the acceptance names (as in step 6). Not split over frames; not in this step.
      • A voxel part that glows rebuilds the scene once when it comes loose (a driven mesh that emits is not placed as an instance: the build flattens it; seen in voxel/cut-body-live, whose posts glow). The daylight level has none; a level with lamps at night does.
      • The level's colliders cost 5.4 s of load and 303 MiB on the benchmark level (the first frame comes after 10.7 s with them, 5.5 s without). An offline still pays the 5.4 s too (16.5–19.6 s for a still of the level against 11.1–12.2 s before), though nothing in it collides: not changed in this step. natively this is a fixed cost of every level of that size. They are a shell of the cells within 4 of the open (every solid cell was 26 s and 1.3 GiB), and objects of one file share one shape until one is edited (before that: 6.9 s and 455 MiB). What is left is the terrain's 1,600 tiles, a shape each. Decided against (2026-11-11): a shell of 2 cells (a body would get through it at 12 m/s), and building them after the first frame (a level whose first seconds have no collision behaves by its load time).
      • The script surface was voxelBodies(), voxelImpulse and the ids physics hits report; voxel bodies as objects, paint and added voxels on bodies and mass by cell are step 10 (a), done.
      • Export and import of the voxel world's and the physics world's state (a level's edits, its bodies, their poses and velocities): waits for the general layer's design of saving (step 9 is that layer's).
      • A tick's time is still not bounded: the first tick after an edit that frees many parts steps them all (400 jagged pieces in one heap: 7 ms a tick, at worst 19; 1,000: 23 ms, at worst 52).
      • A large loose part's collider holds every cell (the level's are shells): a solid block of 200³ cut loose is an edit of 2.8 s and 619 MB, and past 2²⁴ cells the part is refused and becomes debris (a large building cut loose whole would vanish, not fall). Measured by the review; a shell for bodies (they are hit from every side, so 4 cells all round), or a split into pieces, is for when a level has such parts.
      • Scene code's and the engine's bodies and colliders share one count of the physics world's limits (a level with maxBodies: 20000 leaves scripts none); every part cut off a body leaves an empty slot in the level's object list for good.
      • Tree crowns cost more than buildings: five crowns of 10,616–18,894 voxels moving step in 1.6–2.2 ms (leaves make many contacts), a building part of 32,680 in under 0.5 ms. They sleep 5–10 s after the cut.
      • Software traversal is not optimised (the cut's frame 194 ms). A browser: a small voxel scene with bodies in Chrome is not run in this step.
      • The faults above that are parry's and Rapier's own are to be reported upstream (the step's hang: a draft with a reproduction of 60 lines on Rapier alone, not sent). The kick is a way round, not a cure: it rests on two things rayon does today (an injected job wakes a sleeping worker; a worker looks through every deque before it sleeps). To be dropped when Rapier joins that pass without blocking a worker; the stress with THREERT_PHYSICS_KICK=off says when.
    • Then the decision: keep Rapier or write our own. What this step measured for it: Rapier does what the step needs on both ends (the same bits natively and in wasm32, and on several threads; voxel against voxel resting, stacking and sleeping on a level of 61.6 M collider cells; edits of a shape by its cells in 0.1 ms), with the four faults above found and worked round without patching it (the fourth, the hang of the parallel step, by a review's fuzz after this step's own checks had passed). Its cost is the step: about 0.1 ms a large body that moves, on one thread, so a hundred moving bodies are the frame; its parallel solver, now the native default, is worth a factor of 3 on 4 threads at the same bits (about 450–500 moving bodies in a frame). What an engine of our own would have to beat is that step, and it would have to bring the determinism, the sleeping and the voxel-voxel contacts with it.
  2. [ThreeRT] World data and command replay. *Not in this line's order (the user, 2026-11-12): world data, command replay, multiplayer and saving belong to the general layer, to come later; the voxel line goes from step 8 to step
    1. What is below stays as that layer's starting point.* Binary world blocks on the node outside the JSON game state, changed by deterministic commands the room logs and replays to late joiners.
    • Acceptance: a room replayed from its log gives bit-identical world data.
    • The log carries world-hash checkpoints (required by the supervisor of this line, 2026-11-10): at a fixed period the hash of the world data and of the physics world (Physics::hash) is logged, and a node replaying compares. The ends are not assumed to agree bit for bit: a difference is found at the first checkpoint after it and placed between two checkpoints.
    • The voxel world now depends on the physics' determinism (step 8): where a loose part comes to rest, and so which voxels a later edit carves from it, is the physics world's doing. A replay needs the physics' bits to agree wherever the voxels' must; the checkpoints above cover both hashes, and step 8's checks hold native against wasm32 for voxel shapes.
    • World handlers' changes are commands. What on handlers do to the scene (step 7) is not in the game state; it all leaves the script through the scene binding's sync, and that is where it is logged and replayed from. No other way out of a world handler may be added.
    • From step 7, for the physics' part of the log:
      • It rests on step 7's determinism, which holds for one build of the engine on the platforms checked; a new platform or a new Rapier runs tools/physics-determinism.ts first.

      • Precondition: the platform math calls upstream knows of, against what our worlds reach (dimforge/rapier issue #1054 and its reproductions, for Rapier 0.36.1 / parry 0.31.1 / glamx 0.3.1; read 2026-11-10). We build rapier3d with dim3, f32, alloc and enhanced-determinism: no parallel, no soft bodies, no multibody joints, and a game's calls make bodies, the five impulse joints (limits on hinges and sliders, velocity motors), box / sphere / capsule / hull / static trimesh colliders, CCD, contact events and ray / overlap / sweep queries.

        upstream item call on our path what holds it
        inertia diagonalization ("suspicious", no repro upstream) glamx eigen3.rs acos, cos yes: every convex hull and body of several colliders patched (third_party/glamx); 48 of 1,000 worlds differed before; cases 0 and 1
        angular limits (2D repro) joint_constraint_helper.rs sin_cos of the limits' centre, also the 3D line yes: a hinge with limits limits handed over centred, so the centre is 0 and exact (add_joint); case 2, revolute_limits_off_centre
        BVH optimizer ("suspicious") parry bvh_optimize.rs log2 yes: the broad phase, every world tested: the same subtree count with the platform's log2 and libm's for every collider count up to 80,000, on each platform the tests run on
        arc geometry parry vector_ext.rs angle() acos no: its callers are a trimesh's pseudo normals (only with the ORIENTED / FIX_INTERNAL_EDGES flags) and arc generation tested: a trimesh is built with no flags (a_trimesh_has_no_pseudo_normals); case 3 has a trimesh
        revolute angle RevoluteJoint::angle() asin no: neither Rapier's solver nor we call it
        angular motor (2D repro) generic_joint_constraint_builder.rs sin of a motor's target angle no: the multibody path, and a position motor; ours are impulse joints with velocity motors (the impulse path's position motor uses simba's asin) a position motor is not offered to games; adding one re-opens this
        contact coefficients CoefficientCombineRule::Max on ±0 no: we never set a combine rule (the default averages, which IEEE defines)
        singular vectors glamx svd2.rs no: 2D
        deformation damping, elasticity, cloth bending, tear smoothing, plasticity, elastic cap, disk / tube geometry, rest angle (9 repros) soft bodies no: no soft body is made
        inverse kinematics multibody no
        missed tear parallel and soft bodies no
        Delaunay refinement, equal-key sorts ("suspicious") soft bodies, spade no (spade is not in our build)

        Also read in the sources and not in upstream's list: a convex hull's feature lookup takes the sine and cosine of one constant (tested equal to libm's); Aabb::intersects_spiral and the interval arithmetic under it have no caller in our build; the remaining method-syntax calls are in 2D or test code. Case 3 of physics_core::check (200 worlds: CCD on a trimesh, a kinematic body, fixed and ball joints, the answers of queries) is the evidence for the rest of the path: 200 of 200 equal natively and in wasm32, both ways. A new feature of the physics offered to games (soft bodies, position motors, multibody joints, another combine rule, trimesh flags) is checked against this table first.

      • The log needs the tick each call was made at, and the syncs: a frame makes 0 to 5 ticks from the wall clock's dt, and a force lasts "the ticks of its frame", so the calls alone do not replay.

      • A body that drives an object starts at Scene::world_pose, which is the renderer's own glam arithmetic (not under enhanced-determinism): the log should carry the pose the body was made at, as it should carry a voxel command's fixed-point shape (step 6).

  3. [engine] The game API and effects. Four PRs, each reviewed and merged on its own (the user, 2026-11-12: the four are independent, and step 8 in one PR of over 3,000 lines had four faults found in review): (a) voxel bodies as objects; (b) fire and smoke; (c) vehicles and ropes; (d) the acceptance scene.
    • packages/voxel: voxel edits, bodies, joints, lights, scene queries and effects.
    • (a) Voxel bodies as objects (branch voxel-objects; design out/web-probe/step10/a-design.md; docs/VOXEL.md "Voxel bodies as objects"). A loose part is a VoxelBody (an Object3D): voxelBodies(), voxelBody(id) and a physics hit give it, the same object for the same body. It has the physics methods every body has (at once: the body exists), its pose read from the engine, contacts on request (to addEventListener, as any body's), joints with voxel or scene objects, and edits of its own (paint, addVoxels, carve); cut, the part keeping the body keeps the object; retired, carved away or fallen, it is gone with a reason and a "gone" event. Scene code's colliders on a voxel body are refused. Paint reaches bodies; a body's mass is its cells', each at its own density. Step 8's voxelBodies() fields stay (position / rotation are now the object's vector and euler, the quaternion quaternion), voxelImpulse is kept and deprecated, hit.object on a body is its object. packages/scene gets an internal hook (setEngineBodies) for hits, joints and the frame's events, and delivers contacts with the voxel level (other: engineColliders). Checks: the adapter's recorded script with a paint and an add (native at 1 to 8 threads = wasm32 = recorded), physics_fuzz with body edits, contact switches, the gone list and the level's collider shells against brute force every 50 iterations.
      • Found on the way and fixed: an add on a body could scan an unbounded box (at most 65,536 voxels added, 64 times that looked at), and both it and voxel-core's shape check counted cells in an i64 that wraps (a box of 1e30 m was 2^69 cells, counted as 0: a level add that large would never return).
      • The independent review of #25 found, fixed here with tests: an add far from a body made its mesh over the whole box (2.4 GB at 120 m; out of memory at 2e8 m): a body now stays within 2^21 cells spanning at most 1,024 a side and 2^25 in all, checked before anything changes; an add the physics refused left the mesh and the collider apart (the collider is edited first now); a body could grow past the physics' limit and keep being drawn without a collider (never now: it is debris); a getter in a descriptor that called the engine panicked it ("already mutably borrowed", on main too: ten entries read their arguments after borrowing; all read first now); a held object threw between the engine retiring its body and the next look (it finds it gone and does nothing); every redraw left a geometry behind for good (the level's own edits too, on main: +200 geometries in 400 edits; now +1); contacts started twice through an edit and never ended for a body that went; the engine's gone list grew with nobody taking it; a material outside the palette was taken; ids could meet in use ones after a wrap; scene.add of a voxel body threw only at the next sync (it refuses at once).
      • Open: a level add still accepts up to 2^27 cells (the fuzz keeps its adds tame for that, step 8's Open); a voxel body's pose is read from the engine at every read of position (one call; no per-frame cache); World::drop_geometry looks through every object for a user (a few hundred microseconds an edit on the benchmark level's 10,000 objects; a count per geometry would make it nothing).
    • (b) Fire and smoke (branch explosion-fire; design out/web-probe/step10/b-design.md; docs/VOXEL.md "Fire and smoke"). The user's scope (2026-11-12): an explosion's fireball and smoke, on the existing volume and particle paths. Explosions (packages/voxel): a pool of fireballs (each cooling to its own dark smoke) and a pool of point lights made in setup; fire / explode / step / dispose. No smoke grid: its box is a volume, a fireball in it would overlap it, and volumes must not overlap (Explosions refuses one; the destruction game's -fire variant is fireballs only, -smoke unchanged). Caps on fireballs (32) and lights (8), with what happens past each; every number checked before anything changes. No engine call of its own, so nothing new for physics_fuzz (voxelExplode is in its set already). The scene sync checks grid sources and customData only, not transforms or lights: Explosions checks everything it sends. scene::build refuses a scene with more than 32 volumes shown (the kernel's 32-bit mask; the 33rd was not drawn, silently). The stand-in light's table FIRE_LIGHT, measured against offline (tools/bench-voxel-fire.ts); voxel/fire-light 0.987 for 1.
      • Measured at render scale 0.75 against offline (docs/VOXEL.md; again on 0a89089, after #33): the whole image meets ΔE ≤ 3 / SSIM ≥ 0.9 at 0.2 s (1.86 / 0.963; 2.11 / 0.949 before #33), not at 1.0 s (4.39 / 0.851; 3.53 / 0.876 before); the street meets at every age; the fireball itself not (ΔE 5.7-7.8; 4.4-6.9 before): the live march's own picture (held: 2.7-4.3) and the temporal filter. With a smoke grid around the fireballs (the first -fire) the fire was not seen at all at 0.2 and 0.5 s (its region ΔE 19.9, 9.4): kept in the docs as the evidence for the rule. The fire burning in the grid instead was tried and set aside (coverage, one to four cells for a small fire, every cell every frame, no offline reference).
      • Found on the way and fixed: each pool object's first move promoted it to movable with a rebuild (281 ms, and it wiped the live smoke); idle lights had unbounded reach (0.9 ms of GPU with nothing burning).
      • The independent review of #29 found, fixed here with tests: the fireballs sat inside the smoke box and the puff hid them whole (no grid now); 32 fireballs and the grid were 33 volumes, the 33rd never drawn; finite positions past f32 passed the check; options went unchecked to the engine; the puffs' cap was per distinct time and they piled up out of a scene (no puffs now); a new fire at age 0 took a light from an older one; time going back left fires to burn again later; a fire waiting to start was taken over uncounted; the pool's objects lived in the group's space; no dispose.
      • Temporary ways round the shared renderer, in Explosions until the shared paths are fixed (the user and the supervisor, 2026-11-12; docs/VOXEL.md "Temporary ways round on the engine's shared paths", with each one's cause, side effects, and when and how to take it out; this line's worker takes them out in a PR of its own once the shared paths are fixed): the stand-in light (live rays have no media code: offline it counts the fire's light twice unless lights: 0, live it lights the fireball a second time); idle objects parked far away (hiding a volume rebuilds); idle lights reaching 1 mm (a black rangeless light reaches without limit); the fire's history once capped by its light's change (gone since #33, and closed at its source: below); the smoke kept by never rebuilding (a rebuild loses a grid's simulation); and volumes that must not overlap (media_track / media_march take media whole in entry order: no smoke grid around explosions, and two fires close together still overlap).
      • Open, the user's scope of 2026-11-12: fire spreading along burnable voxels, and smoke stopped by voxels, are not done.
      • Open: the live march's media are lighter and more see-through than offline (8 steps; in-scattering isotropic from the cache): the fireball reads lighter than offline.
      • Closed at its source (§ 1a, "Media in the live frame's histories"): the fireball's ghosting. After #33 its region read ΔE 7.32 / 7.81 / 5.71 at 0.2 / 0.5 / 1 s (6.90 / 6.61 / 4.36 when this step merged); now 6.28 / 5.56 / 3.69, without the fire light 6.36 / 5.62 / 4.19, and the whole image meets at 0.2 and 0.5 s (1.77 / 0.964, 2.54 / 0.942; 2.99 / 0.895 at 1 s). What is left is the live march's own picture (the Open above).
    • (c1) Joints and the blast (branch vehicles-ropes; design out/web-probe/step10/c-design.md; docs/VOXEL.md "Joints, the level's anchor and the blast"). (c) split in two (the supervisor, 2026-11-12: engine structure first, features after). The user's decisions 1-4 (2026-11-12), each the standard structure where the engine did otherwise: a joint's parameters change in place (joint_set; before, removed and made again; the engine refuses one that names its bodies, anchors or axis); joints to the level hold to the world's anchor, a fixed body with no collider (the level's colliders stay static, on no body); a joint belongs to the material at its anchor (it moves with a part cut off and the engine reports it, joint_changes, so bodyA / anchorA name the part; it breaks when its cell is carved or its body goes, the world's own removals included: Joint.broken, a "broken" event); an explosion's blast pushes the bodies within 3 radii (impulse by area and distance, through the centre of mass; the carve's radius) and kicks the parts it cuts loose (8 m/s at the default push, whatever their mass; at most 30 m/s in all; the supervisor for the user, 2026-11-12). Recorded hashes: physics-core's script 8e4af124a2061883 (the kick added to its blast), the voxel bodies' 3329720df1b31ca3 (an explosion added that cuts a body in two, to kick its part); the anchor body itself changes neither (with the kick off, both are the first draft's bits); native = parallel = wasm32.
      • The independent review of #31 (2026-11-12): the first draft hung the level's colliders on a fixed body and hid Rapier's per-edit mass sum over them with a zero-mass rule (an explosion's frame had taken 26 s); the tick after a carve still grew with the level's colliders (1.2 ms at 10,000). The anchor body is the standard structure: main's flat cost (0.02-0.05 ms), no special case. Also fixed: the binding did not know of joints the engine moved (a later sync let go of them or remade them on the level); a throwing "broken" listener left the rest unmarked; pose could move the level; the blast's radius was not the carve's; the world's own removals reported no "broken"; joint lookups were linear in the world's joints (40,000 joints: 0.7 to 6 s stalls, now 8-11 ms).
      • Open: the blast is not shielded by walls (decision 4: one voxel ray per body would do it); a joint's anchor on a face between two cells is held by the cell the point falls in, else the nearest solid neighbour.
    • (c2) Vehicles and ropes: the ray-cast vehicle (Rapier's DynamicRayCastVehicleController; the comparison in out/web-probe/step10/c-vehicle-compare.md: steady, 250-300 times cheaper than a car of wheel joints, as deterministic); ropes as RopeJoint and a drawn curve (they do not collide: they pass through walls). Before it: parry's voxel ray, which missed 8-22 % of rays starting on a lattice plane (the wheels' rays go through it), is fixed at the source (the user's decision, 2026-11-12: renderer/third_party/parry3d, its chunk walk only; the world's own walk removed, every ray through Rapier's query; branch parry-voxel-ray); and a CPU comparison of single-ray wheels against shape-cast wheels on debris and narrow gaps (to be scoped).
    • (d) Acceptance: the benchmark level played through as a game, every line of docs/VOXEL.md's benchmark measured.

Known issues

  • Lamps finer than a pixel keep about half their light while the view moves (2026-11-14): the field of upscale/lamps-still-live before a black wall 1 cm behind it, the camera sliding 1.4 pixels a frame, reads 0.045 of its 0.1 on main ef00aa4 and 0.050 with the locks carried by their depth (at rest 0.1057). Not the lock's life (two and four jitter sequences: 0.052, 0.053; the trail grows). Likely the halo: resampling the history every frame spreads a lamp's light past the lock's reach, and the clamp takes what lies outside it. The test for it (that field on that wall, its mean 0.1) comes with its fix.

  • Under software traversal 23 of the 170 atomic tests fail (found 2026-11-11 in § 6 step 7b, the first whole run of the suite under software traversal; main a707e1c's build and the step's, as written and in the merged layout, the same ids and values; not fixed: the rendering line's). Hardware traversal passes all 170.

    • 20 are particles, which software traversal does not draw (they stay collapsed at the pivot, docs/MATERIAL_FUNCTIONS.md): 13 particles/*, the 5 gpu-particles/*, translucent/depth, translucent/order.
    • volume/lighting and volume/lighting-offline read 6 for 1. Basis: both measure one translucent particle in a closed cube with one 6-nit wall behind it (their features are particles, translucency); without the particle the region is the wall. The same missing particles, in a family whose name does not say so.
    • surface/windows reads 0.3934 for 0.4234 (−7 %, tolerance 3 %); surface/windows-mirror beside it passes. Basis: the scene is one plane with the library's facade windows and no instance, so nothing of step 7b is in its kernel (the source is main's byte for byte), and main's build reads the same 0.3934 in both layouts. The cause was not looked for.
    • 2026-11-13 (main 8746130, 190 tests): 24 fail, the 23 above and wind/pivot-sway-live, which reads 9.241 for 10 (its offline twin wind/pivot-sway passes; hardware traversal passes both). The same 24 in the merged layout. Not in any gate: CI runs no render test, and the merge gate runs them on hardware traversal only.
  • Offline renders of bistro, bistro-slice, bistro-district, zero-day and zero-day-animated are not the same bytes twice under hardware traversal (measured 2026-11-11 in § 6 step 7b's merge gate; the last entry here has Bistro's ties between coincident surfaces at 2–4 %). Main a707e1c against itself, 320 × 180, 4 spp: 1,782 / 1,095 / 125 / 7,988 / 10,426 of 57,600 pixels differ; the catalog's other 18 bundles repeat exactly, and software traversal repeats all 23. So hardware traversal's byte identity on these five says nothing; software traversal's is the gate.

  • Emissive quads under masked decals of the same shape went black with hardware ray tracing (found 2026-11-08 by the unbiasedness check, tools/unbiased-check.ts; fixed the same day, branch coplanar-flatten).

    • Zero Day against the software BVH (16384 spp, 320 × 180, raw HDR): one 4 × 4 region 0.966, another 0.978, at every sample count and seed; two pixels the software BVH read at 30–40 nits were 0.05.
    • Cause: Zero Day has an emissive quad and an alpha-masked decal on exactly the same vertices. Instancing put the decal in the model's BLAS and flattened the emitter into world space; both met the ray at the same t, the decal won, its alpha let the ray through, and the next query started past both.
    • Fix (scene build): a pool triangle on exactly the same vertices as a flattened one (emissive, glass, material function) is flattened with it. Zero Day: 2 triangles move; Bistro: none. Regions now 1.007 / 1.005 at 4096 spp, no runtime cost; the catalog's offline renders are byte-identical (software traversal), Bistro's too (hardware).
    • Not taken: one more query per stepped cutout over the gap, opaque geometry only (RAY_FLAG_CULL_NO_OPAQUE). It fixed Zero Day, but Bistro's offline render took 28 % longer, and on Metal the flag changed the queries after it. The same query discarded unused still darkened Bistro's left third by 0.5 % and changed 18 % of its pixels; with RAY_FLAG_FORCE_OPAQUE instead it changed nothing.
  • Live renders with emitters do not repeat exactly (found 2026-11-10 in § 6 step 3, looked into in step 4; not fixed). Two runs of the same live render differ from the second frame on: geometry/emitter-added-live in 98 % of its pixels, a static emissive panel the same; scenes lit by the sun and sky alone (light/sun-point-live, geometry/edit-live), volume emission and procedural objects repeat exactly; water/scatter-live differs in 1 %.

    • Where: the radiance cache's training tiles (pathtrace.wgsl cache_train, inserting). With the cache off (THREERT_CACHE=0) or only the training tiles off (THREERT_CACHE_FLAGS=4) the renders repeat exactly; without the per-frame cap on an entry's samples (CACHE_FRAME_CAP) they still differ. The tiles insert voxels into the hash table concurrently (cache_find: a sample whose free slot another key took first is dropped, and lookups in the same pass find this frame's insertions or not), so which samples an entry gets in a frame depends on the order the GPU runs the threads in. A light whose every sample is the same (a sun) hides it; emitter sampling draws a different point each time, so the entries' means differ from run to run, and through the next frames' reads, every pixel.
    • What it costs: noise, not bias (step 3's layer A tests read the same on both paths and runs). On the benchmark level at night (step 4) two live runs of the same shot differ by ΔE 0.5–1.1 (64 frames after a reset, 0.5 floor), and each reads the same against the offline render to ±0.01; step 4 reports both runs.
    • Fixing it would mean deterministic insertion (a pass that inserts the frame's new keys in a fixed order before the training) or per-tile accumulation merged in order; not taken while it is only run-to-run noise.
  • An object added in place was often not drawn (found 2026-11-10 in § 6 step 2g; fixed in step 5, branch incremental-structure). A scene of one dynamicGeometry mesh, a second added by the frame script: the edit was in place, its data as the build's, but the camera saw the sky where it was (5 of 6 runs; with the queue drained around the builds, every run). The narrowing that found it: an object added with a mesh it already had (no new BLAS) always showed. Cause: the edit built the new mesh's BLAS and then the TLAS in two builds of one encoder; on Metal the TLAS reaches its BLASes through their resource ids (indirect instance descriptors), so nothing ordered its build after the BLAS's, and the BLAS barrier between them is a no-op there: the TLAS could see the BLAS unbuilt and keep its instance empty. Fix: the new BLASes (meshes' and procedural) and the TLAS in one build, as the upload does (Gpu::build_edit). 18 of 18 runs draw it; layer A geometry/added-live, procedural/added-live check the added object (geometry/edit-live checks a swapped geometry: it never showed). The shared-pose path still builds its meshes' BLASes and the TLAS in separate submissions (§ 0's crowd; not changed here).

  • Renders did not repeat exactly with hardware ray queries (found 2026-11-07; fixed 2026-11-08).

    • Two runs of the same offline render (Kabukichō, 64 spp, 320 × 180, THREERT_FREEZE_TIME=1) differed in 1.4–1.6 % of pixels; with software traversal they were bit-identical.
    • Cause: the ray query's candidate loop for alpha-cutout geometry (non-opaque traversal) lost hits on Metal. It came up with potted ferns on sunlit paving (§ 5 item 6.5): about 0.1 % of rays near cutout foliage missed even the opaque ground behind it, or found it unlit, leaving black pixels; confirming every candidate regardless of alpha lost the same hits.
    • Fix (trace_hw.wgsl): every query forces opacity, and a hit on a cutout triangle that fails its alpha test is stepped through (the next query starts just past it, up to 16). Shadow rays still stop at the first hit unless it is a cutout one its alpha lets through.
    • After: 3 of 57,600 pixels differ between runs (0.01 %); the fern's black pixels are gone (offline 1 spp: 74 → 0 in a 68,800-pixel patch). Kabukichō's mean is unchanged (0.6565, every 4 × 4 tile within 0.05 %), and it is faster: perf smoke 15.28 / 16.25 → 15.13 / 15.96 ms still / moving.
    • Back for shadow rays on 2026-11-08 (§ 0 item 3 part 2b, a candidate loop for shadow rays past a leaf), found the same day: two runs of one offline render (64 spp, 320 × 180) differed in 75 % of Kabukichō's pixels and 98 % of Bistro's (one differing shadow ray changes a pixel's random sequence from there on). Trusting only the loop's confirmed hits did not help: Bistro still differed in 98 %. Fixed (branch shadow-determinism): offline shadow rays step through cutouts in order, up to 64 (blocked past that); the live viewport keeps the candidate loop. Now 0 % on Kabukichō, 2–4 % on Bistro, whose ties between coincident surfaces made the renders before differ in 2–10 % (hardware traversal only; software traversal repeats exactly).

Known parity gaps (small)

  • Live volume scattering lost energy (found 2026-11-08, fixed the same day, branch live-volume-energy). volume/furnace-live (a non-absorbing sphere of medium in a uniform sky, which reads 1) read 0.963, and 0.931 without the temporal pass's clamp of the directly seen emission (the sky through the medium, 0 or 1 per sample, which the clamp biases up).

    • Not convergence: 120 / 480 / 2000 frames read 0.854 / 0.963 / 0.963. Not the training's firefly clamp (off, the same 0.963).
    • Cause: the media march looks the volume voxels up at a point jittered within a voxel (the accumulation then filters them instead of showing blocks). Near the medium's boundary the jitter left the medium for voxels no training point reached, read them as dark, and the training's feedback carried that loss into every scattering order.
    • Fix: a jittered lookup that finds a voxel short of CACHE_WARM samples takes the voxel of the point itself. furnace-live 0.9965, 0.993 without the clamp, so background pixels no longer keep the emission clamp (§ 0 live energy); its tolerance 0.05 -> 0.02. box-sun-scatter-live 13.44 -> 13.68 (expected 13.72), box-single-scatter-live 6.255 -> 6.415 (6.349). The C slice's smoke segments read the same against the offline render (46 s ΔE 4.36, 55 s 4.34 -> 4.33; its smoke is a small part of the frame); rain + smoke on Bistro 14.84 / 14.69 ms still / moving either way (alternated); perf smoke ±0.03, ghosting ok, catalog offline byte-identical (live only).
    • Left: volume/lamp-inside-live 7.61 against 6.607 (+15 %). The jitter's average is trilinear interpolation, which overestimates the convex 1 / r² field near the lamp (7.08 unjittered, but blocky). The Bistro C slice's smoke is denser and brighter live than offline (tools/slice-eval.ts).
  • Sparks light what is near them (2026-11-07): SparkBurst particles are emitters, sampled as lights. UE 5.8's burst templates have no Niagara Light Renderer, so their sparks light nothing (tools/bench-burst.ts: floor +0.0028 vs 0). A UE effect that should light its surroundings adds one.

  • Translucent particles (2026-11-07) are drawn over the image by the translucency pass and are in none of the path tracer's acceleration structures. They cast no shadow and show in no reflection, refraction or GI: UE's default for translucent materials (Lumen leaves them out of its scene, and screen traces see only opaque depth). A wet street reflects the signs but not the rain in front of them, in both. Their lighting comes from the radiance cache's volume voxels, the counterpart of UE's translucency lighting volume (docs/MATERIAL_FUNCTIONS.md).

  • Auto exposure on a night scene (measured 2026-11-07, not changed). On the hello-world night scene (compare/hello/threert/neon-reflections.ts, every setting at its default), UE 5.8's default auto exposure lands at EV100 −4.7 and ours at −1.1. UE lifts the night 3.5 stops more than we do; both turn it into a lit room.

    • UE side: the scene built natively (bun ue5/neon-ae.ts; the knot as a gold sphere, no sky), Lumen with the project's default exposure; its EV100 is read off manual renders of the same frame (node tools/neon-ae.ts).
    • Aligning to UE would brighten it further, so nothing changes. A night scene states its exposure (setManualExposure), as a UE level would.
    • Why the two auto exposures differ by 3.5 stops on the same lighting (calibration, metering, UE's default +1 bias) is still open.
  • Emissive light through objects that cast no shadow (fixed 2026-11-06). Shadow rays toward emissive surfaces skipped castShadow = false geometry (in the street scenes: most building parts and the ground), while the BSDF rays that find the same emitters, their MIS partner, are blocked by it. Light leaked through by the emitters' sampling share:

    • Kabukichō −0.45 % overall after the fix, −3 to −6 % on the wet crosswalk (grazing reflections of the signs).
    • District −1.7 to −4.3 % on the facades and ground near the camera.
    • It surfaced in the light LOD prototype, which raises near emitters' share and so made the leak +16 %. castShadow now applies to the analytic lights only, as in UE's path tracer, which reaches emissive surfaces only by rays that every mesh blocks. Glass now also blocks shadow rays toward emitters: lamps behind glass are lit through the glass's BSDF path alone, where before they were counted on both paths. Atomic test shadow/emitter-no-cast (main: ratio 8.09, fixed: 0). Cost at the 0.5 floor: Kabukichō +0.09 ms, district drive +0.11 ms p50.
  • Auto exposure (fixed 2026-11-06): the presets' histogram range was UE's legacy -8 .. 4 (log2 luminance), which daylight saturates (a 3000-nit sky pinned the exposure at EV 6.5, the image washed out). UE 5 projects enable r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange (every template), giving EV100 -10 .. 20, the same log2 luminance at the default lens attenuation. The presets use it now; Kabukichō keeps the legacy range explicitly, as its UE project does. Atomic tests exposure/auto-daylight (offline and live; 14.00 vs 14.03 expected) and exposure/auto-night. Still different: UE's default exposure compensation is +1 EV (r.DefaultFeature.AutoExposure.Bias = 1.0); our camera's default is 0.

  • Sky atmosphere: ours is 5–14 % brighter and bluer than UE's (mannequin scene, sRGB ratios UE/ours 0.95 / 0.92 / 0.86 at the top, 0.95 / 0.93 / 0.88 at the horizon), which also tints sky-lit shadows; UE's horizon band is hazier.

  • Below the horizon (done 2026-11-06). UE's references draw no lit planet ground there, as was assumed:

    • The path tracer shows its sky light, which holds the atmosphere as a cubemap: SkyLight CubemapResolution 128, lower hemisphere black, sampled bilinearly. So the sky fades to black across one texel row of the side faces: 0.9° at a face's centre, 0.63° at its edges, about 15 rows in the Khronos studio's 35° view.
    • Lumen draws a hard dark line instead.
    • The atmosphere bake now writes exactly that fade, rows below the horizon included. The renderers are unchanged, so it costs nothing per frame. A first version computed it in the kernel's environment lookup and slowed Kabukichō's trace by 0.47 ms through code size alone, without even taking the branch.
    • The luminance profile across the Khronos horizon now has UE's shape (ramp to 48 vs UE's 50 over the same rows; the sky above stays ~15 % brighter, the item above).
    • Atomic tests sky/horizon-black and sky/horizon-fade.