3D engine that AI agents drive
Merge remote-tracking branch 'origin/main' into bench/same-quantisation
Nguyen Xuan Ancc18767c70b0
diff --cc bench/reference/README.mdindex ba860d95,a0b2a8ec..15dce3aa--- a/bench/reference/README.md+++ b/bench/reference/README.md@@@ -1281,34 -1281,19 +1281,51 @@@ The best of them is 0.0004 better, whicNext idea: the open floor is more than half of the error and the largest gap, and a surface-level cause there needs a new input (light the metal parts reflect onto the floor, which a diffuse bounce leaves out), for example a few traced caustic-like patches stamped into the ground bounce.+## Same quantisation for 67js and EEVEE (2026-11-03, #258)++The scorer read 67js back as an 8-bit PNG but scored EEVEE from a float array, so every 67js against EEVEE number carried the rounding of one side only. `score.py` now rounds the EEVEE array to 8 bits in display space (`load_eevee`), which is what writing the PNG does. Cycles stays float, because it is the reference both are measured against. The alternative, reading 67js back as float, would need a float readback path in the harness for a measurement of the same size, and the PNG is what the 67js columns already use. `tests/reference-quantisation.test.js` pins the loader against an 8-bit PNG round trip.++The EEVEE columns were regenerated from the stored Cycles and EEVEE arrays and the stored 67js PNGs of the baseline run, without rendering. A cell is replaced only where the old scorer on those stored files reproduces the committed number, so the 67js columns (gpu-vs-cycles, cpu-vs-cycles, gpu-vs-cpu) are untouched. Scene order against EEVEE does not flip in any scene; `metal` goes from EEVEE ahead (0.0916 against 0.0944) to a tie at 0.0944.++| scene | eevee-vs-cycles | gpu-vs-eevee |+| --- | --- | --- |+| brick-flat | 0.1099 to 0.1129 | 0.0961 to 0.0941 |+| brick-graph | 0.1221 to 0.1249 | 0.1001 to 0.0976 |+| brick-room | 0.5020 to 0.5021 | same |+| car-paint | 0.0844 to 0.0869 | same |+| character | 0.0622 to 0.0657 | 0.0661 to 0.0626 |+| dark-shaft | 0.2654 to 0.2658 | 0.2638 to 0.2640 |+| fog | 0.2662 to 0.2677 | 0.1324 to 0.1334 |+| fog-room | 0.3730 to 0.3736 | 0.3635 to 0.3638 |+| fog-valley | 0.1952 to 0.1960 | 0.1563 to 0.1571 |+| foliage | 0.0888 to 0.0924 | 0.0804 to 0.0771 |+| glass | 0.1008 to 0.1056 | 0.1100 to 0.1082 |+| light-linking | 0.1558 to 0.1574 | 0.1127 to 0.1111 |+| lit-interior | same | 0.0926 to 0.0927 |+| long-street | 0.0976 to 0.0990 | 0.1152 to 0.1146 |+| material-spheres | 0.1053 to 0.1070 | same |+| megacity-dusk | 0.1524 to 0.1532 | 0.0947 to 0.0935 |+| metal | 0.0916 to 0.0944 | same |+| mountain-valley | 0.1893 to 0.1895 | 0.2671 to 0.2668 |+| outdoor-hdri | 0.0403 to 0.0441 | 0.0366 to 0.0328 |+| spot-area | 0.1935 to 0.1957 | 0.1709 to 0.1686 |+| temple-hall | 0.2341 to 0.2345 | same |++Not regenerated, still on the old float basis: `cpu-vs-eevee` for most scenes, `gpu-vs-eevee` for `brushed-film`, `car-paint`, `material-spheres`, `metal` and `metal-room` and `eevee-vs-cycles` for `brushed-film`. The `region-*` EEVEE cells of `dark-shaft`, `fog-room` and `temple-hall` were regenerated and are not in the table. The stored images of those scenes come from a later run than the baseline, so the old scorer does not reproduce the committed number from them, and a new number would mix two changes. They need a full `npm run reference` run. `grand.json` is also not regenerated: only `megacity-dusk-a` has an EEVEE array stored, and its stored images score 0.1985 against Cycles where `grand.json` has 0.1507. The side by side images in `images/` keep their old labels until that run.+++ ## Where `foliage` loses to EEVEE, by region (2026-11-03, part of issue #191)++ Nothing in the engine changed; `baseline.json` is unchanged. The GPU was held for the whole session by a long Blender render (`gpu-lock.sh` queue), so only the stored arrays were analysed and no fix was tried on a render. Method: `bench/reference/region-errors.py foliage gpu` (67js 0.0979, EEVEE 0.0888, against Cycles), then the same FLIP error map cut finer (distance from the silhouette, Cycles luminance of the pixel). The shares are of the frame; the gap is the contribution of 67js minus the contribution of EEVEE to the frame mean:++ | Region | Frame share | FLIP 67js / EEVEE | Gap to EEVEE | Display luminance 67js / Cycles / EEVEE |+ | --- | --- | --- | --- | --- |+ | Crown (`broadleaf foliage`) | 0.167 | 0.3037 / 0.2805 | +0.0039 | 0.395 / 0.377 / 0.427 |+ | Open floor | 0.459 | 0.0988 / 0.0931 | +0.0026 | 0.735 / 0.730 / 0.736 |+ | Sky | 0.364 | 0.0157 / 0.0101 | +0.0020 | 0.829 / 0.829 / 0.829 |+ | Bark and the floor part | 0.010 | 0.2016 / 0.1792 | +0.0002 | |++ The sky and the open floor have the same luminance as Cycles, and their gap is almost all 8-bit rounding. The 67js frame is an 8-bit PNG while the Cycles and EEVEE arrays are floats: in the flat sky 67js differs from Cycles by 0.0010 per channel (mean absolute, the value of uniform rounding) and EEVEE by 0.0002, and the sky error is 0.0157 against 0.0101. The floor lit by the sun (Cycles luminance 0.7 to 0.8) shows the same offset (0.0854 against 0.0796). Rounding the EEVEE array to 8 bits and rescoring: EEVEE 0.0888 becomes 0.0924, so 0.0036 of the 0.0091 gap is the format of the comparison, not a rendering error, and no shader can remove it. The remaining gap is 0.0055.++ Inside the crown, by the Cycles luminance of the pixel (contribution to the frame mean, 67js / EEVEE): pixels under 0.15 (share 0.063) 0.0227 / 0.0261, 67js better; 0.15 to 0.5 (0.047) 0.0187 / 0.0170; over 0.5 (0.057, sunlit leaves) 0.0094 / 0.0038. The mean crown luminance is closer to Cycles in 67js (+0.019) than in EEVEE (+0.050). So the level is right and the loss is where individual bright leaves sit: in pixels Cycles draws as lit leaf, 67js has error 0.167 against 0.067, while its shaded leaves beat EEVEE. This is the leaf shape and placement cause #191 already named; the edge of the silhouette (3 px) is only 0.0007 of the frame.++ Next idea: the crown needs a per-card measurement, for example the Cycles array against 67js with the same leaf card in each pixel (a card id image from the harness), to see whether the bright-leaf error is cards missing, shifted or too dark; and the scorer could report the 8-bit EEVEE figure beside the float one so "beats EEVEE" compares like with like. Neither was tried. The first box of #191 stays open.