Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

25.7 KB
Raw Blame

Compatible kit requests after M1

Current disposition (3 October): use the alignment plan and backlog. This ledger preserves original requests and measurements. FARM-001 through FARM-007, GG-001/FF-001, GG-009/GG-010 and FF-003 are implemented. GG-003 reversed depth and GG-004 WebP serving are implemented in the local alignment candidate. Shared GG-007/FF-002 bounds, scrolling and nested-touch changes are also implemented; final integration reproduced a Foundry campus More/help stacking defect, tracked by KIT-2. The original dated response cells below are historical, not the current queue. FARM-008 is advisory and must be demonstrated per scene. The large runtime optimization pass landed in #131; it is not pending work.

Id Need Proposed API Interim behavior Response
FARM-001 SPEC 6.4 starts CPU preparation when verified layout data arrives while renderer/model work remains pending. Optional loadPack(..., { onData }) notification and optional SceneDefinition.prepareData(data, { signal, registry }). Existing consumers keep their current task order and behavior. Farm integration is separate from the completed compatible kit extension. Kit implementation complete 2026-09-29. Seven new deterministic regressions in packages/scene-kit/tests/assets/early-data.test.ts; asset/lifecycle scope totals 40 passing tests and 427 assertions. Evidence: evidence/m2/preparation/kit-unit.log and evidence/m2/preparation/kit-audit.md. Prepared geometry belongs to the current mount registry; no page callbacks, error codes or readiness semantics changed.
GG-001 The Golden Gate builder may serve and connect only on ports 4600-4649. serveOwned, noCorsServer, assertOwnedUrl, runSceneContractTests and runPerformance in testing/node.ts are fixed to 4400-4499, so the shared contract suite cannot run for Golden Gate. Optional port range, for example ports?: { first: number; last: number } on SceneContractTestOptions and PerformanceRunOptions, passed to serveOwned(root, ports), noCorsServer(ports) and assertOwnedUrl(url, owned, ports). Default stays 4400-4499. packages/golden-gate/tests/tools/owned.ts binds 4600-4649 with the kit's startStaticServer (try-bind, no probing) and a package-local runner reuses the kit's exported helpers (launchChrome, waitForReady, waitFrames, capture, assertTeardownListenerAudit, contrastRatio) to run the same B-01..05/B-11/B-12 checks. Done (Foundry Floor FF2 builder, 2026-09-30; approved as a kit change in TASK-FF2 item 5), additive: testing/node.ts exports PortRange ({ first; last }) and DEFAULT_PORT_RANGE (4400-4499, frozen); serveOwned(root, ports?), noCorsServer(ports?) (internal) and assertOwnedUrl(url, owned, ports?) take an optional range, SceneContractTestOptions.ports and PerformanceRunOptions.ports pass it to every server the suite starts and every URL it checks (B-04 hash and CORS fixtures, the callback-failure pack URL, the performance URL). Without a range every helper behaves as before (4400-4499, same messages apart from naming the range). An invalid range (not whole numbers, below 1024, above 65535, or first > last) is refused before any output, server or browser exists. Tests: packages/scene-kit/tests/ui/node-policy.test.ts (three new cases; none binds a port); kit suite 148 of 148. Golden Gate can adopt it later by passing ports: { first: 4600, last: 4649 }; its package-local runner is unchanged.
GG-002 Golden Gate terrain tiles are required to use EXT_meshopt_compression + KHR_mesh_quantization (terrain manifest mesh_loader). loadGlb and loadPack models reject meshopt (validateSelfContained). Optional scene-supplied decoder, for example SceneDefinition.gltf?: { meshopt?: true } (kit sets GLTFLoader.setMeshoptDecoder(MeshoptDecoder) from three/addons/libs/meshopt_decoder.module.js, which is bundled, not downloaded), or loadGlb(path, signal, { meshopt: true }). Draco/basisu stay rejected. Tiles are listed as pack files, fetched through the verified usePackReader().fetchFile (size + SHA-256 checked) and parsed by a package-owned GLTFLoader with the bundled MeshoptDecoder; the scene disposes the results on unmount. Open (filed 2026-09-29 by the Golden Gate builder).
GG-003 The Golden Gate view range is 0.5 m to about 40 km (tower-top and postcard views over a 20 km terrain ring and water to the horizon). A standard 24-bit depth buffer gives shoreline and pier z-fighting at a few kilometres. createGlFactory accepts no renderer options, and reversedDepthBuffer must be set at construction. Optional SceneDefinition.renderer?: { reversedDepthBuffer?: boolean } forwarded to the WebGPURenderer constructor (r186 supports it on WebGPU and, with EXT_clip_control, on WebGL2; it falls back to false otherwise). The scene drives the camera near plane from the camera's clearance to the nearest surface each frame (collision grid, water plane, bridge proxy), the water fades out over the land mask and shallow depth, and the terrain draws a small polygon offset below the water. Open (filed 2026-09-29 by the Golden Gate builder).
GG-004 scripts/static-server.mjs (copied into standalone outputs as serve.mjs) has no .webp MIME entry; terrain albedo and normal maps are WebP. Add '.webp': 'image/webp' to the MIME map. Not blocking: the scene fetches WebP bytes through fetchFile and decodes them from a typed Blob, so the served type is not used. Open (filed 2026-09-29 by the Golden Gate builder).
GG-005 D-21: the Golden Gate web terrain tiles (EXT_meshopt_compression + KHR_mesh_quantization) are a derivative that staging should produce from the canonical decoder-free tiles in packages/golden-gate/source-data/terrain/. The kit pins only three's meshopt decoder, no encoder, so staging cannot produce them. A staging helper backed by a pinned encoder, for example encodeMeshoptGlb(bytes, { positionBits: 16, normalBits: 8, floatTexcoords: true }) in @kiln-scenes/scene-kit/staging; gltfpack 1.3.0 -c -vp 16 -kv -vtf reproduces the delivered tiles. Staging stages the delivered web tiles and proves each one equivalent to its canonical tile (scripts/terrain-canonical.ts: every vertex within one 16-bit quantization step, identical triangles, UVs within half a texel of the 2048 px albedo). All 20 tiles pass. Open (filed 2026-09-29 by the Golden Gate builder).
GG-006 D-21 static export: compose the scene's static content (terrain, bridge, lamps and fixed lights) into one scene.glb for Blender or engine import through composeSceneGLB. That function exists only in Kiln (@kiln/engine/render), which is not a scenes dependency, and the kit exports no equivalent. Export composeSceneGLB, or a kit wrapper over a pinned glTF writer, from @kiln-scenes/scene-kit/staging, taking staged pack models plus placements read from scene data. Not built (D-21: no new exporter). The inputs are ready: canonical decoder-free terrain, the bridge GLB, the six vehicle GLBs, and every placement, lane, light and camera in packages/golden-gate/data/. The scene has no parked vehicles. Open (filed 2026-09-29 by the Golden Gate builder).
GG-007 The help and credits panels collapse when used as Farm and Golden Gate use them. .ks-help and .ks-credits are position:absolute with max-height:calc(100% - 100px), which resolves against the containing block. Placed inside .ks-toolbar (itself position:absolute), that block is the toolbar, about 44 px tall, so the panel shows 32 px of padding and scrolls its text away. Measured in headless Chrome with the Golden Gate test build: clientHeight 32 against scrollHeight 248 at 1280x720 and 289 at 384x832. On a phone the toolbar also wraps, so a panel at top:70px opens over the second row, and .ks-joystick and .ks-touch-buttons paint above an open panel. Size the panels against the HUD rather than their parent, for example by rendering the panel through a portal into the .ks-hud root, or with .ks-hud{container-type:size} and max-height:calc(100cqh - 100px). Offer a narrow-width sheet layout and stack open panels above the touch controls. Golden Gate keeps the kit components and wraps them. Its toolbar is position:static inside a full-HUD layer, so the panels size against the HUD. Below 700 px of HUD width they open as a bottom sheet, and the layer stacks above the touch controls (packages/golden-gate/src/ui/styles.ts, checked by tests/tools/device-check.ts). Farm uses the same toolbar pattern and is probably affected. Open (filed 2026-09-29 by the Golden Gate builder). Farm (M3, 2026-09-29): the same workaround in Farm-scoped CSS, a static toolbar inside a full-HUD layer (PROGRESS R5-03); the kit is unchanged.
GG-008 classifyDevice rates Adreno 7xx and later, Mali-G715 and later, Immortalis, Apple, NVIDIA and Radeon GPUs as high, but it has no pattern for Samsung Xclipse (AMD RDNA) GPUs. A Galaxy S24 or S24+ with the Exynos 2400 (Xclipse 940, the variant sold outside the US) would therefore be rated unknown, or mid if its adapter strings contain "amd", and start on economy, which is Golden Gate Low. The Snapdragon S24+ starts on high, which is Golden Gate Medium. The Exynos adapter strings have not been checked on a real device: Chrome exposes only vendor and architecture. After reading the adapter strings on an Exynos 2400 device, add them to the high pattern (for example xclipse or a Samsung RDNA architecture). Alternatively, provide an optional scene hook that can adjust the DeviceClass. None. The Golden Gate tier table holds no GPU knowledge. tests/unit/tiers.test.ts covers the Snapdragon S24+ path (kit high, which gives Medium) and the mobile WebGL2 path (minimal, which gives Low). Open (filed 2026-09-29 by the Golden Gate builder). Farm (M3, 2026-09-29): the owner's Tab S9 FE (Exynos 1380) reports WebGPU vendor arm, architecture valhall, and WebGL2 ANGLE (ARM, Mali-G68, OpenGL ES 3.2). It is not an Xclipse device, so this request stays unverified; the tablet classifies as SPEC 8.2 intends (mid, so economy on WebGPU; minimal on WebGL2, D-03) (evidence/tablet-2026-09-29/tier/).
GG-009 D-22: on touch the virtual joystick is the only driving input. Push forward to accelerate, pull back to brake and, once stopped, to reverse, and push left or right to steer. The kit VirtualJoystick offered both, a movement stick with one radial dead zone and run near full deflection, and x. A thumb held forward with a few degrees of sideways drift therefore also steered (about 0.17 of full lock at 10 degrees), and steering reduced the throttle. A bidirectional throttle mode. Done in the kit by the Golden Gate builder under D-22, as the coordinator directed (2026-09-29). joystickAxes and VirtualJoystick gain axes: 'throttle' (packages/scene-kit/src/input/core.ts, index.tsx). In this mode x steers and y is a signed throttle, each axis with its own 12 % dead zone, and run is never reported. The thumb stays inside the ring, the screen-reader text describes the driving scheme, and the change is additive: both and x are unchanged. It is tested in packages/scene-kit/tests/input/input.test.ts and noted in the kit README. Golden Gate uses it (src/ui/GoldenGateHud.tsx), checked by tests/tools/drive-check.ts and tests/tools/device-check.ts. Done (2026-09-29, Golden Gate builder, D-22).
GG-010 D-22: a pinch zooms everywhere, including the chase distance while driving. The kit already accumulates pinch and wheel into input.state.zoom, and OrbitRig pinch-zooms through OrbitControls, but VehicleRig takes a fixed distance and height and never reads the zoom input. Its drag-to-orbit (orbitOffset) also captures the first finger of a two-finger pinch, so a pinch swings the chase camera as well as zooming it. VehicleRig gains an optional zoom range and reads input.state.zoom itself, scaling distance and height, so every scene shares chase pinch-zoom. It should also ignore a drag while a second pointer is down. Golden Gate scales the distance and height it passes to VehicleRig from the kit zoom input, within layout.json cameras.chase.zoom (src/play/Driving.tsx, checked by tests/tools/drive-check.ts touch-pinch-chase). The swing during a pinch remains. Done in the kit by the Farm builder (M3, 2026-09-29), additive: VehicleRig takes an optional zoom: { min, max, rate? } (ChaseZoom); with it the rig reads input.state.zoom (pinch and wheel) and scales both distance and height by a clamped factor (stepChaseZoom, reset when the rig re-initialises). Without zoom the chase is unchanged, so Golden Gate's own scaling keeps working until it opts in. For every VehicleRig user a drag is ignored from the moment a second finger lands until all fingers lift, so a pinch no longer swings the chase camera (createChaseDrag). Tests: packages/scene-kit/tests/camera/camera.test.ts "GG-010 chase pinch zoom and drag" (3 tests). Golden Gate, fix round 1 (2026-09-29): it takes the drag fix through VehicleRig without a code change and keeps its own chase zoom scaling, with no zoom opt-in. The new tests/tools/drive-check.ts check touch-pinch-no-swing measures the chase camera's bearing around the car after a pinch in and after a pinch out: 0 rad both times (limit 0.02). The swing noted under interim behaviour no longer occurs. Kit suite 135 of 135.
FARM-002 Owner rule 11:40: browser checks on this PC run headless with an explicit window size. launchChrome passed no --window-size, so the contract suite and every runner used Chrome's default window. launchChrome({ windowSize?: [w, h], args?: string[] }) adds --window-size=w,h and extra arguments; SceneContractTestOptions.windowSize passes it through runSceneContractTests. Defaults unchanged. None. Done (Farm builder, M3, 2026-09-29): packages/scene-kit/src/testing/node.ts. Farm runners pass their page size.
FARM-003 B-10 (SPEC 18) needs an emulated phone profile, but Chrome cannot emulate GPU adapter strings, and no hook existed to inject them. Test and dev builds only: window.__kilnProbeOverride (a partial DeviceProbe, set before mount) is merged over the measured probe before classification; an adapter in it replaces the measured adapter strings. applyProbeOverride(probe) in testing; tierState() also returns the probe used and locked (the governor lock). Public builds never read it (call site behind the build flags; the name is on the bundle denylist). None. Done (Farm builder, M3, 2026-09-29): packages/scene-kit/src/testing/index.ts, src/contract/index.tsx, scripts/check-bundle-hygiene.ts.
FARM-004 SPEC 8.3 step 2 evaluates "with at least 60 samples in the rolling windowMs" (3 s; FrameTimeGovernor, packages/scene-kit/src/quality/core.ts line 133), so below 20 FPS the governor never evaluates: it cannot step down, revert, lock or advise a lower tier. Measured on the owner's Tab S9 FE forced to high on WebGPU: 210 s of living-orbit at median 65.2 ms (17 FPS), 0 level changes (evidence/tablet-2026-09-29/soak/high-living-orbit.json). The classification puts this tablet on economy, where it runs at 30 FPS and the governor does evaluate (0 changes in 210 s), so the gap only matters when a device starts too high: an unknown or misclassified GPU, a persisted tier, an override. An owner or coordinator decision, because it changes SPEC 8.3. For example an optional GovernorOptions.minSamples (default 60), or a coverage rule (evaluate when the samples span at least 90 % of windowMs and number at least 15), so that a slow device steps down. None in Farm. The kit follows SPEC 8.3 unchanged. Done (Farm builder, M4 item 2, 2026-09-29; TASK-M4.md approved the rule): FrameTimeGovernor evaluates once its rolling window holds 60 samples or has spanned windowMs, whichever comes first (packages/scene-kit/src/quality/core.ts, pushFrame); the evaluation cadence, thresholds, benefit check, reversal lock and advice are unchanged. Tests first in packages/scene-kit/tests/quality/quality.test.ts (the three "FARM-004" cases failed on the 60-sample rule): a slow window is evaluated once it spans windowMs and a fast one still at 60 samples; below 20 FPS a constant trace steps down, reverts and locks after the second reversal; below 20 FPS an improving trace exhausts the ladder and the controller advises a lower tier. Re-measured on the tablet on 2026-09-30 with the m4 build (evidence/tablet-2026-09-30/soak/high-living-orbit.json, forced high on WebGPU, 210 s of living-orbit): the governor now evaluates below 20 FPS: one step down at 8.3 s (grass .75), reverted by the benefit rule at 13.8 s, a second step down at 74.3 s that locks (two reversals); 3 changes, 1 reversal, 1 lock (X-10 holds), median 50.2 ms (18 FPS) against 65.2 ms and 0 changes in M3. The lock stops it above the ladder's floor, so no lower tier is advised; that is SPEC 8.3's reversal rule, unchanged.
FARM-005 scripts/static-server.mjs (the kit's serveOwned server, copied into outputs as serve.mjs) starts its CLI server when import.meta.url equals the entry file. When a runner that imports it is bundled (the Farm hub kit's runner/look-farm.mjs, through testing/node.ts), the inlined module gets the bundle's URL, so the guard is true: the bundle opened a second listener on 127.0.0.1:4400 serving runner/ and never exited. Found on 2026-09-29 by the M3 hub-kit plumbing check; the builder stopped its own process. isServerEntry(entry?, moduleUrl?) exported from static-server.mjs: the CLI runs only when the entry is the module file itself and its name is static-server.mjs or serve.mjs. startStaticServer, the CLI options and the serve.mjs copies are unchanged. None. Outputs built before the fix keep the earlier guard in serve.mjs, which is correct there because serve.mjs is only run directly. Done (Farm builder, M3, 2026-09-29): scripts/static-server.mjs, regression scripts/tests/static-server.test.ts (a Bun bundle that imports the module must exit by itself with no server; it failed before the fix with http://127.0.0.1:4400 printed and a kill at 8 s). Any other bundle of this module (for example a Golden Gate kit) is protected once rebuilt.
FARM-006 M4 item 1 (owner's WebGL2 hitch report): the frame graph (createFrameGraph().update()) and BatchSet.update() rewrote every dynamic batch's instance matrices, marked them for upload and recomputed the batch bounds on every frame, whether or not a source had moved (54 dynamic batches on the Farm's minimal tier, where nothing moves). Additive behaviour change, no API change: a dynamic batch's matrices are written, marked for upload and its bounding sphere recomputed only when one of its source matrices changed, compared as Float32 (the stored precision). None needed. Done (Farm builder, M4, 2026-09-29): packages/scene-kit/src/instancing/core.ts; test first in packages/scene-kit/tests/instancing/ ("FARM-006 frame graph writes a dynamic batch only when a source moved", failed on the every-frame rewrite); kit tests pass. three 0.186.0 still uploads a DynamicDrawUsage instance buffer every frame and every per-mesh instance uniform buffer every frame it draws, so the Farm also sets static usage on its dynamic batches and reads instance matrices as attributes (FARM-008).
FARM-007 X-07 (owner decision 2026-09-29 22:10): the Galaxy Tab S9 FE (SM-X518U, Mali-G68) classified economy on WebGPU (vendor arm, architecture valhall, device and description blank) and minimal on WebGL2 (ANGLE (ARM, Mali-G68, OpenGL ES 3.2), D-03); on economy its WebGPU p95 missed the 33.3 ms proposal (M3, X-07 fail). Classification only (classifyDevice, quality scope): a phone or tablet on WebGPU whose adapter strings name a Mali-G5x or G6x, or name no Mali model and report vendor exactly arm and architecture exactly valhall (not Immortalis), starts on minimal with the reason Mali-G68 class on WebGPU (X-07) when the scene's table has a minimal tier; learned tiers never lift it (as D-03); explicit props still win; a table without minimal keeps the earlier result. None. Done (Farm builder, M4, 2026-09-29): packages/scene-kit/src/quality/core.ts (maliG68ClassOnWebGpu, the adapter strings recorded in its comment); test first in packages/scene-kit/tests/quality/quality.test.ts (the X-07 case); the Farm's tier tests and the B-10 profile expectation in scripts/run-farm-tiering.ts (Tab S9 FE strings now minimal) updated. WebGPU exposes nothing finer, so every Valhall Mali reporting no model name takes this route. Refreshed on the device on 2026-09-30 (M4, evidence/tablet-2026-09-30/tier/): the tablet reports the same strings (WebGPU vendor arm, architecture valhall, device and description blank; WebGL2 ANGLE (ARM, Mali-G68, OpenGL ES 3.2)) and starts on minimal on both backends, equal to classifyDevice on its own probe, with the reason Mali-G68 class on WebGPU (X-07) on WebGPU; evidence/tablet-2026-09-29/tier/ keeps the M3 result (economy) for the old rule.
FARM-008 Advisory for Golden Gate and Foundry Floor (no kit change made): three 0.186.0 keeps the matrices of every instanced mesh with at most 1,024 instances in a uniform buffer declared in that mesh's own vertex shader, so each such mesh compiles its own program or pipeline (lazily, when it first comes into view: the M4 WebGL2 hitches of 100 to 243 ms) and uploads its whole buffer every frame it draws (924 KB a frame on the Farm's minimal tier). If the other scenes show the same, a kit-level version of the Farm's two measures: (1) installInstanceAttributes(renderer) (packages/farm/src/world/instance-attributes.ts: three's documented renderer.debug.onNodeBuilderCreated hook reports no uniform-buffer room to instanced meshes, so three reads their matrices as an instanced attribute; identical images, M4 A/B) with static usage for batches that move rarely; (2) the SPEC 6.4 warm pass (packages/farm/src/world/prewarm.ts: compileAsync per drawable, a few chains at a time, then one unculled frame, before ready). Farm only, in packages/farm. Open (filed 2026-09-29 by the Farm builder, M4) for the coordinator to route; the Farm measurements are in evidence/m4/hitches/README.md.
FF-001 The Foundry Floor builder may serve and connect only on ports 4700-4749 (TASK-FF1). The kit's owned-port helpers in testing/node.ts (serveOwned, assertOwnedUrl, runSceneContractTests, runPerformance) are fixed to 4400-4499: the same need as GG-001. Nothing new: GG-001's optional ports range would serve Foundry Floor too. packages/foundry-floor/tests/tools/owned.ts binds 4700-4749 with the kit's startStaticServer (try-bind; EADDRINUSE moves to the next port; no listener is probed), mirroring Golden Gate's helper. FF1 made no kit change. Done with GG-001 (FF2 builder, 2026-09-30, TASK-FF2 item 5): runSceneContractTests({ ..., ports: { first: 4700, last: 4749 } }). The FF2 contract run on 4700-4749 is recorded in packages/foundry-floor/REPORT.md (FF2) and packages/foundry-floor/evidence/contract/ff2/.
FF-002 Advisory (no kit change made). The kit gives .ks-help-button and .ks-credits-button their pointer events back explicitly, but .ks-joystick and .ks-touch-buttons take them only as direct children of .ks-hud (.ks-hud{pointer-events:none} with .ks-hud>*{pointer-events:auto}, packages/scene-kit/src/ui/styles.tsx). A scene that renders them inside its own full-HUD layer (the GG-007 toolbar pattern) gets a joystick that never receives a touch. Found by the Foundry Floor FF2 phone capture (390x844, touch): the walker moved 0 m under a held joystick until the scene CSS took the events back, then 1.542 m in 1.5 s. Add .ks-joystick,.ks-touch-buttons{pointer-events:auto} beside the help and credits rule, so the touch controls work wherever a scene nests them. packages/foundry-floor/src/scene/Hud.tsx: .ff-hud>.ks-joystick{pointer-events:auto}. Open (filed 2026-09-30 by the Foundry Floor FF2 builder).
FF-003 B-04's callback-failure fixtures (callbackFailureOptions) accept only a cancelled pack.json request (isExpectedCallbackFailureDiagnostic, packages/scene-kit/src/testing/node.ts). The kit calls onBackend and onTier during renderer initialisation while loadPack is still fetching (the two run concurrently by design), so when a scene's pack is still loading at that moment, the fatal error cancels files listed in the pack and the suite counts those cancellations as unexpected diagnostics. Measured on the Foundry Floor campus test build (55 pack tasks: 47 models, 10,076,504 B, and 8 data files): the backend and tier fixtures failed at 18 to 32 of 55 assets loaded and cancelled pack-listed files in 3 of 3 runs each; the graphics, pack and build fixtures cancelled nothing (packages/foundry-floor/evidence/contract/ffc1/callback-probe.json, from tests/tools/callback-probe.ts). The B-04 check then fails on its diagnostics assertion, which runs after all nine cases have passed their own assertions (evidence/contract/ffc1/browser-results.json, both attempts). FF2's smaller pack finished first: its recorded B-04 cases cancelled nothing. For callback fixtures, also treat net::ERR_ABORTED of a file listed in that mount's pack.json (same asset base, same request identity) as expected, as the pack URL already is. None in the scene: a fatal error cancelling the scene's own in-flight pack requests is the kit's intended teardown. The FF-C1 contract run reports B-04 as failing on this rule only. Implemented in current kit: callback fixtures recognize aborted files by the exact pack-listed request URL (testing/node.ts and node-policy tests). The original FF-C1 failure below is historical; current FF3 records report B-04 passing. Recheck failure recovery for each changed release.