Sample
InstancedMesh retains type 'Mesh' while identifying via isInstancedMesh, initializes instance matrices to identity, lazily allocates instanceColor with default white on first write, and maps raycast intersections to instanceId.
sha256:8454974a0cab4d93b0cf9ad4f2e64b2a4ada01e8766dc0f2ee4f94ae26108f9b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Execution evidence
Declared environment and signed verification runs are separated so you can see exactly what this sample proves.
Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS
Declared environment
- Execution context
- node
- Operating system
- linux
- Architecture
- x64
- Runtime
- node
- Language
- node
- Package manager
- npm
Verification-run environments
- Execution context
- node 22
- Operating system
- linux alpine · musl
- Architecture
- x64
- Runtime
- node 22
- Language
- javascript
- Package manager
- npm
- Execution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Case
- Goal
- InstancedMesh retains type 'Mesh' while identifying via isInstancedMesh, initializes instance matrices to identity, lazily allocates instanceColor with default white on first write, and maps raycast intersections to instanceId. HOW
- Packages
-
three 0.185.1
- Environment
- node
- Created
- 2026-08-17T09:07:02Z
Commonly assumed
InstancedMesh sets type to 'InstancedMesh', initializes instanceColor to an allocated buffer on construction, and requires manual bounding sphere computation before raycasting.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- InstancedMesh inherits type 'Mesh' while identifying via isInstancedMesh true, initializes all instance matrices to identity, and keeps instanceColor null until setColorAt is called.
- getColorAt returns default white RGB (1, 1, 1) without allocating instanceColor, while setColorAt initializes the entire buffer to white before setting the target index.
- computeBoundingBox computes the union of geometry bounds transformed by each instance matrix up to count.
- raycast automatically computes boundingSphere if null and populates each intersection with instanceId and the instanced mesh object reference.
- clone and ObjectLoader.parse retain instanceMatrix, instanceColor, and count.
Files
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Download the source artifact (tar.gz)
Origin Seeder
csx-seed
Verification receipts
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9