Compare commits

...
Author SHA1 Message Date
poli0981 0058b7c167 Merge commit '33a5da13733e947d0f6ff90c172818d02b7b6b3b' into beta48/pr2-agent-app
# Conflicts:
#	CHANGELOG.md
2026-11-14 10:17:41 +07:00
poli0981andClaude Fable 5.2 33a5da1373 feat(overlay): two more members of NVIDIA's latency report - the driver's active GPU time and its GPU frame time - and every frame-generation multiplier a session saw; four reserved words, layout still 5; a read left by the session before is dropped (D142, D144; in no release yet) (#450)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 10:16:39 +07:00
poli0981andClaude Fable 5.2 a936466f5f feat(advanced): the driver's active GPU time and GPU frame time as two lines of their own; the GPU render label says what it includes; the multiplier row lists every value seen; the texts say two real games were read - Privacy Policy 2.21, Disclaimer 2.17 (D142-D145; in no release yet)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 10:04:27 +07:00
poli0981andClaude Fable 5.2 a0690a4bc2 feat(overlay): two more members of NVIDIA's latency report - the driver's active GPU time and its GPU frame time - and every frame-generation multiplier a session saw; four reserved words, layout still 5; a read left by the session before is dropped (D142, D144; in no release yet)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 09:53:52 +07:00
poli0981andClaude Fable 5.2 3df56f0ca1 docs: item 45 on Cyberpunk 2077 and three games the read leaves alone - read twice, 65 us at the slowest, GPU render sane there; the owner's answer: read the driver's active time (#449)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 02:31:32 +00:00
poli0981andClaude Fable 5.2 80b4437169 docs: the first real game read on 0.1.0-beta.47 - Phantom Blade Zero, three sessions: the driver found and read every second, the slowest call 45 us, no latch; its GPU render span is longer than its total there (item 45) (#448)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 02:09:38 +00:00
poli0981andClaude Fable 5.2 268ad75585 docs(handoff): 0.1.0-beta.47's release facts - the tag's run, the digests, the delta, the wiki, what SonarCloud and Qodana said on the release's commit; and a local gate that a vanished test program made red, not falsely green (#447)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 01:39:20 +00:00
35 changed files with 667 additions and 69 deletions

No files matched your search

+36
View File
@@ -35,6 +35,42 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Added
- **Two more lines from NVIDIA's latency report: how long the graphics card was really at work** (owner decision
D142). In a real game the driver's *GPU render* stage turned out longer than the whole frame: it runs from the
card's start to its end and includes the time the card waited. With Advanced metrics on, a session now also
stores two figures the driver works out itself — **GPU active render**, the same stage without the waiting, and
**GPU frame time**, from the end of one frame's work to the end of the next — as a second chart under *Latency*.
They come from the report FrameLedger already asks the driver for; nothing more is asked. A driver may give
neither, and the chart is then not there. Sessions recorded before this release do not have them.
- **For developers: the part inside a game reads two more figures of NVIDIA's latency report, and keeps every
frame-generation multiplier a session saw** (owner decisions D142, D144; nothing a user sees until the Agent and
the App read them). In a real game the driver's span between its two GPU marks was longer than the frame's whole
— it includes the card's waiting. The driver's own *active* render time and its GPU frame time are members of
the report FrameLedger already fetches; they are read from it, with **no further call into the driver**. Four
reserved words of the shared memory carry them and the multipliers seen (layout 5 as it was). `fl_reflex_summary`
and the injected `[latency]` cases hold it. Measured: +36 ns a read, once a second.
### Changed
- **The *GPU render* line says what it includes** (owner decision D143): *GPU render, start to end (idle time
included)*, in the three languages. The numbers are the same.
- **The driver's frame-generation multiplier is every value the session saw** (owner decision D144). The table of
the driver's low-latency state kept only the last one: a session that generated frames at ×2 and ended in a menu
showed 1. It now shows *1, 2*. Sessions already recorded keep what they stored.
- **The texts say what was read** (owner decision D145). The accuracy statement, the README and the guide said no
real game had been read; two have been, on one driver. They also say now that the stages overlap and do not add
up to the total. **Privacy Policy 2.21** names the two new averages; **Disclaimer 2.17** changes only with the
accuracy statement it carries. The terms window shows once.
### Fixed
- **A session could start with the last read of the session before it.** In a game that kept running between two
sessions, a read of the driver's latency report that ended after the first session's last tick was taken as the
second session's first point. A new session now drops it.
## Releases
Newest first. Each file holds that release's section exactly as it stood here.
+4 -2
View File
@@ -128,8 +128,10 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
shader-compilation stutter are **not measured yet** — they read N/A. ([Accuracy](legal/ACCURACY.md))
- **NVIDIA's own latency report** is read only with *Advanced metrics* on, only on an NVIDIA card, only in a
Direct3D 12 game that uses NVIDIA Reflex: how long the driver says each stage of a frame took, about once a
second. They are the driver's numbers, not FrameLedger's measurement. FrameLedger asks the driver for them from
inside the game; a read that is slow or faults is switched off until the game is closed, and the session says so.
second. They are the driver's numbers, not FrameLedger's measurement. **The stages overlap and do not add up to
the total**, and the graphics card's stage includes the time the card waited — in one game it is longer than the
whole frame; the driver's own figure for the card's active time is shown beside it where the driver gives one.
FrameLedger asks the driver for them from inside the game; a read that is slow or faults is switched off until the game is closed, and the session says so.
([Advanced metrics](guide/12-advanced-metrics.md))
## The game's memory
+7 -4
View File
@@ -93,9 +93,12 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
> long the driver says each stage of a frame took — simulation, render submit, present, driver, the operating
> system's queue, the graphics card — read from the graphics driver about once a second and shown as the driver
> reported it: **the driver's numbers, not a measurement by FrameLedger**, an average of the frames of one read,
> never checked against another tool, and not the delay from a click to the screen. Read with a test program
> against one driver and one card; **no real game had been read when this was written**. A game that does not use
> Reflex has none. The session summary's latency fields stay N/A.
> never checked against another tool, and not the delay from a click to the screen. **The stages overlap and do
> not add up to the total.** The graphics card's stage runs from its start to its end and includes the time the
> card waited — in one game it was longer than the whole frame — so since beta.48 two figures the driver works
> out itself are shown beside it: the card's active time, and the time from one frame's end to the next. A
> driver may give neither, and then there is no line. Read in two real games, on one driver and one card
> (2026-11-14). A game that does not use Reflex has none. The session summary's latency fields stay N/A.
> - **Pacing, VSync and the graphics card (since beta.14):** the share of the time below 30 FPS, below 60 FPS and below
> the monitor's refresh rate, measured from frame times with small margins so that a game held at its limit is not
> counted as below it (a rate less than 2 % under the line reads partly as at it), and how much one frame's time
@@ -258,7 +261,7 @@ FrameLedger is GPL-3.0-only free software, and you are welcome to build it, chan
| `FrameLedger.Overlay.dll` | Inside the game | C++20 hooks + lock-free shared-memory writer. Records only; never analyzes, allocates, or blocks |
| `FrameLedger.VkLayer.dll` | Inside the game | Vulkan implicit layer (Vulkan titles use this instead of injection) |
GPU telemetry is layered so the project never depends on a proprietary vendor licence: a vendor-neutral DXGI/performance-counter baseline, LibreHardwareMonitor (MPL-2.0) for sensors on all vendors, and NVIDIA's NVAPI SDK (MIT) for NVIDIA-only extras (telemetry and the driver's DLSS record today; Reflex latency is not read yet). No Intel or AMD GPU *telemetry* SDK is bundled — see `docs/18_GPU_VENDOR_APIS.md` for why. The one AMD component in the tree is five MIT headers from the FidelityFX SDK, used for types only so the upscaler hook can read an FSR title's own dispatch descriptor; nothing AMD-built is linked or redistributed.
GPU telemetry is layered so the project never depends on a proprietary vendor licence: a vendor-neutral DXGI/performance-counter baseline, LibreHardwareMonitor (MPL-2.0) for sensors on all vendors, and NVIDIA's NVAPI SDK (MIT) for NVIDIA-only extras (telemetry and the driver's DLSS record; and, with Advanced metrics on, the driver's own latency report, read inside a Direct3D 12 game that uses NVIDIA Reflex). No Intel or AMD GPU *telemetry* SDK is bundled — see `docs/18_GPU_VENDOR_APIS.md` for why. The one AMD component in the tree is five MIT headers from the FidelityFX SDK, used for types only so the upscaler hook can read an FSR title's own dispatch descriptor; nothing AMD-built is linked or redistributed.
---
+1 -1
View File
@@ -36,7 +36,7 @@ Let `D` = session duration (first → last present), `F_app` = frames the *game*
| **Frametime σ** | population stddev of `ft_app` (ms) | 1 |
| **Stutter count** | `ft_app[i] > 2 × rollingMedian(ft_app, 19)` (centered, window in **frames**) | 1 |
| **Stutter time %** | `Σ ft_app[stutter] / Σ ft_app × 100` | 1 |
| **PC latency** | mean/p95 of `reflexLatencyUs` when Reflex reports it *(nothing fills `reflexLatencyUs`: a report arrives after its frame's record is written. Since train C, 2026-11-13, the driver's stage report is read as seven Advanced series beside the frames — `18_GPU_VENDOR_APIS` §The inventory — and these session fields stay N/A)* | **1 only** |
| **PC latency** | mean/p95 of `reflexLatencyUs` when Reflex reports it *(nothing fills `reflexLatencyUs`: a report arrives after its frame's record is written. Since train C, 2026-11-13, the driver's stage report is read as seven Advanced series beside the frames — `18_GPU_VENDOR_APIS` §The inventory — and these session fields stay N/A; asked again on 2026-11-14 with two real games read, the owner kept them N/A (D147): the driver's total runs from simulation start to the graphics card's end, not from an input to the display)* | **1 only** |
| **PSO stutter %** | share of stutter frames with `psoCreatedThisFrame > 0` | **1 only** |
| **Time below 30 / 60 FPS** (beta.14) | share of `Σ ft_app` in frames that count as below X — `ft > 1.10 × 1000/X`, or the nine-frame rolling median `> 1.02 × 1000/X` (§Pacing) | 1 |
| **Time below refresh** (beta.14) | the same over **presents**, X = `display_monitor_hz` — the display's rate, so over what the display received | 1 |
+10
View File
@@ -180,6 +180,16 @@ What the region is, as a contract between the two sides:
sum of all ones is a span some summed frame did not report. `FL_ADV_VALID_LATENCY` (bit 7 of the mask) is set once
a read returned OK for the request; it is not one of "the game's calls were read", and `latState` is published
whether or not it is set.
- **Four more latency words (0.1.0-beta.48; owner decisions D142, D144).** The first line was full, so they are
four of the seven reserved words that ended the `sl::DLSSOptions` line (@100..115; three remain, @116..127) —
nothing of DLSS's, and **the layout is still 5** for the same reasons. `latGpuActiveSumUs` and `latGpuFrameSumUs`
are the two times the driver works out itself — the graphics card's render time *excluding the idles in
between* (`gpuActiveRenderTimeUs`) and one frame's GPU end to the next's (`gpuFrameTimeUs`) — summed over the
frames of the newest read that gave one; `latGpuCounts` holds how many did, the first in its low half and the
second in its high half, because a frame can give one and not the other. A frame that gives zero (an older
driver leaves both zero) or more than a second is in neither the sum nor the count, and is still summed for the
seven spans. `latMultipliersSeen` is the session's: bit n is set once the sleep status gave frame-generation
multiplier n since the request, bit 31 standing for 31 and more; `latState` still carries the last one.
- The Vulkan layer never writes it. `ShmLayoutMirrorTests.TheAdvancedStateMirrorMatches` checks every member's
offset against `fl-layout-dump`; `ShmRingReaderTests` the three reads and that the request is stored either way.
+3 -1
View File
@@ -172,7 +172,9 @@ running game.
**The call into the driver (train C, 0.1.0-beta.47) is tested in three places, each for what the
others cannot say.** `fl_reflex_summary` (Catch2) drives `fl_adv_fields.h`'s reader on reports written by hand: the
two newest frames held back, a frame summed once, a span the driver did not report, a span no frame can have, frame
ids that start again, and the ten words of a publication. `fl_guard`'s seven `[latency]` cases inject the Overlay
ids that start again, and the ten words of a publication — and since 0.1.0-beta.48 the driver's two own times
(summed over the frames that gave one, each with its own count; zero and more than a second are not counted and
refuse nothing) and the bit a multiplier has. `fl_guard`'s seven `[latency]` cases inject the Overlay
into a Direct3D 12 target that has loaded a stand-in `nvapi64.dll`, and read that module's call counts from outside
through its named section (`fl_stub_nvapi_shared.h`) — so "the driver was not called" is a count: not asked → not
even asked for the addresses; asked → about one read a second, sums equal to the stand-in's, every counted read a
+23
View File
@@ -192,6 +192,29 @@ the probe, which enforces CFG, has made the calls from the header that ships, so
valid targets. **Not excluded**: a game that enforces CFG on a driver the probe has not been run against — a target
that were not valid is a fast-fail no guard catches.
**In a real game** (the owner, 2026-11-14, Phantom Blade Zero on 0.1.0-beta.47, three sessions, frame generation
×3 and off): the module was found four to five seconds after the attach — `nvapi64.dll` in System32, the getters in
`nvapi64_impl.dll`, as on the probe — a read was made about every second for 344 s, 52 s and 1 119 s, **the slowest
call took 24, 20 and 45 µs**, and no latch fired: no error, no slow call, no fault, no stall. **Cyberpunk 2077 the
same morning**, two sessions (frame generation ×2 and off, 260 s and 581 s): found 4.8 s and 2.6 s after the attach,
the slowest call 34 and 65 µs, no latch. Two Direct3D 11 games and one Direct3D 12 game with no `nvapi64.dll` were
left alone, each with its one line. Two games read, one driver.
**Two more members of the same report, and the multipliers seen (0.1.0-beta.48; owner decisions D142, D144).** In
Phantom Blade Zero the span between the driver's two GPU marks was longer than the frame's whole: it includes the
card's waiting. NVIDIA's header has the figure that does not — `gpuActiveRenderTimeUs`, "excluding the idles in
between" — and beside it `gpuFrameTimeUs`, one frame's GPU end to the next's. Both are read from the report the
getter already filled: **no call is added, and no interface id** (`tools/nvapi-readonly-check.ps1` is unchanged;
the two names are on `tools/overlay-allowed-fields.txt`). The buffer is the Overlay's own, so there is no question
of a member lying past what a game allocated; an older driver leaves both zero, and zero is read as *not given* —
each time has its own count, and neither decides which frames the seven spans are made of. The sleep status'
frame-generation multiplier is now also kept as the set of values a session saw (a session that generated ×2 and
ended in a menu read 1). **One defect fixed with it**: a read that ended after a session's last tick was taken by
the next session as its first point; a new request now drops it. **Measured** (the header's own function, the
Overlay's flags, a report of 62 summed frames, 2 million reports × 3, twice): 393–396 ns before, 429–434 ns after
— **+36 ns a read**, once a second, and after the call's time has been taken, so it cannot reach the 2 ms latch.
The present path is unchanged: one relaxed load.
**The gate.** One word, four states — idle, armed, reading, off (`dllmain.cpp`, above `ReadLatencyOnce`). Only the
watchdog arms; a presenting thread takes *armed* to *reading* by compare-exchange and owns the 15.4 KB report
buffer (static storage, never a game thread's stack) and the read's result until it stores *idle* or *off*; the
+13 -1
View File
@@ -872,6 +872,11 @@ planning, the design reviewed against the code before it was approved.
- **Privacy Policy 2.18** at beta.44 (approved with that release's plan): 2.17 named two further calls and what
they give; Streamline's answers about a feature are in neither list, so they are named, with what of the answer
is never read — the lists it points to.
- **Privacy Policy 2.21 and Disclaimer 2.17** at beta.48 (wording approved with the plan of 2026-11-14, D145):
the Privacy Policy names the two further averages a session stores of the driver's report and that the
frame-generation multiplier is every value the session saw; the Disclaimer changes only with the accuracy
statement it carries, which now says two real games were read, that the stages overlap, and that the graphics
card's stage includes its waiting. No new call: the paragraph on the call the component makes is as it was.
- **Privacy Policy 2.20 and Disclaimer 2.16** at beta.47, train C (wording approved with the plan of
2026-11-13): the first thing read inside a game that is **not an argument of a call the game made**. The Privacy
Policy names what is stored — how long each stage of a frame took, as the driver reports it, and the driver's
@@ -1089,7 +1094,13 @@ only while a session records Advanced metrics, only for a Direct3D 12 game that
`nvapi64.dll`. The report becomes seven series — `adv.nvapi.reflex.frame_report.` and `simulation`,
`render_submit`, `present`, `driver`, `os_queue`, `gpu_render`, `total` — each point the mean, in microseconds, of
the frames one read summed; the sleep status becomes one table of the driver's five switches as seen over the
session. What the *game* asked of Reflex (`nvapi.reflex.mode`) is an argument of a function no module exports:
session and, since 0.1.0-beta.48 (D144), every frame-generation multiplier it gave (it kept the last one, and a
session that ended in a menu read 1). **Since 0.1.0-beta.48 (D142) two more series, an entry of their own** —
`adv.nvapi.reflex.gpu_times.` and `active_render`, `frame_time` — the driver's `gpuActiveRenderTimeUs` and
`gpuFrameTimeUs`, each the mean over the frames of that read that gave one. They are the driver's own figures, not
spans between two of its marks: in Phantom Blade Zero `gpu_render` (the two GPU marks, idle time included) was
longer than `total`, which is why its label now says what it includes (D143). An entry of their own keeps the
seven spans within what one chart draws as lines. What the *game* asked of Reflex (`nvapi.reflex.mode`) is an argument of a function no module exports:
reading it takes a patch at an address learned at run time, which is refused.
| Id | What it is | Scope | Source | Reach | Unit |
@@ -1097,6 +1108,7 @@ reading it takes a patch at an address learned at run time, which is refused.
| `nvapi.reflex.mode` | Reflex: low-latency mode, boost, the frame-rate limit | SessionFact | Nvapi | RefusedRoute | Text |
| `nvapi.reflex.sleep_status` | What the driver's low-latency state is | SessionFact | Nvapi | GameDriver | Table |
| `nvapi.reflex.frame_report` | Latency per frame: simulation, render submit, present, driver, OS queue, GPU render | Series, one per device | Nvapi | GameDriver | Microseconds |
| `nvapi.reflex.gpu_times` | The graphics card's time per frame, as the driver works it out: active render, frame to frame | Series, one per device | Nvapi | GameDriver | Microseconds |
**Inside the game: routes a spike decides**
+1 -1
View File
@@ -1873,7 +1873,7 @@ Moved verbatim, in this order.
| M12 ❓ | **Advanced metrics — which NVAPI rows answer on real hardware (D101, 2026-11-11).** `18_GPU_VENDOR_APIS` §The inventory lists sixty `nvapi.` rows whose reach is `Agent`. They are declared in the vendored headers; **none has been called on a GPU**, and CI has no driver, so it never takes that branch. Unknown per row: whether the RTX 5080 on the current driver answers or returns `NVAPI_NOT_SUPPORTED` (the memory-temperature target already does not exist on that card). | **The measurement is the bridge's probe on the owner's PC**, then the page itself (the release's owner-only item). Pre-committed: a call that does not answer → that row is N/A with NVAPI's own status as the reason, and nothing is put in its place; a call that hangs or faults twice → the row is off for the session (§Runtime policy); a value that contradicts the vendor's own tool → the row is withheld until it is explained. **Half answered the same day, by the bridge's own test on the dev box** (ctest `fl_nvapi_bridge`, AVAILABLE branch; RTX 5080): every fact answers (`present = 0xFFFFF`), eight of ten live groups answer (`0x33F` — no board and no power-supply temperature sensor on this card: N/A, by the first pre-committed outcome), the display answers its four groups, the global profile lists 24 settings; figures in `18_GPU_VENDOR_APIS` §L3. **Still open**: the same values on the page beside the vendor's own tool, and the session rows (`nvapi.session.*`), which need a game. **And one thing seen once and not explained**: in one test run of about a dozen that day, `FlNvReadLive` came back with no field at all although `FlNvReadFacts`, a moment earlier in the same process, had answered everything; nine further runs did not show it. A handle the driver invalidated is the usual cause of that shape, and nothing here re-enumerates after `FlNvInit`. Pre-committed for the reader that owns the thread: two readings in a row with no field → release and initialise the bridge again, once, and say so in the log; if that does not bring the fields back the layer is off for the session, as any layer that fails twice is. |
| M13 ❓ | **Advanced metrics — LibreHardwareMonitor's CPU, memory, motherboard and storage groups, elevated, with PawnIO (D103, 2026-11-11).** Never opened by any build: §M10's elevated run has not been taken either, and this is a larger surface — a sensor chip on the LPC bus, the embedded controller, SPD over SMBus, SMART. Unknown: whether each group opens on the owner's board, what a refresh costs, whether opening the storage group touches removable drives (this PC once had a failing USB drive), and whether any group enables a privilege (`PrivilegeFootprintTests`). | **One elevated run with the probe verb, before the option exists.** Pre-committed: the storage group cannot be opened without touching removable drives → `lhm.storage.*` stays N/A in beta.39 and its reach reads `Deferred`; a node that throws twice → skipped for the session; the Agent above 1% of one core or 150 MB with the option on (NFR-2) → the slow groups are read less often or dropped before the release; a privilege enabled by a group → that group is not opened, and the owner is asked. **Two of the four answered 2026-11-11, before the option exists.** (1) **Storage: not opened, by the first outcome.** LibreHardwareMonitor 0.9.6's `StorageGroup` lists every drive through DiskInfoToolkit's `ReloadStorages` with no filter by bus and follows drives plugged in later — it cannot be opened without touching removable drives. `lhm.storage.*` reads `Deferred`, and `LhmGroups` has no member for it. (2) **Cost, unelevated, measured with `probe-advanced`** on the dev box: one refresh of the graphics-card group alone is 14 ms of processor time (62 ms elapsed) — 1.4% of one core at one a second, above NFR-2 — and one NVAPI read 0.4 ms. By the third outcome the sensor library is read every fifth tick (0.28%). **Still open, and the owner's**: the same probe as administrator with PawnIO — whether the processor, memory and motherboard groups open on this board, what they cost, and `PrivilegeFootprintTests`' new case on a token that holds the privileges (CI's does; the dev box's unelevated run passes by construction). **The first run was taken on 2026-11-12, by the owner, in ordinary use** (0.1.0-beta.40, the Agent as administrator with PawnIO, an i7-14700KF on a board with an IT8689E chip, an RTX 5080), and read here from a copy of the ledger and the Agent's log, not from a probe. **The groups open and read**: nine of ten sessions stored 119 processor series (a clock and a load per thread, temperatures, powers, voltages), 14 memory series and 21 motherboard series (six fans, six temperatures, nine voltages) beside the card's 41 — 195 from the sensor library in all. **No value was compared with another tool**; that is still the owner's. **Two faults, one cause** (`Infrastructure.Telemetry.LhmLibrary`): the Agent held up to three `Computer`s at once, and the library keeps the driver it reads the processor through and its bus mutexes per process — closing one `Computer` let go of them under the others. After seven sessions the Advanced reader's processor device threw `NullReferenceException` twice and was left alone (the page lost the processor until the reader reopened); once a session's start met another instance's close, the reader's `Open` threw `ObjectDisposedException`, and that session stored 17 series instead of 212. **Fixed 2026-11-12**: opens and closes are serialised and a `Computer` is parked, not closed, while another is in use. The cause is read from the log's timing and was not reproduced — it needs this elevation — so **whether the faults are gone is the owner's next sessions to show**: no `advanced: a device is left alone` and no `did not open` in the Agent's log. **First evidence, 2026-11-12, 0.1.0-beta.41, the same PC:** seven sessions between 06:38 and 07:01 with no `advanced:` line at all, each with the option on storing 212 or 213 series; on beta.40 that morning the processor device faulted out after each of six sessions (04:34–05:07) — thirteen of sixteen over the night. The reader failing to open was seen once in sixteen, so this is not yet enough to call that one gone. Still open: any value beside another tool. |
| M16 ✅ | **The L2 telemetry layer's cost — the first number, and it is above NFR-2 (found 2026-11-11, measuring something else).** `LhmTelemetrySource` refreshes LibreHardwareMonitor's graphics-card group once a second in every recorded session. `probe-advanced` measured that refresh, through the same library and the same group, at **14 ms of processor time** on the dev box (RTX 5080, 41 mapped sensors, about twenty of them the Direct3D engine nodes the library enumerates per card) — 1.4% of one core, where NFR-2 allows the whole Agent 1% during capture and `14_TESTING` §Hook overhead's Agent figure has never been measured. This is a measurement of the call, not yet of a session: L2's own poller was not instrumented. | **Measure L2 in a session** (the Agent's processor time over a ten-minute capture, telemetry at 1000 ms and at 2000 ms). Pre-committed: at or under 1% → this row closes with the number; above → the owner chooses between a slower default for `telemetry.interval_ms`, reading the sensors the layer keeps from NVAPI on NVIDIA cards (L3 already has most, at 0.4 ms), or amending NFR-2 to what is measured. Not decided here, and nothing about L2 changes in the Advanced-metrics train. **Measured in a real Agent, 2026-11-11 (owner decision D110), and answered (D117).** `tools/agent-cost.ps1` runs the shipped `FrameLedger.Agent.exe --console capture` against a copy of hook-harness in a scratch data folder — a session that is not hooked, so the telemetry poller runs as in every session and nothing drains frames — and reads the Agent process's own processor time at exit; the cost per second is the slope between a 45 s and a 165 s session, two runs of each. Dev box (RTX 5080, not elevated, layers `l1+lhm+nvapi`): **19.3 ms of processor time per second of session = 1.93 % of one core with Advanced metrics off** (2,312 and 2,312 ms over 45 s; 4,594 and 4,656 ms over 165 s), **20.4 ms = 2.04 % with it on** (2,984 and 3,000; 5,547 and 5,344); peak working set 113 MiB and 119 MiB. A first pass with 30 s and 90 s sessions gave 1.56 % and 2.21 % — its two short runs differed by 670 ms, which is why the lengths were raised. So the probe's number holds in a session: the Agent's steady cost is about twice NFR-2's 1 %, nearly all of it the layer every session has always used, and the new option adds about a tenth of a percent. **The owner's answer: NFR-2 is amended to ≤ 2.5 % of one core** — the limit had never been measured, the sensors keep their one reading a second, and nothing in the code changes. Not measured: a hooked session (the drain's cost on top), a session with the Agent elevated and PawnIO's groups open, another PC. |
| M14 ❓ | **Reflex latency per frame — is there a route within rules 4 and 5? (Train C, 2026-11-11.)** `17_HOOK_ENGINE` §Memory / latency names hooks on `NvAPI_D3D_SetSleepMode` / `SetLatencyMarker` and a call to `NvAPI_D3D_GetLatency`. NVAPI resolves all three through `nvapi_QueryInterface` by id — they are not exports, so a hook on them is a patch at an address learned at run time, the class refused on 2026-08-09. The route to try first needs no hook: the Overlay's own background thread **calls** `GetLatency` with the device of the swap chain it already hooks, once a second (the call returns the last 64 frames' reports). Unknown: whether calling into the driver from that thread is safe on every device kind, what it costs, what it returns when the game never enabled Reflex, and what it means for the Disclaimer's sentence about that thread. | **A spike on `hook-harness` and a stub first, then one real title.** Pre-committed: no route without a patch at a run-time address or a loader-lock call on the game's thread → Reflex stays N/A and the page says why; overhead above NFR-1 → the same. The owner says go or no on the spike's result. **2026-11-12 — the reading that comes before that spike is `spike-notes` §30** (owner decision D130: a document first, beside 0.1.0-beta.45; nothing was run). It finds: a hook on NVAPI's latency functions is the refused class, and a hook on Streamline's Reflex and PCL functions is train D's wrapper (§M15) — and would miss a game that fetched them before the attach, as `slInit` is missed (D129); the Overlay calling `slReflexGetState` itself breaks the thread contract the vendor's header states; **what remains is the route named in this row**, the Overlay calling two driver getters with the game's device, and a no-injection ETW route that gives the game-side markers only and makes the game post messages to its own window. Corrected there: `nvapi64.dll` exports **two** functions on the dev box (`nvapi_Direct_GetMethod` beside `nvapi_QueryInterface`), not one. The go or no is the owner's, and a go needs the owner's ruling that calling a driver getter with the game's device is inside rule 4. **2026-11-13 — the owner answered (D132, D133).** Route D goes to the spike this row names, on `hook-harness` and a stub `nvapi64.dll`, with the ruling: a driver's read-only getter called with the device of the swap chain the Overlay hooks is inside rule 4 (`CLAUDE.md`, the rule's note of that day). No real game before the owner has seen the result, and nothing shipped changes for the spike (`spike-notes` §31, written after 0.1.0-beta.46). Route C is **refused**; the ETW route **stays closed**, and §G is not reopened. **2026-11-13 — the harness spike is done (`spike-notes` §31), and none of its stop conditions fired.** With a stand-in module: nothing is called or loaded when `nvapi64.dll` is absent, a missing getter is refused whole, an error and a report of nothing read as what they are, and a call the driver holds for seconds stops only the thread that made it — so not the watchdog. With the installed driver (32.0.16.2114, RTX 5080), in the probe's own process and with the probe setting the markers a game would: no fault before `NvAPI_Initialize`, without markers, or across 38 million reads beside a marker-setting thread; a call costs half a microsecond to a microsecond and a half; the report is readable from markers alone, in microseconds; and the Direct3D 12 **device** — the object the Overlay already holds — is what the driver takes. What only a game can say is unanswered: a game's own device, a real report, another driver. **The owner's next word is go or no for one real title**; a go is a plan of its own first. **2026-11-13, the same evening — go (D136)**: a plan for one title, Cyberpunk 2077; no code before the plan is approved, and no release carrying it before a stop while a game runs has been exercised on 0.1.0-beta.46 (owner-only item 44 (d)). **2026-11-13, the plan and four more answers (D138–D141).** The read has **no switch of its own**: it is part of Advanced metrics, so after the release it reaches every Direct3D 12 game that loaded the driver's `nvapi64.dll`, for everyone who switched Advanced metrics on — "one title" is the order of the owner's first runs, not a limit in code (D138). The probe ran a leg with a sleep mode first (D139; `spike-notes` §31, *The leg with a sleep*): **the getters do not wait behind `NvAPI_D3D_Sleep`** — thirty-one million reads beside a thread that slept 97 % of the time, none of a millisecond; a read after a sleeping frame costs about 2.6 µs. An `nvapi64.dll` loaded from the game's own folder is refused with the reason (D140). One call of 2 ms or more switches the read off until the game exits (D141). The plan's design, as reviewed against the source, is in [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md) §The train after 0.1.0-beta.46. **2026-11-13, night — written; released as 0.1.0Line truncated
| M14 ❓ | **Reflex latency per frame — is there a route within rules 4 and 5? (Train C, 2026-11-11.)** `17_HOOK_ENGINE` §Memory / latency names hooks on `NvAPI_D3D_SetSleepMode` / `SetLatencyMarker` and a call to `NvAPI_D3D_GetLatency`. NVAPI resolves all three through `nvapi_QueryInterface` by id — they are not exports, so a hook on them is a patch at an address learned at run time, the class refused on 2026-08-09. The route to try first needs no hook: the Overlay's own background thread **calls** `GetLatency` with the device of the swap chain it already hooks, once a second (the call returns the last 64 frames' reports). Unknown: whether calling into the driver from that thread is safe on every device kind, what it costs, what it returns when the game never enabled Reflex, and what it means for the Disclaimer's sentence about that thread. | **A spike on `hook-harness` and a stub first, then one real title.** Pre-committed: no route without a patch at a run-time address or a loader-lock call on the game's thread → Reflex stays N/A and the page says why; overhead above NFR-1 → the same. The owner says go or no on the spike's result. **2026-11-12 — the reading that comes before that spike is `spike-notes` §30** (owner decision D130: a document first, beside 0.1.0-beta.45; nothing was run). It finds: a hook on NVAPI's latency functions is the refused class, and a hook on Streamline's Reflex and PCL functions is train D's wrapper (§M15) — and would miss a game that fetched them before the attach, as `slInit` is missed (D129); the Overlay calling `slReflexGetState` itself breaks the thread contract the vendor's header states; **what remains is the route named in this row**, the Overlay calling two driver getters with the game's device, and a no-injection ETW route that gives the game-side markers only and makes the game post messages to its own window. Corrected there: `nvapi64.dll` exports **two** functions on the dev box (`nvapi_Direct_GetMethod` beside `nvapi_QueryInterface`), not one. The go or no is the owner's, and a go needs the owner's ruling that calling a driver getter with the game's device is inside rule 4. **2026-11-13 — the owner answered (D132, D133).** Route D goes to the spike this row names, on `hook-harness` and a stub `nvapi64.dll`, with the ruling: a driver's read-only getter called with the device of the swap chain the Overlay hooks is inside rule 4 (`CLAUDE.md`, the rule's note of that day). No real game before the owner has seen the result, and nothing shipped changes for the spike (`spike-notes` §31, written after 0.1.0-beta.46). Route C is **refused**; the ETW route **stays closed**, and §G is not reopened. **2026-11-13 — the harness spike is done (`spike-notes` §31), and none of its stop conditions fired.** With a stand-in module: nothing is called or loaded when `nvapi64.dll` is absent, a missing getter is refused whole, an error and a report of nothing read as what they are, and a call the driver holds for seconds stops only the thread that made it — so not the watchdog. With the installed driver (32.0.16.2114, RTX 5080), in the probe's own process and with the probe setting the markers a game would: no fault before `NvAPI_Initialize`, without markers, or across 38 million reads beside a marker-setting thread; a call costs half a microsecond to a microsecond and a half; the report is readable from markers alone, in microseconds; and the Direct3D 12 **device** — the object the Overlay already holds — is what the driver takes. What only a game can say is unanswered: a game's own device, a real report, another driver. **The owner's next word is go or no for one real title**; a go is a plan of its own first. **2026-11-13, the same evening — go (D136)**: a plan for one title, Cyberpunk 2077; no code before the plan is approved, and no release carrying it before a stop while a game runs has been exercised on 0.1.0-beta.46 (owner-only item 44 (d)). **2026-11-13, the plan and four more answers (D138–D141).** The read has **no switch of its own**: it is part of Advanced metrics, so after the release it reaches every Direct3D 12 game that loaded the driver's `nvapi64.dll`, for everyone who switched Advanced metrics on — "one title" is the order of the owner's first runs, not a limit in code (D138). The probe ran a leg with a sleep mode first (D139; `spike-notes` §31, *The leg with a sleep*): **the getters do not wait behind `NvAPI_D3D_Sleep`** — thirty-one million reads beside a thread that slept 97 % of the time, none of a millisecond; a read after a sleeping frame costs about 2.6 µs. An `nvapi64.dll` loaded from the game's own folder is refused with the reason (D140). One call of 2 ms or more switches the read off until the game exits (D141). The plan's design, as reviewed against the source, is in [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md) §The train after 0.1.0-beta.46. **2026-11-13, night — written; released as 0.1.0Line truncated
| M15 ❓ | **The Streamline state behind `slGetFeatureFunction` — re-examined, not reopened (Train D, 2026-11-11).** The owner asked for the refusal in `handoff/history/p0-queue-1-6.md` to be looked at again. `18_GPU_VENDOR_APIS` §The trains states the route to try (hook the export, hand back a wrapper for a fixed list of names) and what it raises: the wrapper is a write to what the game receives, which rule 4 forbids as written; a wrapper must outlive the Overlay's unhook; a game that fetched its functions before the hook existed is never seen. | **A written design against each of the five grounds, then a spike.** Pre-committed: any ground unanswered → the route stays refused, and `sl.dlssg.*`, `sl.reflex.*` and the rest of that block read N/A with "refused" as the reason. Proceeding needs the owner's amendment of rule 4, asked with the rule quoted. |
| M10 ✅ | ~~PDH `\GPU Engine(*)\Utilization Percentage` summed across engines does not reproduce the Task Manager figure the doc invokes. Decide what we actually report and label it accordingly~~ **Decided 2026-09-09 (PR-E1): L1 does not read the engine counters at all.** `LoadPct` is L2's vendor-reported `GPU Core` load (measured ✓ on NVIDIA, §M5 row R1) and is labelled *GPU load (vendor)* wherever it is shown; on a machine without L2 the field is N/A, never a sum that is not the number the user expects. What L1 does read from PDH is one counter, `\GPU Adapter Memory(luid_…_phys_0)\Dedicated Usage`, bound by LUID — the figure Task Manager labels "Dedicated GPU memory", measured 1301 MB at an idle desktop on the RTX 5080. Reopening this needs a measurement of `max(engine)` against Task Manager's own number, not a decision |
+92 -10
View File
@@ -163,20 +163,49 @@ is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a dri
### NEXT
1. **The owner runs item 45** — Cyberpunk 2077 first, frame generation off and then on; every outcome's meaning is
written there. Not first on a game under the user-mode exception's trial (D38).
2. **What follows is the owner's to say once a real game has been read**: more titles; whether the session
summary's latency fields are filled from it; whether D141 stands on a game's numbers.
1. ~~**The owner runs item 45**~~ **Run on 2026-11-14 in Phantom Blade Zero, three sessions: the read works in a
real game** (item 45's last paragraphs) — the driver was found, read every second, and no call took more than
45 µs. **Cyberpunk 2077 followed the same morning, twice, and three games the read must leave alone** (sessions
211–215): read, 65 µs at the slowest, and *not read* where it should be. **Still to run of it**: Reflex off in
a game's menu, off means off; and the owner's word on whether the games felt different.
2. **The owner answered on the *GPU render* line (2026-11-14): read the driver's active time.** Two more members
of the report FrameLedger already fetches — no further call into the driver. ~~**Plan first**~~ **Planned and
approved the same day as the train of 0.1.0-beta.48 (D142–D147)**: the native half first, then the Agent, the
App and the texts, then the sampling period, then the release and owner-only item 46 — one batch of tests for
the owner, with what is left of item 45 in it. What the plan gathered: the multiplier row that keeps only the last value, the pages that still say no real game
was read, the Agent's 1.32 s between samples beside `hz` 1.0. The owner tests what is left once, on that
release. Still the owner's to say: more titles; the session summary's latency fields; D141 (the slowest call
seen in a game is 65 µs, thirty times under it).
3. **`slAllocateResources`** keeps its patch (D135); looked at again when there are more sessions.
4. **Train D** after train C, the same way: a spike first — `sl.pcl.markers` waits for it, and §30 found its hook
would miss a game that fetched its functions before the attach.
### Left open by this session
- **This release's own facts** — the tag's run, the digests, the delta — are not in any file yet: the release is cut
after this text. Record them in the next pull request, with what SonarCloud and Qodana said.
- **No real game has run the read.** The order in which nothing else changed for a game is not a reason to skip
item 45's (h).
- ~~**This release's own facts** — the tag's run, the digests, the delta — are not in any file yet: the release is cut
after this text. Record them in the next pull request, with what SonarCloud and Qodana said.~~ **Recorded
2026-11-14: 0.1.0-beta.47 was released 2026-11-14T01:11:19Z** (08:11 in the owner's time zone) from the signed
tag on `3d7c273` (#446), by run 43537436561 — green at the first attempt, one run for the one tag push. Eight
assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed; the four shipped natives carry
`FL_BUILD_ID v0.1.0-beta.47`. The delta from beta.46 is 1 820 144 bytes beside a full package of 110 795 507 —
"Delta processed 0452 files. 0024 patched, 0428 unchanged". The wiki was published by run 43539059710. The
rehearsal on the release branch (run 43534606602, at `43426fe`, the released tree) had made a delta of 1 838 295
bytes with the same file counts. **SonarCloud answered on `3d7c273`: the quality gate passed and no issue is open
on `main`. Qodana's two reports, CodeQL and `check` are green on that commit.** On the way the advisory checks
found three things after local gates were green (§Traps), and no required check failed.
- **The release branch's local gate was red once, for a reason outside the code** (2026-11-14 07:20): the freshly
linked `fl_guard_test.exe` was gone from the build tree seconds after the gate began — Windows Defender's log has
three configuration changes at 07:20:53–56 and no detection; which security program removed the file is not
known, and nothing of its settings was looked at further or touched. `fl_guard` ended after 0.72 s **and was
counted as failed, not passed**: the rule of #438 (a native test names the line it ends on) did what it was
written for. Run again, the gate was green.
- ~~**No real game has run the read.**~~ Two have (Phantom Blade Zero and Cyberpunk 2077, 2026-11-14). **The accuracy
statement, `LIMITATIONS.md` and the guide still say no real game had been read**: true when written, to be
brought up to date with the next release, as beta.46's pages were.
- **In Phantom Blade Zero the driver's *GPU render* span is longer than its total** (item 45): shown as reported,
not explained. In Cyberpunk 2077 it is not. The owner's answer: read the driver's active time (NEXT 2).
- **The Agent's samples are 1.32 s apart while `sensor_blobs.hz` says 1.0** (seen 2026-11-14 in the `t_ms` series,
in sessions back to beta.42). Not looked into: whether anything reads `hz` as the spacing.
- **No test runs the whole path through the real Agent**: the injected tests stop at the shared memory and the
sampler's start from it; no end-to-end case loads the stand-in module under an Agent session.
- **Two install batches of beta.46 took 0.61 s and 1.26 s and nothing explains them** (Hogwarts Legacy, Cyberpunk
@@ -194,8 +223,9 @@ is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a dri
- **`LIMITATIONS.md` and the accuracy statement still say the processor's, the memory's and the motherboard's
sensors "have never been read on real hardware"** — the owner's to reword. The alpha line still rests (D98).
**Owner-only:** item 45; one session each of Valor Mortis and Black Myth: Wukong with hooking off; what item 41
left unexercised; item 40 (d).
**Owner-only:** what is left of item 45 (Reflex off in a game's menu; off means off; how it felt); one session
each of Valor Mortis and Black Myth: Wukong with hooking off; what item 41 left unexercised;
item 40 (d).
## Owner-only — no PR can close these
@@ -747,6 +777,52 @@ left unexercised; item 40 (d).
`0xc0000409`): a Control Flow Guard refusal of the call — say so at once with the entry; that game enforces
what the probe could only check for this driver. Spans that make no sense — a part larger than the total, a
line that is always zero: say which; they are the driver's numbers and are shown as it reported them.
**Three sessions were run on 2026-11-14 and read the same morning — in Phantom Blade Zero, not Cyberpunk 2077**
(sessions 208–210, Direct3D 12, Streamline 2.14.1). **The read works in a real game.** (a) held: the terms were
accepted once, Disclaimer 2.16 and Privacy Policy 2.20. In all three the overlay log has `LATENCY … reading the
driver's latency report` four to five seconds after the attach, with `C:\WINDOWS\SYSTEM32\nvapi64.dll` and
`…\nvapi64_impl.dll` on the two lines after it, and **no later `LATENCY` line**: no error, no slow call, no
fault, no stall. Each session's line reads *read*, and the slowest call into the driver was **24, 20 and 45 µs**.
Frame generation on: session 208, ×3.0 at 85 → 256 — and the driver's own `fgMultiplier` read 3. Off: sessions
209 and 210, multiplier 1. Seven series in each, 227 / 24 / 823 points: 90 %, 62 % and 98 % of the Agent's own
once-a-second samples (the short session spent its first seconds before the module was found). With frame
generation ×3: total 23.4 ms, simulation 4.4, render submit 10.3, present 0.7, driver 10.9, OS queue 13.0, GPU
render 11.5 (means). The driver's switches: `bLowLatencyMode`, `bUseGameSleep` and `bFullscreenIFlip` *on at
times, off at others*; `bFsVrr` and `bCplVsyncOn` *off* — so in a game the low-latency switch does read on,
which it never did for the probe. No fault counted, nothing dropped, a normal exit each time, nothing about the
game in Windows' application log; rates as on beta.46 for the same game.
**One outcome the list above names: a part larger than the total.** *GPU render* reads 16.4 ms where the *total*
reads 5.4 ms (session 209), and about equals it in session 210 (16.0 against 15.9 ms). The span is the driver's
`gpuRenderStartTime` to `gpuRenderEndTime`, and in this game that start lies **before** the frame's own
simulation start: it reads like the time between two frames' GPU ends, idle time included — a reading, not a
fact; the driver has a field of its own for the active time (`gpuActiveRenderTimeUs`), which FrameLedger does
not read. It is shown as the driver reported it. The spans also overlap — render submit, driver and OS queue
together are longer than the total — so they are not parts that add up, and the page does not say they are.
**Not run**: Cyberpunk 2077, which (b) and (c) name; (d) Reflex off in the game's menu; (f) a game that is not
Direct3D 12 or has no NVIDIA library; (g) off means off. **Not said**: whether the game felt any different with
the option on. Not passed as written; what the three sessions were run for is answered.
**Five more sessions the same morning (211–215), read at 09:15: Cyberpunk 2077 twice, and three games the
read must leave alone.** (b), (c) **Cyberpunk 2077** (Streamline 2.14.1, DLSS): session 211 with frame
generation ×2.0 for 42 % of it (166 → 330) and menus for the rest, session 212 without, at 238 FPS. The module
was found 4.8 s and 2.6 s after the attach, in the same two files; each session's line reads *read*; **the
slowest call took 34 and 65 µs**; no later `LATENCY` line. 190 of 195 and 429 of 438 samples carry a report.
The total: 13.5 ms while frames were generated, 4.1 ms in the menus, 11.7 ms at 238 FPS without generation.
**GPU render is 2.7 ms there and never longer than the total** (0 of 429 samples; 1 of 190) — so what the
three sessions above showed is Phantom Blade Zero's, not the route's. `bLowLatencyMode` *on* throughout. The
table's `fgMultiplier` reads **1 in the session that held ×2 for 105 seconds**: the row keeps the last value
read, and that session ended in a menu — a row that lists what was seen would not mislead. D137's first
Cyberpunk batches: eight of them, 85–221 ms, every one `install` in one apply; beta.46's 0.61 s did not recur.
(f) **Not Direct3D 12**: Crown & Coin (213) and Psycho-Sleuth (214), both Direct3D 11 — one `LATENCY no
Direct3D 12 device` line each, nothing after it, the session's line reads *not read — not Direct3D 12*.
**Direct3D 12 with no NVIDIA library**: Dread Fields (215) — `the game has not loaded nvapi64.dll`, said once,
*not read*. The three ran at the same time and were recorded apart. (h) held in all five: no fault counted,
nothing dropped, normal exits, nothing in Windows' application log.
**A correction to the paragraph above**: the Agent's samples are **1.32 s apart, not one second** (the `t_ms`
series; so in every session looked at back to beta.42, while `sensor_blobs.hz` says 1.0 — not looked into),
so the shares are 227 of 258, 24 of 39 and 823 of 846 samples, and the gaps are the first seconds of a session.
**The owner's answer on the *GPU render* line (2026-11-14): read the driver's active time** — planned as one
train with what else is open. **Left of this item**: (d) Reflex off in the game's menu, (g) off means off, and
the owner's word on how the games felt; the owner runs what is left once, with that train's release.
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
@@ -902,6 +978,12 @@ Where each owner decision is recorded — the file and its section, and a label
| D139 | [`spike-notes/31-reflex-route-d-harness.md`](spike-notes/31-reflex-route-d-harness.md) §The leg with a sleep | before any Overlay code the probe runs a leg with `NvAPI_D3D_SetSleepMode` and `NvAPI_D3D_Sleep` — writes, in the probe's own process, on its own device, in no shipped binary |
| D140 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14 | an `nvapi64.dll` loaded from the game's own folder — a replacement, not the driver's — is refused, and the session says why |
| D141 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14 | one call into the driver of 2 ms or more switches the Reflex read off until the game exits |
| D142 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a driver | asked on 2026-11-14 with Phantom Blade Zero's *GPU render* longer than its total: read the driver's `gpuActiveRenderTimeUs`, and with it `gpuFrameTimeUs` — two more members of the report already fetched, no further call |
| D143 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §The inventory | the start-to-end *GPU render* line stays, stored and shown, under a label that says it includes the card's idle time |
| D144 | [`07_IPC.md`](07_IPC.md) §Region 5 | the driver's frame-generation multiplier is kept as every value a session saw, not the last one |
| D145 | [`../legal/ACCURACY.md`](../legal/ACCURACY.md) | the accuracy statement, the README and the guide say two real games were read on one driver (they said none); Privacy Policy 2.21 and Disclaimer 2.17 with it |
| D146 | [`06_DATA_MODEL.md`](06_DATA_MODEL.md) §sensor_blobs | the Agent's samples were 1.32 s apart under a 1 s setting (it waited the whole interval after its work): sample on a fixed period, and store the rate the samples had |
| D147 | [`03_METRICS.md`](03_METRICS.md) | the session summary's latency fields stay N/A: the driver's total is simulation start to GPU end, not input to display |
| D109 | [`../legal/DISCLAIMER.md`](../legal/DISCLAIMER.md) §5, §5A | asked on 2026-11-11 with both sentences quoted: the Disclaimer goes to 2.15 with the Privacy Policy — PawnIO and the admin mode are no longer "for the CPU temperature" alone; with Advanced metrics on they also read the processor's, the memory's and the motherboard's sensors. The admin mode's disclosure follows (`agent-admin-dialog/2`) |
---
+14
View File
@@ -63,6 +63,20 @@ are kept because they record what each version changed and why (owner decision D
>
> Version 2.5 (2026-09-27, 0.1.0-beta.10) adds how a tracked game's window is shown — read from Windows — and the engine build name read from an Unreal Engine game's executable. It is also the first version to say two things the software already did: it reads the **content** of a library game's executable (markers in its first 8 MB and its import table, since the detection of engines and features; and, when a session starts, the graphics-library markers in the whole file), and it reads the processor load and the memory in use (since 0.1.0-beta.3). Nothing here leaves your device, as before.
### What version 2.21 of the Privacy Policy and 2.17 of the Disclaimer changed (0.1.0-beta.48)
**Two real games had been read, and the texts still said none** (owner decisions D142–D145; the wording's main
points approved with the plan of 2026-11-14). The accuracy statement — and so the README and the Disclaimer, which
carry it — said the driver's report had been "read with a test program against one driver and one card; no real
game had been read when this was written". On 2026-11-14 the owner read it in Phantom Blade Zero and Cyberpunk
2077, and the first of them showed something the statement did not say: the stages overlap, and the graphics
card's stage — the driver's start mark to its end mark — includes the card's waiting and was longer than the whole
frame. So the statement now says both, names the two figures of the driver's own that are shown beside that stage
since this release, and says a driver may give neither. The **Privacy Policy** (2.21) adds those two averages to
what a session stores, and "its frame-generation multiplier" becomes the multipliers the driver gave during the
session. The **Disclaimer** (2.17) changes nowhere else: the component makes no new call, so §2's paragraph on the
one call it makes stands as written.
### What version 2.20 of the Privacy Policy and 2.16 of the Disclaimer changed (0.1.0-beta.47, train C)
**The part inside a game makes a call of its own** (owner decisions D132, D136, D138–D141; the wording's main
@@ -179,3 +179,43 @@ is what tells the two apart afterwards — a driver that holds a call does it ag
milliseconds, once.
**The owner was asked again with this table in hand and kept D141 as it is: one call** (2026-11-13).
### The first real game (2026-11-14, 0.1.0-beta.47, the owner's sessions 208–210)
Phantom Blade Zero, Direct3D 12, three sessions — frame generation ×3, then off twice. What only a game could say,
and now has for one title on this driver:
- **The game's own device is the one the driver takes**, and `nvapi64.dll` is findable by name in a game that uses
Reflex through Streamline: resolved four to five seconds after the attach, the shim in System32 and the getters
in `nvapi64_impl.dll`.
- **No latch fired in 1 515 seconds of reading**: the slowest call was 24, 20 and 45 µs, under a game's real load
and with frame generation's pacer running. The busy-PC reading above put a false latch at a few sessions in a
hundred at worst; three sessions cannot confirm or deny that.
- **The report is real**: with frame generation ×3 the total is 23 ms; without it, 5.4 ms at 149 presents a second
and 15.9 ms at 67. `inputSampleTime` is not read; `driverStartTime` is reported (the driver series has points).
- **The sleep status' low-latency switch reads on in a game** (on at times, off at others) — it never did for the
probe. And the driver's `fgMultiplier` read 3 in the session FrameLedger measured at ×3.0.
- **`gpuRenderStartTime` lies before `simStartTime` in this game**: start to end is 16.4 ms where simulation start
to GPU end is 5.4 ms. The span includes whatever the GPU did before this frame's simulation began — it reads
like the interval between two frames' GPU ends. The header's `gpuActiveRenderTimeUs` is the active time and is
not read by FrameLedger. The probe could not show this: its frames have no GPU work to speak of.
Not said by these sessions: ~~Cyberpunk 2077 (REDengine's own NVAPI use)~~, a game that enforces Control Flow
Guard, another driver, and whether the player feels the read.
**Cyberpunk 2077, the same morning (sessions 211 and 212).** Frame generation ×2 for 105 s of the first, off in
the second at 238 FPS. Read in both; the slowest call 34 and 65 µs; a report in 97 % and 98 % of the samples.
- **The spans are sane there**: total 11.7 ms at 238 FPS, GPU render 2.7 ms, never longer than the total (0 of
429 samples). With frames generated the total is 13.5 ms; in the menus 4.1 ms. So `gpuRenderStartTime` before
`simStartTime` is Phantom Blade Zero's, where *GPU render* sits at 16.4 ms whether the game presents 149 or 67
times a second.
- **`fgMultiplier` read 1 in the session that generated ×2**: the word carries the last value, and the session
ended in a menu. The table needs the values seen, not the last one.
- **Samples are 1.32 s apart** (the Agent's `t_ms`), reads one second apart: a read is not always the one sampled.
- **Left alone as designed**: two Direct3D 11 games (state 1, one line) and a Direct3D 12 game that never loaded
`nvapi64.dll` (state 2, said once, asked again each second without a line).
**The owner's ruling on the span (2026-11-14): read the driver's active time** — `gpuActiveRenderTimeUs`, which
the header defines as the same interval "excluding the idles in between", and with it `gpuFrameTimeUs`. Both are
members of the report already fetched.
+10 -3
View File
@@ -89,9 +89,16 @@ On an NVIDIA card, in a **Direct3D 12** game that uses **NVIDIA Reflex**, a sess
stores the driver's own latency report: how long the driver says each stage of a frame took — *simulation*,
*render submit*, *present*, *driver*, *operating system's render queue*, *GPU render*, and the *total* from the start
of simulation to the end of the graphics card's work. They are seven lines under **Latency**, one point about every
second, each the average of the frames the driver reported since the point before, in microseconds. A table beside
them shows the driver's low-latency state as five switches, by NVIDIA's own names, each *On*, *Off* or *On at times,
off at others*.
second, each the average of the frames of one reading, in microseconds. A table beside them shows the driver's
low-latency state as five switches, by NVIDIA's own names, each *On*, *Off* or *On at times, off at others*, and
`fgMultiplier`: every frame-generation multiplier the driver gave during the session (*1, 2* is a session that
generated frames at ×2 for part of it).
**The stages overlap; they are not parts that add up to the total.** And *GPU render, start to end* includes the
time the card spent waiting between pieces of work — in one game it is longer than the whole frame. So a second
chart, **the graphics card's time per frame, as the driver works it out**, has two lines of the driver's own
figures: *GPU active render*, the same stage without the waiting, and *GPU frame time*, from the end of one
frame's work to the end of the next. A driver may give neither; the chart is then not there, and nothing is wrong.
Three things to know about them:
+6 -3
View File
@@ -92,9 +92,12 @@
> long the driver says each stage of a frame took — simulation, render submit, present, driver, the operating
> system's queue, the graphics card — read from the graphics driver about once a second and shown as the driver
> reported it: **the driver's numbers, not a measurement by FrameLedger**, an average of the frames of one read,
> never checked against another tool, and not the delay from a click to the screen. Read with a test program
> against one driver and one card; **no real game had been read when this was written**. A game that does not use
> Reflex has none. The session summary's latency fields stay N/A.
> never checked against another tool, and not the delay from a click to the screen. **The stages overlap and do
> not add up to the total.** The graphics card's stage runs from its start to its end and includes the time the
> card waited — in one game it was longer than the whole frame — so since beta.48 two figures the driver works
> out itself are shown beside it: the card's active time, and the time from one frame's end to the next. A
> driver may give neither, and then there is no line. Read in two real games, on one driver and one card
> (2026-11-14). A game that does not use Reflex has none. The session summary's latency fields stay N/A.
> - **Pacing, VSync and the graphics card (since beta.14):** the share of the time below 30 FPS, below 60 FPS and below
> the monitor's refresh rate, measured from frame times with small margins so that a game held at its limit is not
> counted as below it (a rate less than 2 % under the line reads partly as at it), and how much one frame's time
+7 -4
View File
@@ -1,6 +1,6 @@
# FrameLedger — Disclaimer
**Version:** 2.16 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.17 · **Effective:** {{RELEASE_DATE}}
## 0. This is pre-release software
@@ -205,9 +205,12 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
> long the driver says each stage of a frame took — simulation, render submit, present, driver, the operating
> system's queue, the graphics card — read from the graphics driver about once a second and shown as the driver
> reported it: **the driver's numbers, not a measurement by FrameLedger**, an average of the frames of one read,
> never checked against another tool, and not the delay from a click to the screen. Read with a test program
> against one driver and one card; **no real game had been read when this was written**. A game that does not use
> Reflex has none. The session summary's latency fields stay N/A.
> never checked against another tool, and not the delay from a click to the screen. **The stages overlap and do
> not add up to the total.** The graphics card's stage runs from its start to its end and includes the time the
> card waited — in one game it was longer than the whole frame — so since beta.48 two figures the driver works
> out itself are shown beside it: the card's active time, and the time from one frame's end to the next. A
> driver may give neither, and then there is no line. Read in two real games, on one driver and one card
> (2026-11-14). A game that does not use Reflex has none. The session summary's latency fields stay N/A.
> - **Pacing, VSync and the graphics card (since beta.14):** the share of the time below 30 FPS, below 60 FPS and below
> the monitor's refresh rate, measured from frame times with small margins so that a game held at its limit is not
> counted as below it (a rate less than 2 % under the line reads partly as at it), and how much one frame's time
+2 -2
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.20 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.21 · **Effective:** {{RELEASE_DATE}}
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
@@ -11,7 +11,7 @@ Stored in `%LOCALAPPDATA%\FrameLedger` on your device:
- Your game library entries (names, executable paths, metadata you or the app filled in, and whether each one is recorded).
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC, or a game ships in its own folder, is shown from where it is and not copied.
- Performance sessions: frame timing series, computed statistics, hardware sensor series (temperatures, load, power, memory usage, and the graphics card's clock speeds, fan speed, memory temperature and whether its power limit or heat held it back), the game's own memory use (its dedicated and shared video memory, private working set, working set and commit, once a second), session duration, crash flags, the graphics driver's settings the game ran under (NVIDIA only), how the game's window was shown (full-screen, borderless or windowed, for how long, its size and the monitor's), tags and notes you write.
- **Only while Settings ▸ Advanced metrics is on** (it is off unless you switch it on), with each session: more hardware sensor series — the graphics card's memory use in detail, its load by part, its clocks, voltages, currents, power, each fan and its video encoder's use; and, when the capture agent runs as administrator with PawnIO installed, the processor's temperatures, load, clocks, power and voltages by core, the memory in use and its modules' temperatures, and the motherboard's temperatures, fans and voltages — and a description of the hardware: the graphics card's firmware version, architecture, bus and memory sizes, the graphics driver's package and the chipset it names, the motherboard's and the memory modules' model names, what each connected display can do (the HDR formats it accepts, its brightness range, variable refresh), whether variable refresh was in use on the display the game ran on and the colour space the game presented in, and the graphics driver's settings — its global ones and the ones it holds for the game (NVIDIA only). For a game FrameLedger injects into, a session then also stores what the game itself passed to its upscaler in the calls FrameLedger intercepts: the output size, the model presets and the exposure values it gave DLSS, whether it said its colour buffers are HDR, auto-exposure and alpha upscaling; and the sharpening, the size of the jitter, the exposure, the depth range, the lowest and highest field of view and the flags it gave FSR, the frame time it reported to FSR, and FSR's own video memory when the game asked for it; what the game told NVIDIA Streamline about each frame — the size of the jitter, the motion-vector scale, the depth range and whether depth is inverted, the lowest and highest field of view, the aspect ratio, whether the projection is orthographic, how its motion vectors are stored and how often it reset the upscaler's history; and how it configured FSR frame generation — on or off, whether it may run asynchronously, its flags, whether only generated frames are presented, and the rectangle it generates in; and what NVIDIA Streamline answered when the game asked it about a feature — which features the game asked about, the version of each and of its NGX model, and what each requires: the graphics APIs it supports, whether V-Sync must be off and hardware-accelerated GPU scheduling on, how many processor threads, viewports and buffers, and the versions of Windows and of the graphics driver that Streamline found beside the ones the feature needs ; and, for each Streamline feature the game asks about or controls: whether Streamline answers that it is supported, whether it is loaded, whether the game switched it on or off while it ran, and how many times its resources were allocated and freed; and whether the game shut Streamline down, and how many times — never the lists Streamline's answer points to (the buffers' names, the names of Vulkan extensions and features), never what identifies the graphics card that the game hands over with its question, never the content of a graphics resource, and never where the game's camera is, which way it looks, or its matrices. For a Direct3D 12 game that had itself loaded NVIDIA's driver library, a session also stores what the graphics driver reports about the game's frames when FrameLedger asks it, about once a second, from inside the game: how long each stage of a frame took — simulation, render submit, present, the driver, the operating system's queue and the graphics card, and the whole from the start of simulation to the end of the graphics card's work — as averages in microseconds, and the driver's low-latency state (five switches it reports, and its frame-generation multiplier) — never a time of day, and never the moment the player pressed anything. No serial number, no display identification data (EDID) and no list of other programs is read or stored. Switching the option off stops the reading, inside a game as well; what earlier sessions stored stays with them until you delete those sessions.
- **Only while Settings ▸ Advanced metrics is on** (it is off unless you switch it on), with each session: more hardware sensor series — the graphics card's memory use in detail, its load by part, its clocks, voltages, currents, power, each fan and its video encoder's use; and, when the capture agent runs as administrator with PawnIO installed, the processor's temperatures, load, clocks, power and voltages by core, the memory in use and its modules' temperatures, and the motherboard's temperatures, fans and voltages — and a description of the hardware: the graphics card's firmware version, architecture, bus and memory sizes, the graphics driver's package and the chipset it names, the motherboard's and the memory modules' model names, what each connected display can do (the HDR formats it accepts, its brightness range, variable refresh), whether variable refresh was in use on the display the game ran on and the colour space the game presented in, and the graphics driver's settings — its global ones and the ones it holds for the game (NVIDIA only). For a game FrameLedger injects into, a session then also stores what the game itself passed to its upscaler in the calls FrameLedger intercepts: the output size, the model presets and the exposure values it gave DLSS, whether it said its colour buffers are HDR, auto-exposure and alpha upscaling; and the sharpening, the size of the jitter, the exposure, the depth range, the lowest and highest field of view and the flags it gave FSR, the frame time it reported to FSR, and FSR's own video memory when the game asked for it; what the game told NVIDIA Streamline about each frame — the size of the jitter, the motion-vector scale, the depth range and whether depth is inverted, the lowest and highest field of view, the aspect ratio, whether the projection is orthographic, how its motion vectors are stored and how often it reset the upscaler's history; and how it configured FSR frame generation — on or off, whether it may run asynchronously, its flags, whether only generated frames are presented, and the rectangle it generates in; and what NVIDIA Streamline answered when the game asked it about a feature — which features the game asked about, the version of each and of its NGX model, and what each requires: the graphics APIs it supports, whether V-Sync must be off and hardware-accelerated GPU scheduling on, how many processor threads, viewports and buffers, and the versions of Windows and of the graphics driver that Streamline found beside the ones the feature needs ; and, for each Streamline feature the game asks about or controls: whether Streamline answers that it is supported, whether it is loaded, whether the game switched it on or off while it ran, and how many times its resources were allocated and freed; and whether the game shut Streamline down, and how many times — never the lists Streamline's answer points to (the buffers' names, the names of Vulkan extensions and features), never what identifies the graphics card that the game hands over with its question, never the content of a graphics resource, and never where the game's camera is, which way it looks, or its matrices. For a Direct3D 12 game that had itself loaded NVIDIA's driver library, a session also stores what the graphics driver reports about the game's frames when FrameLedger asks it, about once a second, from inside the game: how long each stage of a frame took — simulation, render submit, present, the driver, the operating system's queue and the graphics card, and the whole from the start of simulation to the end of the graphics card's work — as averages in microseconds, with two figures the driver works out itself (how long the graphics card was actually at work on a frame, and the time from the end of one frame's work to the end of the next), and the driver's low-latency state (five switches it reports, and the frame-generation multipliers it gave during the session) — never a time of day, and never the moment the player pressed anything. No serial number, no display identification data (EDID) and no list of other programs is read or stored. Switching the option off stops the reading, inside a game as well; what earlier sessions stored stays with them until you delete those sessions.
- A hardware snapshot per session (CPU/GPU model, driver version, RAM size, OS build, display mode) used for the "what changed between sessions" feature.
- App settings, logs (rotated daily — the app keeps 7 days, the capture agent 14 — including the logs written by the component loaded into games), and, after a crash of the app itself, crash dump files.
- Which games you enabled code injection for, and when you consented.
+9
View File
@@ -193,6 +193,7 @@ public static class Strings
nameof(Adv_nvapi_load_video),
nameof(Adv_nvapi_pstate),
nameof(Adv_nvapi_reflex_frame_report),
nameof(Adv_nvapi_reflex_gpu_times),
nameof(Adv_nvapi_reflex_mode),
nameof(Adv_nvapi_reflex_sleep_status),
nameof(Adv_nvapi_session_driver_profile),
@@ -346,6 +347,7 @@ public static class Strings
nameof(AdvSource_PawnIoMissing),
nameof(AdvSource_Reading),
nameof(AdvSource_Unknown),
nameof(AdvToken_active_render),
nameof(AdvToken_adaptive_sync),
nameof(AdvToken_agp),
nameof(AdvToken_axi),
@@ -358,6 +360,7 @@ public static class Strings
nameof(AdvToken_driver_default),
nameof(AdvToken_edr),
nameof(AdvToken_fpci),
nameof(AdvToken_frame_time),
nameof(AdvToken_game_ready),
nameof(AdvToken_gpu_render),
nameof(AdvToken_gsync_module),
@@ -1887,6 +1890,8 @@ public static class Strings
public static string Adv_nvapi_reflex_frame_report => ResourceManager.GetString(nameof(Adv_nvapi_reflex_frame_report), Culture) ?? nameof(Adv_nvapi_reflex_frame_report);
public static string Adv_nvapi_reflex_gpu_times => ResourceManager.GetString(nameof(Adv_nvapi_reflex_gpu_times), Culture) ?? nameof(Adv_nvapi_reflex_gpu_times);
public static string Adv_nvapi_reflex_mode => ResourceManager.GetString(nameof(Adv_nvapi_reflex_mode), Culture) ?? nameof(Adv_nvapi_reflex_mode);
public static string Adv_nvapi_reflex_sleep_status => ResourceManager.GetString(nameof(Adv_nvapi_reflex_sleep_status), Culture) ?? nameof(Adv_nvapi_reflex_sleep_status);
@@ -2193,6 +2198,8 @@ public static class Strings
public static string AdvSource_Unknown => ResourceManager.GetString(nameof(AdvSource_Unknown), Culture) ?? nameof(AdvSource_Unknown);
public static string AdvToken_active_render => ResourceManager.GetString(nameof(AdvToken_active_render), Culture) ?? nameof(AdvToken_active_render);
public static string AdvToken_adaptive_sync => ResourceManager.GetString(nameof(AdvToken_adaptive_sync), Culture) ?? nameof(AdvToken_adaptive_sync);
public static string AdvToken_agp => ResourceManager.GetString(nameof(AdvToken_agp), Culture) ?? nameof(AdvToken_agp);
@@ -2217,6 +2224,8 @@ public static class Strings
public static string AdvToken_fpci => ResourceManager.GetString(nameof(AdvToken_fpci), Culture) ?? nameof(AdvToken_fpci);
public static string AdvToken_frame_time => ResourceManager.GetString(nameof(AdvToken_frame_time), Culture) ?? nameof(AdvToken_frame_time);
public static string AdvToken_game_ready => ResourceManager.GetString(nameof(AdvToken_game_ready), Culture) ?? nameof(AdvToken_game_ready);
public static string AdvToken_gpu_render => ResourceManager.GetString(nameof(AdvToken_gpu_render), Culture) ?? nameof(AdvToken_gpu_render);
+13 -1
View File
@@ -385,6 +385,10 @@
<value>フレームごとの遅延: シミュレーション、レンダー送信、プレゼント、ドライバー、OS キュー、GPU レンダー</value>
<comment>review</comment>
</data>
<data name="Adv_nvapi_reflex_gpu_times" xml:space="preserve">
<value>ドライバーが算出するフレームごとの GPU 時間: 実描画時間、フレーム間隔</value>
<comment>review</comment>
</data>
<data name="Adv_nvapi_reflex_mode" xml:space="preserve">
<value>Reflex: 低遅延モード、ブースト、フレーム レート制限</value>
<comment>review</comment>
@@ -1049,8 +1053,16 @@
<value>Game Ready</value>
<comment>review</comment>
</data>
<data name="AdvToken_active_render" xml:space="preserve">
<value>GPU 実描画 (待機時間を除く)</value>
<comment>review</comment>
</data>
<data name="AdvToken_frame_time" xml:space="preserve">
<value>GPU フレーム時間 (前のフレームの終了から次の終了まで)</value>
<comment>review</comment>
</data>
<data name="AdvToken_gpu_render" xml:space="preserve">
<value>GPU 描画</value>
<value>GPU 描画、開始から終了まで (待機時間を含む)</value>
<comment>review</comment>
</data>
<data name="AdvToken_gsync_module" xml:space="preserve">
+10 -1
View File
@@ -294,6 +294,9 @@
<data name="Adv_nvapi_reflex_frame_report" xml:space="preserve">
<value>Latency per frame: simulation, render submit, present, driver, OS queue, GPU render</value>
</data>
<data name="Adv_nvapi_reflex_gpu_times" xml:space="preserve">
<value>The graphics card's time per frame, as the driver works it out: active render, frame to frame</value>
</data>
<data name="Adv_nvapi_reflex_mode" xml:space="preserve">
<value>Reflex: low-latency mode, boost, the frame-rate limit</value>
</data>
@@ -792,8 +795,14 @@
<data name="AdvToken_game_ready" xml:space="preserve">
<value>Game Ready</value>
</data>
<data name="AdvToken_active_render" xml:space="preserve">
<value>GPU active render (idle time excluded)</value>
</data>
<data name="AdvToken_frame_time" xml:space="preserve">
<value>GPU frame time, one frame's end to the next</value>
</data>
<data name="AdvToken_gpu_render" xml:space="preserve">
<value>GPU render</value>
<value>GPU render, start to end (idle time included)</value>
</data>
<data name="AdvToken_gsync_module" xml:space="preserve">
<value>G-SYNC module</value>
+10 -1
View File
@@ -289,6 +289,9 @@
<data name="Adv_nvapi_reflex_frame_report" xml:space="preserve">
<value>Độ trễ từng khung hình: mô phỏng, gửi lệnh dựng hình, present, driver, hàng đợi hệ điều hành, GPU dựng hình</value>
</data>
<data name="Adv_nvapi_reflex_gpu_times" xml:space="preserve">
<value>Thời gian của card đồ hoạ cho mỗi khung hình, do driver tự tính: lúc thực sự vẽ, và từ khung này sang khung kế</value>
</data>
<data name="Adv_nvapi_reflex_mode" xml:space="preserve">
<value>Reflex: chế độ độ trễ thấp, boost, giới hạn tốc độ khung hình</value>
</data>
@@ -787,8 +790,14 @@
<data name="AdvToken_game_ready" xml:space="preserve">
<value>Game Ready</value>
</data>
<data name="AdvToken_active_render" xml:space="preserve">
<value>GPU thực sự vẽ (không tính lúc nghỉ)</value>
</data>
<data name="AdvToken_frame_time" xml:space="preserve">
<value>nhịp khung của GPU, từ lúc xong khung này tới lúc xong khung kế</value>
</data>
<data name="AdvToken_gpu_render" xml:space="preserve">
<value>GPU vẽ</value>
<value>GPU vẽ, từ lúc bắt đầu tới lúc xong (gồm cả lúc nghỉ)</value>
</data>
<data name="AdvToken_gsync_module" xml:space="preserve">
<value>Mô-đun G-SYNC</value>
@@ -189,6 +189,9 @@ public static class AdvancedMetricCatalog
Session("nvapi.reflex.mode", Nvapi, RefusedRoute, Text, Latency, "Reflex: low-latency mode, boost, the frame-rate limit"),
Session("nvapi.reflex.sleep_status", Nvapi, GameDriver, Table, Latency, "What the driver's low-latency state is"),
SampledFamily("nvapi.reflex.frame_report", Nvapi, GameDriver, Microseconds, Latency, "Latency per frame: simulation, render submit, present, driver, OS queue, GPU render"),
// Two figures the driver works out itself, members of the same report (0.1.0-beta.48, D142): the span between
// its two GPU marks includes the card's idle time and was longer than a frame's whole in a real game.
SampledFamily("nvapi.reflex.gpu_times", Nvapi, GameDriver, Microseconds, Latency, "The graphics card's time per frame, as the driver works it out: active render, frame to frame"),
// ---- Inside the game: routes a spike decides ------------------------------------------------------------
Session("sl.dlss.optimal_settings", Streamline, Spike, Text, Upscaling, "The render size and sharpness DLSS recommends"),
@@ -44,11 +44,26 @@ public sealed class InGameAdvancedSampler
/// </summary>
public const string LatencySeriesStem = AdvancedMetric.SeriesPrefix + "nvapi.reflex.frame_report.";
/// <summary>
/// The stem of the two series of the driver's own times (0.1.0-beta.48, D142): <c>adv.nvapi.reflex.gpu_times.</c>
/// and one of <see cref="GpuTimes"/>. An entry of their own: they are figures the driver works out, not spans
/// between two of its marks, and the seven spans stay within what one chart draws as lines.
/// </summary>
public const string GpuTimesSeriesStem = AdvancedMetric.SeriesPrefix + "nvapi.reflex.gpu_times.";
private const double _mebibyte = 1024.0 * 1024.0;
// The two groups of LatState that say which sleep switches were seen on and off.
private const uint _sleepSeenBits =
(FlAdvancedState.LatSleepBits << FlAdvancedState.LatSleepSeenOnShift) | (FlAdvancedState.LatSleepBits << FlAdvancedState.LatSleepSeenOffShift);
// The spans of a frame the driver reports, in the order the capture side publishes their sums.
private static readonly string[] _latencySpans = ["simulation", "render_submit", "present", "driver", "os_queue", "gpu_render", "total"];
// The two times the driver works out itself: the card at work without its idle time, and one frame's GPU end to
// the next's. In the order the capture side publishes their sums.
private static readonly string[] _gpuTimes = ["active_render", "frame_time"];
// NV_GET_SLEEP_STATUS_PARAMS's five switches, by bit: the vendor's own names, shown as they are.
private static readonly string[] _sleepSwitches = ["bLowLatencyMode", "bFsVrr", "bCplVsyncOn", "bUseGameSleep", "bFullscreenIFlip"];
@@ -91,11 +106,14 @@ public sealed class InGameAdvancedSampler
/// switch seen over a session, the flags of the dispatch that have a name, "none", and what a field of view
/// that cannot be radians is said to be (D128). A flag bit nobody named is <c>bit_N</c> and is shown as it is.
/// </summary>
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", _notRadians, .. _flagTokens, .. _latencySpans];
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", _notRadians, .. _flagTokens, .. _latencySpans, .. _gpuTimes];
/// <summary>The seven spans of a frame, as the last part of a series' name; the App translates each (<c>AdvToken_*</c>).</summary>
public static IReadOnlyList<string> LatencySpans => _latencySpans;
/// <summary>The driver's two own times, as the last part of a series' name; the App translates each (<c>AdvToken_*</c>).</summary>
public static IReadOnlyList<string> GpuTimes => _gpuTimes;
private InGameAdvanced? _last;
private FlLatencyState _latencyState;
private bool _latencyFrames;
@@ -272,7 +290,7 @@ public sealed class InGameAdvancedSampler
_latencyFrames = true;
uint[] sums = [s.LatSimulationSumUs, s.LatSubmitSumUs, s.LatPresentSumUs, s.LatDriverSumUs, s.LatOsQueueSumUs, s.LatGpuSumUs, s.LatTotalSumUs];
var readings = new List<AdvancedReading>(sums.Length);
var readings = new List<AdvancedReading>(sums.Length + _gpuTimes.Length);
for (int span = 0; span < sums.Length; span++)
{
if (sums[span] != FlAdvancedState.LatSumNone)
@@ -281,6 +299,18 @@ public sealed class InGameAdvancedSampler
}
}
// The driver's two own times (D142): each the mean over the frames that gave one, so each has its own count.
// A driver that gives neither - an older one leaves both zero - has no point here, and not a zero.
uint[] gpuSums = [s.LatGpuActiveSumUs, s.LatGpuFrameSumUs];
uint[] gpuFrames = [s.LatGpuCounts & 0xFFFFu, s.LatGpuCounts >> 16];
for (int time = 0; time < gpuSums.Length; time++)
{
if (gpuFrames[time] != 0)
{
readings.Add(new AdvancedReading(GpuTimesSeriesStem + _gpuTimes[time], gpuSums[time] / (double)gpuFrames[time]));
}
}
return readings;
}
@@ -326,7 +356,8 @@ public sealed class InGameAdvancedSampler
}
// The driver's sleep status (train C): its five switches as seen over the session, by the vendor's own names, and
// the frame-generation multiplier it last gave. THE DRIVER'S WORDS: on the driver the probe ran against,
// every frame-generation multiplier it gave (D144: a session that generated x2 and ended in a menu read 1 while
// only the last one was kept). THE DRIVER'S WORDS: on the driver the probe ran against,
// bLowLatencyMode read off for a device whose game had just switched low latency on (spike-notes §31) - so this
// is never worded as "the game uses Reflex".
private static void AddDriverSleepStatus(InGameAdvanced published, List<AdvancedFact> facts)
@@ -346,15 +377,35 @@ public sealed class InGameAdvancedSampler
AddSwitch(rows, _sleepSwitches[bit], ((off >> bit) & 1u) | (((on >> bit) & 1u) << 1));
}
uint multiplier = s.LatState >> FlAdvancedState.LatFgMultiplierShift;
if (multiplier != 0)
if (MultipliersSeen(s.LatMultipliersSeen) is { } multipliers)
{
rows.Add(new AdvancedRow("fgMultiplier", multiplier.ToString(CultureInfo.InvariantCulture)));
rows.Add(new AdvancedRow("fgMultiplier", multipliers));
}
facts.Add(Fact("nvapi.reflex.sleep_status", AdvancedValue.OfRows(rows)));
}
// The multipliers a session saw, lowest first: bit n of the word is multiplier n, bit 31 stands for 31 and more.
// Bit 0 is a status that gave none, which is not a multiplier and is not listed.
private static string? MultipliersSeen(uint seen)
{
var values = new List<string>(4);
for (int multiplier = 1; multiplier < 31; multiplier++)
{
if ((seen & (1u << multiplier)) != 0)
{
values.Add(multiplier.ToString(CultureInfo.InvariantCulture));
}
}
if ((seen & (1u << 31)) != 0)
{
values.Add("\u2265 31");
}
return values.Count == 0 ? null : string.Join(", ", values);
}
// Whether Streamline says each feature is supported and loaded, and what the game did with it while the session
// watched (0.1.0-beta.45): two facts, rows named as the versions' are. A refusal is the answer to "is it
// supported", so the result is said by the vendor's own name whatever it is. A count that reached 15 stopped there.
@@ -847,7 +898,7 @@ public sealed class InGameAdvancedSampler
uint SlAspect,
ulong SlFlags,
ulong SlFeatures,
uint DriverSleep)
ulong DriverSleep)
{
public static FactKey Of(InGameAdvanced published)
{
@@ -889,8 +940,9 @@ public sealed class InGameAdvancedSampler
s.SlAspectBits,
Pair(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse),
FeaturesHash(published),
// The driver's sleep status as seen and its multiplier: what the one latency fact is made of.
s.ValidMask.HasFlag(FlAdvancedValid.Latency) ? s.LatState >> FlAdvancedState.LatSleepSeenOnShift : 0u);
// The driver's sleep status as seen and the multipliers seen: what the one latency fact is made of.
// Not the LAST multiplier, which is no longer in the fact - it moves with every menu.
s.ValidMask.HasFlag(FlAdvancedValid.Latency) ? Pair(s.LatState & _sleepSeenBits, s.LatMultipliersSeen) : 0UL);
}
// The feature slots as one number (FNV-1a over the words of the slots in use): an answer that arrives, or one
+19 -1
View File
@@ -1000,8 +1000,26 @@ public unsafe struct FlAdvancedState
/// <summary>Must be zero.</summary>
public fixed byte DlssPad[3];
/// <summary>
/// The driver's own active render time (<c>gpuActiveRenderTimeUs</c>) summed over the frames of the newest read
/// that gave one, microseconds (0.1.0-beta.48, D142; four words of this line's reserve, nothing of DLSS's).
/// </summary>
public uint LatGpuActiveSumUs;
/// <summary>The driver's own frame time at the graphics card (<c>gpuFrameTimeUs</c>), summed the same way.</summary>
public uint LatGpuFrameSumUs;
/// <summary>Bits 0..15: the frames in <see cref="LatGpuActiveSumUs"/>; bits 16..31: those in <see cref="LatGpuFrameSumUs"/>.</summary>
public uint LatGpuCounts;
/// <summary>
/// Bit n: the driver's sleep status gave frame-generation multiplier n since the request; bit 31 stands for 31
/// and more (D144).
/// </summary>
public uint LatMultipliersSeen;
/// <summary>Must be zero.</summary>
public fixed uint ReservedDlss[7];
public fixed uint ReservedDlss[3];
/// <summary>Upscale dispatches whose extras were read (wraps).</summary>
public uint FfxDispatches;
@@ -656,8 +656,13 @@ inline void ObserveSlShutdown(Accumulators& a) noexcept {
// ls const NV_GET_SLEEP_STATUS_PARAMS& the driver's sleep status
//
// WHAT IS NOT READ: inputSampleTime (the probe never saw it set, and "when the player pressed something" is nothing
// a frame-time tool needs), the GPU times the driver reports beside the marks, and the sleep interval -- it changes
// with every frame, so it is not a fact of a session.
// a frame-time tool needs), the camera, cross-adapter and frame-generation times, and the sleep interval -- it
// changes with every frame, so it is not a fact of a session.
//
// TWO TIMES THE DRIVER WORKS OUT ITSELF (0.1.0-beta.48, owner decision D142): gpuActiveRenderTimeUs -- the header:
// the GPU's start to its end "excluding the idles in between" -- and gpuFrameTimeUs, one frame's GPU end to the
// next's. In a real game the span between the two GPU marks was longer than the frame's whole (HANDOFF, item 45):
// it includes the waiting. They are members of the report already in hand; no call is added.
//
// THE RULES A GAME NEEDS (spike-notes §31). The newest frames of a report are not final -- one run read a span of
// half an hour in the newest -- so the two newest ids are never summed. A span whose end point is zero was not
@@ -682,6 +687,11 @@ struct LatencyTally {
uint32_t refused = 0; // frames refused
uint32_t sumUs[kLatSpans]{}; // microseconds, over the frames summed
uint32_t lacking = 0; // bit n: a summed frame did not report span n
// The driver's two own times, each over the summed frames that gave one: a count apiece.
uint32_t activeSumUs = 0;
uint32_t activeFrames = 0;
uint32_t frameTimeSumUs = 0;
uint32_t frameTimeFrames = 0;
};
// Where the reader is in the game's frame ids: the newest one already summed or refused. 0 = none yet.
@@ -714,6 +724,17 @@ inline uint64_t LatencyFrameId(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf)
return lf.frameID;
}
// One of the driver's own times, of a frame that is summed. Zero is a frame the driver gave no such time for
// (an older driver leaves both zero, and so did the probe's frames, which had no work for the card); more than a
// second is a time no frame can have. Neither is summed, and neither refuses the frame: which frames the spans are
// made of does not depend on these.
inline void LatencyAddTime(uint32_t us, uint32_t& sumUs, uint32_t& frames) noexcept {
if (us != 0u && us <= kLatSpanLimitUs) {
sumUs += us;
++frames;
}
}
inline void ObserveLatencyFrame(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf, LatencyTally& tally) noexcept {
uint32_t us[kLatSpans]{};
const uint32_t kind[kLatSpans] = {
@@ -741,6 +762,8 @@ inline void ObserveLatencyFrame(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf,
tally.sumUs[i] += us[i];
}
}
LatencyAddTime(lf.gpuActiveRenderTimeUs, tally.activeSumUs, tally.activeFrames);
LatencyAddTime(lf.gpuFrameTimeUs, tally.frameTimeSumUs, tally.frameTimeFrames);
}
// One report: the frames newer than the cursor, the two newest left for the next read.
@@ -797,12 +820,18 @@ inline LatencySleep ObserveSleepStatus(const NV_GET_SLEEP_STATUS_PARAMS& ls) noe
return seen;
}
// The bit of fl_shm.h's latMultipliersSeen for one multiplier the status gave: bit n for n, bit 31 for 31 and more.
inline uint32_t LatencyMultiplierBit(uint32_t value) noexcept {
return 1u << (value > 31u ? 31u : value);
}
// What the watchdog publishes of it. THE WATCHDOG'S: filled from what a read left behind while nobody is reading.
struct LatencyOut {
uint32_t state = FL_LAT_NONE; // FlLatencyState
uint32_t sleepSeenOn = 0; // switches the status showed on, since the request
uint32_t sleepSeenOff = 0; // ... and off
uint32_t multiplier = 0; // the last frame-generation multiplier the status gave
uint32_t multipliersSeen = 0; // every one it gave since the request (LatencyMultiplierBit)
uint32_t reads = 0; // reads made since the request
uint32_t worstUs = 0; // the slowest call since the request
LatencyTally tally; // of the newest read not yet published; Publish empties it
@@ -898,8 +927,8 @@ inline void Reset(Accumulators& a) noexcept {
// -> even with no compare-exchange. The frame-time pair is drained, so each
// publication carries the dispatches since the last one.
//
// `latency` is the watchdog's summary of the driver's latency report, or null for a caller that has none: the ten
// words are then left as they are -- zero, in a region nobody else writes.
// `latency` is the watchdog's summary of the driver's latency report, or null for a caller that has none: the
// fourteen latency words are then left as they are -- zero, in a region nobody else writes.
inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request, uint64_t qpc,
LatencyOut* latency = nullptr) noexcept {
if (region == nullptr) {
@@ -940,6 +969,10 @@ inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request,
put32(region->latOsQueueSumUs, LatencySum(out.tally, 4u));
put32(region->latGpuSumUs, LatencySum(out.tally, 5u));
put32(region->latTotalSumUs, LatencySum(out.tally, kLatTotal));
put32(region->latGpuActiveSumUs, out.tally.activeSumUs);
put32(region->latGpuFrameSumUs, out.tally.frameTimeSumUs);
put32(region->latGpuCounts, Stop16(out.tally.activeFrames) | (Stop16(out.tally.frameTimeFrames) << 16));
put32(region->latMultipliersSeen, out.multipliersSeen);
out.tally = LatencyTally{}; // one publication carries one read: a reader never adds two up
}
@@ -899,6 +899,7 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
g_latOut.sleepSeenOn = 0u;
g_latOut.sleepSeenOff = 0u;
g_latOut.multiplier = 0u;
g_latOut.multipliersSeen = 0u;
g_latOut.tally = fl::adv::LatencyTally{};
}
if (g_latStalled) {
@@ -919,6 +920,13 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
}
g_latReadingSinceQpc = 0;
// A read that ended after the last tick of the request before this one was never taken -- nobody ticks while
// nobody asks. It is that session's: its frames are not this one's first point, and its multiplier is not one
// this session saw. (Armed is not expected here -- the request's end disarms -- and is left to its reader.)
if (newRequest && gate != kLatGateArmed) {
g_latRead.fresh = 0u;
}
// Idle, armed or off: nobody is reading. What the last read left is taken here.
if (gate != kLatGateArmed && g_latRead.fresh != 0u) {
g_latRead.fresh = 0u;
@@ -933,6 +941,7 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
g_latOut.sleepSeenOn |= g_latRead.sleep.on & FL_LAT_SLEEP_BITS;
g_latOut.sleepSeenOff |= ~g_latRead.sleep.on & FL_LAT_SLEEP_BITS;
g_latOut.multiplier = g_latRead.sleep.multiplier;
g_latOut.multipliersSeen |= fl::adv::LatencyMultiplierBit(g_latRead.sleep.multiplier);
}
if (g_latOut.state != g_latLoggedState) {
g_latLoggedState = g_latOut.state;
+24 -7
View File
@@ -75,6 +75,10 @@
// reader of an older build finds zeros where it was told to expect zeros, and the build-id handshake refuses a
// mismatched pair before either reads the other -- the precedent is slShutdowns. A trial must also be removable
// without a layout 7.
//
// STILL 5 (2026-11-14, 0.1.0-beta.48, owner decisions D142 and D144): four of the seven reserved words that ended
// region 5's second line became four more latency words (latGpuActiveSumUs .. latMultipliersSeen) -- the first line
// was full. The same reasons, and three reserved words remain there.
#define FL_SHM_LAYOUT_VERSION 5u
#define FL_SHM_HANDSHAKE_OFFSET 0x00u
@@ -1083,12 +1087,22 @@ struct alignas(64) FlAdvancedState {
uint32_t dlssExposureScaleBits; // @84
// sl::DLSSPreset PLUS ONE, in the header's order: DLAA, quality, balanced, performance, ultra performance,
// ultra quality (the last is struct version 2's - 0 where the game's struct is older).
uint8_t dlssPresets[6]; // @88..93
uint8_t dlssColorBuffersHdr; // @94 sl::Boolean PLUS ONE; 0 = not read
uint8_t dlssAutoExposure; // @95 (struct version 2)
uint8_t dlssAlphaUpscaling; // @96 (struct version 3)
uint8_t dlssPad[3]; // @97..99 must be zero
uint32_t reservedDlss[7]; // @100..127 must be zero
uint8_t dlssPresets[6]; // @88..93
uint8_t dlssColorBuffersHdr; // @94 sl::Boolean PLUS ONE; 0 = not read
uint8_t dlssAutoExposure; // @95 (struct version 2)
uint8_t dlssAlphaUpscaling; // @96 (struct version 3)
uint8_t dlssPad[3]; // @97..99 must be zero
// Reflex latency again (0.1.0-beta.48, D142 and D144): the first line was full, and this one had seven words
// spare. Nothing here is DLSS's. The two sums and their counts are of the newest read not yet published, as
// latFrames is; the two times are the driver's own figures, not spans between two of its marks, and each has
// a count of its own because a frame can give one and not the other. A frame that gives zero, or more than a
// second, is not in the sum and not in the count.
uint32_t latGpuActiveSumUs; // @100 gpuActiveRenderTimeUs over the frames that gave one, microseconds
uint32_t latGpuFrameSumUs; // @104 gpuFrameTimeUs over the frames that gave one
uint32_t latGpuCounts; // @108 bits 0..15 frames in the first sum, bits 16..31 in the second
uint32_t latMultipliersSeen; // @112 bit n: the sleep status gave fgMultiplier n since the request;
// bit 31 stands for 31 and more
uint32_t reservedDlss[3]; // @116..127 must be zero
// ---- line 2: the ffx upscale dispatch, beyond its two sizes ---------------------------------------------------
uint32_t ffxDispatches; // @128 upscale dispatches whose extras were read (wraps)
@@ -1406,7 +1420,10 @@ static_assert(offsetof(FlAdvancedState, dlssPreExposureBits) == 80);
static_assert(offsetof(FlAdvancedState, dlssPresets) == 88);
static_assert(offsetof(FlAdvancedState, dlssColorBuffersHdr) == 94);
static_assert(offsetof(FlAdvancedState, dlssAlphaUpscaling) == 96);
static_assert(offsetof(FlAdvancedState, reservedDlss) == 100);
static_assert(offsetof(FlAdvancedState, latGpuActiveSumUs) == 100);
static_assert(offsetof(FlAdvancedState, latGpuCounts) == 108);
static_assert(offsetof(FlAdvancedState, latMultipliersSeen) == 112);
static_assert(offsetof(FlAdvancedState, reservedDlss) == 116);
static_assert(offsetof(FlAdvancedState, ffxDispatches) == 128);
static_assert(offsetof(FlAdvancedState, ffxFrameTimeSumUs) == 188);
static_assert(offsetof(FlAdvancedState, ffxMemoryTotalBytes) == 192);
+19 -1
View File
@@ -7816,7 +7816,11 @@ void WatchLatency(const MappedRing& r, uint32_t request, int ms, LatencySeen& se
a.latPresentSumUs == frames * fl::stubnv::kPresentUs &&
(a.latDriverSumUs == frames * fl::stubnv::kDriverUs || a.latDriverSumUs == FL_LAT_SUM_NONE) &&
a.latOsQueueSumUs == frames * fl::stubnv::kOsQueueUs &&
a.latGpuSumUs == frames * fl::stubnv::kGpuUs && a.latTotalSumUs == frames * fl::stubnv::kTotalUs;
a.latGpuSumUs == frames * fl::stubnv::kGpuUs && a.latTotalSumUs == frames * fl::stubnv::kTotalUs &&
// The driver's two own times: every frame of the stub gives both.
a.latGpuActiveSumUs == frames * fl::stubnv::kGpuActiveUs &&
a.latGpuFrameSumUs == frames * fl::stubnv::kGpuFrameUs &&
a.latGpuCounts == (frames | (frames << 16));
}
}
Sleep(50);
@@ -7883,6 +7887,7 @@ TEST_CASE("the driver's latency report is read only while a session asks, once a
CHECK(((a.latState >> FL_LAT_SLEEP_SEEN_ON_SHIFT) & FL_LAT_SLEEP_BITS) == (1u | 8u)); // the stub's status
CHECK(((a.latState >> FL_LAT_SLEEP_SEEN_OFF_SHIFT) & FL_LAT_SLEEP_BITS) == (2u | 4u | 16u));
CHECK((a.latState >> FL_LAT_FG_MULTIPLIER_SHIFT) == 2u);
CHECK(a.latMultipliersSeen == (1u << fl::stubnv::kFgMultiplier)); // the one multiplier the status has given
CHECK((a.latReads >> 16) < 2000u); // no call of two milliseconds: that would have been the last one
LatencySeen seen;
@@ -7919,6 +7924,16 @@ TEST_CASE("the driver's latency report is read only while a session asks, once a
SetStubWord(stub->mode, fl::stubnv::kModeReports);
REQUIRE(WaitForLatState(r, 7u, fl::FL_LAT_READING, a));
// ---- 3b. THE MULTIPLIERS SEEN: the status now gives 3. The last one is 3, and the session saw both.
SetStubWord(stub->fgMultiplier, 3u);
bool sawBoth = false;
for (int i = 0; i < 8 && !sawBoth; ++i) {
REQUIRE(ReadAdvanced(r, 7u, a, a.samples));
sawBoth = a.latMultipliersSeen == ((1u << 2) | (1u << 3));
}
CHECK(sawBoth);
CHECK((a.latState >> FL_LAT_FG_MULTIPLIER_SHIFT) == 3u);
// ---- 4. NOT ASKED AGAIN. No further call.
SetAdvancedRequest(r, 0u);
TickFor(r, 2500); // the watchdog has seen the zero, and a read already under way has ended
@@ -7933,6 +7948,9 @@ TEST_CASE("the driver's latency report is read only while a session asks, once a
CHECK(LatStateOf(a) == fl::FL_LAT_READING);
CHECK((a.latReads & 0xFFFFu) <= 3u);
CHECK(StubWord(stub->queries) == 2u);
// ... and so is what it saw: the 2 of the session before is not in it, whether as a multiplier that session
// was given or as a read it left behind.
CHECK(a.latMultipliersSeen == (1u << 3));
// ---- 6. THE STOP while a session asks: nothing is called after it.
r.ctl->unhookRequested = 1;
+70 -1
View File
@@ -191,6 +191,58 @@ TEST_CASE("the sleep status is the driver's five switches and its multiplier, an
CHECK(fl::adv::ObserveSleepStatus(status).on == (2u | 8u));
}
TEST_CASE("the driver's two own times are summed over the frames that gave one, each with its own count", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
// Twelve frames, 5000..5011: ten are summed, the two newest wait.
auto report = Report(5000u, 12u);
for (std::uint32_t i = 52u; i < 64u; ++i) {
report->frameReport[i].gpuActiveRenderTimeUs = 3500u;
report->frameReport[i].gpuFrameTimeUs = 4200u;
}
report->frameReport[52].gpuActiveRenderTimeUs = 0u; // 5000: the driver gave no active time
report->frameReport[53].gpuFrameTimeUs = 1'000'001u; // 5001: a frame time no frame can have
report->frameReport[54].gpuActiveRenderTimeUs = 1'000'000u; // 5002: a second, to the microsecond, is kept
fl::adv::ObserveLatencyReport(*report, cursor, tally);
CHECK(tally.frames == 10u); // neither of the two refuses a frame
CHECK(tally.refused == 0u);
CHECK(tally.sumUs[fl::adv::kLatTotal] == 10u * 7500u);
CHECK(tally.lacking == 0u);
CHECK(tally.activeFrames == 9u);
CHECK(tally.activeSumUs == 8u * 3500u + 1'000'000u);
CHECK(tally.frameTimeFrames == 9u);
CHECK(tally.frameTimeSumUs == 9u * 4200u);
// A frame that is refused gives neither, and a driver that fills in neither leaves both counts at zero.
cursor = fl::adv::LatencyCursor{};
auto refused = Report(6000u, 3u);
refused->frameReport[61].gpuActiveRenderTimeUs = 3500u;
refused->frameReport[61].gpuFrameTimeUs = 4200u;
refused->frameReport[61].presentEndTime = refused->frameReport[61].presentStartTime - 50u;
fl::adv::ObserveLatencyReport(*refused, cursor, tally);
CHECK(tally.frames == 0u);
CHECK(tally.refused == 1u);
CHECK(tally.activeFrames == 0u);
CHECK(tally.frameTimeFrames == 0u);
cursor = fl::adv::LatencyCursor{};
auto older = Report(7000u);
fl::adv::ObserveLatencyReport(*older, cursor, tally);
CHECK(tally.frames == 62u);
CHECK(tally.activeFrames == 0u);
CHECK(tally.activeSumUs == 0u);
CHECK(tally.frameTimeFrames == 0u);
}
TEST_CASE("a multiplier the status gave has a bit of its own, and thirty-one and more share the last", "[latency]") {
CHECK(fl::adv::LatencyMultiplierBit(0u) == 1u);
CHECK(fl::adv::LatencyMultiplierBit(1u) == 2u);
CHECK(fl::adv::LatencyMultiplierBit(4u) == 16u);
CHECK(fl::adv::LatencyMultiplierBit(31u) == 0x80000000u);
CHECK(fl::adv::LatencyMultiplierBit(255u) == 0x80000000u);
}
TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries it once", "[latency]") {
fl::adv::Accumulators a;
fl::FlAdvancedState region{};
@@ -199,6 +251,7 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
out.sleepSeenOn = 1u | 8u;
out.sleepSeenOff = 2u | 4u | 16u;
out.multiplier = 2u;
out.multipliersSeen = (1u << 1) | (1u << 2);
out.reads = 70'000u; // stops at 65535
out.worstUs = 66u;
out.tally.frames = 10u;
@@ -207,6 +260,10 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
out.tally.sumUs[i] = 1000u * (i + 1u);
}
out.tally.lacking = 1u << 3;
out.tally.activeSumUs = 31'500u;
out.tally.activeFrames = 9u;
out.tally.frameTimeSumUs = 42'000u;
out.tally.frameTimeFrames = 10u;
fl::adv::Publish(a, &region, 7u, 1234u, &out);
CHECK((region.latState & FL_LAT_STATE_MASK) == fl::FL_LAT_READING);
@@ -224,6 +281,11 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
CHECK(region.latOsQueueSumUs == 5000u);
CHECK(region.latGpuSumUs == 6000u);
CHECK(region.latTotalSumUs == 7000u);
CHECK(region.latGpuActiveSumUs == 31'500u);
CHECK(region.latGpuFrameSumUs == 42'000u);
CHECK((region.latGpuCounts & 0xFFFFu) == 9u);
CHECK((region.latGpuCounts >> 16) == 10u);
CHECK(region.latMultipliersSeen == ((1u << 1) | (1u << 2)));
CHECK(region.request == 7u);
// The next publication, with no read in between: the state stands, the frames and the sums are gone.
@@ -232,12 +294,19 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
CHECK(region.latFrames == 0u);
CHECK(region.latTotalSumUs == 0u);
CHECK(region.latDriverSumUs == 0u);
CHECK(region.latGpuActiveSumUs == 0u);
CHECK(region.latGpuFrameSumUs == 0u);
CHECK(region.latGpuCounts == 0u);
CHECK(region.latMultipliersSeen == ((1u << 1) | (1u << 2))); // the session's, like the switches
CHECK((region.latReads >> 16) == 66u);
// A caller with no latency summary leaves the ten words alone.
// A caller with no latency summary leaves the latency words alone.
fl::FlAdvancedState untouched{};
fl::adv::Publish(a, &untouched, 7u, 1236u);
CHECK(untouched.latState == 0u);
CHECK(untouched.latReads == 0u);
CHECK(untouched.latTotalSumUs == 0u);
CHECK(untouched.latGpuActiveSumUs == 0u);
CHECK(untouched.latGpuCounts == 0u);
CHECK(untouched.latMultipliersSeen == 0u);
}
+4
View File
@@ -136,6 +136,10 @@ int main() {
FL_ADV_FIELD(dlssAutoExposure);
FL_ADV_FIELD(dlssAlphaUpscaling);
FL_ADV_FIELD(dlssPad);
FL_ADV_FIELD(latGpuActiveSumUs);
FL_ADV_FIELD(latGpuFrameSumUs);
FL_ADV_FIELD(latGpuCounts);
FL_ADV_FIELD(latMultipliersSeen);
FL_ADV_FIELD(reservedDlss);
FL_ADV_FIELD(ffxDispatches);
FL_ADV_FIELD(ffxSharpenSeen);
@@ -35,6 +35,10 @@ inline constexpr std::uint32_t kDriverUs = 400u;
inline constexpr std::uint32_t kOsQueueUs = 1200u;
inline constexpr std::uint32_t kGpuUs = 3700u;
inline constexpr std::uint32_t kTotalUs = 7500u;
// The two times a driver works out itself, of every frame: the card at work, and one frame's GPU end to the next's.
inline constexpr std::uint32_t kGpuActiveUs = 3500u;
inline constexpr std::uint32_t kGpuFrameUs = 4200u;
inline constexpr std::uint32_t kFgMultiplier = 2u; // what GetSleepStatus gives while `fgMultiplier` is zero
inline constexpr std::uint32_t kFirstFrameId = 5000u;
inline constexpr std::uint32_t kFrameIdStep = 10u; // how far the ids move on at each call
@@ -46,7 +50,8 @@ struct Shared {
std::uint32_t queries; // nvapi_QueryInterface calls
std::uint32_t latencyCalls; // GetLatency calls
std::uint32_t sleepStatusCalls; // GetSleepStatus calls
std::uint32_t reserved[2];
std::uint32_t fgMultiplier; // the multiplier GetSleepStatus gives; zero = kFgMultiplier
std::uint32_t reserved[1];
};
inline constexpr wchar_t kSectionFormat[] = L"Local\\FrameLedger.StubNvapi.%lu";
@@ -117,8 +117,8 @@ NvAPI_Status __cdecl StubGetLatency(IUnknown* device, NV_LATENCY_RESULT_PARAMS*
r.osRenderQueueEndTime = t + 3900u;
r.gpuRenderStartTime = t + 3900u;
r.gpuRenderEndTime = t + 7600u;
r.gpuActiveRenderTimeUs = 3500u;
r.gpuFrameTimeUs = 4200u;
r.gpuActiveRenderTimeUs = fl::stubnv::kGpuActiveUs;
r.gpuFrameTimeUs = fl::stubnv::kGpuFrameUs;
if (mode == fl::stubnv::kModeNoDriverSpan) {
r.driverStartTime = 0u;
}
@@ -144,7 +144,8 @@ NvAPI_Status __cdecl StubGetSleepStatus(IUnknown* device, NV_GET_SLEEP_STATUS_PA
out->bLowLatencyMode = 1;
out->sleepIntervalUs = 4166u;
out->bUseGameSleep = 1;
out->fgMultiplier = 2;
const std::uint32_t multiplier = Get(g_shared->fgMultiplier);
out->fgMultiplier = static_cast<NvU8>(multiplier == 0u ? fl::stubnv::kFgMultiplier : multiplier);
return NVAPI_OK;
}
@@ -438,6 +438,33 @@ public sealed class AdvancedPresenterTests
Strings.ResourceManager.GetString(nameof(Strings.Advanced_Status_InGameDriver), c).Should().NotBeNullOrEmpty();
}
[Fact]
public void TheDriversTwoOwnTimesAreLinesOfAnEntryOfTheirOwnSoTheSevenSpansStayLines()
{
(AdvancedMetric? metric, string label) = AdvancedPresenter.Resolve("adv.nvapi.reflex.gpu_times.active_render", []);
metric!.Id.Should().Be("nvapi.reflex.gpu_times");
label.Should().Be(AdvancedLabels.Member(AdvancedLabels.Of(metric), Strings.AdvToken_active_render));
label.Should().NotContain("active_render", "the member is one of ours and is said in words");
// Nine series, two entries: neither chart is past what it draws as lines.
string[] series =
[
.. InGameAdvancedSampler.LatencySpans.Select(static span => InGameAdvancedSampler.LatencySeriesStem + span),
.. InGameAdvancedSampler.GpuTimes.Select(static time => InGameAdvancedSampler.GpuTimesSeriesStem + time),
];
AdvancedPresenter.Metrics(series, []).Select(static m => m.Id).Should().BeEquivalentTo("nvapi.reflex.frame_report", "nvapi.reflex.gpu_times");
// The span between the driver's two GPU marks says what it includes, in every language (D143).
foreach (string culture in new[] { "", "vi", "ja" })
{
string render = Strings.ResourceManager.GetString(nameof(Strings.AdvToken_gpu_render), CultureInfo.GetCultureInfo(culture))!;
string active = Strings.ResourceManager.GetString(nameof(Strings.AdvToken_active_render), CultureInfo.GetCultureInfo(culture))!;
render.Should().Contain("(", "the label carries what the span includes");
render.Should().NotBe(active);
}
}
[Fact]
public void TheSevenSpansOfTheDriversReportAreSeriesOfOneEntryLabelledInWords()
{
@@ -93,14 +93,17 @@ public sealed partial class AdvancedMetricCatalogTests
}
[Fact]
public void WhatThePartInsideAGameAsksTheDriverForItselfIsTwoEntriesOfNvapiAndNothingMore()
public void WhatThePartInsideAGameAsksTheDriverForItselfIsThreeEntriesOfNvapiAndNothingMore()
{
// Train C (owner decisions D132, D136, D138): the one reach that is not an argument of a hooked call. The
// Overlay calls NVIDIA's two read-only latency getters; tools/nvapi-readonly-check.ps1 holds that those two
// are the only NVAPI functions code loaded into a game may name. Two entries, and they stay two until an
// owner's ruling of the same kind names another.
// are the only NVAPI functions code loaded into a game may name. Two entries until 0.1.0-beta.48; the third
// (owner decision D142) is two more members of the report the first getter already filled - no further call.
// They stay three until an owner's ruling of the same kind names another.
string[] driver = [.. _all.Where(static m => m.Reach == AdvancedReach.GameDriver).Select(static m => m.Id)];
driver.Should().Equal("nvapi.reflex.sleep_status", "nvapi.reflex.frame_report");
driver.Should().Equal("nvapi.reflex.sleep_status", "nvapi.reflex.frame_report", "nvapi.reflex.gpu_times");
AdvancedMetricCatalog.Find("nvapi.reflex.gpu_times")!.IsFamily.Should().BeTrue("two series, the driver's own figures");
AdvancedMetricCatalog.Find("nvapi.reflex.gpu_times")!.Unit.Should().Be(AdvancedUnit.Microseconds);
_all.Where(static m => m.Reach == AdvancedReach.GameDriver).Should().OnlyContain(static m => m.Source == AdvancedSource.Nvapi && m.IsRead);
_all.Where(static m => m.Reach == AdvancedReach.GameDriver).Should().OnlyContain(static m => m.Scope != AdvancedScope.MachineFact, "what a driver says of a game's frames is of a session");
AdvancedMetricCatalog.Find("nvapi.reflex.frame_report")!.IsFamily.Should().BeTrue("seven series, one a span");
@@ -591,6 +591,7 @@ public sealed class InGameAdvancedSamplerTests
ValidMask = frames == 0 ? FlAdvancedValid.None : FlAdvancedValid.Latency,
// The stand-in driver's status: low-latency mode and the game's sleep on, the other three off, x2.
LatState = (uint)state | ((1u | 8u) << FlAdvancedState.LatSleepSeenOnShift) | ((2u | 4u | 16u) << FlAdvancedState.LatSleepSeenOffShift) | (2u << FlAdvancedState.LatFgMultiplierShift),
LatMultipliersSeen = 1u << 2,
LatReads = 1u | (slowestUs << 16),
LatFrames = frames,
LatSimulationSumUs = frames * 800,
@@ -626,6 +627,65 @@ public sealed class InGameAdvancedSamplerTests
sampler.Take(new InGameAdvanced(Latency(FlLatencyState.Reading, frames: 62, samples: 2) with { LatFrames = 0 })).Should().BeNull();
}
[Fact]
public void TheDriversTwoOwnTimesArePointsOfAnEntryOfTheirOwnEachTheMeanOfTheFramesThatGaveOne()
{
// 0.1.0-beta.48 (D142): sixty of sixty-two frames gave an active time, all of them a frame time.
IReadOnlyList<AdvancedReading> readings = new InGameAdvancedSampler().Take(new InGameAdvanced(Latency(FlLatencyState.Reading, frames: 62) with
{
LatGpuActiveSumUs = 60 * 3500,
LatGpuFrameSumUs = 62 * 4200,
LatGpuCounts = 60u | (62u << 16),
}))!;
readings.Should().HaveCount(9);
readings.Should().Contain(new AdvancedReading("adv.nvapi.reflex.gpu_times.active_render", 3500.0));
readings.Should().Contain(new AdvancedReading("adv.nvapi.reflex.gpu_times.frame_time", 4200.0));
readings.Should().Contain(new AdvancedReading("adv.nvapi.reflex.frame_report.gpu_render", 3700.0), "the span between the driver's two marks is kept beside them");
InGameAdvancedSampler.GpuTimes.Should().Equal("active_render", "frame_time");
// One and not the other: a frame can give either.
IReadOnlyList<AdvancedReading> one = new InGameAdvancedSampler().Take(new InGameAdvanced(Latency(FlLatencyState.Reading, frames: 62) with
{
LatGpuFrameSumUs = 10 * 4200,
LatGpuCounts = 10u << 16,
}))!;
one.Where(static r => r.Series.StartsWith(InGameAdvancedSampler.GpuTimesSeriesStem, StringComparison.Ordinal))
.Should().Equal(new AdvancedReading("adv.nvapi.reflex.gpu_times.frame_time", 4200.0));
// A driver that gives neither - an older one leaves both zero: no point, and not a zero.
new InGameAdvancedSampler().Take(new InGameAdvanced(Latency(FlLatencyState.Reading, frames: 62)))!
.Should().NotContain(static r => r.Series.StartsWith(InGameAdvancedSampler.GpuTimesSeriesStem, StringComparison.Ordinal));
}
[Fact]
public void TheMultiplierRowListsEveryValueTheSessionSawNotTheLastOne()
{
// D144: x2 while the game generated frames, then a menu - the last value is 1, and the session saw both.
var sampler = new InGameAdvancedSampler();
FlAdvancedState state = Latency(FlLatencyState.Reading, frames: 62) with
{
LatState = (uint)FlLatencyState.Reading | (1u << FlAdvancedState.LatSleepSeenOnShift) | (1u << FlAdvancedState.LatFgMultiplierShift),
LatMultipliersSeen = (1u << 1) | (1u << 2),
};
sampler.Take(new InGameAdvanced(state));
Rows(Fact(sampler, "nvapi.reflex.sleep_status")).Should().Equal("bLowLatencyMode=on", "fgMultiplier=1, 2");
// The last multiplier moves with every menu and is not in the table: the facts are not made again for it...
IReadOnlyList<AdvancedFact> before = sampler.Facts;
sampler.Take(new InGameAdvanced(state with { Samples = 2, LatState = state.LatState ^ (3u << FlAdvancedState.LatFgMultiplierShift) }));
sampler.Facts.Should().BeSameAs(before);
// ...and are for a value not seen before. Thirty-one and more share a bit; a status that gave none is not one.
sampler.Take(new InGameAdvanced(state with { Samples = 3, LatMultipliersSeen = 1u | (1u << 1) | (1u << 2) | (1u << 4) | (1u << 31) }));
Rows(Fact(sampler, "nvapi.reflex.sleep_status")).Should().Equal("bLowLatencyMode=on", "fgMultiplier=1, 2, 4, \u2265 31");
var none = new InGameAdvancedSampler();
none.Take(new InGameAdvanced(state with { LatMultipliersSeen = 1u }));
Rows(Fact(none, "nvapi.reflex.sleep_status")).Should().Equal("bLowLatencyMode=on");
}
[Fact]
public void ASpanTheDriverDidNotReportHasNoPointAndTheOthersDo()
{
+6 -3
View File
@@ -95,9 +95,10 @@ FfxApiEffectMemoryUsage::aliasableUsageInBytes
# NVIDIA's latency report and sleep status (parameters `lr`, `lf`, `ls`; Advanced metrics train C, owner decisions
# D132, D136). NOT arguments of a hooked call: what the driver wrote into buffers the Overlay handed to its two
# read-only getters (fl_reflex.h). Of a frame: its id and the six pairs of times the spans are made of. Not read:
# `inputSampleTime`, the GPU times the driver reports beside the marks, the frame-generation and cross-adapter
# times. Of the sleep status: the five switches and the frame-generation multiplier; the sleep interval is not read.
# read-only getters (fl_reflex.h). Of a frame: its id, the six pairs of times the spans are made of and, since
# 0.1.0-beta.48 (owner decision D142), the two times the driver works out itself -- the GPU's active render time and
# its frame time. Not read: `inputSampleTime`, the camera, frame-generation and cross-adapter times. Of the sleep
# status: the five switches and the frame-generation multiplier; the sleep interval is not read.
NV_LATENCY_RESULT_PARAMS::frameReport
NV_LATENCY_RESULT_PARAMS::FrameReport::frameID
NV_LATENCY_RESULT_PARAMS::FrameReport::simStartTime
@@ -112,6 +113,8 @@ NV_LATENCY_RESULT_PARAMS::FrameReport::osRenderQueueStartTime
NV_LATENCY_RESULT_PARAMS::FrameReport::osRenderQueueEndTime
NV_LATENCY_RESULT_PARAMS::FrameReport::gpuRenderStartTime
NV_LATENCY_RESULT_PARAMS::FrameReport::gpuRenderEndTime
NV_LATENCY_RESULT_PARAMS::FrameReport::gpuActiveRenderTimeUs
NV_LATENCY_RESULT_PARAMS::FrameReport::gpuFrameTimeUs
NV_GET_SLEEP_STATUS_PARAMS::bLowLatencyMode
NV_GET_SLEEP_STATUS_PARAMS::bFsVrr
NV_GET_SLEEP_STATUS_PARAMS::bCplVsyncOn