fix(h3d-carve-14): Toby r1 — 4 findings resolved

F1 (dead DI wiring): remove 7 fn-refs absent from V-section pre-carve:
  xFret, pbBeg, pbEnd, arpeggioChordIdForNoteWithInferCache,
  arpHsBoundsForNote, chordWireHighDensity, muteXMat
  Wiring count 137→130 in both factory signature and screen.js call.

F2 (dead imports): trim geometry.js import to the 3 live symbols:
  dZ, slideTrailEnd, renderOrderForLayerAtZ (drop 8 unused).

F3 (counts coherence): header 136/30→130/24, test name and
  assertion 137→130, all coherent after F1.

F4 (behavioral kill): add two execution-path tests for drawNote via
  new Function sandbox with full DI stubs.
  - Negative: dt=-999 → early exit at line 452 → pNote.get()=0
  - Positive: dt=0 → gem body executes → pNote.get()≥2 (outline+core)
  Kill proof documented in test comments.

Suite: 1377 pass / 2 fail (same 2 pre-existing as c58c40f baseline).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014uZ169yfoFYArXz962g7KW
This commit is contained in:
byrongamatos
2026-09-05 21:17:27 +02:00
co-authored by Claude Sonnet 4.6
parent c58c40f1ed
commit 59bccefe00
3 changed files with 201 additions and 21 deletions
+2 -4
View File
@@ -10181,14 +10181,12 @@ import { createNoteRenderer } from './src/note-renderer.js'; // h3d-carve-14
TS, _ND_TIME_EPS,
// ── Function refs ──────────────────────────────────────────────
slideOffsetWorldX, hwyPostHitTailFadeMul, anchorLaneBoundsAt,
validString, sY, xFretMid, xFret,
validString, sY, xFretMid,
_firstEventTimeGreaterThan, _setLabelMap,
pbBeg, pbEnd,
_spriteMat2MeshMat, _meshMatForGhostFretDigit,
arpeggioChordIdForNoteWithInferCache, arpHsBoundsForNote, chordWireHighDensity,
fretLabelScaleForFret, fretMid,
txtMat, darkenHex,
palmMuteXSpriteMat, fretHandMuteXSpriteMat, muteXMat,
palmMuteXSpriteMat, fretHandMuteXSpriteMat,
triMat, bendChevronMat, slideArrowMat,
pinchHarmonicMat, naturalHarmonicMat,
_timingHex, _sparkBurst, _fxSpawnPop,
+6 -13
View File
@@ -3,9 +3,9 @@
// Factory pattern: createNoteRenderer({DI}) → { drawNote, drawArpBrackets, drawNotedetectLabels, chordHarmonyLabels }
// chordHarmonyLabels is also called from update() (U-section) at line 9016.
//
// DI surface: 136 params
// DI surface: 130 params
// - 27 constants (shorthand)
// - 30 fn-refs (shorthand)
// - 24 fn-refs (shorthand)
// - 69 getters (() => _var arrows)
// - 3 setters ((v) => { _var = v; } arrows)
// - 7 stable refs (by-ref mutate only, shorthand)
@@ -20,13 +20,7 @@
// entry. Read-write vars (_streakHits, _ndVerdictSawAlpha, _ndVerdictMaxAlpha) use
// getter/setter inline so writes propagate correctly across notes within a frame.
import {
dZ, slideTrailEnd, lowerBoundT, geoFretX, geoFretMid,
renderOrderForLayerAtZ,
RENDER_ORDER_LAYER_STACK, RENDER_ORDER_LAYER_INDEX,
RENDER_ORDER_AT_Z_ZERO, RENDER_ORDER_FAR_CLAMP,
_noteKey,
} from './geometry.js'; // h3d-carve-14
import { dZ, slideTrailEnd, renderOrderForLayerAtZ } from './geometry.js'; // h3d-carve-14
export function createNoteRenderer({
// ── Constants ──────────────────────────────────────────────────────────
@@ -43,13 +37,12 @@ export function createNoteRenderer({
TS, _ND_TIME_EPS,
// ── Function refs ──────────────────────────────────────────────────────
slideOffsetWorldX, hwyPostHitTailFadeMul, anchorLaneBoundsAt,
validString, sY, xFretMid, xFret,
_firstEventTimeGreaterThan, _setLabelMap, pbBeg, pbEnd,
validString, sY, xFretMid,
_firstEventTimeGreaterThan, _setLabelMap,
_spriteMat2MeshMat, _meshMatForGhostFretDigit,
arpeggioChordIdForNoteWithInferCache, arpHsBoundsForNote, chordWireHighDensity,
fretLabelScaleForFret, fretMid,
txtMat, darkenHex,
palmMuteXSpriteMat, fretHandMuteXSpriteMat, muteXMat,
palmMuteXSpriteMat, fretHandMuteXSpriteMat,
triMat, bendChevronMat, slideArrowMat,
pinchHarmonicMat, naturalHarmonicMat,
_timingHex, _sparkBurst, _fxSpawnPop,