Repository navigation
perf(stream): build the latency round for a console test - #38
Draft
enricobuehler wants to merge 10 commits into
Draft
enricobuehler wants to merge 10 commits into
enricobuehler wants to merge 10 commits into
Conversation
The late take stopped at a fixed 10 ms, a guess at the compositor's deadline, while composition left room past 12 ms. A frame still queued at the next present is the one sign it missed its vblank, so the limit walks later only after long clean runs and steps back for good at a miss, inside the GPU's room. The arrivals drift through the refresh. While their band sits on the take, newest wins shows some pictures a refresh late and never shows others. Under the latency intent the take moves before such a band, so every picture goes the same way, and returns once the band clears it. A queued frame after a stalled present, a drained wait or stopped drains says nothing about the deadline and is not read as a miss. The espera-fixa marker keeps the fixed 10 ms for the A/B.
The shared rule resolves an Automatic buffer to two frames. On this console one frame presents as many pictures a second, one refresh sooner, and holds end to end steady where two swing by a refresh. A buffer the player picks still stands, and the latency intent is untouched.
The system core that serves every socket call is the stream's bottleneck, and its load follows datagrams in both directions. The input thread sends pads, motion and touch as their own datagrams at 250 Hz, and nobody has counted them. The stats line now reports what the input thread hands core a second: pad, motion, touch and other. A pad's button and axis events in one tick count once, as core folds them into one snapshot.
hid stamps each six-axis sample with a sampling number. A tick that reads the same sample again has nothing new for the host, which holds the last rate it got. A sample the every-other-tick rule held back used to go out a tick late; it now stays home and the next new sample goes out instead. A reading that moves under an unchanged number still counts as new, so a sensor whose counter never moves cannot freeze the gyro. Rest is still counted in ticks, so a pad's zero rate goes out on time between samples. The stats line now shows motion datagrams against the new samples read, which measures the sensors' real rate on the console.
Video is most of the datagrams the system's socket service carries, in proportion to bitrate, and Automatic climbs to the flat 20 Mb/s ceiling handheld. A lower ceiling trades picture for load, so it is measured before anyone picks a default. A file teto-mbps in the data directory, holding whole megabits a second from 5 to 20, sets the ceiling for that run. Absent, it stays 20; the log names the ceiling each run uses, and says when the file was ignored.
Every performance configuration a retail console runs a game at keeps the CPU at 1020 MHz, and the socket service that carries the stream runs near its limit there. A governor that drops it lower slows the receive path, and the clocks in the stats line alone do not flag it. Each stream now logs one warning with the clock it read when the CPU is below stock. The clock is only read; this client sets none.
A governor can lower the CPU clock while a stream runs, after the check at stream start has passed. The stats window reads the clocks every 10 s anyway, so a drop below stock there warns once, and a return to stock arms the next warning. A drop the stream start already named is not named again.
The pump waited 100 ms on an empty plane and fed nothing, so a Wi-Fi stall drained the ring into underruns. Underruns grew the ring's target, and the gap concealed at the stall's end landed on top, so the ring stayed deeper and the audio later behind the picture. The pump now wakes once a frame and ticks core's DroughtConceal, which conceals on core's own thresholds and budget. The packet that ends the quiet conceals only the frames still owed. Concealment enters the sink apart from fed packets, so the audio window still shows the stall's gap and counts the concealed frames.
The late take's limit, the steering, Automatic smoothness, the uplink count, the bitrate ceiling marker, the CPU warning and the audio concealment are built and have not run on a console. The notes say what each does, where the limit cannot help, and what the round reads. The clock raise is marked as decided against, and the slow way back after a hitch as read from the code with the log that would settle it.
Unasked, a title runs the handheld GPU at 307 MHz, the lowest row of the system's table, and composition on it is what bounds the late take at stock clocks. A retail game asks for its row. A file nivel-gpu holding 384 or 460 makes the title ask for that row, with the CPU and the memory where the default has them, so a console round can measure what the level buys against the battery. Without the file nothing is asked, and the former row goes back at exit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A build for one console round. Draft until that round has run: nothing here has been on a console.
Why
Two measured facts from #30 and
docs/NOTES.mdshape it.What changes
stats:counts uplink datagrams by kindteto-mbps(5 to 20) sets Automatic's ceiling for a runnivel-gpu(384 or 460) asks the system for that handheld GPU levelespera-fixakeeps the late take at the old fixed 10 msCredit
The arrival-band estimate (
pf-nx-vk/src/steer.rs) and the one-frame Automatic are @broslife's work from #15, carried over here. The band now chooses a side of the limit instead of placing the take on its own.What the round should know
nivel-gpuis in the build to measure exactly that: a title that asks for nothing runs the GPU at 307 MHz, and a retail game asks the system for its level. It is a request the system may refuse, not a clock write.docs/improvements.mdnames the debug log that settles it.The runs, the lines to read and what passes are in
docs/improvements.md, "Latency and load round".Checked
cargo test --workspace(152 passed), fmt, clippy.punktfunk-nx-host:2: fmt,clippy --workspace --all-targets -D warnings,cargo test --workspace(184 passed), on the nine commits before the GPU marker.check -p pf-nx-sysonly.Not checked locally: the console build of
pf-nx-platformandpf-nx. The changes inconsole/mod.rs,console/lifecycle.rsandconsole/pads.rshave never compiled; this PR's console lane is that check.