Compare commits

...
16 changed files with 253 additions and 25 deletions

No files matched your search

+16
View File
@@ -35,6 +35,22 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Added
- **For developers: the part inside a game reads two more figures of NVIDIA's latency report, and keeps every
frame-generation multiplier a session saw** (owner decisions D142, D144; nothing a user sees until the Agent and
the App read them). In a real game the driver's span between its two GPU marks was longer than the frame's whole
— it includes the card's waiting. The driver's own *active* render time and its GPU frame time are members of
the report FrameLedger already fetches; they are read from it, with **no further call into the driver**. Four
reserved words of the shared memory carry them and the multipliers seen (layout 5 as it was). `fl_reflex_summary`
and the injected `[latency]` cases hold it. Measured: +36 ns a read, once a second.
### Fixed
- **A session could start with the last read of the session before it.** In a game that kept running between two
sessions, a read of the driver's latency report that ended after the first session's last tick was taken as the
second session's first point. A new session now drops it.
## Releases
Newest first. Each file holds that release's section exactly as it stood here.
+10
View File
@@ -180,6 +180,16 @@ What the region is, as a contract between the two sides:
sum of all ones is a span some summed frame did not report. `FL_ADV_VALID_LATENCY` (bit 7 of the mask) is set once
a read returned OK for the request; it is not one of "the game's calls were read", and `latState` is published
whether or not it is set.
- **Four more latency words (0.1.0-beta.48; owner decisions D142, D144).** The first line was full, so they are
four of the seven reserved words that ended the `sl::DLSSOptions` line (@100..115; three remain, @116..127) —
nothing of DLSS's, and **the layout is still 5** for the same reasons. `latGpuActiveSumUs` and `latGpuFrameSumUs`
are the two times the driver works out itself — the graphics card's render time *excluding the idles in
between* (`gpuActiveRenderTimeUs`) and one frame's GPU end to the next's (`gpuFrameTimeUs`) — summed over the
frames of the newest read that gave one; `latGpuCounts` holds how many did, the first in its low half and the
second in its high half, because a frame can give one and not the other. A frame that gives zero (an older
driver leaves both zero) or more than a second is in neither the sum nor the count, and is still summed for the
seven spans. `latMultipliersSeen` is the session's: bit n is set once the sleep status gave frame-generation
multiplier n since the request, bit 31 standing for 31 and more; `latState` still carries the last one.
- The Vulkan layer never writes it. `ShmLayoutMirrorTests.TheAdvancedStateMirrorMatches` checks every member's
offset against `fl-layout-dump`; `ShmRingReaderTests` the three reads and that the request is stored either way.
+3 -1
View File
@@ -172,7 +172,9 @@ running game.
**The call into the driver (train C, 0.1.0-beta.47) is tested in three places, each for what the
others cannot say.** `fl_reflex_summary` (Catch2) drives `fl_adv_fields.h`'s reader on reports written by hand: the
two newest frames held back, a frame summed once, a span the driver did not report, a span no frame can have, frame
ids that start again, and the ten words of a publication. `fl_guard`'s seven `[latency]` cases inject the Overlay
ids that start again, and the ten words of a publication — and since 0.1.0-beta.48 the driver's two own times
(summed over the frames that gave one, each with its own count; zero and more than a second are not counted and
refuse nothing) and the bit a multiplier has. `fl_guard`'s seven `[latency]` cases inject the Overlay
into a Direct3D 12 target that has loaded a stand-in `nvapi64.dll`, and read that module's call counts from outside
through its named section (`fl_stub_nvapi_shared.h`) — so "the driver was not called" is a count: not asked → not
even asked for the addresses; asked → about one read a second, sums equal to the stand-in's, every counted read a
+15
View File
@@ -200,6 +200,21 @@ same morning**, two sessions (frame generation ×2 and off, 260 s and 581 s): fo
the slowest call 34 and 65 µs, no latch. Two Direct3D 11 games and one Direct3D 12 game with no `nvapi64.dll` were
left alone, each with its one line. Two games read, one driver.
**Two more members of the same report, and the multipliers seen (0.1.0-beta.48; owner decisions D142, D144).** In
Phantom Blade Zero the span between the driver's two GPU marks was longer than the frame's whole: it includes the
card's waiting. NVIDIA's header has the figure that does not — `gpuActiveRenderTimeUs`, "excluding the idles in
between" — and beside it `gpuFrameTimeUs`, one frame's GPU end to the next's. Both are read from the report the
getter already filled: **no call is added, and no interface id** (`tools/nvapi-readonly-check.ps1` is unchanged;
the two names are on `tools/overlay-allowed-fields.txt`). The buffer is the Overlay's own, so there is no question
of a member lying past what a game allocated; an older driver leaves both zero, and zero is read as *not given* —
each time has its own count, and neither decides which frames the seven spans are made of. The sleep status'
frame-generation multiplier is now also kept as the set of values a session saw (a session that generated ×2 and
ended in a menu read 1). **One defect fixed with it**: a read that ended after a session's last tick was taken by
the next session as its first point; a new request now drops it. **Measured** (the header's own function, the
Overlay's flags, a report of 62 summed frames, 2 million reports × 3, twice): 393–396 ns before, 429–434 ns after
— **+36 ns a read**, once a second, and after the call's time has been taken, so it cannot reach the 2 ms latch.
The present path is unchanged: one relaxed load.
**The gate.** One word, four states — idle, armed, reading, off (`dllmain.cpp`, above `ReadLatencyOnce`). Only the
watchdog arms; a presenting thread takes *armed* to *reading* by compare-exchange and owns the 15.4 KB report
buffer (static storage, never a game thread's stack) and the read's result until it stores *idle* or *off*; the
+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 |
+10 -2
View File
@@ -169,8 +169,10 @@ is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a dri
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**, as one train with
what else is open: the multiplier row that keeps only the last value, the pages that still say no real game
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).
@@ -976,6 +978,12 @@ Where each owner decision is recorded — the file and its section, and a label
| D139 | [`spike-notes/31-reflex-route-d-harness.md`](spike-notes/31-reflex-route-d-harness.md) §The leg with a sleep | before any Overlay code the probe runs a leg with `NvAPI_D3D_SetSleepMode` and `NvAPI_D3D_Sleep` — writes, in the probe's own process, on its own device, in no shipped binary |
| D140 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14 | an `nvapi64.dll` loaded from the game's own folder — a replacement, not the driver's — is refused, and the session says why |
| D141 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14 | one call into the driver of 2 ms or more switches the Reflex read off until the game exits |
| D142 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Calls the Overlay makes into a driver | asked on 2026-11-14 with Phantom Blade Zero's *GPU render* longer than its total: read the driver's `gpuActiveRenderTimeUs`, and with it `gpuFrameTimeUs` — two more members of the report already fetched, no further call |
| D143 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §The inventory | the start-to-end *GPU render* line stays, stored and shown, under a label that says it includes the card's idle time |
| D144 | [`07_IPC.md`](07_IPC.md) §Region 5 | the driver's frame-generation multiplier is kept as every value a session saw, not the last one |
| D145 | [`../legal/ACCURACY.md`](../legal/ACCURACY.md) | the accuracy statement, the README and the guide say two real games were read on one driver (they said none); Privacy Policy 2.21 and Disclaimer 2.17 with it |
| D146 | [`06_DATA_MODEL.md`](06_DATA_MODEL.md) §sensor_blobs | the Agent's samples were 1.32 s apart under a 1 s setting (it waited the whole interval after its work): sample on a fixed period, and store the rate the samples had |
| D147 | [`03_METRICS.md`](03_METRICS.md) | the session summary's latency fields stay N/A: the driver's total is simulation start to GPU end, not input to display |
| D109 | [`../legal/DISCLAIMER.md`](../legal/DISCLAIMER.md) §5, §5A | asked on 2026-11-11 with both sentences quoted: the Disclaimer goes to 2.15 with the Privacy Policy — PawnIO and the admin mode are no longer "for the CPU temperature" alone; with Advanced metrics on they also read the processor's, the memory's and the motherboard's sensors. The admin mode's disclosure follows (`agent-admin-dialog/2`) |
---
+19 -1
View File
@@ -1000,8 +1000,26 @@ public unsafe struct FlAdvancedState
/// <summary>Must be zero.</summary>
public fixed byte DlssPad[3];
/// <summary>
/// The driver's own active render time (<c>gpuActiveRenderTimeUs</c>) summed over the frames of the newest read
/// that gave one, microseconds (0.1.0-beta.48, D142; four words of this line's reserve, nothing of DLSS's).
/// </summary>
public uint LatGpuActiveSumUs;
/// <summary>The driver's own frame time at the graphics card (<c>gpuFrameTimeUs</c>), summed the same way.</summary>
public uint LatGpuFrameSumUs;
/// <summary>Bits 0..15: the frames in <see cref="LatGpuActiveSumUs"/>; bits 16..31: those in <see cref="LatGpuFrameSumUs"/>.</summary>
public uint LatGpuCounts;
/// <summary>
/// Bit n: the driver's sleep status gave frame-generation multiplier n since the request; bit 31 stands for 31
/// and more (D144).
/// </summary>
public uint LatMultipliersSeen;
/// <summary>Must be zero.</summary>
public fixed uint ReservedDlss[7];
public fixed uint ReservedDlss[3];
/// <summary>Upscale dispatches whose extras were read (wraps).</summary>
public uint FfxDispatches;
@@ -656,8 +656,13 @@ inline void ObserveSlShutdown(Accumulators& a) noexcept {
// ls const NV_GET_SLEEP_STATUS_PARAMS& the driver's sleep status
//
// WHAT IS NOT READ: inputSampleTime (the probe never saw it set, and "when the player pressed something" is nothing
// a frame-time tool needs), the GPU times the driver reports beside the marks, and the sleep interval -- it changes
// with every frame, so it is not a fact of a session.
// a frame-time tool needs), the camera, cross-adapter and frame-generation times, and the sleep interval -- it
// changes with every frame, so it is not a fact of a session.
//
// TWO TIMES THE DRIVER WORKS OUT ITSELF (0.1.0-beta.48, owner decision D142): gpuActiveRenderTimeUs -- the header:
// the GPU's start to its end "excluding the idles in between" -- and gpuFrameTimeUs, one frame's GPU end to the
// next's. In a real game the span between the two GPU marks was longer than the frame's whole (HANDOFF, item 45):
// it includes the waiting. They are members of the report already in hand; no call is added.
//
// THE RULES A GAME NEEDS (spike-notes §31). The newest frames of a report are not final -- one run read a span of
// half an hour in the newest -- so the two newest ids are never summed. A span whose end point is zero was not
@@ -682,6 +687,11 @@ struct LatencyTally {
uint32_t refused = 0; // frames refused
uint32_t sumUs[kLatSpans]{}; // microseconds, over the frames summed
uint32_t lacking = 0; // bit n: a summed frame did not report span n
// The driver's two own times, each over the summed frames that gave one: a count apiece.
uint32_t activeSumUs = 0;
uint32_t activeFrames = 0;
uint32_t frameTimeSumUs = 0;
uint32_t frameTimeFrames = 0;
};
// Where the reader is in the game's frame ids: the newest one already summed or refused. 0 = none yet.
@@ -714,6 +724,17 @@ inline uint64_t LatencyFrameId(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf)
return lf.frameID;
}
// One of the driver's own times, of a frame that is summed. Zero is a frame the driver gave no such time for
// (an older driver leaves both zero, and so did the probe's frames, which had no work for the card); more than a
// second is a time no frame can have. Neither is summed, and neither refuses the frame: which frames the spans are
// made of does not depend on these.
inline void LatencyAddTime(uint32_t us, uint32_t& sumUs, uint32_t& frames) noexcept {
if (us != 0u && us <= kLatSpanLimitUs) {
sumUs += us;
++frames;
}
}
inline void ObserveLatencyFrame(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf, LatencyTally& tally) noexcept {
uint32_t us[kLatSpans]{};
const uint32_t kind[kLatSpans] = {
@@ -741,6 +762,8 @@ inline void ObserveLatencyFrame(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf,
tally.sumUs[i] += us[i];
}
}
LatencyAddTime(lf.gpuActiveRenderTimeUs, tally.activeSumUs, tally.activeFrames);
LatencyAddTime(lf.gpuFrameTimeUs, tally.frameTimeSumUs, tally.frameTimeFrames);
}
// One report: the frames newer than the cursor, the two newest left for the next read.
@@ -797,12 +820,18 @@ inline LatencySleep ObserveSleepStatus(const NV_GET_SLEEP_STATUS_PARAMS& ls) noe
return seen;
}
// The bit of fl_shm.h's latMultipliersSeen for one multiplier the status gave: bit n for n, bit 31 for 31 and more.
inline uint32_t LatencyMultiplierBit(uint32_t value) noexcept {
return 1u << (value > 31u ? 31u : value);
}
// What the watchdog publishes of it. THE WATCHDOG'S: filled from what a read left behind while nobody is reading.
struct LatencyOut {
uint32_t state = FL_LAT_NONE; // FlLatencyState
uint32_t sleepSeenOn = 0; // switches the status showed on, since the request
uint32_t sleepSeenOff = 0; // ... and off
uint32_t multiplier = 0; // the last frame-generation multiplier the status gave
uint32_t multipliersSeen = 0; // every one it gave since the request (LatencyMultiplierBit)
uint32_t reads = 0; // reads made since the request
uint32_t worstUs = 0; // the slowest call since the request
LatencyTally tally; // of the newest read not yet published; Publish empties it
@@ -898,8 +927,8 @@ inline void Reset(Accumulators& a) noexcept {
// -> even with no compare-exchange. The frame-time pair is drained, so each
// publication carries the dispatches since the last one.
//
// `latency` is the watchdog's summary of the driver's latency report, or null for a caller that has none: the ten
// words are then left as they are -- zero, in a region nobody else writes.
// `latency` is the watchdog's summary of the driver's latency report, or null for a caller that has none: the
// fourteen latency words are then left as they are -- zero, in a region nobody else writes.
inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request, uint64_t qpc,
LatencyOut* latency = nullptr) noexcept {
if (region == nullptr) {
@@ -940,6 +969,10 @@ inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request,
put32(region->latOsQueueSumUs, LatencySum(out.tally, 4u));
put32(region->latGpuSumUs, LatencySum(out.tally, 5u));
put32(region->latTotalSumUs, LatencySum(out.tally, kLatTotal));
put32(region->latGpuActiveSumUs, out.tally.activeSumUs);
put32(region->latGpuFrameSumUs, out.tally.frameTimeSumUs);
put32(region->latGpuCounts, Stop16(out.tally.activeFrames) | (Stop16(out.tally.frameTimeFrames) << 16));
put32(region->latMultipliersSeen, out.multipliersSeen);
out.tally = LatencyTally{}; // one publication carries one read: a reader never adds two up
}
@@ -899,6 +899,7 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
g_latOut.sleepSeenOn = 0u;
g_latOut.sleepSeenOff = 0u;
g_latOut.multiplier = 0u;
g_latOut.multipliersSeen = 0u;
g_latOut.tally = fl::adv::LatencyTally{};
}
if (g_latStalled) {
@@ -919,6 +920,13 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
}
g_latReadingSinceQpc = 0;
// A read that ended after the last tick of the request before this one was never taken -- nobody ticks while
// nobody asks. It is that session's: its frames are not this one's first point, and its multiplier is not one
// this session saw. (Armed is not expected here -- the request's end disarms -- and is left to its reader.)
if (newRequest && gate != kLatGateArmed) {
g_latRead.fresh = 0u;
}
// Idle, armed or off: nobody is reading. What the last read left is taken here.
if (gate != kLatGateArmed && g_latRead.fresh != 0u) {
g_latRead.fresh = 0u;
@@ -933,6 +941,7 @@ void TickLatency(bool newRequest, int64_t now) noexcept {
g_latOut.sleepSeenOn |= g_latRead.sleep.on & FL_LAT_SLEEP_BITS;
g_latOut.sleepSeenOff |= ~g_latRead.sleep.on & FL_LAT_SLEEP_BITS;
g_latOut.multiplier = g_latRead.sleep.multiplier;
g_latOut.multipliersSeen |= fl::adv::LatencyMultiplierBit(g_latRead.sleep.multiplier);
}
if (g_latOut.state != g_latLoggedState) {
g_latLoggedState = g_latOut.state;
+24 -7
View File
@@ -75,6 +75,10 @@
// reader of an older build finds zeros where it was told to expect zeros, and the build-id handshake refuses a
// mismatched pair before either reads the other -- the precedent is slShutdowns. A trial must also be removable
// without a layout 7.
//
// STILL 5 (2026-11-14, 0.1.0-beta.48, owner decisions D142 and D144): four of the seven reserved words that ended
// region 5's second line became four more latency words (latGpuActiveSumUs .. latMultipliersSeen) -- the first line
// was full. The same reasons, and three reserved words remain there.
#define FL_SHM_LAYOUT_VERSION 5u
#define FL_SHM_HANDSHAKE_OFFSET 0x00u
@@ -1083,12 +1087,22 @@ struct alignas(64) FlAdvancedState {
uint32_t dlssExposureScaleBits; // @84
// sl::DLSSPreset PLUS ONE, in the header's order: DLAA, quality, balanced, performance, ultra performance,
// ultra quality (the last is struct version 2's - 0 where the game's struct is older).
uint8_t dlssPresets[6]; // @88..93
uint8_t dlssColorBuffersHdr; // @94 sl::Boolean PLUS ONE; 0 = not read
uint8_t dlssAutoExposure; // @95 (struct version 2)
uint8_t dlssAlphaUpscaling; // @96 (struct version 3)
uint8_t dlssPad[3]; // @97..99 must be zero
uint32_t reservedDlss[7]; // @100..127 must be zero
uint8_t dlssPresets[6]; // @88..93
uint8_t dlssColorBuffersHdr; // @94 sl::Boolean PLUS ONE; 0 = not read
uint8_t dlssAutoExposure; // @95 (struct version 2)
uint8_t dlssAlphaUpscaling; // @96 (struct version 3)
uint8_t dlssPad[3]; // @97..99 must be zero
// Reflex latency again (0.1.0-beta.48, D142 and D144): the first line was full, and this one had seven words
// spare. Nothing here is DLSS's. The two sums and their counts are of the newest read not yet published, as
// latFrames is; the two times are the driver's own figures, not spans between two of its marks, and each has
// a count of its own because a frame can give one and not the other. A frame that gives zero, or more than a
// second, is not in the sum and not in the count.
uint32_t latGpuActiveSumUs; // @100 gpuActiveRenderTimeUs over the frames that gave one, microseconds
uint32_t latGpuFrameSumUs; // @104 gpuFrameTimeUs over the frames that gave one
uint32_t latGpuCounts; // @108 bits 0..15 frames in the first sum, bits 16..31 in the second
uint32_t latMultipliersSeen; // @112 bit n: the sleep status gave fgMultiplier n since the request;
// bit 31 stands for 31 and more
uint32_t reservedDlss[3]; // @116..127 must be zero
// ---- line 2: the ffx upscale dispatch, beyond its two sizes ---------------------------------------------------
uint32_t ffxDispatches; // @128 upscale dispatches whose extras were read (wraps)
@@ -1406,7 +1420,10 @@ static_assert(offsetof(FlAdvancedState, dlssPreExposureBits) == 80);
static_assert(offsetof(FlAdvancedState, dlssPresets) == 88);
static_assert(offsetof(FlAdvancedState, dlssColorBuffersHdr) == 94);
static_assert(offsetof(FlAdvancedState, dlssAlphaUpscaling) == 96);
static_assert(offsetof(FlAdvancedState, reservedDlss) == 100);
static_assert(offsetof(FlAdvancedState, latGpuActiveSumUs) == 100);
static_assert(offsetof(FlAdvancedState, latGpuCounts) == 108);
static_assert(offsetof(FlAdvancedState, latMultipliersSeen) == 112);
static_assert(offsetof(FlAdvancedState, reservedDlss) == 116);
static_assert(offsetof(FlAdvancedState, ffxDispatches) == 128);
static_assert(offsetof(FlAdvancedState, ffxFrameTimeSumUs) == 188);
static_assert(offsetof(FlAdvancedState, ffxMemoryTotalBytes) == 192);
+19 -1
View File
@@ -7816,7 +7816,11 @@ void WatchLatency(const MappedRing& r, uint32_t request, int ms, LatencySeen& se
a.latPresentSumUs == frames * fl::stubnv::kPresentUs &&
(a.latDriverSumUs == frames * fl::stubnv::kDriverUs || a.latDriverSumUs == FL_LAT_SUM_NONE) &&
a.latOsQueueSumUs == frames * fl::stubnv::kOsQueueUs &&
a.latGpuSumUs == frames * fl::stubnv::kGpuUs && a.latTotalSumUs == frames * fl::stubnv::kTotalUs;
a.latGpuSumUs == frames * fl::stubnv::kGpuUs && a.latTotalSumUs == frames * fl::stubnv::kTotalUs &&
// The driver's two own times: every frame of the stub gives both.
a.latGpuActiveSumUs == frames * fl::stubnv::kGpuActiveUs &&
a.latGpuFrameSumUs == frames * fl::stubnv::kGpuFrameUs &&
a.latGpuCounts == (frames | (frames << 16));
}
}
Sleep(50);
@@ -7883,6 +7887,7 @@ TEST_CASE("the driver's latency report is read only while a session asks, once a
CHECK(((a.latState >> FL_LAT_SLEEP_SEEN_ON_SHIFT) & FL_LAT_SLEEP_BITS) == (1u | 8u)); // the stub's status
CHECK(((a.latState >> FL_LAT_SLEEP_SEEN_OFF_SHIFT) & FL_LAT_SLEEP_BITS) == (2u | 4u | 16u));
CHECK((a.latState >> FL_LAT_FG_MULTIPLIER_SHIFT) == 2u);
CHECK(a.latMultipliersSeen == (1u << fl::stubnv::kFgMultiplier)); // the one multiplier the status has given
CHECK((a.latReads >> 16) < 2000u); // no call of two milliseconds: that would have been the last one
LatencySeen seen;
@@ -7919,6 +7924,16 @@ TEST_CASE("the driver's latency report is read only while a session asks, once a
SetStubWord(stub->mode, fl::stubnv::kModeReports);
REQUIRE(WaitForLatState(r, 7u, fl::FL_LAT_READING, a));
// ---- 3b. THE MULTIPLIERS SEEN: the status now gives 3. The last one is 3, and the session saw both.
SetStubWord(stub->fgMultiplier, 3u);
bool sawBoth = false;
for (int i = 0; i < 8 && !sawBoth; ++i) {
REQUIRE(ReadAdvanced(r, 7u, a, a.samples));
sawBoth = a.latMultipliersSeen == ((1u << 2) | (1u << 3));
}
CHECK(sawBoth);
CHECK((a.latState >> FL_LAT_FG_MULTIPLIER_SHIFT) == 3u);
// ---- 4. NOT ASKED AGAIN. No further call.
SetAdvancedRequest(r, 0u);
TickFor(r, 2500); // the watchdog has seen the zero, and a read already under way has ended
@@ -7933,6 +7948,9 @@ TEST_CASE("the driver's latency report is read only while a session asks, once a
CHECK(LatStateOf(a) == fl::FL_LAT_READING);
CHECK((a.latReads & 0xFFFFu) <= 3u);
CHECK(StubWord(stub->queries) == 2u);
// ... and so is what it saw: the 2 of the session before is not in it, whether as a multiplier that session
// was given or as a read it left behind.
CHECK(a.latMultipliersSeen == (1u << 3));
// ---- 6. THE STOP while a session asks: nothing is called after it.
r.ctl->unhookRequested = 1;
+70 -1
View File
@@ -191,6 +191,58 @@ TEST_CASE("the sleep status is the driver's five switches and its multiplier, an
CHECK(fl::adv::ObserveSleepStatus(status).on == (2u | 8u));
}
TEST_CASE("the driver's two own times are summed over the frames that gave one, each with its own count", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
// Twelve frames, 5000..5011: ten are summed, the two newest wait.
auto report = Report(5000u, 12u);
for (std::uint32_t i = 52u; i < 64u; ++i) {
report->frameReport[i].gpuActiveRenderTimeUs = 3500u;
report->frameReport[i].gpuFrameTimeUs = 4200u;
}
report->frameReport[52].gpuActiveRenderTimeUs = 0u; // 5000: the driver gave no active time
report->frameReport[53].gpuFrameTimeUs = 1'000'001u; // 5001: a frame time no frame can have
report->frameReport[54].gpuActiveRenderTimeUs = 1'000'000u; // 5002: a second, to the microsecond, is kept
fl::adv::ObserveLatencyReport(*report, cursor, tally);
CHECK(tally.frames == 10u); // neither of the two refuses a frame
CHECK(tally.refused == 0u);
CHECK(tally.sumUs[fl::adv::kLatTotal] == 10u * 7500u);
CHECK(tally.lacking == 0u);
CHECK(tally.activeFrames == 9u);
CHECK(tally.activeSumUs == 8u * 3500u + 1'000'000u);
CHECK(tally.frameTimeFrames == 9u);
CHECK(tally.frameTimeSumUs == 9u * 4200u);
// A frame that is refused gives neither, and a driver that fills in neither leaves both counts at zero.
cursor = fl::adv::LatencyCursor{};
auto refused = Report(6000u, 3u);
refused->frameReport[61].gpuActiveRenderTimeUs = 3500u;
refused->frameReport[61].gpuFrameTimeUs = 4200u;
refused->frameReport[61].presentEndTime = refused->frameReport[61].presentStartTime - 50u;
fl::adv::ObserveLatencyReport(*refused, cursor, tally);
CHECK(tally.frames == 0u);
CHECK(tally.refused == 1u);
CHECK(tally.activeFrames == 0u);
CHECK(tally.frameTimeFrames == 0u);
cursor = fl::adv::LatencyCursor{};
auto older = Report(7000u);
fl::adv::ObserveLatencyReport(*older, cursor, tally);
CHECK(tally.frames == 62u);
CHECK(tally.activeFrames == 0u);
CHECK(tally.activeSumUs == 0u);
CHECK(tally.frameTimeFrames == 0u);
}
TEST_CASE("a multiplier the status gave has a bit of its own, and thirty-one and more share the last", "[latency]") {
CHECK(fl::adv::LatencyMultiplierBit(0u) == 1u);
CHECK(fl::adv::LatencyMultiplierBit(1u) == 2u);
CHECK(fl::adv::LatencyMultiplierBit(4u) == 16u);
CHECK(fl::adv::LatencyMultiplierBit(31u) == 0x80000000u);
CHECK(fl::adv::LatencyMultiplierBit(255u) == 0x80000000u);
}
TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries it once", "[latency]") {
fl::adv::Accumulators a;
fl::FlAdvancedState region{};
@@ -199,6 +251,7 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
out.sleepSeenOn = 1u | 8u;
out.sleepSeenOff = 2u | 4u | 16u;
out.multiplier = 2u;
out.multipliersSeen = (1u << 1) | (1u << 2);
out.reads = 70'000u; // stops at 65535
out.worstUs = 66u;
out.tally.frames = 10u;
@@ -207,6 +260,10 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
out.tally.sumUs[i] = 1000u * (i + 1u);
}
out.tally.lacking = 1u << 3;
out.tally.activeSumUs = 31'500u;
out.tally.activeFrames = 9u;
out.tally.frameTimeSumUs = 42'000u;
out.tally.frameTimeFrames = 10u;
fl::adv::Publish(a, &region, 7u, 1234u, &out);
CHECK((region.latState & FL_LAT_STATE_MASK) == fl::FL_LAT_READING);
@@ -224,6 +281,11 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
CHECK(region.latOsQueueSumUs == 5000u);
CHECK(region.latGpuSumUs == 6000u);
CHECK(region.latTotalSumUs == 7000u);
CHECK(region.latGpuActiveSumUs == 31'500u);
CHECK(region.latGpuFrameSumUs == 42'000u);
CHECK((region.latGpuCounts & 0xFFFFu) == 9u);
CHECK((region.latGpuCounts >> 16) == 10u);
CHECK(region.latMultipliersSeen == ((1u << 1) | (1u << 2)));
CHECK(region.request == 7u);
// The next publication, with no read in between: the state stands, the frames and the sums are gone.
@@ -232,12 +294,19 @@ TEST_CASE("a publication carries one read, packed as fl_shm.h says, and carries
CHECK(region.latFrames == 0u);
CHECK(region.latTotalSumUs == 0u);
CHECK(region.latDriverSumUs == 0u);
CHECK(region.latGpuActiveSumUs == 0u);
CHECK(region.latGpuFrameSumUs == 0u);
CHECK(region.latGpuCounts == 0u);
CHECK(region.latMultipliersSeen == ((1u << 1) | (1u << 2))); // the session's, like the switches
CHECK((region.latReads >> 16) == 66u);
// A caller with no latency summary leaves the ten words alone.
// A caller with no latency summary leaves the latency words alone.
fl::FlAdvancedState untouched{};
fl::adv::Publish(a, &untouched, 7u, 1236u);
CHECK(untouched.latState == 0u);
CHECK(untouched.latReads == 0u);
CHECK(untouched.latTotalSumUs == 0u);
CHECK(untouched.latGpuActiveSumUs == 0u);
CHECK(untouched.latGpuCounts == 0u);
CHECK(untouched.latMultipliersSeen == 0u);
}
+4
View File
@@ -136,6 +136,10 @@ int main() {
FL_ADV_FIELD(dlssAutoExposure);
FL_ADV_FIELD(dlssAlphaUpscaling);
FL_ADV_FIELD(dlssPad);
FL_ADV_FIELD(latGpuActiveSumUs);
FL_ADV_FIELD(latGpuFrameSumUs);
FL_ADV_FIELD(latGpuCounts);
FL_ADV_FIELD(latMultipliersSeen);
FL_ADV_FIELD(reservedDlss);
FL_ADV_FIELD(ffxDispatches);
FL_ADV_FIELD(ffxSharpenSeen);
@@ -35,6 +35,10 @@ inline constexpr std::uint32_t kDriverUs = 400u;
inline constexpr std::uint32_t kOsQueueUs = 1200u;
inline constexpr std::uint32_t kGpuUs = 3700u;
inline constexpr std::uint32_t kTotalUs = 7500u;
// The two times a driver works out itself, of every frame: the card at work, and one frame's GPU end to the next's.
inline constexpr std::uint32_t kGpuActiveUs = 3500u;
inline constexpr std::uint32_t kGpuFrameUs = 4200u;
inline constexpr std::uint32_t kFgMultiplier = 2u; // what GetSleepStatus gives while `fgMultiplier` is zero
inline constexpr std::uint32_t kFirstFrameId = 5000u;
inline constexpr std::uint32_t kFrameIdStep = 10u; // how far the ids move on at each call
@@ -46,7 +50,8 @@ struct Shared {
std::uint32_t queries; // nvapi_QueryInterface calls
std::uint32_t latencyCalls; // GetLatency calls
std::uint32_t sleepStatusCalls; // GetSleepStatus calls
std::uint32_t reserved[2];
std::uint32_t fgMultiplier; // the multiplier GetSleepStatus gives; zero = kFgMultiplier
std::uint32_t reserved[1];
};
inline constexpr wchar_t kSectionFormat[] = L"Local\\FrameLedger.StubNvapi.%lu";
@@ -117,8 +117,8 @@ NvAPI_Status __cdecl StubGetLatency(IUnknown* device, NV_LATENCY_RESULT_PARAMS*
r.osRenderQueueEndTime = t + 3900u;
r.gpuRenderStartTime = t + 3900u;
r.gpuRenderEndTime = t + 7600u;
r.gpuActiveRenderTimeUs = 3500u;
r.gpuFrameTimeUs = 4200u;
r.gpuActiveRenderTimeUs = fl::stubnv::kGpuActiveUs;
r.gpuFrameTimeUs = fl::stubnv::kGpuFrameUs;
if (mode == fl::stubnv::kModeNoDriverSpan) {
r.driverStartTime = 0u;
}
@@ -144,7 +144,8 @@ NvAPI_Status __cdecl StubGetSleepStatus(IUnknown* device, NV_GET_SLEEP_STATUS_PA
out->bLowLatencyMode = 1;
out->sleepIntervalUs = 4166u;
out->bUseGameSleep = 1;
out->fgMultiplier = 2;
const std::uint32_t multiplier = Get(g_shared->fgMultiplier);
out->fgMultiplier = static_cast<NvU8>(multiplier == 0u ? fl::stubnv::kFgMultiplier : multiplier);
return NVAPI_OK;
}
+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