Conversation
SECTION_2D_UNIFORM_SLOT_COUNT sized the shared section-2D-overlay uniform buffer with a hand-written 6, while SECTION_2D_UNIFORM_SLOT_INDEX maps each draw site to its slot. Nothing tied the two together: a new key added to the index type-checks fine (a property access needs the key to compile) but the count doesn't grow with it, so the buffer stays one slot short and the new draw site's bind-group offset lands one record past the end. Derive the count from the index instead, and pin the two equal with a test so a future divergence fails a test rather than only surfacing as a WebGPU validation error on the new site. Refs #3342
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe renderer now derives ChangesRenderer slot count
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The uniform buffer slot count is now derived from the slot index and covered by a regression test; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
Viewer benchmark✅ No threshold regressions detected. 01_Snowdon_Towers_Sample_Structural(1).ifcBaseline recorded 2026-07-01T20:31:05.538Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.
AC20-FZK-Haus.ifcBaseline recorded 2026-07-01T20:30:59.972Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.
Refresh the baseline from a CI run: dispatch the Benchmark workflow with |
Summary
SECTION_2D_UNIFORM_SLOT_COUNT(packages/renderer/src/shaders/section-2d-overlay.wgsl.ts) sized the shared section-2D-overlay uniform buffer with a hand-written6.SECTION_2D_UNIFORM_SLOT_INDEX, defined just above it, maps each draw site to its slot and currently has 6 keys — the two agree today, but nothing enforces it. A new key added to the index type-checks (a property access forces the key to exist) while the count stays whatever was last typed, leaving the buffer one slot short of what the new draw site addresses.SECTION_2D_UNIFORM_SLOT_COUNTis nowObject.keys(SECTION_2D_UNIFORM_SLOT_INDEX).length, so the two can no longer drift.section-2d-overlay-lifecycle.test.tspinning the count equal to the index's key count, as a backstop in case a future refactor reintroduces a literal.Verification the test is non-vacuous
Confirmed by hand before committing (not left in the diff): with the old literal
6restored and a 7th key added to the index, the new test failed (not ok 1 - equals the number of entries in SECTION_2D_UNIFORM_SLOT_INDEX). Reverting the perturbation and re-applying the derive fix turned it green again.Other literals checked
Grepped every
.ts/.tsxreference to both symbols. No other hand-written literal is tied to the slot count — the other consumers (section-2d-overlay.ts,section-2d-overlay-lifecycle.test.ts) all readSECTION_2D_UNIFORM_SLOT_COUNTitself, so they automatically track the fix.Test plan
cd packages/renderer && npx tsx --test src/*.test.ts— 1144 pass, 0 fail, 1 pre-existing skipnode scripts/check-module-size.mjs— OKnode scripts/check-source-text-assertions.mjs— OKRefs #3342
https://claude.ai/code/session_01QPHChk3Ve9N519A4kY7436
Summary by CodeRabbit