Skip to content

test(playtest): add PRD-564 resolution measurement gate - #489

Draft
jonit-dev wants to merge 3 commits into
developfrom
perf/prd564-resolution-subrect
Draft

jonit-dev wants to merge 3 commits into
developfrom
perf/prd564-resolution-subrect

Conversation

@jonit-dev

Copy link
Copy Markdown
Contributor

Adds a measurement-only harness for PRD-564, where resolution changes may recreate render targets and pipelines. It reuses the authored starter bootstrap, checks actual runtime/adapter identity, records first-frame and following-window census data, and computes a fail-closed gate. Runtime optimization is not implemented.

Validation: 53 nearest probe/startup-ready tests and playtest TypeScript previously passed; current whole-repository lint passes. Normal pre-push agents/docs/lint/drift checks passed; these do not prove runtime behavior. A prior hardware preflight passed functional checks only on named NVIDIA Turing at pinned scale 1. The current full measurement reached its 240-second deadline with 0/3 contexts and 0/9 steps completed, no gate verdict, and unqualified host timing. Descriptor byte sums are not physical memory measurements.

The separate lint repair preserves the donor's fixed public/math-schema property names through an exact-file naming override. Isolated containment checks passed, while nonallowlisted names and other paths remain checked. Donor source is unchanged.

Progress remains 0%. No optimization, native parity, cost improvement or visual verdict is claimed. Visual comparisons/judging remain open; draft/skipped CI is not a passing runtime qualification.

TL;DR — ResolutionScaler (packages/core/src/resolution-scaler.ts) picks one of 10 rungs, from 1.0 to 0.23. Its own comments say why the rungs are coarse: "every step reallocates render targets on WebGPU, and fine granularity buys smoothness with hitches" (:20-24), and "the resize reallocates every render target, which rebuilds pipelines" (:72-73).

0% by the PRD's own boxes: 0/3 phases (0/5 boxes), 0/2 acceptance criteria. PRD: docs/PRDs/unreal-source-borrowing/PRD-564-the-resolution-scale-changes-without-reallocating-a-target.md.

Phases

Phase 1: Price the resize — 0/1

  • Three forced steps (1.0 → 0.85 → 0.61 → 1.0) on the starter record the step frame, the next 30 frames, pipelines built and bytes reallocated, over 3 runs. proof: node packages/playtest/dist/runner/cli.js perf on the scenario, results under ## Decisions with the continue or decline call.

Phase 2: Draw into the sub-rectangle — 0/2

  • A scale change sets the scene pass viewport and scissor and allocates nothing; a canvas resize still reallocates once. proof: red-green pnpm exec vitest run packages/core/__tests__/renderer*.spec.ts with an allocation-counting renderer stub.
  • Each built-in chain stage samples inside the sub-rectangle, and a stage without support reports refused and keeps the reallocation path. proof: red-green chain spec, one case per stage in RENDER_CHAIN_STAGE_ORDER.

Phase 3: Finer steps and native — 0/2

  • The controller takes continuous fractions (quantized to 8 px, 2% threshold, at least 8 frames apart, amortized up-steps), and PRD-384's existing scaler suites still pass. proof: red-green pnpm exec vitest run packages/core/__tests__/resolution-scaler*.spec.ts.
  • The native desktop host draws the same sub-rectangle frame as the browser. proof: pnpm parity --target desktop --only-tests resolution-subrect.

Acceptance criteria

  • AC-1 [local]: On the starter in browser WebGPU (RTX 2080), a forced scale step allocates no texture and builds no pipeline, and the step frame stays within the window's p95. proof: node packages/playtest/dist/runner/cli.js perf with a forced-step scenario, TN_FRAME_BUDGET and the pipeline census. — Evidence: pending.
  • AC-2 [local]: A frame at scale 0.72 through the sub-rectangle matches the same frame through today's reallocation path within the visual gate's threshold. proof: pnpm visuals:ab. — Evidence: pending.

Still open

  • Phase 1: Price the resize: Three forced steps (1.0 → 0.85 → 0.61 → 1.0) on the starter record the step frame, the next 30 frames, pipelines built and bytes reallocated, over 3 runs. proof: node packages/playtest/dist/runner/cli.js perf on the scenario, results under ## Decisions with the continue or decline call.
  • Phase 2: Draw into the sub-rectangle: A scale change sets the scene pass viewport and scissor and allocates nothing; a canvas resize still reallocates once. proof: red-green pnpm exec vitest run packages/core/__tests__/renderer*.spec.ts with an allocation-counting renderer stub.
  • Phase 2: Draw into the sub-rectangle: Each built-in chain stage samples inside the sub-rectangle, and a stage without support reports refused and keeps the reallocation path. proof: red-green chain spec, one case per stage in RENDER_CHAIN_STAGE_ORDER.
  • Phase 3: Finer steps and native: The controller takes continuous fractions (quantized to 8 px, 2% threshold, at least 8 frames apart, amortized up-steps), and PRD-384's existing scaler suites still pass. proof: red-green pnpm exec vitest run packages/core/__tests__/resolution-scaler*.spec.ts.
  • Phase 3: Finer steps and native: The native desktop host draws the same sub-rectangle frame as the browser. proof: pnpm parity --target desktop --only-tests resolution-subrect.
  • Acceptance Criteria: AC-1 [local]: On the starter in browser WebGPU (RTX 2080), a forced scale step allocates no texture and builds no pipeline, and the step frame stays within the window's p95. proof: node packages/playtest/dist/runner/cli.js perf with a forced-step scenario, TN_FRAME_BUDGET and the pipeline census. — Evidence: pending.
  • Acceptance Criteria: AC-2 [local]: A frame at scale 0.72 through the sub-rectangle matches the same frame through today's reallocation path within the visual gate's threshold. proof: pnpm visuals:ab. — Evidence: pending.

Generated from the PRD's checkboxes. Regenerate on each push so the PR and the PRD never disagree.

@jonit-dev jonit-dev added the prd:0% No verified implementation phase complete label Oct 11, 2026

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

prd:0% No verified implementation phase complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant