3D engine that AI agents drive
Note what the flicker fix costs in bytes, memory and frame time (#751)
Nguyen Xuan An80b1b2f26b6d
diff --git a/changes/751-cost-note.md b/changes/751-cost-note.mdnew file mode 100644index 00000000..ac4e93f7--- /dev/null+++ b/changes/751-cost-note.md@@ -0,0 +1 @@+- Measured what the #751 flicker fix costs in bundle bytes, render-target and geometry memory and frame time, and noted it in the size file (#751)diff --git a/changes/751-cost-note.size.md b/changes/751-cost-note.size.mdnew file mode 100644index 00000000..8fa49bf8--- /dev/null+++ b/changes/751-cost-note.size.md@@ -0,0 +1,6 @@+- Cost of the #751 flicker fix (flush ranking and cut, #758 on), measured 2026-11-12 on main 2732ced2 (#939 merged) against 4443e672, the commit before #758. This change touches no bundle; it records the cost the owner accepted when he said a fix that stops this flicker for good is worth its size, memory and frame time.+- Gzip bytes (`npm run size` bundles, 4443e672 to main 2732ced2): `entry:core` 85,185 to 90,062 (+4,877), `entry:coplanar-overlap` 4,032 to 11,576 (+7,544), `entry:path-tracer` 23,104 to 28,601 (+5,497), `entry:path-tracer-progressive` 33,722 to 37,035, `entry:path-tracer-realtime` 38,209 to 41,504, `scene:lit-box` 54,333 to 58,788. Only part of that is the fix, because other PRs landed in the same window. Measured at the PR's own commits: #758 alone is `entry:core` +494 and `entry:coplanar-overlap` +3,848 (17599eed against 4443e672); #765 `entry:core` +45 and `entry:path-tracer` +21; #769 `entry:coplanar-overlap` +59 (its branch tip first reached 16,676 and was trimmed to 11,464 before merge). #935's own note counts 680 bytes in `entry:path-tracer`; the bundle did not move between the commits on either side of its merge, so that cost is not separable from the other growth in the window. Before #758, #752 (reversed-Z float depth) had added `entry:core` +1,901 (83,284 to 85,185).+- Memory per frame, read from the renderer (render-target ledger and `geometryBytes`, 1280x720, 4x MSAA, HDR): render targets 65.22 MiB with the flush pass on, off and before #758, so the pass adds no target. Geometry on the Melbourne drape: 13.52 MiB before #758 and with the pass off, 14.32 MiB with it on (+0.80 MiB; 4 parts cut, 241,560 to 254,212 triangles, 15,848 vertices added). Trap `stack-30-exact`: 60 to 466 triangles; `kitbash-duplicates`: 12 to 99.+- Frame time, headless Chrome on the shared RTX 3060 through gpu-lock, 3 rounds of 9 batches of 20 frames, each batch closed by a 1 px readPixels (this waits for the work queued, not for display). Quiet rounds, ms per frame, pass off (identical to before #758 on the drape) / pass on: drape roofs 0.41-0.42 / 0.43-0.44, drape overview 0.45-0.47 / 0.46-0.47, trap `stack-30-exact` 0.33 / 0.19, `kitbash-duplicates` 0.17-0.23 / 0.23-0.24. Draw calls per frame: drape 10 off, 40 on; `stack-30-exact` 2 off, 17 on; `kitbash-duplicates` 2 off, 5 on. Rounds in which another session was using the card read 8 to 33 ms for every setting alike (4 of 12 cells with the pass on, 5 of 12 off), so only the quiet ones are quoted; the gap between settings is under 0.03 ms on the drape and within noise on the traps.+- Load time: the flush pass takes 0.9 to 1.5 s once at load on the Melbourne drape and 3 to 11 ms on the traps.+- Why the bytes are worth it: the drape flickered at every roof, bridge and river before the fix and shows none by eye after, and the ground-truth probe counts 0 true visibility flips with the pass on (#933, #939). The pass costs about 0.8 MiB of geometry, one second at load on a 240k-triangle city and no frame time this harness can see. Trimming the addon is a later optimisation, as the decision on #751 says.