Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ node_modules/
.npmrc
dist/
dist-native/
# A build writes `<artifact>.build-report.json` beside the artifact; it measures one machine's
# bytes, so tracking it only re-dirties the tree.
*.build-report.json
# The locally assembled native payload and its scoped lock, regenerated by `pnpm release:native`.
/release-native/
.threenative/
Expand Down
380 changes: 380 additions & 0 deletions docs/PRDs/done/PRD-495-junk-audit-2026-10-04-cleanup.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations are recorded.
evidence.
- [CONFLICTS](strategy/CONFLICTS.md) records decisions where strategy and the binding document
disagree.
- [Latest round ledger](verification/round-10-2026-08-16.md) gives the current self-improvement
- [Latest round ledger](verification/round-14-2026-09-04.md) gives the current self-improvement
state. The [Studio hosting series](PRDs/studio-hosting/README.md) describes the proposed
container, session broker, and production path — for the private Studio repository, not this one.
- [Engine-load comparison](verification/runtime-perf-state.md#prd-117-browser-comparison-2026-08-14)
Expand Down Expand Up @@ -77,7 +77,7 @@ recorded in builder sessions, and the defect shapes reviewers keep re-finding.

A round ledger records one self-improvement round's inputs, decisions, evidence, and resulting
state. `pnpm round:next` resumes from the latest ledger, and `pnpm round:deletions` reports
persistent unused-export evidence. The [newest ledger is round 12](verification/round-12-close-2026-08-22.md);
persistent unused-export evidence. The [newest ledger is round 14](verification/round-14-2026-09-04.md);
[the earlier rounds](verification/) sit beside it.

## Benchmark
Expand Down
Binary file not shown.
Binary file removed docs/product/ThreeNative_Product_Playbook.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/verification/PRD-289-conventions-2026-08-31.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ table, reads each template's `AGENTS.md`, and checks the TypeScript AST for the
| rts | N/A — every unit is placed by the simulation at its own ground height, so there is no rendered body to keep on a floor | N/A — every model is procedural in metres already, so no authored asset needs normalising | N/A — the template has no held object or character hand | N/A — no skinned or animated asset is loaded |
| runner | `src/conventions.ts:19` | `src/conventions.ts:18` | N/A — the runner carries nothing and has no character hand | N/A — the jump is an authored arc, not an AnimationClip |
| sailing | N/A — the ship is waterborne and uses buoyancy, not floor grounding | `src/conventions.ts:9` | N/A — the template has no held object or character hand | N/A — no skinned or animated asset is loaded |
| shooter | N/A — the soldier's floor contact is measured against the town's own collider boxes, and a corpse is settled onto the deck it fell on | `src/entities/Enemy.ts:863` | `src/entities/Enemy.ts:869` | `src/entities/Rifle.ts:121` |
| shooter | N/A — the soldier's floor contact is measured against the town's own collider boxes, and a corpse is settled onto the deck it fell on | `src/entities/Enemy.ts:848` | `src/entities/Enemy.ts:854` | `src/entities/Rifle.ts:121` |
| snow | N/A — the procedural explorer plants each boot on the canonical snow surface (`src/entities/Explorer.ts`), and no authored model is grounded | N/A — every body is built from primitives in metres; no authored model is loaded | N/A — the template has no held object | N/A — the gait is procedural IK, not an AnimationClip |
| starter | `src/conventions.ts:15` | `src/conventions.ts:14` | N/A — the template has no held object or character hand | N/A — the native proof asset is static and has no AnimationClip |
| tower-defense | N/A — every tower, walker and pad is placed by the simulation at ground level, so there is no rendered body to keep on a floor | N/A — every model is procedural in metres already, so no authored asset needs normalising | N/A — the template has no held object or character hand | N/A — no skinned or animated asset is loaded |
Expand Down
20 changes: 10 additions & 10 deletions docs/verification/native-runtime-census-2026-08-16.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ considered, and a KEEP/DELETE verdict.

| Counted area | Lines | Owner | Live proof or caller | Alternative considered | Verdict |
| --- | ---: | --- | --- | --- | --- |
| `src/` | 57,757 | PRD-045, PRD-047, PRD-048, PRD-050, PRD-053, PRD-116, PRD-143, PRD-153, PRD-154, PRD-155, PRD-292 | `src/physics/native_bindings.cpp:586`; desktop V8 and native runtime commands | Move host shims into each game or delete the native host | **KEEP** — this is the owned native host and its physics boundary. |
| `conformance/` | 9,477 | PRD-053, PRD-054, PRD-055, PRD-076 | `conformance/run-conformance.mjs`; root `pnpm parity` | Replace cross-target registry/proofs with untested per-game scripts | **KEEP** — shared executable conformance evidence. |
| `tests/` | 57,859 | PRD-045, PRD-046, PRD-048, PRD-049, PRD-050, PRD-053, PRD-054, PRD-055, PRD-076, PRD-116, PRD-127, PRD-143, PRD-153, PRD-154, PRD-155, PRD-292 | `tests/physics_actuation_bindings_test.cpp:141`; runtime-native Vitest and native tests | Delete fail-closed tests to reduce the trigger | **KEEP** — removal would conceal regressions. |
| `src/` | 57,863 | PRD-045, PRD-047, PRD-048, PRD-050, PRD-053, PRD-116, PRD-143, PRD-153, PRD-154, PRD-155, PRD-292 | `src/physics/native_bindings.cpp:586`; desktop V8 and native runtime commands | Move host shims into each game or delete the native host | **KEEP** — this is the owned native host and its physics boundary. |
| `conformance/` | 9,517 | PRD-053, PRD-054, PRD-055, PRD-076 | `conformance/run-conformance.mjs`; root `pnpm parity` | Replace cross-target registry/proofs with untested per-game scripts | **KEEP** — shared executable conformance evidence. |
| `tests/` | 58,508 | PRD-045, PRD-046, PRD-048, PRD-049, PRD-050, PRD-053, PRD-054, PRD-055, PRD-076, PRD-116, PRD-127, PRD-143, PRD-153, PRD-154, PRD-155, PRD-292 | `tests/physics_actuation_bindings_test.cpp:141`; runtime-native Vitest and native tests | Delete fail-closed tests to reduce the trigger | **KEEP** — removal would conceal regressions. |
| `__tests__/` | 936 | PRD-228 | `__tests__/host-gap-gpu-drain.spec.ts`; the runtime-native Vitest suite via `vitest.config.ts` | Fold it into `tests/`, where every other spec in this package lives | **KEEP** — it is one source-reading spec proving the GPU-drain profile stays diagnostic-only and never ships, and it is picked up by the same suite either way. Its one-file directory is an accident of where it landed, not a design; moving it into `tests/` is a tidy-up and not this row's argument. |
| `scripts/` | 30,902 | PRD-045, PRD-048, PRD-049, PRD-050, PRD-053, PRD-054, PRD-116, PRD-127, PRD-153, PRD-155, PRD-292 | `scripts/verify-desktop-physics.mjs:206-228`; build, platform, and device-condition verifiers | Make every game own packaging, device, and verifier orchestration | **KEEP** — no smaller shared alternative preserves the proof. |
| `scripts/` | 30,901 | PRD-045, PRD-048, PRD-049, PRD-050, PRD-053, PRD-054, PRD-116, PRD-127, PRD-153, PRD-155, PRD-292 | `scripts/verify-desktop-physics.mjs:206-228`; build, platform, and device-condition verifiers | Make every game own packaging, device, and verifier orchestration | **KEEP** — no smaller shared alternative preserves the proof. |
| `scenarios/` | 109 | PRD-217 | `scenarios/starter-ui-overlay-desktop.playtest.json`; run by the hosted `native-platforms` desktop-core job through `scripts/verify-starter-ui-overlay.mjs` | Keep the starter-HUD input assertion inside the desktop-core job script instead of a standalone scenario file | **KEEP** — the scenario is the portable playtest that proves the starter HUD receives real input on the packed desktop runtime; the hosted desktop-core job is its caller, so the area is one owned proof rather than reusable game content. |
| `include/` | 6,091 | PRD-046, PRD-047, PRD-053, PRD-116, PRD-143, PRD-153, PRD-292 | `include/threenative/physics_native.h:131`; C ABI consumed at `src/physics/native_bindings.cpp:586` | Add per-game native headers or remove the native C boundary | **KEEP** — the coarse host ABI is the shared boundary. |
| `android/` | 3,187 | PRD-045, PRD-048, PRD-050, PRD-053, PRD-054, PRD-153 | Android host sources and `scripts/verify-android-physics-parity.mjs` | Require each game to rebuild Android lifecycle and transport | **KEEP** — required Android packaging and execution plumbing. |
| `include/` | 6,118 | PRD-046, PRD-047, PRD-053, PRD-116, PRD-143, PRD-153, PRD-292 | `include/threenative/physics_native.h:131`; C ABI consumed at `src/physics/native_bindings.cpp:586` | Add per-game native headers or remove the native C boundary | **KEEP** — the coarse host ABI is the shared boundary. |
| `android/` | 1,814 | PRD-045, PRD-048, PRD-050, PRD-053, PRD-054, PRD-153 | Android host sources and `scripts/verify-android-physics-parity.mjs` | Require each game to rebuild Android lifecycle and transport | **KEEP** — required Android packaging and execution plumbing. |
| `native/` | 8,580 | PRD-046, PRD-049, PRD-116, PRD-143, PRD-292 | `native/physics/src/lib.rs:463`; `native/physics/tests/actuation.rs:324` | Use the web WASM/Rapier backend on native or move physics into games | **KEEP** — this is the native Rust implementation behind the shared API. |
| Root `CMakeLists.txt` | 2,759 | PRD-047, PRD-048, PRD-050 | `pnpm native:build`; explicit binding target build | Make every game own native dependency discovery and linking | **KEEP** — opt-in host build configuration. |
| Root `CMakeLists.txt` | 2,802 | PRD-047, PRD-048, PRD-050 | `pnpm native:build`; explicit binding target build | Make every game own native dependency discovery and linking | **KEEP** — opt-in host build configuration. |
| `cmake/` | 328 | PRD-047, PRD-048, PRD-050 | Root CMake configuration includes these platform modules | Duplicate compiler/platform rules in each game | **KEEP** — shared build modules. |
| `CMakePresets.json` | 141 | PRD-047, PRD-048, PRD-050 | `tn-linux` preset used by the native build and binding target | Remove declared presets and use undocumented local flags | **KEEP** — reproducible host presets. |
| `ios/` | 598 | PRD-045, PRD-048, PRD-049, PRD-050, PRD-153 | `scripts/verify-ios-simulator.mjs` and iOS host sources | Make each game own iOS packaging and simulator lifecycle | **KEEP** — shared iOS packaging boundary; this lane made no iOS execution claim. |
| `package.json` | 106 | PRD-048, PRD-050, PRD-054, PRD-116 | `native:build`, `native:physics:parity`, and `native:verify:desktop` scripts | Hide opt-in native commands in per-game manifests | **KEEP** — package-level command contract. |
| `package.json` | 107 | PRD-048, PRD-050, PRD-054, PRD-116 | `native:build`, `native:physics:parity`, and `native:verify:desktop` scripts | Hide opt-in native commands in per-game manifests | **KEEP** — package-level command contract. |
| `vitest.config.ts` | 10 | PRD-048, PRD-050 | Runtime-native Vitest command and parity producer | Drop native package test collection | **KEEP** — declares the native package test boundary. |
| `tools/` | 145 | PRD-077 | `conformance/desktop-touch.mjs` → `threenative-uinput-touch`, built by the `CMakeLists.txt` target of the same name | Write the injector in Node, or take an npm addon, or shell out to `python3` | **KEEP, and it cannot be smaller.** Creating a `uinput` device is a sequence of ioctls and Node exposes none, so the alternatives are a new native harness dependency rebuilt per Node version, or a Python toolchain this repository does not otherwise have. This owns only the ioctls and the device's lifetime — every event is encoded in JavaScript where a test can assert two `ABS_MT_SLOT` groups precede one `SYN_REPORT`. Linux-only by construction. |
| `shim-manifest.json` | 61 | PRD-215 | `scripts/check-native-shims.ts` from `pnpm budgets`; native host installs in `src/runtime.cpp` and `src/webgpu/bindings.cpp` | Keep the native-global contract as prose only in `AGENTS.md` | **KEEP** — machine-readable shim evidence is the enforced web/native boundary. |
| `js-engine-versions.json` | 38 | PRD-222 | `tests/js-engine-version-skew.test.mjs`; `scripts/download-deps.mjs` consumes the pinned engine versions | Leave engine/version compatibility as prose or duplicate pins across download scripts | **KEEP** — one fail-closed manifest prevents desktop, Android, and iOS engine pins from drifting silently. |
| `build-matrix.json` | 231 | PRD-235 | `scripts/check-build-matrix.ts` from `scripts/check-budgets.ts:467` via `pnpm budgets`; proven by `scripts/__tests__/check-build-matrix.spec.ts` | Leave "which build directory does this test executable live in" as prose in `AGENTS.md` and tribal knowledge | **KEEP** — the prose answer was already wrong once: a contract test that only links in `build/tn-linux` is invisible to anyone reading `CMakeLists.txt`. This is the machine-readable contract, and the gate cross-checks every preset, cache variable, and test executable it names against CMake, so either side drifting is a named failure. |
| `build-matrix.json` | 238 | PRD-235 | `scripts/check-build-matrix.ts` from `scripts/check-budgets.ts:467` via `pnpm budgets`; proven by `scripts/__tests__/check-build-matrix.spec.ts` | Leave "which build directory does this test executable live in" as prose in `AGENTS.md` and tribal knowledge | **KEEP** — the prose answer was already wrong once: a contract test that only links in `build/tn-linux` is invisible to anyone reading `CMakeLists.txt`. This is the machine-readable contract, and the gate cross-checks every preset, cache variable, and test executable it names against CMake, so either side drifting is a named failure. |
| `native-deps.lock.json` | 1,050 | PRD-059 | `scripts/download-deps.mjs` reads it before any acquisition; `tests/dependency-provenance.test.mjs` proves lock coverage | Leave dependency URLs/versions/hashes as inline mutable code in `download-deps.mjs` | **KEEP** — the reviewed immutable payload matrix is what makes reconstruction mean the same bytes; inline authority already served one 404. |
| **Total** | **180,365** | | `pnpm budgets` current measurement | | **No area rejected.** |
| **Total** | **179,864** | | `pnpm budgets` current measurement | | **No area rejected.** |

**Regenerated 2026-09-02 for PRD-292 recovery:** the native physics ABI, its contract test, and
the continuous-collision measurement harness changed the counted `src/`, `include/`, `tests/`,
Expand Down
16 changes: 0 additions & 16 deletions examples/abyss-framework/dist.build-report.json

This file was deleted.

30 changes: 0 additions & 30 deletions examples/abyss-framework/src/entities/Crate.ts

This file was deleted.

36 changes: 0 additions & 36 deletions examples/abyss-framework/src/entities/Player.ts

This file was deleted.

1 change: 0 additions & 1 deletion examples/native-cpu-load-test/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ async function run(): Promise<IProfileResult> {
const removed = meshes[2] as Mesh;
const reparented = meshes[3] as Mesh;
const removedParent = removed.parent;
const reparentHome = reparented.parent;
const relocated = new Group();
relocated.position.set(0, 500, 0);
scene.add(relocated);
Expand Down
6 changes: 0 additions & 6 deletions examples/quarry/src/quarry/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { floorHeight } from "./terrain.js";
export const EYE_HEIGHT = 1.7;
/** Frames the route takes end to end at the game's fixed 1/60 step: thirty seconds of walking. */
export const ROUTE_FRAMES = 1800;
/** Discarded before anything is measured: first-frame compiles and uploads are not the walk. */
export const ROUTE_WARMUP_FRAMES = 90;
/** How close the walk's last frame stands to the rock. */
export const CONTACT_DISTANCE = 0.4;

Expand All @@ -31,8 +29,6 @@ export const ROUTE_MARKS = [
{ frame: 1740, label: "contact" },
] as const;

export type RouteMark = (typeof ROUTE_MARKS)[number]["label"];

/**
* Ground-plane control points, walked in order. The final point is placed against the rock rather
* than at an authored z, because the face is generated and an authored number would be measuring a
Expand Down Expand Up @@ -98,5 +94,3 @@ export function routePose(frameIndex: number): IRoutePose {
return { position, target: [position[0], position[1], position[2] - 1] };
return { position, target };
}

export const ROUTE_LENGTH_METRES = path.totalLength;
1 change: 0 additions & 1 deletion examples/vfx-gallery/src/render/archivePresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export type ArchiveLayer = {

type PresetFactory = (position: ArchiveVec3) => ArchiveLayer[];

const FIRE_SPRITE_TEXTURE = "fire";
const SMOKE_SPRITE_TEXTURE = "smoke";
const GLOW_SPRITE_TEXTURE = "glow";

Expand Down
4 changes: 0 additions & 4 deletions packages/assets/src/passes/audio-pcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ function sampleReaderFor(format: number, bits: number): SampleReader | undefined
return undefined;
}

/** Vorbis VBR quality, the same -1 to 10 scale the reference encoder takes. */
export const MIN_QUALITY = -1;
export const MAX_QUALITY = 10;

/**
* Encodes PCM to Ogg Vorbis with a serial number derived from the asset's own path.
*
Expand Down
2 changes: 0 additions & 2 deletions packages/core/__tests__/world-tiles-cost.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ describe("TerrainTiles settled-frame cost", () => {
attributeReads += attributes.mock.calls.length - before;
}
attributes.mockRestore();
// eslint-disable-next-line no-console
console.log(
`TerrainTiles 6 s walk: ${perCall.toFixed(3)} ms per follow()+process(), ` +
`${(attributeReads / frames).toFixed(0)} getAttribute a frame, ` +
Expand Down Expand Up @@ -430,7 +429,6 @@ describe("TerrainTiles settled-frame cost", () => {
tiles.process();
}
const perCall = (performance.now() - started) / 100;
// eslint-disable-next-line no-console
console.log(
`TerrainTiles settled 289-tile ring: ${perCall.toFixed(3)} ms per follow()+process()`,
);
Expand Down
Loading
Loading