Skip to content

Report measured display-criteria settle times and name the switch's ordering - #279

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/display-settle-timing
Aug 2, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/display-settle-timing

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

The Stage 2 settle logs summed startGrace.ticks * 10 + stage2Ticks * 50. The first term is Stage 1's blind-poll budget, not the time spent in it, so a switch the gate saw immediately and that settled on Stage 2's first tick logged ~1050ms under the .full budget when it had taken about 50 ms.

That makes every settle time in every log collected so far unusable for the question they get read for. #274 sized the play-gate Stage 1 budget down to 200 ms for sessions no dynamic-range switch can reach, on the premise from d87b54d that rate-only switches are sub-second; the logs that would confirm or refute it could not be read that way. This changes no budget, only the measurement that decides it.

What the line reports now

[DisplayCriteria] rate-only switch settled (start pre-gate after 0ms, total 90ms, SDR, EDR headroom 1.0 as expected)
  • start pre-gate vs start in-gate: the observers are registered on entry, so a switch already running is only visible through the in-progress flag. pre-gate therefore means the panel was switching while the AVPlayerItem was built, in-gate means it started inside the gate. This is the ordering question Sodalite#49 was filed on, and no log line distinguished the two.
  • Stage 1 and total, both measured.

Second defect from the same logs

The Stage 2 cap explained every unobservable switch as "likely DV", including an engine SDR rate-only write. That is the same misattribution #274 fixed one branch over. The cap now reads the same attribution helper (switchEndOutcome renamed to criteriaAttribution, since a pending switch and an ended one ask the same question), so a rate-only write that never reports an end is logged as its own event. Two of the reporter's five runs sat at the cap for the full two seconds on SDR content.

Verification

  • swift test --filter DisplayCriteria: 23 tests, 3 suites, green. Timing helpers and attribution are pure and covered, including that the reported total no longer contains the budget.
  • xcodebuild -scheme AetherEngine -destination generic/platform=tvOS build: succeeded. Required, the changed body is inside #if os(tvOS) and a macOS swift build never compiles it.
  • swift build -Xswiftc -strict-concurrency=complete: clean.

Measured from logs supplied by @nathanpiper on Sodalite#49.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE

…ring

The Stage 2 settle logs summed `startGrace.ticks * 10 + stage2Ticks * 50`.
The first term is Stage 1's blind-poll budget, not the time spent in it:
Stage 1 breaks out the moment it sees a switch, and the loop index was
discarded. A switch the gate saw immediately and that settled on Stage 2's
first tick therefore logged `~1050ms` under the .full budget when it had
taken about 50 ms.

Every settle time in every log collected so far is inflated by up to a
second, which makes them useless for the one question they get read for:
how long a panel really takes to switch. #274 sized the play-gate Stage 1
budget down to 200 ms for sessions no dynamic-range switch can reach,
resting on the premise from d87b54d that rate-only switches are sub-second.
The logs that would confirm or refute that premise could not, and still
cannot, be read that way. This does not change the budget, it makes the
measurement that decides it trustworthy.

The line now reports Stage 1 and total separately, both measured, plus
which signal ended Stage 1. That last bit is the ordering question
Sodalite#49 was filed on: the observers are registered on entry, so a
switch already running can only be seen through the in-progress flag
(`pre-gate`, meaning the panel was switching while the AVPlayerItem was
built) while a start notification means it began inside the gate
(`in-gate`). No log line distinguished the two before.

Second defect from the same logs: the Stage 2 cap explained every
unobservable switch as "likely DV", including an engine SDR rate-only
write, which is the same misattribution #274 fixed one branch over. The
cap now reads `criteriaAttribution` (renamed from `switchEndOutcome`, since
both a switch that ended and one still pending ask the same question) and
an engine rate-only write that never reports an end is logged as its own
event. Two of the reporter's five runs sat here for the full two seconds on
SDR content.

Timing helpers and attribution are pure and unit-tested. Verified on the
tvOS build: the changed body is inside `#if os(tvOS)` and a macOS `swift
build` does not compile it.

Measured from logs supplied by @nathanpiper on Sodalite#49.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant