Skip to content

PRD-573: Unreal-class performance in release cycles (whole epic) - v1 - #493

Draft
jonit-dev wants to merge 465 commits into
developfrom
docs/unreal-class-epic
Draft

jonit-dev wants to merge 465 commits into
developfrom
docs/unreal-class-epic

Conversation

@jonit-dev

@jonit-dev jonit-dev commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

One PRD and one PR for the whole Unreal-class performance epic (owner order, 2026-10-12).

PRD: docs/PRDs/performance/PRD-573-unreal-class-performance-in-release-cycles.md

In this PR so far:

Gates run: pnpm check:docs exit 0; prose lane 244/244 tests passed; pnpm prd:progress 1/26 phases, 3/60 boxes.

Owner waiver: this PRD has 26 phases, over the 3-phase limit, because the owner asked for one PRD for the epic.

Supersedes #438 and #494.

Snow Heightfield validation (2026-10-16)

Fresh read-only judge: NEUTRAL in both native and both browser comparisons; no visible regression. Native pair 2 differs by one simulation tick, limiting exact contact-state equivalence. Four native runs passed eight logical assertions plus the separately evaluated unchanged pixel guard; four browser runs passed the original footsteps scenario.

Five valid hardware pairs reduced render P50 by 31.3–33.6 ms, exceeding the measured 8.0 ms A/A noise band. The original tail-latency gate still fails; private Xvfb does not qualify release FPS or end-to-end performance. Focused repaired template contracts: 119/119 passed. Full template/native matrix and release qualification remain open.

Snow native-compare1: BEFORE / AFTER

Snow native-compare2: BEFORE / AFTER

Snow browser-compare1: BEFORE / AFTER

Snow browser-compare2: BEFORE / AFTER

Raw capture hashes.

jonit-dev added a commit that referenced this pull request Oct 12, 2026
Owner order 2026-10-12: one PRD and one PR (#493) for the whole epic.
docs/PRDs/performance/PRD-573-unreal-class-performance-in-release-cycles.md
replaces the epic folder (README, ROADMAP, PRD-573..578). Phases are the
release cycles v1..v5, each with its KPI and stability gate as boxes; v1
phases are the slices from the slice plan (0 charter, ticked; 0b CI scope;
1 core fixes; 2a..8) plus the scorecard. No inbound links existed.
@jonit-dev jonit-dev changed the title docs(prd): Unreal-class performance epic as release cycles PRD-573: Unreal-class performance in release cycles (whole epic) Oct 12, 2026
@jonit-dev jonit-dev added the prd:25% PRD phase 1 verified label Oct 12, 2026
@jonit-dev
jonit-dev marked this pull request as draft October 12, 2026 04:32
@jonit-dev jonit-dev changed the title PRD-573: Unreal-class performance in release cycles (whole epic) PRD-573: Unreal-class performance in release cycles (whole epic) - v1 Oct 12, 2026
@jonit-dev

Copy link
Copy Markdown
Contributor Author

PRD-573 v1.11: native engine skinning fix (visual judge: IMPROVEMENT)

On R5 the native arm drew the 50 foxes in bind pose: the SkinnedMesh binding kept skeleton, bindMatrix and bindMatrixInverse read-only, so core's projection copy dropped them. Red-green: native_engine_v8_skeletal.

BEFORE (native) AFTER (native) LEGACY (reference)

A fresh read-only judge compared 2 runs per arm: the foxes now match the legacy poses, with no artifacts and no change outside the foxes.

KPI progress chart (legacy ÷ native CPU per bench point, target 2×):

@jonit-dev

Copy link
Copy Markdown
Contributor Author

PRD-573 v1.11 step 3: host projection (visual judge: PASS)

The native renderer batches the source scene itself; core's JS mirror is skipped. R5@4096 projection phase 8.0 → 0.57 ms; thread CPU without present legacy 12.87 ms vs native 7.65 ms (rounds 1.63×, 2.26×, 1.90×, host loaded).

BEFORE (JS mirror) AFTER (host projection) LEGACY

Picture identical BEFORE vs AFTER (judge PASS, 2 runs). Open before any KPI claim: a fairness audit of the 21k-triangle gap vs legacy.

…er-frame record work

On the native player core's beforeRender restored its projected cull before the C++ draw ran, so
sub-pixel meshes were hidden and shown again without effect. The player now holds the restore until
its draw ends. Reflection passes skip skeletons the main pass already posed; a nested mesh finds its
record by object id; a mesh outside every frustum keeps its record and builds nothing; a keyframe
track whose keyframes are all equal reads its first keyframe.

Tier-1 Midway desktop flights (one flight each, last 1,000 frames, parity PASS): main-thread
instructions per frame 22,899 K (winner) -> 21,068 K (-8.0%). Tier 2 (three isolated pairs and
visual judge) still owed. Five native-engine ctests (animation mixer/events/property tracks,
render_skinned, skinned_crowd_cpu) fail on HEAD as well; not caused by this change.
…hread

With a GPU thread, GpuResources::writeTexture copied every changed HUD frame (a full-screen RGBA
image) into a new vector on the main thread before posting the queue write. Midway's HUD changes
every frame, so that copy and its allocation were about 4% of the main thread's cycles. The overlay
upload now posts the web view's own pixels: a UI frame stays valid until the next uiOverlayFrame
call, which the player makes only after the GPU thread's wait.

The warm-batches ctest now bounds record builds by one per cube: since the frustum early-out a cube
no camera has held builds no record.

Tier 1 (one Midway desktop flight, last 1,000 frames, parity PASS): 21,068 K -> 20,845 K main-thread
instructions per frame (-1.1%; memcpy is few instructions per byte, so cycles fall more). Full engine
ctest with all test targets built: 388/397; the 9 failures are labelled known-red/perf or the
pre-existing target_graph check.
…GPU thread before UI detach

TN_PLAYER_FRAME gains cpuFrameKCycles beside cpuFrameKInstructions, over the same window with the
same present exclusion, and the Midway dashboard reports its median. Instructions undercount
memory-bound work (one rep movsb moves kilobytes; a cache miss retires nothing), so a cut that
removes copies or misses shows in cycles, not in instructions.

At shutdown the player now waits for the GPU thread before detaching the UI: a posted overlay upload
reads the UI frame that detaching frees.

Checks: native_engine_player and animation ctests 35/35; midway-dashboard spec 40/40.
Exclude incompatible historical CPU references, parse successful runner reports, and prove browser flag forwarding. Restore the unchanged engine after the shared-seek candidate fails its second instruction probe. Add the missing existing WASM boot workspace lock importer so frozen installs succeed.
Add private TRS write tracking and sticky fallback for raw aliases, matrix views and numeric address borrows; admit fresh V8 model clones and cover native mutation paths. No cache consumes metadata yet and no performance win or AC3 completion is claimed.

Validation: five focused V8 math/matrix/GC cases pass; native-writer focused checks 11/11; numeric-address checks 6/6; final alias refinements rerun js_math_views/native_matrix_world successfully. Focused Biome passes with two existing warnings. Physics runtime and new-player flight unverified. Internal _a/_o descriptor replacement/deletion now rejects; normal assignment and raw array writes remain supported.
@jonit-dev
jonit-dev marked this pull request as draft October 16, 2026 01:54
…priteNodeMaterial (PRD-620)

- SpriteNodeMaterial takes node slots (positionNode, colorNode, opacityNode...) on the V8 adapter, plus
  scaleNode and rotationNode, which the sprite program lowers (scale over the model scale, rotation over the material's).
- Loop gets a node start and a numeric update step (condition "<"): the particle bounds reduction strides by LANES.
- uniform(value, "uint") makes a typed uniform; mod(vec2, float) widens the scalar; compute nodes carry isComputeNode.
- MaterialNodes grew two slots: RenderDatabase's graph root list now follows pointers() with a static_assert.
- catalog.json gains the CatmullRomCurve3.computeFrenetFrames member the registry already bound.
Tests: player-compute-ops (sprite scale/rotation pixel rows, stepped loop, typed uniform, mod) and storage.spec.ts.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

critical prd:25% PRD phase 1 verified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant