From 0b58be307a45030d1f8e27c7f12e9279c584d97f Mon Sep 17 00:00:00 2001 From: Niklas Gorman Date: Mon, 24 Aug 2026 17:22:59 +0200 Subject: [PATCH] chore: remove the quality-tier API nothing drives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #128. Adaptive quality is not planned, so per that issue's decision the dead API goes rather than being wired. setQualityTier() and placementCount had no callers anywhere in src, tests or scripts, and neither was on the SceneRenderer interface, so nothing could reach them polymorphically either. #qualityTier was initialised to "high" and never changed, which meant the tier path in the renderer never executed. Left as-is that is worse than no API: a reader finding setQualityTier() reasonably concludes quality adapts, and placementCount documented two consumers — tests and a diagnostics overlay — that do not exist. The tier machinery underneath is real and stays. Every asset declares a minimumQualityTier, buildSceneLayers filters on it, and tierAllows is tested as a pure function; callers just always pass "high". That is now an explicitly named constant with the reasoning attached, so whoever wires adaptation later finds the filtering already built and only needs something that decides a tier. Also drops "quality tiers" from the delivered-properties list in docs/decisions.md, so the record matches the code. The mention in docs/baseline/README.md stays: that is a field to record when benchmarking, not a claim that adaptation works. The Pixi visual guard confirms the frames are byte-identical, which is the expected result of changing how an unchanged value reaches the layer factory. Co-Authored-By: Claude Opus 5 --- docs/decisions.md | 4 ++-- src/render/pixi-renderer.ts | 31 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index 40d3c09..3498b18 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -249,8 +249,8 @@ A mechanic or site is migrated only when: - exact or epsilon numerical and event checkpoints pass; - save/load and pause/resume preserve the state; - keyboard and touch intents produce equivalent authoritative actions; -- the PixiJS scene has camera culling, bounded allocations, quality tiers, and - no whole-screen effect at an unmeasured resolution; +- the PixiJS scene has camera culling, bounded allocations, and no + whole-screen effect at an unmeasured resolution; - interactive controls and critical status have accessible, localizable, non-canvas representations; - every warning has visual equivalence, semantic audio priority, and diff --git a/src/render/pixi-renderer.ts b/src/render/pixi-renderer.ts index f54a2fd..c326358 100644 --- a/src/render/pixi-renderer.ts +++ b/src/render/pixi-renderer.ts @@ -21,6 +21,20 @@ const SITE_ID = "wreck"; // RESYNC_DISTANCE_M, so the margin has to exceed that or content can enter the // frame during the gap between syncs. const CULL_MARGIN_M = 10; + +// Issue #128: adaptive quality is not planned, so this never varies. +// +// The tier machinery underneath is real — every asset declares a +// `minimumQualityTier` and `buildSceneLayers` filters on it — but nothing ever +// chose a tier. `setQualityTier()` and `placementCount` were removed rather +// than left in place, because an API that advertises adaptive quality while +// the value is pinned is worse than no API: it reads as a working feature. +// +// Wiring it later means adding something that decides the tier (a frame +// budget, a device-capability probe, or a user setting), putting the setter on +// SceneRenderer, and replacing this constant. The filtering is already there +// and tested. +const QUALITY_TIER: QualityTier = "high"; const RESYNC_DISTANCE_M = 4; export class PixiWreckRenderer implements SceneRenderer { @@ -41,7 +55,6 @@ export class PixiWreckRenderer implements SceneRenderer { #markerPool: Graphics[] = []; #activeMarkers: Graphics[] = []; #lastSyncFocus: { x: number; y: number } | null = null; - #qualityTier: QualityTier = "high"; async mount(host: HTMLElement): Promise { if (this.#app) { @@ -153,20 +166,6 @@ export class PixiWreckRenderer implements SceneRenderer { this.#lastSyncFocus = null; } - /** Quality tier drops decoration before anything a diver navigates by. */ - setQualityTier(tier: QualityTier): void { - if (tier === this.#qualityTier) { - return; - } - this.#qualityTier = tier; - this.#lastSyncFocus = null; - } - - /** Visible placement count, for tests and the diagnostics overlay. */ - get placementCount(): number { - return this.#activeMarkers.length; - } - #syncSceneLayers(camera: CameraTransform, force: boolean): void { const focus = camera.focus; if ( @@ -190,7 +189,7 @@ export class PixiWreckRenderer implements SceneRenderer { const { halfWidthM, halfHeightM } = visibleHalfExtentM(camera); const layers = buildSceneLayers(SITE_ID, { - qualityTier: this.#qualityTier, + qualityTier: QUALITY_TIER, cullMarginM: CULL_MARGIN_M, camera: { leftM: focus.x - halfWidthM,