Compare commits

...
Author SHA1 Message Date
poli0981andClaude Fable 5.2 207a0c7cdb test(guard): the log case's expected words are widened before they are multiplied (Qodana native: bugprone-implicit-widening-of-multiplication-result, two)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 15:51:01 +07:00
poli0981andClaude Fable 5.2 e9ff143cc9 feat(overlay): the frames of NVIDIA's latency report are counted for the native log - each by its GPU span and the driver's active time, in batches that belong to one state of the sleep status (D148, D151; nothing published, no new call, no further member; in no release yet)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 15:26:03 +07:00
poli0981andClaude Fable 5.2 c97bf8bd98 docs(handoff): owner-only item 46 read - beta.48 on ten real sessions (#455)
* docs(handoff): owner-only item 46 read - ten sessions on beta.48: samples a second apart, both games gave the driver's own GPU times, the multipliers listed, off means off; active render longer than the span in Cyberpunk 2077 without frame generation, not explained

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* docs(handoff): item 46 (g) - the owner's answer: no hitch with Advanced metrics on

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 07:36:55 +00:00
poli0981andClaude Fable 5.2 59be004be1 docs(handoff): 0.1.0-beta.48's release facts - the tag's run, the digests, the delta, the wiki, what SonarCloud and Qodana said on the release's commit (#454)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 05:10:45 +00:00
poli0981andClaude Fable 5.2 aec1736a1f release: 0.1.0-beta.48 - two real games read; the driver's own GPU times, every multiplier seen, samples a second apart (D142-D147); owner-only item 46 (#453)
* 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>

* 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>

* fix(telemetry): the poller keeps its period - it waited the whole interval after a poll's work, and on the owner's PC a second was 1.32 s; sensor_blobs.hz is the rate the samples had, not the constant 1 (D146; in no release yet)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* release: 0.1.0-beta.48 - two real games read; the driver's own GPU times beside a span that includes idle (D142, D143); every frame-generation multiplier a session saw (D144); samples a second apart (D146); Privacy Policy 2.21, Disclaimer 2.17 (D145); owner-only item 46

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 11:29:09 +07:00
poli0981andClaude Fable 5.2 5694ec91f7 fix(telemetry): the poller keeps its period, and sensor_blobs.hz is the rate the samples had (D146) (#452)
* 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>

* 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>

* fix(telemetry): the poller keeps its period - it waited the whole interval after a poll's work, and on the owner's PC a second was 1.32 s; sensor_blobs.hz is the rate the samples had, not the constant 1 (D146; in no release yet)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 11:06:21 +07:00
poli0981andClaude Fable 5.2 b693207387 feat(advanced): two lines for the graphics card's own time, an honest GPU render label, every multiplier seen; Privacy Policy 2.21, Disclaimer 2.17 (D142-D145) (#451)
* 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>

* 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>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 10:41:29 +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 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
47 changed files with 1804 additions and 159 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ barrier. It is written for the person who has just met one; the details for deve
FrameLedger is a desktop program: its own window, its dialogs, its document windows, the icon by the clock and the
notices Windows shows for it. It draws nothing inside a game, so it cannot make a game itself any easier to use.
*Beta software: this page describes version 0.1.0-beta.47. In the app: Help ▸ Accessibility.*
*Beta software: this page describes version 0.1.0-beta.48. In the app: Help ▸ Accessibility.*
## What FrameLedger aims for
+15
View File
@@ -35,12 +35,27 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Added
- **The frames NVIDIA's latency report gives are counted, for the Overlay's own log** (owner decisions D148,
D151; nothing new is stored, shown, asked of the driver or read from its report). The owner's sessions on
0.1.0-beta.48 showed both of the driver's own GPU times in two games — and in Cyberpunk 2077 without frame
generation an *active render* time longer than the span from the card's start on a frame to its end, which the
two averages cannot explain: one is over every frame, one only over the frames that gave a time. While a session
with *Advanced metrics* reads the driver, the Overlay now places each frame by its own two numbers and writes
the counts to `overlay-<pid>-….log` as `LATENCY_FRAMES` lines, in batches that each belong to **one state of
the driver's low-latency status and its frame-generation multiplier** — the counts are read together with
Reflex and frame generation, never apart. About six lines a minute; a game that exits by itself loses the last
batch, under a minute. A bug report carries those logs, as it carried them before. Measured: 65 billionths of a
second more for each reading of the report, once a second; a presented frame costs what it did.
## Releases
Newest first. Each file holds that release's section exactly as it stood here.
| Version | Date | Notes |
|---|---|---|
| `0.1.0-beta.48` | 2026-11-14 | [`docs/changelog/0.1.0-beta.48.md`](docs/changelog/0.1.0-beta.48.md) |
| `0.1.0-beta.47` | 2026-11-14 | [`docs/changelog/0.1.0-beta.47.md`](docs/changelog/0.1.0-beta.47.md) |
| `0.1.0-beta.46` | 2026-11-13 | [`docs/changelog/0.1.0-beta.46.md`](docs/changelog/0.1.0-beta.46.md) |
| `0.1.0-beta.45` | 2026-11-12 | [`docs/changelog/0.1.0-beta.45.md`](docs/changelog/0.1.0-beta.45.md) |
+3
View File
@@ -139,6 +139,9 @@ src/
# a frame's stages - NOT an argument of a hooked call: the Overlay calls two
# read-only getters of the driver itself (reach GameDriver); seven adv.* series
# and one table, and AdvancedDriverRead says what became of the read.
# Since 0.1.0-beta.48 (D142-D144) also two figures the driver works out itself, of
# the same report - no further call: an entry of their own, nvapi.reflex.gpu_times,
# two adv.* series; and the table lists every frame-generation multiplier seen.
FrameLedger.Infrastructure/ # SQLite, shm reader, vendor APIs, injector interop, parsers,
# and Capture/ (PR-C): ShmRingAttacher/ShmCaptureSink over the
# reader, HeldProcessLivenessSource, TargetResolver (path only,
+6 -3
View File
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
page lists them in plain words; each item links to the document that has the details.
*Beta software: this page describes version 0.1.0-beta.47.*
*Beta software: this page describes version 0.1.0-beta.48.*
## Games it will not measure
@@ -128,8 +128,11 @@ 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.
One point is one reading; with the sensor interval set above one second, some readings are not stored.
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
+9 -6
View File
@@ -13,7 +13,7 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-11-11.** The software is a beta; its latest
> **beta is `0.1.0-beta.47`** (2026-11-14), an unsigned installer built from that tag with its
> **beta is `0.1.0-beta.48`** (2026-11-14), an unsigned installer built from that tag with its
> checksums published beside it (alphas — experimental builds that try a newer .NET — are published apart). The source holds the desktop app
> (library, store import, charts, settings) and the background Agent, which records a session when a
> game in the library runs (unless you switched its recording off), injects only into games you enabled
@@ -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
@@ -212,7 +215,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
## Install
> **The latest beta is `v0.1.0-beta.47` (2026-11-14); before it `v0.1.0-beta.46` (2026-11-13), `v0.1.0-beta.45` (2026-11-12), `v0.1.0-beta.44` (2026-11-12), `v0.1.0-beta.43` (2026-11-12), `v0.1.0-beta.42` (2026-11-12), `v0.1.0-beta.41` (2026-11-12), `v0.1.0-beta.40` (2026-11-12), `v0.1.0-beta.39` (2026-11-11), `v0.1.0-beta.38` (2026-11-11), `v0.1.0-beta.37` (2026-11-11), `v0.1.0-beta.36` (2026-11-10), `v0.1.0-beta.35` (2026-11-09), `v0.1.0-beta.34` (2026-11-06), `v0.1.0-beta.33` (2026-11-03), `v0.1.0-beta.32` (2026-10-31), `v0.1.0-beta.31` (2026-10-26), `v0.1.0-beta.30` (2026-10-26), `v0.1.0-beta.29` (2026-10-25), `v0.1.0-beta.28` (2026-10-20), `v0.1.0-beta.27` (2026-10-20), `v0.1.0-beta.26` (2026-10-19), `v0.1.0-beta.25` (2026-10-19), `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
> **The latest beta is `v0.1.0-beta.48` (2026-11-14); before it `v0.1.0-beta.47` (2026-11-14), `v0.1.0-beta.46` (2026-11-13), `v0.1.0-beta.45` (2026-11-12), `v0.1.0-beta.44` (2026-11-12), `v0.1.0-beta.43` (2026-11-12), `v0.1.0-beta.42` (2026-11-12), `v0.1.0-beta.41` (2026-11-12), `v0.1.0-beta.40` (2026-11-12), `v0.1.0-beta.39` (2026-11-11), `v0.1.0-beta.38` (2026-11-11), `v0.1.0-beta.37` (2026-11-11), `v0.1.0-beta.36` (2026-11-10), `v0.1.0-beta.35` (2026-11-09), `v0.1.0-beta.34` (2026-11-06), `v0.1.0-beta.33` (2026-11-03), `v0.1.0-beta.32` (2026-10-31), `v0.1.0-beta.31` (2026-10-26), `v0.1.0-beta.30` (2026-10-26), `v0.1.0-beta.29` (2026-10-25), `v0.1.0-beta.28` (2026-10-20), `v0.1.0-beta.27` (2026-10-20), `v0.1.0-beta.26` (2026-10-19), `v0.1.0-beta.25` (2026-10-19), `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
@@ -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 |
+16
View File
@@ -496,6 +496,22 @@ Because Tier-1 and Tier-2 sessions carry different fields, every query that comp
> Sensor series are aligned to `t_ms` (milliseconds from `qpc_epoch`) and a tick with no reading is stored as
> **−1** — never 0, which would be a reading — because temperatures, loads, power and memory are never negative.
>
> **`t_ms` is the time axis; `hz` is the fallback** (written here 2026-11-14, owner decision D146 — the code cited
> this rule before the page had it). Every series of a session is stored beside `t_ms`, which carries each
> sample's own time, and the App draws against it; `hz` is read only for a row that has no `t_ms`
> (`SessionSeriesLoader`). **Until 0.1.0-beta.48 `hz` was the constant 1**, whatever the samples did — and they
> were not one second apart: the poller waited its whole interval *after* a poll's work. In the owner's ledger of
> 2026-11-14, under a setting of 1000 ms, 180 of the 186 sessions long enough to tell have a median of 1.32 s
> between samples; six have 1.0 s. **What takes the third of a second is not established.** Unelevated — the layers
> composed as the Agent composes them, each read under a stopwatch — a poll takes about a millisecond. The two
> sessions with no `cpu_temp` series (an Agent that was not elevated) are among the six, which points at the
> sensor library's processor update, run on the poll's thread as administrator with PawnIO; but four sessions
> that have the series kept one second, and the call itself was not timed (it needs elevation). Since 0.1.0-beta.48 the poller keeps a fixed period
> (`TelemetryPoller.UntilNextTick`) and `hz` is the rate the session's samples had, measured from the samples
> (`SessionFinalizer.SampleRate`: the gaps between the first and the last over the time between them, to a
> thousandth; 1 for fewer than two) — so it is right for a session recovered from a `.partial` file as well.
> Rows written before keep their 1.
>
> **The advanced series are the exception, and say so by their name (schema 0023, owner decision D102).** A series
> whose name starts with `adv.` stores **NaN** for a tick with no reading: a motherboard's −12 V rail is negative, so
> −1 cannot mark a gap, and most of its ticks are gaps — the sensor library is read every fifth. They go through a
+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.
+8 -1
View File
@@ -172,7 +172,14 @@ 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 — and since 0.1.0-beta.49 the counts for the native log: every place
a summed frame can be in, a span of a microsecond, an active time as long as the span, a refused frame, when a
batch is due, a batch closed by a change of state and the thirty-two such closings a request has, the six lines
and what each carries; a hidden `[.bench]` case is the measurement of one report's cost. `fl_guard`'s eight
`[latency]` cases (the eighth reads the log: the first batch after ten reads, by number, and what is left when a
flush is asked for — against the stand-in's `kModeGpuShapes`) 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
+52
View File
@@ -192,6 +192,42 @@ 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.
**Since 0.1.0-beta.49 each summed frame is also counted for the native log** (owner decisions D148, D151;
§Native logging, `LATENCY_FRAMES`). The owner's ten sessions on beta.48 (HANDOFF, item 46) gave both of the
driver's own times in every frame report of both games — and in Cyberpunk 2077 without frame generation the mean
active time was **longer** than the mean span between the two GPU marks (3.17 against 2.79 ms), which the two
means cannot explain: the span's is over every summed frame, one of no length included, the active time's over
the frames that gave one. So the reader places each summed frame by its own two numbers (`CountGpuTimes`), after
the frame is accepted: which frames are summed does not change, and the seven spans, the two times and their
counts are what they were. **No new call, no further member of the report** — the two GPU marks and
`gpuActiveRenderTimeUs` were read already — and nothing of it leaves the process: the watchdog adds each read's
counts to a batch and writes the batch to the log. **Measured** (the same instrument: 2 million reports × 3,
twice): 424–435 ns before, 490–499 ns after — **+65 ns a read**, once a second, after the call's time has been
taken. `fl_reflex_summary_test "[.bench]"` is that measurement in the tree. The present path is unchanged.
**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
@@ -909,6 +945,22 @@ No logging in hook bodies. A small fixed-size in-memory ring of structured event
> `FlLatencyState`, the text what it means — and, when the module is found, two more with the end of the path
> `nvapi64.dll` was loaded from and of the image its getters are in. Written by the watchdog; a fault in a getter
> is a `FAULT` line from the presenting thread, as any fault is.
> **`LATENCY_FRAMES` (0.1.0-beta.49, owner decisions D148, D151)**: the frames the driver reads summed, counted
> for this log and nowhere else — nothing of it is published, stored or shown. Each summed frame is placed by its
> own two numbers, the span between its two GPU marks and the driver's active render time: no start mark, a span
> of no length, an active time with no span, a span with no active time, and — where a frame has both — *active
> longer than the span* or *active within the span*, each with its count and both sums in microseconds. No
> threshold: a span of one microsecond is a span. **A batch is six lines and belongs to one state of the driver's
> sleep status** — its low-latency switch, its "the game sleeps" switch and its frame-generation multiplier —
> because the counts mean nothing apart from it: a read in another state closes the batch first (thirty-two such
> closings a request, after which a batch runs to its length and its first line says what it held). A batch is
> also written after a request's tenth read, its thirtieth and every sixtieth from there, when the Agent asks for
> a flush, at a new request and at a stop. `a` is printed in decimal and `b` in hex: *reads* and the switches
> seen on, off (`<<8`) and the multipliers seen (`<<16`); *frames summed* and refused; *GPU span absent* and of no
> length; *active time with no span* and span with no active time; then the two heaps, `a` their frames and `b`
> their span sum (`<<32`) and active sum. **A game that exits by itself takes the batch in hand with it** — under
> a minute of reads. About six lines a minute while a session with *Advanced metrics* reads the driver; none
> otherwise.
> **Three flush points — four since beta.42, the same note —, none on a present path:** the end of `InitThread` (so the
> file exists from the start of the session and a crash mid-session still leaves it), the watchdog when
> `FlControlBlock.logFlushRequested` changes (a counter the Agent bumps at session end; nothing clears it),
+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 |
+229 -76
View File
@@ -86,6 +86,7 @@ owner-only items stay below; the history of every train, the passed owner-only i
| `§beta.44`, what the owner's eight sessions on beta.44 showed, session by session (item 42), this release's facts, the traps of that train | [`handoff/history/0.1.0-beta.44.md`](handoff/history/0.1.0-beta.44.md) |
| `§beta.45`, what the owner's seven sessions on beta.45 showed, session by session (item 43), that release's facts and SonarCloud's gate on its commit, the traps of that train | [`handoff/history/0.1.0-beta.45.md`](handoff/history/0.1.0-beta.45.md) |
| `§beta.46`, what the owner's five sessions on beta.46 showed (item 44), the design of the train that followed as the plan's review left it (`§The train after 0.1.0-beta.46`), that release's facts, the traps of that train | [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md) |
| `§beta.47`, what that release decided beyond D136–D141, what item 44's last part showed, that release's facts, the traps of that train, its NEXT as the owner's sessions of 2026-11-14 changed it | [`handoff/history/0.1.0-beta.47.md`](handoff/history/0.1.0-beta.47.md) |
| `§Owner-only`, an open item | [§Owner-only](#owner-only--no-pr-can-close-these) below |
| `§Owner-only`, a passed item (3, 12, 14–19, 38, 39) | [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) |
| `§Traps`, `§Two corrections carried forward` | [`handoff/traps.md`](handoff/traps.md) |
@@ -93,97 +94,105 @@ owner-only items stay below; the history of every train, the passed owner-only i
---
## **START HERE** — 2026-11-14, 0.1.0-beta.47: the part inside a game asks NVIDIA's driver for its latency report; the batch log says how a batch ended
## **START HERE** — 2026-11-14, 0.1.0-beta.48: two real games read; the driver's own GPU times beside a span that includes idle; every multiplier seen; samples a second apart
*Status is `docs/changelog/0.1.0-beta.47.md`; this is what no other file carries.* The owner ran five sessions on
beta.46 the evening it was released and said: check and go on. They were read (#439), the owner took six decisions
(D136–D141) and approved the plan of the train the same evening, and the five pull requests of it were merged
overnight: #440 (the decisions; the probe's leg with a sleep mode), #441 (D137), #442 (the latency words of region
5), #443 (the Overlay makes the read; the gates; the fixtures), #444 (the Agent, the App, the legal texts,
owner-only item 45). The release was held for item 44 (d), which the owner ran on 2026-11-14 (#445, and below).
**What the five sessions showed, the design of the train as the plan's review left it, and the traps of beta.46
are [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md)**; what the read is and what bounds it
is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a driver; what was measured is
[`spike-notes/31-reflex-route-d-harness.md`](spike-notes/31-reflex-route-d-harness.md).
*Status is `docs/changelog/0.1.0-beta.48.md`; this is what no other file carries.* The owner ran eight sessions on
beta.47 the morning it was released and said, twice: check. They were read (#448, #449): Phantom Blade Zero three
times, Cyberpunk 2077 twice, two Direct3D 11 games and a Direct3D 12 game with no NVIDIA library — **the read
works in real games**, and four things came out of it that the owner ruled on the same morning (D142–D147) and
approved as one train: #450 (the Overlay reads two more members of the report and keeps the multipliers seen),
#451 (the Agent, the App, the texts — Privacy Policy 2.21, Disclaimer 2.17), #452 (the poller's period), and this
release. **What the eight sessions showed is item 45's last paragraphs, below; beta.47's own section, its traps
and its release facts are [`handoff/history/0.1.0-beta.47.md`](handoff/history/0.1.0-beta.47.md)**; what the
read is and what bounds it is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a driver.
### What this release decided, beyond D136–D141
### What this release decided, beyond D142–D147
- **It is the first thing the Overlay does in a game that is not reading a hooked call's arguments**, and it is
listed as that — its own table in `17_HOOK_ENGINE`, its own reach in the catalog (`GameDriver`, not a stretched
`Game`), its own paragraph in the Disclaimer. A second call of this kind needs a ruling of the same kind (D132).
- **Resolve on the watchdog, once for the process; call on the presenting thread, after the record is published,
behind one gate of four states** — idle, armed, reading, off. The plan's first draft had a busy flag beside
accumulators: two presenting threads could have read back to back, and the watchdog could have published half a
read. The whole design as reviewed is in the history file, §The train after 0.1.0-beta.46.
- **`nvapi64.dll` is a shim.** The check that the two addresses lie inside the module it asked refused the real
driver: the getters are in `nvapi64_impl.dll`, in the driver's store. An address is accepted when it is executable
code of a loaded image, and a reference is kept on that image too. Only the run against the installed driver
could find it — the stand-in answers with addresses of its own.
- **The code that is called is a Control Flow Guard image**; the plan's review had reasoned from the shim, which is
not. The probe enforces CFG and makes the calls from the header that ships, so this driver's getters are valid
targets. A CFG-enforcing game on another driver is not covered, and a refusal there is a fast-fail.
- **The layout stayed 5**: ten reserved words of region 5 took the read. `FL_HOOK_REFLEX`, `FL_MEASURED_LATENCY`
and `reflexLatencyUs` stay unset — there is no hook, and the numbers are series beside the frames.
- **D141 was asked twice.** A run on a busy PC showed the 2 ms latch can fire on a pause that was Windows'; the
owner kept one call. Do not re-ask without a real game's numbers.
- **What the game asked of Reflex, and Reflex through Streamline, are `RefusedRoute`** — a patch at a run-time
address, and a call the vendor forbids from another thread (D133). `sl.pcl.markers` waits for train D's spike.
### What item 44's last part showed (2026-11-14)
- **A first try did not exercise it** (sessions 203–205, #445): *Disable all hooking* was on before the games were
started, so two sessions were `RefusedKillSwitch` with nothing injected, and the hooked one ran to its exit.
- **The second try did, twice, in Phantom Blade Zero** (sessions 206 and 207): the game started with the switch
off, was recorded for a minute and a half, and the switch was turned on while it ran. Each log has `STOP` at the
next safety scan, **an `UNHOOK_RESTORED` line for every one of the twenty-nine patches, all at one time**, one
`PATCH_BATCH restore` — **83 309 µs and 85 578 µs for twenty-nine** — and `STOP_FLUSHED … a=1`. Nothing was
declined. Both sessions ended `KillSwitchEngaged`, tier 1, no fault, no record dropped, writer status
*unhooked*; the game ran on for three and four minutes and closed with nothing in Windows' application log.
Restoring twenty-nine one by one would have cost about 2.4 s at this game's 84 ms a stop.
- **Not said by the logs**: whether the owner felt a hitch at the stop. Not exercised: (e) a game with no
Streamline and (g) off means off — both are parts of item 45 now.
- **Two more members of a report already fetched are not a new call.** Rule 4's note stands as written: the same
two getters, the Overlay's own buffer, the two names on `tools/overlay-allowed-fields.txt`. The owner ruled on
them by name (D142); a third member is asked the same way.
- **The driver's own times have a count each, and zero means not given.** An older driver leaves both zero, and
so did the probe's frames. They are added after the frame is accepted, so which frames the seven spans are made
of did not move — a session's old series mean what they meant.
- **An entry of their own in the catalog** (`nvapi.reflex.gpu_times`), not an eighth and ninth line of the frame
report: `AdvancedPresenter.MaxLines` is 8, and nine series of one entry are drawn as a band.
- **The layout stayed 5 again**: line 0 of region 5 was full, so the four words came out of the seven reserved
words that ended the `sl::DLSSOptions` line. Three remain there, two on the `sl::Constants` line, two on the
FidelityFX line.
- **The fact's key no longer holds the last multiplier.** It held it since beta.47, so every menu rewrote the
session's context.
- **`hz` is measured from the samples, not taken from the setting**: the finalizer cannot see the setting, and a
session recovered from a `.partial` file never knew it.
- **The plan named `tools/agent-cost` for the poller's change and it was not run**: it runs the Agent unelevated,
where a poll takes a millisecond and the period was already a second. Said in #452 rather than run for show.
### Traps this train left
- **A bash here-document ate backslashes again** and wrote a NUL byte into a `.cpp`. Edit scripts are files.
- **A file made by the Write tool is LF**; `dotnet format --verify-no-changes` fails a new `.cs` for it. Convert.
- **`NvAPI_Status(__cdecl*)(…)` is a call by name to `nvapi-readonly-check`**: the status type has an alias in
`fl_reflex.h`. And a member of the Overlay's own named like a vendor's (`fgMultiplier`) fails
`overlay-fields-check` outside the header.
- **A copy of the harness in `%TEMP%` leaves an overlay log the run's sweep does not own** (it matches this
build's harness by path): the test that makes the copy sweeps it.
- **Stacked pull requests, with a dirty tree**: once the lower one is squash-merged GitHub retargets the next to
`main`; `gh pr update-branch` works while the upper branch only adds, and conflicts once it edited lines the
lower one added — then `git rebase -S --onto origin/main <lower tip> <branch>` and a forced push with lease.
- **Advisory checks found real things after the local gate was green**: SonarCloud a `wcslen`, Qodana's native
report a `switch` that did not name two enumerators, its managed report two redundant qualifiers and a
redundant `!`. Hold a merge until both have reported.
- **The probe's numbers depend on what else the PC does**: a run beside a build read 3.4 µs where three alone read
2.6, and saw reads of 2 ms. Say which kind a number is.
- **A cause I wrote down before checking it.** "The third of a second is the processor's temperature" went into
five files on two facts — unelevated a poll takes a millisecond; the sessions without a `cpu_temp` series are a
second apart — and then four sessions *with* the series turned out to be a second apart too. The texts were
taken back to what is established before the commit. **Count the exceptions before naming a cause.**
- **A bash here-document ate a backslash again** (a Python one-liner with `'\\'`). Edit scripts are files — the
rule already existed.
- **`FETCH_HEAD` belongs to the worktree that fetched.** A merge in a second worktree needs the commit's id.
- **A squash-merge of the lower pull request conflicts the upper one in `CHANGELOG.md` every time** both added to
`[Unreleased]`. With Auto-fix on, the app asks for a merge of `main`, not a rebase: do it in a worktree of its
own when a gate is running in the main one, keep the upper branch's file (it is the superset), and check that
the merged tree equals the branch's tip — then the gate already run still stands.
- **The gate script's last lines do not reach a background task's output**: read the log's last line and hash the
`rules` folder by hand.
- **An analyzer wants a `<summary>` once any `<param>` is written** (RCS1139).
### 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 46**~~ **Run and read 2026-11-14** (the item, below): the samples are a second apart,
both games gave both figures, the multipliers are listed, off means off. **The owner's word, the same day: no
hitch.** What is left of it is whether session 221 was the one with Reflex off.
2. **Then the owner's to say**: more titles; D141 on a larger sample (the slowest call seen in a game is 65 µs);
whether the processor update is worth timing on their PC and moving off the poll's thread (below).
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
4. **Train D** after it, 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.48 was released 2026-11-14T04:49:19Z** (11:49 in the owner's time zone) from the signed
tag on `aec1736` (#453), by run 43556901499 — 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, and the portable package hashed
here equals its line; the five native libraries in it carry `FL_BUILD_ID v0.1.0-beta.48`, none of them
`-dirty`. The delta from beta.47 is 1 944 037 bytes beside a full package of 110 800 248 — "Delta processed
0452 files. 0024 patched, 0428 unchanged". The wiki was published by run 43558546949. The rehearsal on the
release branch (run 43555020289, at `0c210d0`, the released tree) had made a delta of 1 966 174 bytes with the
same file counts. **SonarCloud answered on `aec1736`: the quality gate passed and no issue is open on `main`. Qodana's two reports, CodeQL and `check` are green on that
commit**, as they were on each of #450–#453 before its merge; no advisory check found anything in this train.
- ~~**No real game has given the two new figures yet.**~~ **Two have (item 46, 2026-11-14)**, in every frame
report: Phantom Blade Zero's active render is the short number the reading expected (9.6 ms inside a span of
16.4 ms at 60 FPS). **In Cyberpunk 2077 without frame generation active render is longer than the span between
the two GPU marks** (3.17 against 2.79 ms) **and why is not established** — the two averages are over different
frames, or the driver counts work outside the marks. The label says *idle time included*, which that game's
numbers do not show; the texts say the figures are the driver's own. Not changed.
- **After a session's first report, 0.4–7.3 % of its samples carry none** (item 46): the Overlay's reads are a
second apart or two — its watchdog's tick — and the Agent's samples exactly one. Read in the code, not measured;
not changed.
- **Where the third of a second of a poll goes is not established.** Unelevated, a poll takes about a millisecond
(the layers composed as the Agent composes them, each read under a stopwatch). In the owner's ledger 180 of 186
sessions are 1.32 s apart and six are 1.0 s: the two with no `cpu_temp` series (an Agent not elevated) are among
the six — which points at the sensor library's processor update, run on the poll's thread as administrator
with PawnIO — **but four sessions that have the series kept one second** (22, 72, 73, 136). **Not measured**:
that call itself (it needs elevation), and whether it is processor time or waiting. The period no longer
depends on it; a poll that takes a third of every second is still a poll that takes a third of every second.
- **With the sensor interval above one second, some readings of the driver's report are not stored**: the newest
stands until a sample carries it (`SessionRecorder`). Said in the guide; not changed.
- **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
2077). Since this release the log says whether a batch went singly; the next long one can be read.
- **Two install batches of beta.46 took 0.61 s and 1.26 s and nothing explains them.** Cyberpunk 2077's eight
batches on beta.47 took 85–221 ms, each in one apply; Hogwarts Legacy has not been run since.
- **The Japanese strings are new and unreviewed**, as every `ja` string is.
- **Off means off has never been exercised on a real game** (item 43 (f), item 44 (g), now item 45 (g)); nor (c)
and (h) of item 43, which only the owner sees.
- ~~**Off means off has never been exercised on a real game**~~ **It was, 2026-11-14** (item 46 (e), session
226: no `LATENCY` line, none of the hooks Advanced metrics adds, no row). (c) and (h) of item 43, which only the
owner sees, are still not.
- **Valor Mortis's crash at 51 s** (twice, beta.40 and beta.44) **and Black Myth: Wukong's fault in Steam's crash
handler at every exit** are not explained. One session of each with hooking off is the comparison that is missing.
- **What item 41 left unexercised**: a configure through the FidelityFX 2.3 loader (Cyberpunk 2077 with FSR frame
@@ -194,8 +203,8 @@ 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:** 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 +756,140 @@ 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.
**They are (d), (e) and (g) of item 46.**
46. **beta.48 — the driver's own GPU times, the multipliers seen, samples a second apart; and what item 45 left**
(D142–D146). **One batch**, as the owner asked: any Direct3D 12 games that use Reflex, as many as wanted, with
*Advanced metrics* on — **not first on a game under the user-mode exception's trial** (D38). Then say *check*;
the sessions are read from a copy of the ledger and the logs.
(a) **The update** shows the terms window once, with **Privacy Policy 2.21 and Disclaimer 2.17**.
(b) **Phantom Blade Zero and Cyberpunk 2077 again**, a few minutes of play each: on the Advanced page, under
**Latency**, a second chart — *the graphics card's time per frame, as the driver works it out* — with two lines,
*GPU active render* and *GPU frame time*; and the old line reads *GPU render, start to end (idle time included)*.
(c) **A session with both a menu and frame generation**: the table's `fgMultiplier` row lists both — *1, 2*, or
*1, 3* — not the last one.
(d) **Reflex switched off in a game's menu**, if a game lets you (item 45 (d)): say what the session's line reads.
(e) **Off means off** (item 45 (g)): switch *Advanced metrics* off, start a game afresh, play a minute, close
it; switch it back on afterwards.
(f) **Any other games of the batch** — Clair Obscur, Black Myth: Wukong, Hogwarts Legacy, Dread Fields, a
Direct3D 11 game: nothing to do but play and close them.
(g) **How the games felt** with the option on — a hitch once a second is the thing to look for; nobody but the
player can say it.
**Read from the ledger, nothing for the owner to do**: the samples of every session are one second apart, not
1.32 s, and `hz` says what they were.
**What each outcome means, written before the run.** *The two lines are there, and active render is shorter
than GPU render*: D142 did what it was for; in Phantom Blade Zero the reading of 2026-11-14 expects *GPU frame
time* near the 16 ms the old line showed, and *active render* well under it — **if active render is as long as
the old line there, that reading was wrong**, and the span is long for another reason: say the numbers. *The
second chart is not there, and the seven lines are*: the driver gave zero for both figures in every frame —
nothing is wrong with the read, and the texts already say a driver may give neither; say which game. *One line
and not the other*: the same, for one figure. *Active render longer than GPU render, start to end*: they are the
driver's numbers and are shown as reported — say which game and by how much. *`fgMultiplier` shows one value in
a session that had both*: the driver's status did not change with the menu in that game, or the mask is wrong —
say the game; the log's `LATENCY` lines and the frame-generation mix of the session tell the two apart. *Samples
still 1.3 s apart*: the period is not kept — the poll takes longer than the interval, or the change is not in
the build: stop and say so. *Samples a second apart and the Agent's processor use visibly higher*: a poll that
took a third of 1.32 s now takes a third of a second — say so; where that time goes is not established
(§Left open). *(d) reads "read"*: the driver reports frames with the game's Reflex off — both that and *asked,
and the driver reported no frame* are possible and neither is wrong. *(e) the log has a `LATENCY` line*: off
does not mean off — say so at once, with the log. **A fault, a freeze, a game closing by itself, a hitch every
second, or a session that says *stopped***: as item 45 says for each — say so at once.
**Run 2026-11-14, 12:49–14:12, and read the same afternoon** from a copy of the ledger and the logs: ten
sessions on beta.48 — Phantom Blade Zero seven times (217, 219, 220, 223–226), Cyberpunk 2077 three times (218,
221, 222). Every one tier 1, exit code 0, no fault counted, nothing dropped; nothing in Windows' application
log. (Session 216, an hour of Phantom Blade Zero, was still beta.47 — it ran while the release was cut — and
is 1.32 s apart like the ones before it.)
**The samples are a second apart**: the median gap is 996–1002 ms in all ten (session 223: 2 294 of 2 394 gaps
round to 1.00 s, the rest lie between 0.80 and 1.27 s), and `hz` reads 1.000–1.017.
(a) `legal_acceptance` holds Privacy Policy 2.21 and Disclaimer 2.17, accepted at 12:48:40.
(b) **Both figures were given by both games, in every frame report**: in the nine sessions with the option on,
every sample that has a *GPU render* span has both (3 834 of 3 834). **Phantom Blade Zero is what the reading of
2026-11-14 expected**: at 60 FPS (217) the span's median is 16.39 ms, *GPU frame time* 16.67 ms and *GPU active
render* **9.59 ms**; in the menu (224) 16.39 / 16.67 / **2.77**; at 91 FPS (225) 11.49 / 11.79 / 10.05; with
frame generation ×5 (223) 15.67 / 15.88 / 14.08. So in that game the span is the time from one frame to the
next less a third of a millisecond, whatever the card did in it, and active render is never longer than it
(0 of 3 406 samples). **Cyberpunk 2077 is the outcome written above as "active render longer than GPU render,
start to end"**: without frame generation it is longer at 157 of 158 samples (218: medians 3.17 against
2.79 ms, frame time 6.02) and at 48 of 48 (221: 2.03 against 1.82, frame time 2.37); with frame generation ×2
(222) it is shorter at all 222 (4.85 against 6.35, frame time 6.67). Shown as reported. **Why is not
established**, and two things could do it: the two are averages over different frames — the span over every
summed frame, one of no length included (the smallest mean span of a sample there is 0.5 µs, the smallest active
time 0.29 ms), active render over the frames that gave one — or the driver counts work the two marks do not
enclose. The ledger cannot tell them apart; a count of the frames whose span has no length would.
(c) `fgMultiplier` reads **1, 2** in Cyberpunk 2077 (222: ×2.0 for 69 % of it), **1, 5** in Phantom Blade Zero
(220: ×5.0 for 71 %, 30 → 151 FPS; 223: ×5.0 for 95 %, 63 → 316) and **1** in the seven sessions that generated
nothing.
(d) **Session 221** (Cyberpunk 2077, 59 s of menus at 421 FPS) is the only Cyberpunk session whose
`bLowLatencyMode` reads *on and off* — 218 and 222 read *on*, as 211 and 212 did — and is taken to be the one
where Reflex was switched off; the owner has not said which it was. Its line reads *read*, 48 of 57 samples
carry a report, every one from the first on, and the slowest call took 19 µs: the driver goes on reporting
frames.
(e) **Off means off, on a real game for the first time**: session 226 (`telemetry.advanced` 0) has no
`session_advanced` row and 19 series where the others have 240; its log has ten hooks, none of the ones
Advanced metrics adds, and **no `LATENCY` line**. The setting was still off when the ledger was copied.
(f) No other game was in the batch.
**The read itself**: one `reading the driver's latency report` line a session, 1.4–6.7 s after the attach, in
the same two files, and none after it; the slowest call of a session 18–123 µs; no latch. The install batches
took 75–191 ms, every one `install`.
**Samples with no report**: after a session's first report, 0.4–7.3 % of its samples carry none (1 of 223 in
222; 134 of 2 377 in 223, minutes of four in five there). They are not the sensor library's ticks (25 of the 134
fall on one, 24 just after one). What the code says, not measured: the watchdog ticks once a second and arms a
read when a second has passed since the last arm, so a tick that comes a moment early waits for the next one —
the reads are a second apart or two, the samples exactly one. Nothing is lost by it; a sample shows a gap.
(g) **The owner's answer, asked whether a game hitched once a second with the option on (2026-11-14): no
hitch.** What the frames say, in the sessions without frame
generation: a frame three times the median of the 120 before it and 8 ms longer comes 0.33 times a second
with the option on (225) and 0.32 with it off (226), and such frames do not gather at a period of one second
(vector strength 0.05–0.10 where chance gives 0.10–0.20; 217, 218 and 222 the same). Sessions with frame
generation cannot be judged that way. **Not seen in the ledger**: what the page looked like, and the Agent's
processor use now that a poll comes every second.
**Read, and (g) answered**: (a)–(g) each have their answer; whether session 221 was (d) is inferred, and the
owner's to say. The owner has not said the item is passed.
**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 +1045,16 @@ 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 |
| D148 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Native logging | asked on 2026-11-14 with item 46's Cyberpunk 2077 numbers (active render longer than the span between the GPU marks): count the frames, and write the counts **only to the Overlay's native log** — no layout, schema, App or string change |
| D149 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Native logging | told that a bug report carries the five newest Overlay logs and so these lines: **no change to the legal texts** — the Privacy Policy names the logs of the component loaded into games, and the lines are counts and sums of microseconds |
| D150 | [`07_IPC.md`](07_IPC.md) §Region 5 | the samples that carry no report are mended **on both sides**: the Overlay reads and publishes on a grid of one second, and the Agent no longer overwrites a reading that waits for a sample |
| D151 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Native logging | the owner's word: Reflex is checked together with frame generation — without it the owner's games do not switch Reflex on, and a low-latency switch that reads on and off is the NVIDIA App's override. A batch of counts belongs to one state of the sleep status |
| 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`) |
---
+90
View File
@@ -0,0 +1,90 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.48 was cut, 2026-11-14 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.48] - 2026-11-14
**The forty-eighth pre-release: NVIDIA's latency report has now been read in real games, and what they showed is
in it.** On the day 0.1.0-beta.47 came out the owner recorded eight sessions with *Advanced metrics* on. The
report was read in Phantom Blade Zero and in Cyberpunk 2077, with frame generation on and off: the driver answered
every second, the slowest request took 65 millionths of a second, nothing was switched off, and no game was
disturbed that the logs can show. Two games that are not Direct3D 12 and one that never loaded NVIDIA's library
were left alone, each with its one line saying why. The same unsigned installer: verify its hash against
`SHA256SUMS.txt`, then *More info → Run anyway*.
**What the first game showed, and what this release does about it.** In Phantom Blade Zero the line called *GPU
render* was longer than the whole frame — 16 thousandths of a second where the total was 5. That line runs from
the moment the graphics card starts on a frame to the moment it ends, **and includes the time the card waited in
between**. NVIDIA's driver also works out the figure without the waiting, and the time from one frame's end to the
next. Both are in the report FrameLedger already asks for, and a session now stores them as **a second chart under
*Latency*, with two lines**: *GPU active render* and *GPU frame time*. Nothing more is asked of the driver. The
old line stays, under a name that says what it includes. **The stages of a frame overlap; they were never parts
that add up to the total**, and the texts now say so.
**Three more things the sessions showed.**
- The table of the driver's low-latency state kept only the *last* frame-generation multiplier: a session that
generated frames at ×2 and ended in a menu showed 1. It now lists every value the session saw — *1, 2*.
- **Sensors were read every 1.3 seconds where the setting says every second** — on the owner's PC, in nearly every
session since the series began. The capture agent waited the whole interval *after* each reading, and a reading
there takes about a third of a second. It now keeps the period. No chart was wrong, because every sample is
stored with its own time; but a session now has about a third more samples, and readings of the latency report
no longer fall between two of them. What makes a reading take that long there is not established.
- A session could begin with the last reading of the session before it, in a game that kept running between the
two. It no longer does.
**What it is not.** Two games on one driver and one card (GeForce RTX 5080, driver 32.0.16.2114) are not every
game. The two new figures have not been seen from a real game yet: a driver may give neither, and the chart is
then simply not there. Reflex switched off in a game's menu, and a game started with Advanced metrics off, have
still not been tried on a real game. They remain the driver's numbers, not a measurement by FrameLedger, and not
the delay from a click to the screen; the session summary's latency fields still read N/A. Nothing here is read
on Direct3D 11, Vulkan or OpenGL. The Japanese texts are new and unreviewed.
**Measured overhead this release.** A presented frame: unchanged. The request to the driver, once a second while
Advanced metrics is on: summing the two further figures adds about 36 billionths of a second to work that follows
the request itself. In the real games of 2026-11-14 the slowest request took 20 to 65 millionths of a second.
**Updating from `0.1.0-beta.47`:** Help ▸ Check for updates, then *Restart to update* with no game running. **The
terms are shown once** — Privacy Policy 2.21 and Disclaimer 2.17. No change to the ledger (schema 23) or to the
shared memory's layout (5); the detection rules stay at `2026.11.2`. **The code loaded into a game changed in this
release**, so a game that was running during the update keeps the old part until it is started again.
### 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). 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
- **Sensors were read less often than the setting says** (owner decision D146). With the sensor interval at
1000 ms, nearly every session on the owner's PC got a sample every 1.3 seconds: the Agent waited the whole
interval *after* each reading, and a reading there takes about a third of a second (what in it does is not
established; on a PC where the Agent is not run as administrator it takes a millisecond, and the samples were
already a second apart). It now keeps the period. No chart was wrong — every sample is stored with its own time — but a session
has about a third more samples now, and about a quarter of the readings of NVIDIA's latency report no longer
fall between two samples. For developers: `sensor_blobs.hz` was the constant 1 and is now the rate the
session's samples had.
- **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.
+146
View File
@@ -0,0 +1,146 @@
# HANDOFF history — 0.1.0-beta.47
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.48 was cut, 2026-11-14 (owner decision D66); `docs/HANDOFF.md` §How this file is split lists every part. Nothing below was edited, so its "below" and "above" mean HANDOFF.md as it stood then, and a path it writes is relative to `docs/`. **Its NEXT and its "Left open" were written through the morning of 2026-11-14 as the owner's sessions were read**: what they led to is HANDOFF.md's section for 0.1.0-beta.48.*
## **START HERE** — 2026-11-14, 0.1.0-beta.47: the part inside a game asks NVIDIA's driver for its latency report; the batch log says how a batch ended
*Status is `docs/changelog/0.1.0-beta.47.md`; this is what no other file carries.* The owner ran five sessions on
beta.46 the evening it was released and said: check and go on. They were read (#439), the owner took six decisions
(D136–D141) and approved the plan of the train the same evening, and the five pull requests of it were merged
overnight: #440 (the decisions; the probe's leg with a sleep mode), #441 (D137), #442 (the latency words of region
5), #443 (the Overlay makes the read; the gates; the fixtures), #444 (the Agent, the App, the legal texts,
owner-only item 45). The release was held for item 44 (d), which the owner ran on 2026-11-14 (#445, and below).
**What the five sessions showed, the design of the train as the plan's review left it, and the traps of beta.46
are [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md)**; what the read is and what bounds it
is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a driver; what was measured is
[`spike-notes/31-reflex-route-d-harness.md`](spike-notes/31-reflex-route-d-harness.md).
### What this release decided, beyond D136–D141
- **It is the first thing the Overlay does in a game that is not reading a hooked call's arguments**, and it is
listed as that — its own table in `17_HOOK_ENGINE`, its own reach in the catalog (`GameDriver`, not a stretched
`Game`), its own paragraph in the Disclaimer. A second call of this kind needs a ruling of the same kind (D132).
- **Resolve on the watchdog, once for the process; call on the presenting thread, after the record is published,
behind one gate of four states** — idle, armed, reading, off. The plan's first draft had a busy flag beside
accumulators: two presenting threads could have read back to back, and the watchdog could have published half a
read. The whole design as reviewed is in the history file, §The train after 0.1.0-beta.46.
- **`nvapi64.dll` is a shim.** The check that the two addresses lie inside the module it asked refused the real
driver: the getters are in `nvapi64_impl.dll`, in the driver's store. An address is accepted when it is executable
code of a loaded image, and a reference is kept on that image too. Only the run against the installed driver
could find it — the stand-in answers with addresses of its own.
- **The code that is called is a Control Flow Guard image**; the plan's review had reasoned from the shim, which is
not. The probe enforces CFG and makes the calls from the header that ships, so this driver's getters are valid
targets. A CFG-enforcing game on another driver is not covered, and a refusal there is a fast-fail.
- **The layout stayed 5**: ten reserved words of region 5 took the read. `FL_HOOK_REFLEX`, `FL_MEASURED_LATENCY`
and `reflexLatencyUs` stay unset — there is no hook, and the numbers are series beside the frames.
- **D141 was asked twice.** A run on a busy PC showed the 2 ms latch can fire on a pause that was Windows'; the
owner kept one call. Do not re-ask without a real game's numbers.
- **What the game asked of Reflex, and Reflex through Streamline, are `RefusedRoute`** — a patch at a run-time
address, and a call the vendor forbids from another thread (D133). `sl.pcl.markers` waits for train D's spike.
### What item 44's last part showed (2026-11-14)
- **A first try did not exercise it** (sessions 203–205, #445): *Disable all hooking* was on before the games were
started, so two sessions were `RefusedKillSwitch` with nothing injected, and the hooked one ran to its exit.
- **The second try did, twice, in Phantom Blade Zero** (sessions 206 and 207): the game started with the switch
off, was recorded for a minute and a half, and the switch was turned on while it ran. Each log has `STOP` at the
next safety scan, **an `UNHOOK_RESTORED` line for every one of the twenty-nine patches, all at one time**, one
`PATCH_BATCH restore` — **83 309 µs and 85 578 µs for twenty-nine** — and `STOP_FLUSHED … a=1`. Nothing was
declined. Both sessions ended `KillSwitchEngaged`, tier 1, no fault, no record dropped, writer status
*unhooked*; the game ran on for three and four minutes and closed with nothing in Windows' application log.
Restoring twenty-nine one by one would have cost about 2.4 s at this game's 84 ms a stop.
- **Not said by the logs**: whether the owner felt a hitch at the stop. Not exercised: (e) a game with no
Streamline and (g) off means off — both are parts of item 45 now.
### Traps this train left
- **A bash here-document ate backslashes again** and wrote a NUL byte into a `.cpp`. Edit scripts are files.
- **A file made by the Write tool is LF**; `dotnet format --verify-no-changes` fails a new `.cs` for it. Convert.
- **`NvAPI_Status(__cdecl*)(…)` is a call by name to `nvapi-readonly-check`**: the status type has an alias in
`fl_reflex.h`. And a member of the Overlay's own named like a vendor's (`fgMultiplier`) fails
`overlay-fields-check` outside the header.
- **A copy of the harness in `%TEMP%` leaves an overlay log the run's sweep does not own** (it matches this
build's harness by path): the test that makes the copy sweeps it.
- **Stacked pull requests, with a dirty tree**: once the lower one is squash-merged GitHub retargets the next to
`main`; `gh pr update-branch` works while the upper branch only adds, and conflicts once it edited lines the
lower one added — then `git rebase -S --onto origin/main <lower tip> <branch>` and a forced push with lease.
- **Advisory checks found real things after the local gate was green**: SonarCloud a `wcslen`, Qodana's native
report a `switch` that did not name two enumerators, its managed report two redundant qualifiers and a
redundant `!`. Hold a merge until both have reported.
- **The probe's numbers depend on what else the PC does**: a run beside a build read 3.4 µs where three alone read
2.6, and saw reads of 2 ms. Say which kind a number is.
### NEXT
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.~~ **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). **Looked into the same day (D146)**: the poller waited its whole interval after a poll's work; only
the App's series loader reads `hz`, and only where a row has no `t_ms`, so no chart was wrong. The poller now
keeps a fixed period and `hz` is measured from the samples (`06_DATA_MODEL` §sensor_blobs) — in no release yet.
- **Where the third of a second goes is not established.** Unelevated, a poll takes about a millisecond (the
layers composed as the Agent composes them, each read under a stopwatch). In the owner's ledger 180 of 186
sessions are 1.32 s apart and six are 1.0 s: the two with no `cpu_temp` series (an Agent not elevated) are among
the six — which points at the sensor library's processor update, run on the poll's thread as administrator
with PawnIO — **but four sessions that have the series kept one second** (22, 72, 73, 136). **Not measured**:
that call itself (it needs elevation), and whether it is processor time or waiting. Not changed; the period no
longer depends on it. The owner's to say whether it is worth timing on their PC and moving off the poll's thread.
- **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
2077). Since this release the log says whether a batch went singly; the next long one can be read.
- **The Japanese strings are new and unreviewed**, as every `ja` string is.
- **Off means off has never been exercised on a real game** (item 43 (f), item 44 (g), now item 45 (g)); nor (c)
and (h) of item 43, which only the owner sees.
- **Valor Mortis's crash at 51 s** (twice, beta.40 and beta.44) **and Black Myth: Wukong's fault in Steam's crash
handler at every exit** are not explained. One session of each with hooking off is the comparison that is missing.
- **What item 41 left unexercised**: a configure through the FidelityFX 2.3 loader (Cyberpunk 2077 with FSR frame
generation), a game with neither library.
- **A fault while a game is closing is not seen by a hooked session** (D127: written down, not changed).
- **`docs/LIST_GAME_TESTED.md` is as of 2026-11-06**: refreshing it is a new copy of the ledger and the owner's review.
- **Item 40 (d)** was not exercised and the owner has not said item 40 passed. **Items 36 (d) and 37 are still open.**
- **`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:** 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).
+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.
+1 -1
View File
@@ -20,7 +20,7 @@ The link under them, *Read what the hook does and does not do*, opens the safety
| Setting | What it does | Default |
|---|---|---|
| **Minimum session length (s)** | A shorter session is not kept. 5 to 600 seconds. *Agent.* | 30 |
| **Sensor interval (ms)** | How often the PC's sensors are read during a session. 500 to 2000 ms. *Agent.* | 1000 |
| **Sensor interval (ms)** | How often the PC's sensors are read during a session. 500 to 2000 ms. With a value above 1000, not every reading of NVIDIA's latency report — made about once a second inside the game — becomes a point: each point is still one reading ([Advanced metrics](12-advanced-metrics.md)). *Agent.* | 1000 |
| **Raw series kept per game** | How many of each game's newest sessions keep their per-frame data; older ones keep their statistics. 0 keeps everything. *Agent.* | 20 |
| **Advanced metrics** | Reads more from the graphics driver and the hardware sensors during a session — the graphics card's memory and load in detail, each fan and voltage, what your display can do, the driver's settings for the game — and stores it with the session. In a game FrameLedger measures from inside it also reads what the game tells DLSS, Streamline and FSR, and — on an NVIDIA card, in a Direct3D 12 game that uses NVIDIA's library — asks the graphics driver about once a second how long each stage of a frame took ([Advanced metrics](12-advanced-metrics.md)). Off: nothing more is read or stored. It applies from the next session; a session recorded while it was off is not filled in later. While it is on, the **Advanced** page is in the list on the left ([Advanced metrics](12-advanced-metrics.md)). *Agent.* | Off |
+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:
+7 -4
View File
@@ -12,7 +12,7 @@
HTML comments are not part of the block.
-->
> ⚠ **What FrameLedger actually measures today — 2026-11-11.** The software is a beta; its latest
> **beta is `0.1.0-beta.47`** (2026-11-14), an unsigned installer built from that tag with its
> **beta is `0.1.0-beta.48`** (2026-11-14), an unsigned installer built from that tag with its
> checksums published beside it (alphas — experimental builds that try a newer .NET — are published apart). The source holds the desktop app
> (library, store import, charts, settings) and the background Agent, which records a session when a
> game in the library runs (unless you switched its recording off), injects only into games you enabled
@@ -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
+8 -5
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
@@ -125,7 +125,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-11-11.** The software is a beta; its latest
> **beta is `0.1.0-beta.47`** (2026-11-14), an unsigned installer built from that tag with its
> **beta is `0.1.0-beta.48`** (2026-11-14), an unsigned installer built from that tag with its
> checksums published beside it (alphas — experimental builds that try a newer .NET — are published apart). The source holds the desktop app
> (library, store import, charts, settings) and the background Agent, which records a session when a
> game in the library runs (unless you switched its recording off), injects only into games you enabled
@@ -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
@@ -33,7 +33,12 @@ public static class AdvancedSessionBuilder
/// </summary>
public const int MaxSeries = 256;
public static (IReadOnlyList<SensorBlob> Blobs, AdvancedSessionRow? Row) Build(IReadOnlyList<TelemetrySample> sensors, AdvancedSessionData? data, ISeriesCodec codec)
/// <summary>The session's advanced series as blobs, and its <c>session_advanced</c> row — nothing when there is neither a series nor data.</summary>
/// <param name="sensors">The session's samples, in order.</param>
/// <param name="data">What the session knew of the machine and itself, or null when the option was off.</param>
/// <param name="codec">How a series is encoded.</param>
/// <param name="hz">The rate the samples had (<see cref="SessionFinalizer.SampleRate"/>): stored with each series as the fallback for a reader with no <c>t_ms</c>.</param>
public static (IReadOnlyList<SensorBlob> Blobs, AdvancedSessionRow? Row) Build(IReadOnlyList<TelemetrySample> sensors, AdvancedSessionData? data, ISeriesCodec codec, double hz = 1)
{
ArgumentNullException.ThrowIfNull(sensors);
ArgumentNullException.ThrowIfNull(codec);
@@ -48,7 +53,7 @@ public static class AdvancedSessionBuilder
var stats = new Dictionary<string, SensorSeriesStats>(StringComparer.Ordinal);
for (int s = 0; s < names.Count; s++)
{
blobs.Add(new SensorBlob { Series = names[s], Hz = 1, Codec = codec.Tag, Data = codec.EncodeSparseFloat32(columns[s]) });
blobs.Add(new SensorBlob { Series = names[s], Hz = hz, Codec = codec.Tag, Data = codec.EncodeSparseFloat32(columns[s]) });
SeriesAggregates aggregates = SeriesAggregates.Of(columns[s].Select(static v => float.IsNaN(v) ? (double?)null : v));
if (aggregates.Count > 0)
{
@@ -59,7 +59,8 @@ public sealed class SessionFinalizer
// Advanced metrics (D102), both tiers: they are read by the Agent, not by a hook, so a session that was not
// hooked has them all the same. Nothing when the option was off - no series, no row.
(IReadOnlyList<SensorBlob> advancedBlobs, AdvancedSessionRow? advanced) = AdvancedSessionBuilder.Build(input.Sensors, input.Advanced, _codec);
double hz = SampleRate(input.Sensors, row.QpcFrequency);
(IReadOnlyList<SensorBlob> advancedBlobs, AdvancedSessionRow? advanced) = AdvancedSessionBuilder.Build(input.Sensors, input.Advanced, _codec, hz);
if (input.Hooked is null)
{
// A Tier-2 row has no frames and every sensor the machine provided (2026-09-22): the same averages a
@@ -67,7 +68,7 @@ public sealed class SessionFinalizer
return new FinalizedSession
{
Row = SessionAggregator.WithSensorAggregates(row with { Tier = CaptureTier.NotHooked }, input.Sensors),
Sensors = [.. EncodeSensors(input.Sensors, row.QpcEpoch, row.QpcFrequency), .. advancedBlobs],
Sensors = [.. EncodeSensors(input.Sensors, row.QpcEpoch, row.QpcFrequency, hz), .. advancedBlobs],
Advanced = advanced,
};
}
@@ -82,11 +83,32 @@ public sealed class SessionFinalizer
{
FirstPresentMs = FirstPresentMs(r.Dominant, row.QpcEpoch, row.QpcFrequency),
},
Sensors = [.. EncodeSensors(input.Sensors, row.QpcEpoch, row.QpcFrequency), .. advancedBlobs],
Sensors = [.. EncodeSensors(input.Sensors, row.QpcEpoch, row.QpcFrequency, hz), .. advancedBlobs],
Advanced = advanced,
};
}
/// <summary>
/// The rate the session's samples had, a second (owner decision D146): the gaps between the first and the last
/// over the time between them, to a thousandth. 1 where there are fewer than two samples or no time between them.
/// </summary>
/// <remarks>
/// Measured, not the configured interval: it is then right for a session recovered from a <c>.partial</c> file,
/// which never knew the setting, and for one whose poller could not keep its period. It is the FALLBACK for a
/// reader: every series is stored beside <c>t_ms</c>, which carries each sample's own time.
/// </remarks>
public static double SampleRate(IReadOnlyList<TelemetrySample> sensors, long qpcFrequency)
{
ArgumentNullException.ThrowIfNull(sensors);
if (sensors.Count < 2 || qpcFrequency <= 0)
{
return 1;
}
long span = sensors[^1].QpcTicks - sensors[0].QpcTicks;
return span <= 0 ? 1 : Math.Round((sensors.Count - 1) * (double)qpcFrequency / span, 3);
}
/// <summary>
/// The discard rule, the owner, then step 5: one transaction, then the retention sweep.
/// </summary>
@@ -248,7 +270,7 @@ public sealed class SessionFinalizer
}
/// <summary><c>t_ms</c> plus one series per field any sample carried, aligned to <c>t_ms</c>, −1 where a tick had no reading.</summary>
private List<SensorBlob> EncodeSensors(IReadOnlyList<TelemetrySample> sensors, ulong qpcEpoch, long qpcFrequency)
private List<SensorBlob> EncodeSensors(IReadOnlyList<TelemetrySample> sensors, ulong qpcEpoch, long qpcFrequency, double hz)
{
if (sensors.Count == 0)
{
@@ -257,34 +279,34 @@ public sealed class SessionFinalizer
var blobs = new List<SensorBlob>
{
Blob("t_ms", sensors, s => (float)((s.QpcTicks - (long)qpcEpoch) * 1000.0 / qpcFrequency)),
Blob("t_ms", sensors, hz, s => (float)((s.QpcTicks - (long)qpcEpoch) * 1000.0 / qpcFrequency)),
};
// One list (SensorSeriesCatalog) for the blobs and for sensor_stats_json; the game process's memory joined it in
// beta.12 (D43) — five series, MiB, both tiers.
foreach ((string name, Func<TelemetrySample, double?> select) in SensorSeriesCatalog.All)
{
AddIfAny(blobs, name, sensors, select);
AddIfAny(blobs, name, sensors, hz, select);
}
return blobs;
}
private void AddIfAny(List<SensorBlob> into, string series, IReadOnlyList<TelemetrySample> sensors, Func<TelemetrySample, double?> field)
private void AddIfAny(List<SensorBlob> into, string series, IReadOnlyList<TelemetrySample> sensors, double hz, Func<TelemetrySample, double?> field)
{
if (sensors.Any(s => field(s) is not null))
{
into.Add(Blob(series, sensors, s => field(s) is { } v ? (float)v : SensorMissing));
into.Add(Blob(series, sensors, hz, s => field(s) is { } v ? (float)v : SensorMissing));
}
}
private SensorBlob Blob(string series, IReadOnlyList<TelemetrySample> sensors, Func<TelemetrySample, float> value) => new()
private SensorBlob Blob(string series, IReadOnlyList<TelemetrySample> sensors, double hz, Func<TelemetrySample, float> value) => new()
{
Series = series,
// Nominal: the poller ticks once a second by default (TelemetryPollerOptions). The t_ms series stored beside every
// series carries each tick's real time, and that is what the App draws against; Hz is only its fallback for a row
// written without t_ms (06_DATA_MODEL §sensor_blobs).
Hz = 1,
// The rate the samples had (SampleRate; it was the constant 1 until 0.1.0-beta.48, whatever the samples did).
// The t_ms series stored beside every series carries each tick's real time, and that is what the App draws
// against; Hz is only its fallback for a row written without t_ms (06_DATA_MODEL §sensor_blobs).
Hz = hz,
Codec = _codec.Tag,
Data = _codec.EncodeFloat32([.. sensors.Select(value)]),
};
@@ -2,6 +2,7 @@
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Collections.Concurrent;
using System.Diagnostics;
using FrameLedger.Application.Advanced;
using FrameLedger.Application.Telemetry;
@@ -205,12 +206,34 @@ public sealed class TelemetryPoller : ITelemetryPoller
}
}
/// <summary>
/// How long to wait for the next tick of a fixed period (owner decision D146): ticks are due at whole intervals
/// from the loop's start, so the answer is what is left of the interval now running - more than nothing, at most
/// a whole interval. A poll that overran one or more periods is followed by the next tick still to come: the
/// ticks it missed are skipped, never run in a burst.
/// </summary>
/// <remarks>
/// Until 0.1.0-beta.48 the loop waited the whole interval AFTER a poll's work. In the owner's ledger nearly
/// every session has its samples 1.32 s apart under a setting of one second - so the part inside a game, which
/// reads the driver's latency report once a second, had a quarter of its reads fall between two samples. What
/// takes the third of a second is not established (06_DATA_MODEL §sensor_blobs): unelevated, a poll takes about
/// a millisecond. Whatever a poll costs, the period no longer depends on it.
/// </remarks>
public static TimeSpan UntilNextTick(TimeSpan elapsed, TimeSpan interval)
{
ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(interval, TimeSpan.Zero);
long into = elapsed <= TimeSpan.Zero ? 0 : elapsed.Ticks % interval.Ticks;
return TimeSpan.FromTicks(interval.Ticks - into);
}
private void Loop()
{
// The stopwatch, not the injected clock: this is about waiting, and a test's clock stands still.
long started = Stopwatch.GetTimestamp();
do
{
PollOnce();
}
while (!_stop.Wait(_options.Interval));
while (!_stop.Wait(UntilNextTick(Stopwatch.GetElapsedTime(started), _options.Interval)));
}
}
+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
@@ -670,18 +675,45 @@ inline void ObserveSlShutdown(Accumulators& a) noexcept {
// ---------------------------------------------------------------------------------------------------------------------
inline constexpr uint32_t kLatSpans =
7u; // simulation, submit, present, driver, OS queue, GPU, total: the region's order
inline constexpr uint32_t kLatGpu = 5u;
inline constexpr uint32_t kLatTotal = 6u;
inline constexpr uint32_t kLatReportFrames = 64u;
inline constexpr uint64_t kLatSpanLimitUs = 1000000u;
static_assert(sizeof(NV_LATENCY_RESULT_PARAMS::frameReport) / sizeof(NV_LATENCY_RESULT_PARAMS::FrameReport) ==
kLatReportFrames);
// HOW A FRAME'S GPU SPAN AND THE DRIVER'S ACTIVE TIME STAND TO EACH OTHER (0.1.0-beta.49, owner decision D148). In one
// real game the mean active time was LONGER than the mean span between the two GPU marks (HANDOFF, item 46), and the
// two means cannot say why: the span's is over every summed frame, one of no length included, the active time's over
// the frames that gave one. So each summed frame is put in one place here, by its own two numbers, and the frames
// that have both are kept in two heaps -- the active time longer than the span, or not -- each with its count and
// both sums. No threshold: a span of one microsecond is a span. FOR THE NATIVE LOG ONLY: nothing of it is published,
// and which frames are summed does not depend on it.
struct LatencyGpuCounts {
uint32_t spanAbsent = 0; // no GPU start mark
uint32_t spanZero = 0; // the two GPU marks are the same instant
uint32_t activeNoSpan = 0; // an active time, and no span with a length
uint32_t spanNoActive = 0; // a span with a length, and no active time
uint32_t longerFrames = 0; // both, and the active time is the LONGER
uint32_t longerSpanUs = 0; // ... their spans
uint32_t longerActiveUs = 0; // ... their active times
uint32_t withinFrames = 0; // both, and the active time is no longer than the span
uint32_t withinSpanUs = 0;
uint32_t withinActiveUs = 0;
};
// What one read of the report added up to.
struct LatencyTally {
uint32_t frames = 0; // frames summed
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;
LatencyGpuCounts gpu; // the summed frames, each by its GPU span and its active time: the native log's
};
// Where the reader is in the game's frame ids: the newest one already summed or refused. 0 = none yet.
@@ -714,6 +746,49 @@ 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 bool LatencyTimeGiven(uint32_t us) noexcept {
return us != 0u && us <= kLatSpanLimitUs;
}
inline void LatencyAddTime(uint32_t us, uint32_t& sumUs, uint32_t& frames) noexcept {
if (LatencyTimeGiven(us)) {
sumUs += us;
++frames;
}
}
// One summed frame's place in LatencyGpuCounts: its GPU span as LatencySpan gave it, and the driver's active time
// of the same frame, "given" by the rule LatencyAddTime sums it by. An impossible span never comes here -- its frame
// was refused.
inline void CountGpuTimes(uint32_t spanKind, uint32_t spanUs, uint32_t activeUs, LatencyGpuCounts& counts) noexcept {
const bool span = spanKind == kLatSpanReported && spanUs != 0u;
const bool active = LatencyTimeGiven(activeUs);
if (spanKind == kLatSpanAbsent) {
++counts.spanAbsent;
} else if (spanUs == 0u) {
++counts.spanZero;
}
if (span && active) {
if (activeUs > spanUs) {
++counts.longerFrames;
counts.longerSpanUs += spanUs;
counts.longerActiveUs += activeUs;
} else {
++counts.withinFrames;
counts.withinSpanUs += spanUs;
counts.withinActiveUs += activeUs;
}
} else if (active) {
++counts.activeNoSpan;
} else if (span) {
++counts.spanNoActive;
}
}
inline void ObserveLatencyFrame(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf, LatencyTally& tally) noexcept {
uint32_t us[kLatSpans]{};
const uint32_t kind[kLatSpans] = {
@@ -741,6 +816,9 @@ 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);
CountGpuTimes(kind[kLatGpu], us[kLatGpu], lf.gpuActiveRenderTimeUs, tally.gpu);
}
// One report: the frames newer than the cursor, the two newest left for the next read.
@@ -797,12 +875,155 @@ 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);
}
// ---------------------------------------------------------------------------------------------------------------------
// THE COUNTS, IN BATCHES, FOR THE NATIVE LOG (0.1.0-beta.49, owner decisions D148, D151). The watchdog's.
//
// A BATCH BELONGS TO ONE STATE of the driver's sleep status -- its low-latency switch, its "the game sleeps" switch
// and its frame-generation multiplier -- because the counts mean nothing apart from it: the owner's games switch
// Reflex on only with frame generation, and the low-latency switch may be the NVIDIA App's override and not the
// game's. A read in another state closes the batch before it is added. A state that flickers would write a batch a
// read, so after kLatStateClosures such closings a request's batches run to their length whatever the state, and the
// "seen" words of the batch say what it held.
//
// A batch is also closed after the request's tenth read, its thirtieth, and every sixtieth from there: a game that
// exits takes the watchdog with it, and what was not written by then is lost -- under a minute of it.
// ---------------------------------------------------------------------------------------------------------------------
inline constexpr uint32_t kLatBatchFirst = 10u;
inline constexpr uint32_t kLatBatchSecond = 30u;
inline constexpr uint32_t kLatBatchEvery = 60u;
inline constexpr uint32_t kLatStateClosures = 32u;
inline constexpr uint32_t kLatStateUnknown = 0xFFFFFFFFu; // a read whose sleep status did not come back
inline constexpr uint32_t kLatStateSwitches = 1u | 8u; // bLowLatencyMode, bUseGameSleep (ObserveSleepStatus)
struct LatencyBatch {
uint32_t reads = 0; // reads whose report came back, in this batch
uint32_t frames = 0; // frames they summed
uint32_t refused = 0; // frames they refused
LatencyGpuCounts gpu;
uint32_t sleepOn = 0; // switches the status showed on in this batch
uint32_t sleepOff = 0; // ... and off
uint32_t multipliers = 0; // LatencyMultiplierBit of every multiplier it gave
uint32_t state = kLatStateUnknown; // LatencyStateOf its first read
};
struct LatencyBatchBook {
LatencyBatch batch;
uint32_t okReads = 0; // reads whose report came back, since the request
uint32_t closures = 0; // batches a change of state closed, since the request
};
inline uint32_t LatencyStateOf(bool sleepValid, const LatencySleep& sleep) noexcept {
if (!sleepValid) {
return kLatStateUnknown;
}
return (sleep.on & kLatStateSwitches) | ((sleep.multiplier > 255u ? 255u : sleep.multiplier) << 8);
}
// Whether the batch is to be written BEFORE a read in `state` is added to it.
inline bool LatencyBatchTurns(const LatencyBatchBook& book, uint32_t state) noexcept {
return book.batch.reads != 0u && book.batch.state != state && book.closures < kLatStateClosures;
}
// Whether the batch is to be written AFTER the request's okReads-th read was added.
inline bool LatencyBatchDue(uint32_t okReads) noexcept {
if (okReads <= kLatBatchSecond) {
return okReads == kLatBatchFirst || okReads == kLatBatchSecond;
}
return (okReads - kLatBatchSecond) % kLatBatchEvery == 0u;
}
// A batch is sixty reads of sixty-two frames at most, and a time is a second at most: under 2^32 microseconds. The
// sums stop there all the same, so that a word never wraps into a small number.
inline void LatencyAddStop(uint32_t& sum, uint32_t value) noexcept {
sum = value > 0xFFFFFFFFu - sum ? 0xFFFFFFFFu : sum + value;
}
inline void LatencyBatchAdd(LatencyBatchBook& book, const LatencyTally& tally, bool sleepValid,
const LatencySleep& sleep) noexcept {
LatencyBatch& batch = book.batch;
if (batch.reads == 0u) {
batch.state = LatencyStateOf(sleepValid, sleep);
}
++batch.reads;
++book.okReads;
LatencyAddStop(batch.frames, tally.frames);
LatencyAddStop(batch.refused, tally.refused);
LatencyAddStop(batch.gpu.spanAbsent, tally.gpu.spanAbsent);
LatencyAddStop(batch.gpu.spanZero, tally.gpu.spanZero);
LatencyAddStop(batch.gpu.activeNoSpan, tally.gpu.activeNoSpan);
LatencyAddStop(batch.gpu.spanNoActive, tally.gpu.spanNoActive);
LatencyAddStop(batch.gpu.longerFrames, tally.gpu.longerFrames);
LatencyAddStop(batch.gpu.longerSpanUs, tally.gpu.longerSpanUs);
LatencyAddStop(batch.gpu.longerActiveUs, tally.gpu.longerActiveUs);
LatencyAddStop(batch.gpu.withinFrames, tally.gpu.withinFrames);
LatencyAddStop(batch.gpu.withinSpanUs, tally.gpu.withinSpanUs);
LatencyAddStop(batch.gpu.withinActiveUs, tally.gpu.withinActiveUs);
if (sleepValid) {
batch.sleepOn |= sleep.on & FL_LAT_SLEEP_BITS;
batch.sleepOff |= ~sleep.on & FL_LAT_SLEEP_BITS;
batch.multipliers |= LatencyMultiplierBit(sleep.multiplier);
}
}
// The batch as lines of the native log: a text, the line's `a` (printed in decimal) and its `b` (printed in hex).
inline constexpr uint32_t kLatBatchLines = 6u;
struct LatencyLogLine {
const char* text;
uint32_t a;
uint64_t b;
};
constexpr uint64_t LatencyPair(uint32_t high, uint32_t low) noexcept {
return (static_cast<uint64_t>(high) << 32) | low;
}
constexpr LatencyLogLine LatencyBatchLine(const LatencyBatch& batch, uint32_t line) noexcept {
switch (line) {
case 0u:
return {"reads / sleep switches on | off<<8 | multipliers seen<<16", batch.reads,
batch.sleepOn | (batch.sleepOff << 8) | (static_cast<uint64_t>(batch.multipliers) << 16)};
case 1u:
return {"frames summed / refused", batch.frames, batch.refused};
case 2u:
return {"GPU span absent / of no length", batch.gpu.spanAbsent, batch.gpu.spanZero};
case 3u:
return {"active time with no span / span with no active time", batch.gpu.activeNoSpan, batch.gpu.spanNoActive};
case 4u:
return {"active longer than span: frames / span us<<32 | active us", batch.gpu.longerFrames,
LatencyPair(batch.gpu.longerSpanUs, batch.gpu.longerActiveUs)};
default:
return {"active within span: frames / span us<<32 | active us", batch.gpu.withinFrames,
LatencyPair(batch.gpu.withinSpanUs, batch.gpu.withinActiveUs)};
}
}
// The longest of those texts, for whoever writes them into a line of fixed length.
constexpr uint32_t LatencyBatchLongestText() noexcept {
uint32_t longest = 0u;
for (uint32_t line = 0u; line < kLatBatchLines; ++line) {
const char* text = LatencyBatchLine(LatencyBatch{}, line).text;
uint32_t length = 0u;
while (text[length] != '\0') {
++length;
}
longest = length > longest ? length : longest;
}
return longest;
}
// 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 +1119,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 +1161,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
}
+49 -1
View File
@@ -143,7 +143,10 @@ void PublishHandshake() noexcept {
// the log that should have said which hooks went in and what they were handed
// ended before the game had loaded its upscaler. Events are few and bounded
// (installs, a handful of first sights, three faults at most), so this is a few
// appends per session, on the watchdog's own tick.
// appends per session, on the watchdog's own tick -- and, since 0.1.0-beta.49,
// six lines a batch of the driver read's frame counts (LATENCY_FRAMES: a batch
// a minute at most once a session is under way), only while a session asks for
// Advanced metrics and the driver is being read.
// ---------------------------------------------------------------------------
enum FlLogCode : uint32_t {
kLogRingCreated = 1,
@@ -166,6 +169,7 @@ enum FlLogCode : uint32_t {
kLogFfxConfigureType,
kLogPatchBatch,
kLogLatency,
kLogLatencyFrames,
};
const char* LogCodeName(uint32_t code) noexcept {
@@ -210,6 +214,8 @@ const char* LogCodeName(uint32_t code) noexcept {
return "PATCH_BATCH";
case kLogLatency:
return "LATENCY";
case kLogLatencyFrames:
return "LATENCY_FRAMES";
default:
return "?";
}
@@ -227,6 +233,8 @@ struct FlLogEvent {
static_assert(sizeof(FlLogEvent) == 96, "the native log's event: 256 of them are static storage in a game's process");
static_assert(sizeof(fl::inventory::RowName::text) <= sizeof(FlLogEvent::text),
"a row's module!symbol name must fit an event's text, or two rows could log the same truncated name");
static_assert(fl::adv::LatencyBatchLongestText() < sizeof(FlLogEvent::text),
"a line of the driver read's frame counts must fit an event's text: LogNote cuts without saying so");
constexpr uint32_t kLogCapacity = 256;
FlLogEvent g_log[kLogCapacity]{};
@@ -804,6 +812,8 @@ bool g_latStalled = false;
int64_t g_latArmedQpc = 0;
int64_t g_latReadingSinceQpc = 0;
uint32_t g_latLoggedState = FL_LAT_NONE;
// The frame counts of the reads, for the native log only (fl_adv_fields.h; owner decisions D148, D151).
fl::adv::LatencyBatchBook g_latBook;
// One read, on a presenting thread that found the gate armed. Not inlined: RecordPresent stays as small as it was.
__declspec(noinline) void ReadLatencyOnce() noexcept {
@@ -890,15 +900,33 @@ const char* LatencyStateName(uint32_t state) noexcept {
}
}
// The batch of frame counts in hand, as LATENCY_FRAMES lines; nothing when no read is in it. The watchdog's: at the
// batch's end, when the Agent asks for a flush, at a new request and at a stop -- whatever a game that exits by
// itself had not had written by then is lost, under a minute of it.
void WriteLatencyBatch() noexcept {
if (g_latBook.batch.reads == 0u) {
return;
}
for (uint32_t line = 0; line < fl::adv::kLatBatchLines; ++line) {
const fl::adv::LatencyLogLine entry = fl::adv::LatencyBatchLine(g_latBook.batch, line);
LogNote(kLogLatencyFrames, entry.text, entry.a, entry.b);
}
g_latBook.batch = fl::adv::LatencyBatch{};
}
// THE WATCHDOG'S HALF, once a tick while a session asks. `now` is this tick's QPC.
void TickLatency(bool newRequest, int64_t now) noexcept {
if (newRequest) {
// What the session before left of a batch is its own, written before this one's counts begin.
WriteLatencyBatch();
g_latBook = fl::adv::LatencyBatchBook{};
// A session's counts are its own; where the read stands is the process's and stays.
g_latOut.reads = 0u;
g_latOut.worstUs = 0u;
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 +947,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;
@@ -928,11 +963,22 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
if (g_latRead.ok != 0u) {
g_latOut.tally = g_latRead.tally;
fl::adv::NoteBits(g_adv.validMask, FL_ADV_VALID_LATENCY);
// The same read's frames, counted for the log: a batch is of one state of the sleep status.
const bool sleepValid = g_latRead.sleepValid != 0u;
if (fl::adv::LatencyBatchTurns(g_latBook, fl::adv::LatencyStateOf(sleepValid, g_latRead.sleep))) {
WriteLatencyBatch();
++g_latBook.closures;
}
fl::adv::LatencyBatchAdd(g_latBook, g_latRead.tally, sleepValid, g_latRead.sleep);
if (fl::adv::LatencyBatchDue(g_latBook.okReads)) {
WriteLatencyBatch();
}
}
if (g_latRead.sleepValid != 0u) {
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;
@@ -3551,6 +3597,7 @@ DWORD WatchdogLoop() noexcept {
std::atomic_ref<uint32_t> flushReq{g_control->logFlushRequested};
if (const uint32_t req = flushReq.load(std::memory_order_acquire); req != g_logFlushSeen) {
g_logFlushSeen = req;
WriteLatencyBatch(); // what is counted of the driver read so far is part of what the Agent asks for
FlushLog();
}
@@ -3689,6 +3736,7 @@ DWORD WINAPI WatchdogThread(LPVOID) noexcept {
}
}
const bool complete = g_stopLogged.load(std::memory_order_acquire) != 0u;
WriteLatencyBatch(); // the watchdog's own book: no presenting thread ever touches it
LogNote(kLogStopFlushed, complete ? "every stop line is above" : "the stop was still writing", complete ? 1u : 0u);
FlushLog(true);
return r;
+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);
+111 -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);
@@ -7853,6 +7857,98 @@ bool TargetHasModule(HANDLE process, const wchar_t* leaf) {
} // namespace
TEST_CASE("the frames a read summed are counted in the native log, each by its GPU span and the driver's active time: "
"a batch after ten reads, and what is left when the Agent asks",
"[guard][inject][shm][advanced][latency][log]") {
// WHY (0.1.0-beta.49, owner decisions D148, D151). In one real game the mean active time was longer than the mean
// span between the two GPU marks, and the two means cannot say whether that is the driver's doing or the way they
// are taken. The counts that can are written to the log only -- nothing of them is published -- in batches that
// each belong to one state of the sleep status.
LatencyTarget t;
REQUIRE(StartLatencyTarget(t, LatencyArgs(L"--hold-presenting-d3d12 40"), true));
const MappedRing& r = t.r;
fl::stubnv::Shared* stub = t.stub.words;
if (stub == nullptr || r.st == nullptr || r.ctl == nullptr) {
return; // not reached after the REQUIRE; said in the form a static analyser follows (cpp:S2259)
}
REQUIRE(WaitForRecords(r));
SetStubWord(stub->mode, fl::stubnv::kModeGpuShapes); // before the first read: every read is of these frames
SetAdvancedRequest(r, 7u);
// Ten reads sum the frames 5000..5151: sixty-two, then ten a read. By frameID % 5 (fl_stub_nvapi_shared.h) that is
// 31, 31, 30, 30, 30 of the five shapes.
const uint32_t zero = 31u + 30u; // shapes 1 and 4
const uint32_t longer = 30u; // shape 2
const uint32_t within = 31u; // shape 0
char tails[6][64]{};
snprintf(tails[0], sizeof(tails[0]), " a=10 b=0x%x", (1u | 8u) | ((2u | 4u | 16u) << 8) | ((1u << 2) << 16));
snprintf(tails[1], sizeof(tails[1]), " a=152 b=0x0");
snprintf(tails[2], sizeof(tails[2]), " a=0 b=0x%x", zero);
snprintf(tails[3], sizeof(tails[3]), " a=30 b=0x%x", 30u); // shape 4; shape 3
snprintf(tails[4], sizeof(tails[4]), " a=%u b=0x%llx", longer,
(static_cast<unsigned long long>(longer) * fl::stubnv::kGpuUs << 32) |
(static_cast<unsigned long long>(longer) * fl::stubnv::kGpuActiveLongUs));
snprintf(tails[5], sizeof(tails[5]), " a=%u b=0x%llx", within,
(static_cast<unsigned long long>(within) * fl::stubnv::kGpuUs << 32) |
(static_cast<unsigned long long>(within) * fl::stubnv::kGpuActiveUs));
const char* names[6] = {"reads / sleep switches", "frames summed / refused", "GPU span absent / of no length",
"active time with no span", "active longer than span", "active within span"};
std::wstring log;
std::string text;
bool complete = false;
for (int i = 0; i < 500 && !complete; ++i) {
++r.ctl->guardTicks;
Sleep(50);
if (i % 10 != 9 || (log.empty() && !FindOverlayLog(t.child.pi.dwProcessId, t.child.pi.hProcess, log))) {
continue;
}
text = ReadWholeFile(log);
complete = CountOf(text, "LATENCY_FRAMES") >= 6u;
}
INFO("log " << Narrow(log) << ":\n" << text);
REQUIRE(complete);
for (int line = 0; line < 6; ++line) {
INFO("line " << line << ": " << names[line] << " ..." << tails[line]);
CHECK(LogHasLine(text, "LATENCY_FRAMES", names[line], tails[line]));
}
CHECK(CountOf(text, "LATENCY_FRAMES") == 6u); // one batch: the next is twenty reads away
CHECK(r.ctl->logFlushRequested == 0u); // nobody asked for it
// What is published is what it was: these counts are the log's.
fl::FlAdvancedState a{};
REQUIRE(ReadAdvanced(r, 7u, a, 0u, fl::FL_ADV_VALID_LATENCY));
CHECK(LatStateOf(a) == fl::FL_LAT_READING);
for (uint32_t word : a.reservedDlss) {
CHECK(word == 0u);
}
// ---- THE REST, WHEN THE AGENT ASKS. A few reads more, then a flush request: the batch in hand is written with
// the log, six lines whose frames are ten a read.
TickFor(r, 3200);
++r.ctl->logFlushRequested;
complete = false;
for (int i = 0; i < 100 && !complete; ++i) {
++r.ctl->guardTicks;
Sleep(50);
if (i % 10 == 9) {
text = ReadWholeFile(log);
complete = CountOf(text, "LATENCY_FRAMES") >= 12u;
}
}
INFO("log after the flush request:\n" << text);
REQUIRE(complete);
CHECK(CountOf(text, "LATENCY_FRAMES") == 12u);
bool rest = false;
for (uint32_t reads = 1u; reads < 20u && !rest; ++reads) { // the thirtieth read would close it itself
char frames[32]{};
snprintf(frames, sizeof(frames), " a=%u b=0x0", reads * fl::stubnv::kFrameIdStep);
rest = LogHasLine(text, "LATENCY_FRAMES", names[1], frames);
}
CHECK(rest);
CHECK(r.st->faultCount == 0u);
}
TEST_CASE("the driver's latency report is read only while a session asks, once a second, and stops with the request "
"and with the hooks",
"[guard][inject][shm][advanced][latency]") {
@@ -7883,6 +7979,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 +8016,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 +8040,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;
+304 -1
View File
@@ -12,7 +12,10 @@
// read as a game that has stopped.
#include <catch2/catch_test_macros.hpp>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <fl_adv_fields.h>
#include <memory>
@@ -191,6 +194,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 +254,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 +263,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 +284,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 +297,250 @@ 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);
}
// ---------------------------------------------------------------------------------------------------------------------
// THE COUNTS FOR THE NATIVE LOG (0.1.0-beta.49, owner decisions D148, D151).
// ---------------------------------------------------------------------------------------------------------------------
TEST_CASE("each summed frame is counted by its GPU span and the driver's active time, and what is summed does not move",
"[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto report = Report(100u); // 100..163: 100..161 are summed
for (std::uint32_t i = 0; i < 64u; ++i) {
Frame& f = report->frameReport[i];
switch (i % 6u) {
case 0u: // a span of 3700 and an active time that is the shorter
f.gpuActiveRenderTimeUs = 3500u;
break;
case 1u: // the two marks at one instant, and no active time
f.gpuRenderStartTime = f.gpuRenderEndTime;
break;
case 2u: // an active time longer than the span
f.gpuActiveRenderTimeUs = 4000u;
break;
case 3u: // the span, and no active time
break;
case 4u: // the two marks at one instant, and an active time
f.gpuRenderStartTime = f.gpuRenderEndTime;
f.gpuActiveRenderTimeUs = 3500u;
break;
default: // no start mark, and an active time
f.gpuRenderStartTime = 0u;
f.gpuActiveRenderTimeUs = 3500u;
break;
}
}
fl::adv::ObserveLatencyReport(*report, cursor, tally);
// Sixty-two frames: eleven each of the first two shapes, ten each of the other four.
REQUIRE(tally.frames == 62u);
CHECK(tally.refused == 0u);
CHECK(tally.gpu.withinFrames == 11u);
CHECK(tally.gpu.withinSpanUs == 11u * 3700u);
CHECK(tally.gpu.withinActiveUs == 11u * 3500u);
CHECK(tally.gpu.longerFrames == 10u);
CHECK(tally.gpu.longerSpanUs == 10u * 3700u);
CHECK(tally.gpu.longerActiveUs == 10u * 4000u);
CHECK(tally.gpu.spanZero == 11u + 10u);
CHECK(tally.gpu.spanAbsent == 10u);
CHECK(tally.gpu.spanNoActive == 10u);
CHECK(tally.gpu.activeNoSpan == 10u + 10u);
// Every summed frame is in exactly one place: the four counted here, or neither a span nor an active time -- the
// eleven whose two marks are one instant and that gave no time.
const std::uint32_t placed =
tally.gpu.withinFrames + tally.gpu.longerFrames + tally.gpu.spanNoActive + tally.gpu.activeNoSpan;
CHECK(placed + 11u == tally.frames);
// WHAT IS PUBLISHED IS WHAT IT WAS: the span over every frame that reported one, the time over those that gave one.
CHECK(tally.sumUs[fl::adv::kLatGpu] == (11u + 10u + 10u) * 3700u);
CHECK((tally.lacking & (1u << fl::adv::kLatGpu)) != 0u);
CHECK(tally.activeFrames == 11u + 10u + 10u + 10u);
CHECK(tally.activeSumUs == 31u * 3500u + 10u * 4000u);
CHECK(tally.sumUs[fl::adv::kLatTotal] == 62u * 7500u);
}
TEST_CASE(
"an active time as long as the span is not the longer; one of over a second was not given; a refused frame is "
"not counted",
"[latency]") {
fl::adv::LatencyGpuCounts counts;
fl::adv::CountGpuTimes(fl::adv::kLatSpanReported, 3700u, 3700u, counts);
CHECK(counts.withinFrames == 1u);
CHECK(counts.longerFrames == 0u);
fl::adv::CountGpuTimes(fl::adv::kLatSpanReported, 1u, 2u, counts); // a span of a microsecond is a span
CHECK(counts.longerFrames == 1u);
CHECK(counts.longerSpanUs == 1u);
CHECK(counts.longerActiveUs == 2u);
CHECK(counts.spanZero == 0u);
fl::adv::CountGpuTimes(fl::adv::kLatSpanReported, 3700u, 1'000'001u, counts); // no frame has such a time
CHECK(counts.spanNoActive == 1u);
CHECK(counts.longerFrames == 1u);
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto report = Report(100u);
for (auto& f : report->frameReport) {
f.gpuActiveRenderTimeUs = 3500u;
}
report->frameReport[5].presentEndTime = report->frameReport[5].presentStartTime - 50u; // refused whole
fl::adv::ObserveLatencyReport(*report, cursor, tally);
CHECK(tally.frames == 61u);
CHECK(tally.refused == 1u);
CHECK(tally.gpu.withinFrames == 61u);
CHECK(tally.gpu.withinSpanUs == 61u * 3700u);
}
TEST_CASE("a batch of the log's counts is written after ten reads, after thirty, and every sixty from there",
"[latency]") {
std::uint32_t due = 0u;
for (std::uint32_t reads = 1u; reads <= 400u; ++reads) {
const bool expected = reads == 10u || reads == 30u || reads == 90u || reads == 150u || reads == 210u ||
reads == 270u || reads == 330u || reads == 390u;
CHECK(fl::adv::LatencyBatchDue(reads) == expected);
due += fl::adv::LatencyBatchDue(reads) ? 1u : 0u;
}
CHECK(due == 8u);
CHECK_FALSE(fl::adv::LatencyBatchDue(0u));
}
TEST_CASE("a batch belongs to one state of the sleep status: another state closes it, until a request has closed "
"thirty-two that way",
"[latency]") {
fl::adv::LatencyTally tally;
tally.frames = 10u;
tally.refused = 1u;
tally.gpu.spanZero = 2u;
tally.gpu.longerFrames = 3u;
tally.gpu.longerSpanUs = 300u;
tally.gpu.longerActiveUs = 450u;
tally.gpu.withinFrames = 4u;
tally.gpu.withinSpanUs = 4000u;
tally.gpu.withinActiveUs = 3600u;
// The state: the low-latency switch, "the game sleeps", and the multiplier -- not the other three switches.
const fl::adv::LatencySleep reflexTwo{1u | 8u, 2u};
const fl::adv::LatencySleep reflexTwoVrr{1u | 2u | 8u | 16u, 2u};
const fl::adv::LatencySleep overrideOne{1u, 1u};
const fl::adv::LatencySleep manyFrames{0u, 900u};
CHECK(fl::adv::LatencyStateOf(true, reflexTwo) == ((1u | 8u) | (2u << 8)));
CHECK(fl::adv::LatencyStateOf(true, reflexTwoVrr) == fl::adv::LatencyStateOf(true, reflexTwo));
CHECK(fl::adv::LatencyStateOf(true, overrideOne) != fl::adv::LatencyStateOf(true, reflexTwo));
CHECK(fl::adv::LatencyStateOf(false, reflexTwo) == fl::adv::kLatStateUnknown);
CHECK(fl::adv::LatencyStateOf(true, manyFrames) == (255u << 8));
fl::adv::LatencyBatchBook book;
CHECK_FALSE(fl::adv::LatencyBatchTurns(book, fl::adv::LatencyStateOf(true, reflexTwo))); // nothing to close
fl::adv::LatencyBatchAdd(book, tally, true, reflexTwo);
fl::adv::LatencyBatchAdd(book, tally, true, reflexTwoVrr);
CHECK(book.okReads == 2u);
CHECK(book.batch.reads == 2u);
CHECK(book.batch.frames == 20u);
CHECK(book.batch.refused == 2u);
CHECK(book.batch.gpu.spanZero == 4u);
CHECK(book.batch.gpu.longerFrames == 6u);
CHECK(book.batch.gpu.longerActiveUs == 900u);
CHECK(book.batch.gpu.withinSpanUs == 8000u);
CHECK(book.batch.state == fl::adv::LatencyStateOf(true, reflexTwo));
CHECK(book.batch.sleepOn == (1u | 2u | 8u | 16u));
CHECK(book.batch.sleepOff == (2u | 4u | 16u)); // off in one read or the other
CHECK(book.batch.multipliers == (1u << 2));
CHECK_FALSE(fl::adv::LatencyBatchTurns(book, fl::adv::LatencyStateOf(true, reflexTwoVrr)));
CHECK(fl::adv::LatencyBatchTurns(book, fl::adv::LatencyStateOf(true, overrideOne)));
CHECK(fl::adv::LatencyBatchTurns(book, fl::adv::kLatStateUnknown)); // a read with no status is a state too
// A read with no status adds its frames and nothing to the "seen" words.
fl::adv::LatencyBatchAdd(book, tally, false, overrideOne);
CHECK(book.batch.reads == 3u);
CHECK(book.batch.sleepOn == (1u | 2u | 8u | 16u));
CHECK(book.batch.multipliers == (1u << 2));
// A status that flickers: after thirty-two closings the batch runs on, and says what it held.
book.closures = fl::adv::kLatStateClosures;
CHECK_FALSE(fl::adv::LatencyBatchTurns(book, fl::adv::LatencyStateOf(true, overrideOne)));
fl::adv::LatencyBatchAdd(book, tally, true, overrideOne);
CHECK(book.batch.state == fl::adv::LatencyStateOf(true, reflexTwo)); // its first read's
CHECK(book.batch.multipliers == ((1u << 1) | (1u << 2)));
CHECK(book.batch.sleepOff == (2u | 4u | 8u | 16u));
// A sum stops at the top of its word instead of wrapping into a small number.
std::uint32_t sum = 0xFFFFFFF0u;
fl::adv::LatencyAddStop(sum, 0x20u);
CHECK(sum == 0xFFFFFFFFu);
}
TEST_CASE("a batch is six lines of the log: a text that fits, a count in decimal, and a word in hex", "[latency]") {
fl::adv::LatencyBatch batch;
batch.reads = 10u;
batch.frames = 152u;
batch.refused = 3u;
batch.sleepOn = 1u | 8u;
batch.sleepOff = 2u | 4u | 16u;
batch.multipliers = 1u << 2;
batch.gpu.spanAbsent = 5u;
batch.gpu.spanZero = 61u;
batch.gpu.activeNoSpan = 30u;
batch.gpu.spanNoActive = 31u;
batch.gpu.longerFrames = 30u;
batch.gpu.longerSpanUs = 111000u;
batch.gpu.longerActiveUs = 120000u;
batch.gpu.withinFrames = 26u;
batch.gpu.withinSpanUs = 96200u;
batch.gpu.withinActiveUs = 91000u;
const std::uint64_t expectedB[fl::adv::kLatBatchLines] = {
0x41609ull, 3ull, 61ull, 31ull, (111000ull << 32) | 120000ull, (96200ull << 32) | 91000ull};
const std::uint32_t expectedA[fl::adv::kLatBatchLines] = {10u, 152u, 5u, 30u, 30u, 26u};
for (std::uint32_t line = 0; line < fl::adv::kLatBatchLines; ++line) {
const fl::adv::LatencyLogLine entry = fl::adv::LatencyBatchLine(batch, line);
INFO("line " << line << ": " << entry.text);
CHECK(entry.a == expectedA[line]);
CHECK(entry.b == expectedB[line]);
CHECK(std::strlen(entry.text) <= fl::adv::LatencyBatchLongestText());
CHECK(std::strlen(entry.text) < 72u); // the native log's event has 72 characters of text, the last a zero
for (std::uint32_t other = 0; other < line; ++other) {
CHECK(std::strcmp(entry.text, fl::adv::LatencyBatchLine(batch, other).text) != 0);
}
}
}
// What summing one report costs: the reader runs on a game's presenting thread, once a second. Hidden -- a number
// for a pull request, not a gate: `fl_reflex_summary_test "[.bench]"`.
TEST_CASE("what summing one report of sixty-four frames costs", "[.bench]") {
auto report = Report(5000u);
for (auto& f : report->frameReport) {
f.gpuActiveRenderTimeUs = 3500u;
f.gpuFrameTimeUs = 4200u;
}
constexpr std::uint32_t kRuns = 2'000'000u;
std::uint64_t frames = 0u;
for (int pass = 0; pass < 5; ++pass) {
const auto began = std::chrono::steady_clock::now();
for (std::uint32_t run = 0; run < kRuns; ++run) {
fl::adv::LatencyCursor cursor; // every run sums the report's sixty-two frames anew
fl::adv::LatencyTally tally;
fl::adv::ObserveLatencyReport(*report, cursor, tally);
frames += tally.frames + tally.gpu.withinFrames;
}
const auto nanos =
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now() - began).count();
std::printf("pass %d: %.1f ns a report\n", pass, static_cast<double>(nanos) / kRuns);
}
CHECK(frames == 5ull * kRuns * (62u + 62u));
}
+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);
@@ -25,6 +25,13 @@ enum Mode : std::uint32_t {
kModeFault = 3, // an access violation inside GetLatency
kModeNoDriverSpan = 4, // reports whose driverStartTime is zero: what the driver gives without a sleep mode
kModeImpossible = 5, // reports whose present ends before it starts
// Reports whose frames differ in their GPU span and in the driver's active time, by frameID % 5:
// 0 as kModeReports: a span of kGpuUs and an active time of kGpuActiveUs, which is the shorter
// 1 the two GPU marks at the same instant, and no active time
// 2 an active time of kGpuActiveLongUs, longer than the span
// 3 the span, and no active time
// 4 the two GPU marks at the same instant, and an active time
kModeGpuShapes = 6,
};
// One frame of kModeReports, in microseconds: every frame has these spans.
@@ -35,6 +42,11 @@ 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 kGpuActiveLongUs = 4000u; // kModeGpuShapes: longer than kGpuUs
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 +58,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";
+16 -3
View File
@@ -117,14 +117,26 @@ 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;
}
if (mode == fl::stubnv::kModeImpossible) {
r.presentEndTime = r.presentStartTime - 50u;
}
if (mode == fl::stubnv::kModeGpuShapes) {
const std::uint64_t shape = id % 5u;
if (shape == 1u || shape == 4u) {
r.gpuRenderStartTime = r.gpuRenderEndTime; // a span of no length; the frame's total is as it was
}
if (shape == 1u || shape == 3u) {
r.gpuActiveRenderTimeUs = 0u;
}
if (shape == 2u) {
r.gpuActiveRenderTimeUs = fl::stubnv::kGpuActiveLongUs;
}
}
}
return NVAPI_OK;
}
@@ -144,7 +156,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()
{
@@ -58,6 +58,10 @@ public sealed class AdvancedSessionBuilderTests
blobs.Select(static b => b.Series).Should().Equal("adv.nvapi.pstate", "adv.lhm.board.voltage.lpc_0_7");
blobs.Should().OnlyContain(static b => b.Hz == 1 && string.Equals(b.Codec, "raw-le-test", StringComparison.Ordinal));
// The rate the session's samples had is the caller's to say (D146); 1 is only what is assumed without it.
AdvancedSessionBuilder.Build(Samples(), _data, new RawSeriesCodec(), hz: 0.758).Blobs
.Should().OnlyContain(static b => b.Hz == 0.758);
float[] pstate = Decode(blobs[0]);
float[] rail = Decode(blobs[1]);
pstate.Should().HaveCount(5);
@@ -118,6 +118,32 @@ public sealed class SessionFinalizerTests
built.Sensors.Should().AllSatisfy(s => s.Hz.Should().Be(1));
}
[Fact]
public void TheRateStoredWithASeriesIsTheOneTheSamplesHad()
{
// D146: it was the constant 1. Samples 1.32 s apart - what a poller that waited its whole interval after its
// work made of "once a second" - are 0.758 a second, and are stored as that.
SessionFinalizer.SampleRate(SessionFixtures.Sensors(3), SessionFixtures.QpcFrequency).Should().Be(1);
List<Application.Telemetry.TelemetrySample> slow = SessionFixtures.Sensors(5);
for (int i = 0; i < slow.Count; i++)
{
slow[i] = slow[i] with { QpcTicks = (long)SessionFixtures.QpcEpoch + (i * SessionFixtures.QpcFrequency * 132 / 100) };
}
SessionFinalizer.SampleRate(slow, SessionFixtures.QpcFrequency).Should().Be(0.758);
(SessionFinalizer finalizer, _) = Make();
FinalizedSession built = finalizer.Build(new FinalizeInput { Skeleton = SessionFixtures.Skeleton(tier: CaptureTier.NotHooked), Sensors = slow });
built.Sensors.Should().NotBeEmpty();
built.Sensors.Should().AllSatisfy(s => s.Hz.Should().Be(0.758));
// Fewer than two samples, or no time between them, have no rate to measure: 1, as before.
SessionFinalizer.SampleRate([], SessionFixtures.QpcFrequency).Should().Be(1);
SessionFinalizer.SampleRate(SessionFixtures.Sensors(1), SessionFixtures.QpcFrequency).Should().Be(1);
SessionFinalizer.SampleRate([slow[0], slow[0]], SessionFixtures.QpcFrequency).Should().Be(1);
SessionFinalizer.SampleRate(slow, 0).Should().Be(1);
}
[Fact]
public void TheMachinesReadingsBecomeTheCpuAndMemorySeriesTheSchemaAlwaysAllowed()
{
@@ -231,6 +231,56 @@ public sealed class TelemetryPollerTests
empty.Should().Throw<ArgumentOutOfRangeException>();
}
[Fact]
public void TheNextTickIsDueAtAWholeIntervalFromTheStartHoweverLongThePollTook()
{
TimeSpan second = TimeSpan.FromSeconds(1);
// D146: a poll that took 320 ms is followed 680 ms later, not a whole second later.
TelemetryPoller.UntilNextTick(TimeSpan.FromMilliseconds(320), second).Should().Be(TimeSpan.FromMilliseconds(680));
TelemetryPoller.UntilNextTick(TimeSpan.FromMilliseconds(5320), second).Should().Be(TimeSpan.FromMilliseconds(680));
// A poll that overran two periods: the next tick still to come, and the two it missed are not made up.
TelemetryPoller.UntilNextTick(TimeSpan.FromMilliseconds(2500), second).Should().Be(TimeSpan.FromMilliseconds(500));
// On the boundary, and before any time has passed: a whole interval - never nothing, never more.
TelemetryPoller.UntilNextTick(second, second).Should().Be(second);
TelemetryPoller.UntilNextTick(TimeSpan.Zero, second).Should().Be(second);
TelemetryPoller.UntilNextTick(TimeSpan.FromSeconds(-3), second).Should().Be(second);
for (int ms = 0; ms < 5000; ms += 37)
{
TelemetryPoller.UntilNextTick(TimeSpan.FromMilliseconds(ms), TimeSpan.FromMilliseconds(500))
.Should().BeGreaterThan(TimeSpan.Zero).And.BeLessThanOrEqualTo(TimeSpan.FromMilliseconds(500));
}
Action none = () => TelemetryPoller.UntilNextTick(second, TimeSpan.Zero);
none.Should().Throw<ArgumentOutOfRangeException>();
}
[Fact]
public void TheThreadKeepsItsPeriodWhenAPollTakesTime()
{
// A layer that takes 300 ms to answer, polled every 500 ms: the samples are 500 ms apart, where waiting the
// whole interval after the work made them 800 ms apart.
using var layer = new FakeLayer(TelemetryLayer.Lhm);
GpuSample sample = layer.Sample(_t0, load: 1);
layer.Script(() =>
{
Thread.Sleep(300);
return sample;
});
var poller = new TelemetryPoller(layer, new TelemetryPollerOptions { Interval = TelemetryPollerOptions.MinimumInterval }, TimeProvider.System);
poller.Start();
SpinWait.SpinUntil(() => poller.Queued >= 7, TimeSpan.FromSeconds(20)).Should().BeTrue("seven ticks, half a second apart");
poller.Dispose();
var samples = new List<TelemetrySample>();
poller.Drain(samples);
double apart = TimeProvider.System.GetElapsedTime(samples[0].QpcTicks, samples[6].QpcTicks).TotalMilliseconds / 6;
apart.Should().BeLessThan(700, "the period is the interval (500 ms), not the interval plus the work (800 ms)");
}
[Fact]
public void TheThreadPollsAtItsIntervalAndReturnsOnDispose()
{
+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