PrivatefloorPrivatefloorPrivatefloorPrivatelastPrivateceilingPrivateceilingPrivateceilingPrivatepunishedPrivatelastPrivate ReadonlyconfigCurrent escalation level (0 = no active streak); for logs/tests.
The current operating ceiling, or null when not demoted (the caller then uses the live native DPR). By design the only demoted value is exactly 1.0 — a principled Schelling point (CSS-pixel resolution, what every 1x display renders), not a hunted estimate.
Punished ascents accumulated toward demotion; for logs/tests.
Whether a proposed scale-down target is blocked by the floor.
The to-or-below early-return (rather than clamping to the floor) is load-bearing: after a rejection the next proposed step lands at exactly the floored value, and clamping would re-fire the same failing probe every evaluation tick — the TTL would never get a chance to expire.
Record a rejected probe: tighten the floor to the probed DPR.
A rejection at (approximately) the same DPR as the previous one is the same experiment failing again — escalate the TTL. A rejection at a different DPR is new evidence and restarts the ladder.
the TTL applied, ms (for logging)
Record an accepted probe: the current regime responds to DPR reduction after all, so the rejection streak is stale evidence.
Let an expired floor decay back to minDPR. Returns true when the floor actually lifted (callers log on that edge). The escalation streak SURVIVES expiry — that memory is what makes the next identical rejection back off harder.
Record a scale-up that moved the DPR above 1.0. If FPS collapses shortly after, recordSlowSample() counts it as a punished ascent.
A previous ascent still on record here has, by construction, outlived its punishment window without a slow sample — evidence the scene CAN sustain above-1.0, so the punishment tally is stale and resets. Without this the count is a lifetime tally and two isolated hiccups minutes apart would demote a perfectly HiDPI-capable scene.
Record a below-down-threshold FPS sample (callers must NOT feed load-suppressed samples — load jank is not the ascent's fault). If it lands within the punishment window of a recorded ascent, the ascent is punished; at the configured threshold the ceiling demotes to 1.0 with a (backed-off) TTL.
true when the demotion happened on THIS call — the caller then clamps its operating DPR to 1.0 in one step.
Demote the ceiling to 1.0 directly on outside evidence (sustained sub-throttle distress — FPS too low to be any real display throttle), bypassing the punished-ascent tally: the scene has already proven it can't afford the above-1.0 luxury without any ascent experiment. Same TTL/backoff ladder as an earned demotion — a scene that keeps re-earning it holds it longer each time.
the TTL applied, ms (for logging)
Lift an expired ceiling demotion. The backoff level SURVIVES — a scene that keeps re-earning the demotion holds it longer each time. Returns true when the ceiling actually lifted.
Scene content changed: pull the floor's and ceiling's expiry
forward to at most recheckMs from now and reset the escalation
streaks — the old evidence described different content.
Forget everything learned (disable, native-DPR change).
Lowest DPR scale-down will currently accept.