Compare commits

...
Author SHA1 Message Date
poli0981andClaude Fable 5.2 a0690a4bc2 feat(overlay): two more members of NVIDIA's latency report - the driver's active GPU time and its GPU frame time - and every frame-generation multiplier a session saw; four reserved words, layout still 5; a read left by the session before is dropped (D142, D144; in no release yet)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 09:53:52 +07:00
poli0981andClaude Fable 5.2 3df56f0ca1 docs: item 45 on Cyberpunk 2077 and three games the read leaves alone - read twice, 65 us at the slowest, GPU render sane there; the owner's answer: read the driver's active time (#449)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 02:31:32 +00:00
poli0981andClaude Fable 5.2 80b4437169 docs: the first real game read on 0.1.0-beta.47 - Phantom Blade Zero, three sessions: the driver found and read every second, the slowest call 45 us, no latch; its GPU render span is longer than its total there (item 45) (#448)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 02:09:38 +00:00
poli0981andClaude Fable 5.2 268ad75585 docs(handoff): 0.1.0-beta.47's release facts - the tag's run, the digests, the delta, the wiki, what SonarCloud and Qodana said on the release's commit; and a local gate that a vanished test program made red, not falsely green (#447)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 01:39:20 +00:00
poli0981andClaude Fable 5.2 3d7c273e3b release: 0.1.0-beta.47 - with Advanced metrics on, the part inside a game asks NVIDIA's driver for its latency report (D132, D136, D138-D141); the batch log says how a batch ended (D137); item 44 (d) run by the owner, twice; owner-only item 45 (#446)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 07:56:00 +07:00
poli0981andClaude Fable 5.2 29b84832ee docs(handoff): item 44 (d) was tried on 2026-11-14 and not exercised - the switch was on before the games started (two sessions refused, nothing injected), and the hooked session ran to its exit; how (d) is run (#445)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 00:15:09 +00:00
poli0981andClaude Fable 5.2 cd4f69af1a feat(advanced): the driver's latency report in the Agent and the App - seven series and one table under Latency; Privacy Policy 2.20 and Disclaimer 2.16; owner-only item 45 (D132, D136, D138-D141; in no release yet) (#444)
* feat(advanced): the driver's latency report in the Agent and the App - seven series and one table under Latency, what became of the read said in words; reaches GameDriver and RefusedRoute; Privacy Policy 2.20 and Disclaimer 2.16; owner-only item 45 (D132, D136, D138-D141; in no release yet)

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

* docs: the owner kept the 2 ms latch at one call after the busy-PC run (D141)

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

* test(app): no redundant qualifier and no redundant null suppression in the driver-read tests (Qodana)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 06:30:00 +07:00
poli0981andClaude Fable 5.2 80d1048235 feat(overlay): the driver's latency report, read while a session asks - two read-only getters, once a second, on the presenting thread; the gates that hold it (D132, D136, D138-D141; in no release yet) (#443)
* feat(overlay): the driver's latency report, read while a session asks - two getters of an nvapi64.dll the game loaded, about once a second on the presenting thread, behind a gate of four states; a module beside the executable refused, a fault or a call of 2 ms the last one; the gates that hold it (D132, D136, D138-D141; in no release yet)

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

* fix(overlay): the latency log line measures its path with a bound (cpp:S5813)

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

* fix(overlay): the resolve switch names every outcome (Qodana native: clang-diagnostic-switch-enum)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 00:29:23 +07:00
poli0981andClaude Fable 5.2 70a81ed765 feat(shm): the Reflex latency words of region 5 - ten reserved words named, written by nobody; the layout stays 5 (D136, D138) (#442)
* spike(reflex): the leg with a sleep - the decision table, written before the run (D139)

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

* spike(reflex): the getters while the game sleeps - a leg of the probe with a sleep mode, three runs, no stop condition (D139); the plan's four decisions (D138-D141) and the train's design in HANDOFF

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

* feat(overlay): the PATCH_BATCH line says how a batch ended - install / restore for one apply, install singly / restore singly with the count in the high half of b (D137)

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

* feat(shm): the Reflex latency words of region 5 - ten reserved words named, written by nobody; the layout stays 5 (D136, D138)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 23:43:12 +07:00
poli0981andClaude Fable 5.2 c02ee63a4e feat(overlay): the PATCH_BATCH line says how a batch ended - one apply, or finished one patch at a time (D137) (#441)
* spike(reflex): the leg with a sleep - the decision table, written before the run (D139)

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

* spike(reflex): the getters while the game sleeps - a leg of the probe with a sleep mode, three runs, no stop condition (D139); the plan's four decisions (D138-D141) and the train's design in HANDOFF

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

* feat(overlay): the PATCH_BATCH line says how a batch ended - install / restore for one apply, install singly / restore singly with the count in the high half of b (D137)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 23:16:30 +07:00
poli0981andClaude Fable 5.2 f8d4945e6d spike(reflex): the getters while the game sleeps - the probe's leg with a sleep mode (D139), and the decisions and design of the train that follows (D138-D141) (#440)
* spike(reflex): the leg with a sleep - the decision table, written before the run (D139)

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

* spike(reflex): the getters while the game sleeps - a leg of the probe with a sleep mode, three runs, no stop condition (D139); the plan's four decisions (D138-D141) and the train's design in HANDOFF

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 22:46:16 +07:00
poli0981andClaude Fable 5.2 fc8072019e docs(handoff): what the owner's five sessions on 0.1.0-beta.46 showed (item 44) - the batches went in whole in five games; two long ones not explained; the stop not exercised (#439)
* docs(handoff): what the owner's five sessions on 0.1.0-beta.46 showed - eighteen install batches in five games, sixteen at 81-262 ms whatever they held, two not explained (Hogwarts Legacy 1.26 s, Cyberpunk 2077 0.61 s); the stop while a game runs was not exercised; item 44's sentence about a fallback corrected

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

* docs: the owner's answers of 2026-11-13 - Reflex route D goes to a plan for one real title, Cyberpunk 2077 (D136); the PATCH_BATCH line says how a batch ended, with the next release (D137)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 14:27:34 +00:00
poli0981andClaude Fable 5.2 2c9bc3e17c test(native): a test that is cut short is not a pass - every native test names the line it ends on and ctest requires it, a test registered without one fails the configure, and four canaries prove the rule red and green (#438)
On 2026-11-13 security software removed a freshly linked fl_guard_test.exe while a local gate ran: the process
ended early with exit code 0 and ctest printed "fl_guard ... Passed 0.66 sec" for a suite that takes three
minutes. Only the next test, which runs the same executable, made the gate red.

- src/native/CMakeLists.txt: fl_test_completes(<test> <regex>...) and fl_catch2_test_completes(<test>...) set the
  line a test must print (Catch2: "All tests passed (", or its summary row with a skipped case, never a row that
  names a failure); fl_require_every_test_completes() fails the configure when a test in tests/ or tools/ was
  registered without one.
- All 35 tests go through one of the two, each on the last line it already printed; no program changed.
- Four canaries print what a Catch2 run would - nothing, its last line, a row with a skipped case, a row with a
  failure beside "passed" - through the same helper; the two that must be red are WILL_FAIL.
- fl_nvapi_bridge, fl_process_stats, fl_nvapi_probe and fl_signer_probe passed on a line printed in the middle of
  their run; they now need it and, after it, their last line. fl_nvapi_probe also passed whatever followed its
  branch line - a pass expression makes ctest ignore the exit code.

Docs: 14_TESTING, HANDOFF, the changelog. No shipped code.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 20:36:41 +07:00
poli0981andClaude Fable 5.2 aa30080e06 docs(handoff): 0.1.0-beta.46'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 counted a test cut short as passed (#437)
- Released 2026-11-13T11:10:28Z from the signed tag on 47f010a by run 43412434074; eight assets, seven digests
  equal, the build id in four natives, the delta 634,023 bytes, the wiki run. SonarCloud's gate passed on the
  release's commit with no issue open; Qodana's two reports are green on it.
- Security software on the development PC removed the freshly linked fl_guard_test.exe while a local gate ran, and
  ctest reported the run that was cut short as Passed after 0.66 s (the suite takes 181 s); only the next test,
  which runs the same executable, made the gate red. Recorded with a proposal; nothing changed.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 19:27:10 +07:00
poli0981andClaude Fable 5.2 39a747f2a3 spike: Reflex route D on the harness - the driver's two getters from an unshipped probe, against a stand-in module and the installed driver; no game touched (spike-notes §31; D132) (#436)
* spike: Reflex route D on the harness - the driver's two getters called from an unshipped probe, against a stand-in nvapi64.dll and against the installed driver; a decision table written before the runs, and what they showed (spike-notes §31; D132)

No shipped code changes and no game was touched.

- tools/fl-probe-reflex: fl_reflex_candidate.h, the call sequence that would move into the Overlay (find
  nvapi64.dll only if the process already holds it, resolve NvAPI_D3D_GetLatency and NvAPI_D3D_GetSleepStatus by
  interface id, call them SEH-guarded); --stub against tools/vendor-stubs/stub_nvapi64.cpp (ctest
  fl_reflex_probe_stub); --real against the installed driver with the probe playing the game's part - it sets
  latency markers on its own device, in its own process.
- docs/spike-notes/31-reflex-route-d-harness.md: nine pre-committed measurements and their results. No fault
  before initialisation, without markers, or beside a marker-setting thread (38 million reads); a call costs half
  a microsecond; the Direct3D 12 device the Overlay holds is the object the driver takes; the report's unit is
  microseconds. The call belongs on the presenting thread once a second, not on the watchdog. The newest frames
  of a report are not final. Ends in the owner's go or no for one real title.

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

* docs(spike): §31 in the index, §M14 and §30 point at what the harness spike showed; the probe and its stub in the build document and CLAUDE.md's tools list

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

* docs(spike): HANDOFF says the route D spike is done and what a plan must keep from it; the changelog names the probe as a developer's tool

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

* fix(probe): the Reflex probe's Measure takes its callable by const reference - a forwarding reference it never forwarded (Qodana native, cppcoreguidelines-missing-std-forward)

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

* fix(probe): what SonarCloud reported on the Reflex probe - the counter read through the union member it was initialised with, a guard for an empty measurement, NvU32 printed as what it is, a variable no longer named module; and the note says what a fourth run measured (1.5 us a call, 70 us at worst)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 19:05:59 +07:00
poli0981andClaude Fable 5.2 47f010a7b7 release: 0.1.0-beta.46 - hooks go into a game together and come out together: one stop of the game's threads for a batch of patches, not one a patch (D134); the pages brought up to date with the first real sessions on 0.1.0-beta.45; owner-only item 44 (#435)
- docs/changelog/0.1.0-beta.46.md takes [Unreleased] as it stood, under an introduction that says what the
  release is and is not; CHANGELOG.md keeps an empty [Unreleased] and gains the table row.
- docs/HANDOFF.md: the beta.45 section moves verbatim to docs/handoff/history/0.1.0-beta.45.md; a new START HERE -
  what the release decided beyond D132-D135 (the refused first design and the rules that replaced it, the gate, the
  engine's verdict, the fallback), the traps of the train, NEXT, what is left open.
- Owner-only item 44, with what each outcome means written before the run.
- The release lines: ACCESSIBILITY.md, LIMITATIONS.md, README.md, legal/ACCURACY.md, legal/DISCLAIMER.md.

Documents only; nothing under src/ changes.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 17:51:54 +07:00
poli0981andClaude Fable 5.2 28c7760d28 feat(overlay): patches go in and come out under one stop of the game's threads - MinHook's queue, behind a gate (beta.46 PR-1; D134) (#434)
* feat(overlay): patches go in and come out under one stop of the game's threads - MinHook's queue for the rows a tick finds and for the stop, behind a gate, with only patches that are still ours ever marked for a restore (beta.46 PR-1; D134)

MinHook stops every thread of the process to write a jump, and enabling or disabling one hook did that for one
jump: thirteen Streamline patches took 0.74 s to 2.8 s of a game's start in the owner's sessions of 2026-11-13,
and a stop restored its patches the same way.

- fl_patch_registry.h: fl::patch::Batch (Add: slot and create, nothing marked; Commit: enable them all, then the
  re-read of the flag Install makes) and fl::patch::RestoreAll, the stop's walk. Install and Registry untouched.
- dllmain.cpp: InstallUpscalerHooks queues every row a tick finds something for and commits once, before the
  families published "when whole"; InstallRtHooks batches its two; StopObserving calls RestoreAll. A patch's
  HOOK_INSTALLED line, family bit and latch come in that order and only once it is in. A new log line an apply,
  PATCH_BATCH install|restore (a = microseconds, b = patches). No hook body changed.
- MH_ApplyQueued applies every hook whose mark differs from its state, whoever marked it. So no mark is left
  standing, only a patch that is still ours is marked for a restore and nothing is marked "all" (a draft that did
  could put a patch back in after a stop; refused on review against hook.c), and mark, apply and commit happen
  inside a gate - a slim lock on no hook body's path, never held across a symbol lookup, re-entered by its owner.
  The verdict on an install is the engine's, not the bytes'. An apply stops at its first failure: the hooks
  after it are enabled or restored one at a time.

Measured on hook-harness's Streamline target, three runs before and after: the nine Advanced-only patches,
0.60 / 0.70 / 0.60 s one by one, are one batch of 81 / 90 / 78 ms; the stop's eighteen, 1.37 / 1.56 / 1.37 s,
are one apply of 77 / 90 / 76 ms; unhook requested to UNHOOKED, 1.27-1.48 s, is 94-109 ms.

ctest fl_unhook_inline: six new cases, against real MinHook and against a model of its table. fl_guard's
Streamline [advanced] case asserts the batch lines. No real game has been run.

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

* fix(overlay, tests): what SonarCloud reported on the batching pull request - the performance counter read through the union member it was initialised with, a test's strlen, and a model index that could be -1

- dllmain.cpp: QpcNow() names QuadPart in the LARGE_INTEGER's initialiser, so the member read back is the member
  the union holds (cpp:S6232, four times on MicrosSince); MicrosSince takes the ticks.
- guard_test.cpp: the log-field helper takes a string_view instead of calling strlen (cpp:S5813).
- unhook_inline_test.cpp: the model's Set refuses an index outside its table and the test marks a foreign patch
  through a method that looks the target up (cpp:S3519: enabled[-1] if Find had failed).

No behaviour changes. The batch timings on the fixture are as before (four in 70 ms, nine in 70 ms, eighteen
out in 76 ms).

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 16:41:53 +07:00
poli0981andClaude Fable 5.2 92affcd11e docs: what the owner's seven sessions on 0.1.0-beta.45 showed (item 43), and the four decisions taken on them - Reflex route D to a harness spike with rule 4's note, route C refused and ETW left closed, installs and restores to be batched, slAllocateResources keeps its patch (D132-D135) (#433)
Read 2026-11-13 from a copy of the ledger (sessions 190-196), seven overlay logs, the Agent's log and Windows'
application log. Every session hooked, normal, no fault counted, no PATCH_FAILED. slIsFeatureSupported read in
every Streamline session; slIsFeatureLoaded in three games; slSetFeatureLoaded in two; slFreeResources and
slShutdown once in one game each; slAllocateResources in none. Hogwarts Legacy and Black Myth: Wukong fault
while closing at the offsets they had before. Thirteen interposer patches take 0.7 s to 2.8 s of a game's start.
Off means off and a stop while a game runs were not exercised. The pages that said "not confirmed" are corrected.

The owner's decisions the same day: D132 (route D goes to a spike on hook-harness and a stub; a driver's
read-only getter with the device of the hooked swap chain is inside rule 4 - CLAUDE.md carries the note, and
nothing shipped does it), D133 (route C refused, the ETW route stays closed), D134 (batch installs and restores
through MinHook's queue, released alone as 0.1.0-beta.46), D135 (slAllocateResources keeps its patch).

Documents only.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 15:48:15 +07:00
poli0981andClaude Fable 5.2 d3e8dd3609 docs(handoff): 0.1.0-beta.45's release facts - the tag's run, the digests, the delta, the wiki, Qodana; and SonarCloud's gate, failed on the release's commit by 39 duplicated lines of one enum mirrored by design - the Domain's mirror is left out of duplication detection (#432)
- docs/HANDOFF.md: released 2026-11-12T16:40:42Z from the signed tag on 550d830 by run 43257803723; eight assets,
  seven digests equal, the build id in four natives, the delta 1,762,465 bytes, the wiki run, what Qodana said.
- SonarCloud's quality gate failed on 550d830 on duplicated lines on new code (3.7 % against 3 %), with no issue
  open: the six new members of FlHookFamily and of its Domain mirror HookFamilies, which are the same on purpose
  and held together by MetricEnumMirrorTests. SonarQube.Analysis.xml leaves the mirror out of the detection, with
  the reason there and in docs/13_CI_CD.md.

Whether the gate is green again is for the analysis of this commit on main to say.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 00:10:24 +07:00
poli0981andClaude Fable 5.2 550d83089d release: 0.1.0-beta.45 - six more of Streamline's calls, hooked only where asked: whether each feature is supported and loaded, the game switching it, its resources allocated and freed, Streamline shut down; slInit stays out (D129-D131); owner-only item 43 (#431)
- docs/changelog/0.1.0-beta.45.md takes [Unreleased] as it stood, under an introduction that says what the
  release is and is not; CHANGELOG.md keeps an empty [Unreleased] and gains the table row.
- docs/HANDOFF.md: the beta.44 section moves verbatim to docs/handoff/history/0.1.0-beta.44.md; a new START
  HERE - what the release decided beyond D129-D131, the traps of the train, NEXT, what is left open, and one
  finding not acted on: a stop restores its patches one after another, about 160 ms each.
- Owner-only item 43, with what each outcome means written before the run.
- The release lines: ACCESSIBILITY.md, LIMITATIONS.md, README.md, legal/ACCURACY.md, legal/DISCLAIMER.md.

Documents only; nothing under src/ changes.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 23:21:23 +07:00
poli0981andClaude Fable 5.2 a2235d7075 docs(spike): Reflex latency per frame - the routes there are and what each would cost, a reading with nothing run; the owner's go or no comes before any code (spike-notes §30; D130, §M14) (#430)
Train C's spike as a document. Hooking NVAPI's latency functions is the refused class; hooking Streamline's
Reflex and PCL functions is train D's wrapper and would miss a game that fetched them before the attach;
the Overlay calling slReflexGetState breaks the vendor's stated thread contract. What remains is the
Overlay calling two driver getters with the game's device (no patch; the owner's ruling on rule 4 first)
and a no-injection ETW route that gives the game-side markers only. Every Streamline game the owner ran
asks about kFeatureReflex. nvapi64.dll exports two functions on the dev box, not one.

No shipped code changes.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 15:59:09 +00:00
poli0981andClaude Fable 5.2 b6d7a58ee1 feat(advanced): a session shows whether each Streamline feature is supported and loaded, and what the game did with it - two facts from six calls, one sentence for their states, Privacy Policy 2.19 (beta.45 PR-3; D129-D131) (#429)
The Agent and the App read what the six hooks of this release keep.

- InGameAdvancedSampler: sl.feature.support (<feature> · slIsFeatureSupported as NVIDIA's own sl::Result
  name, a refusal included; <feature> · slIsFeatureLoaded on or off) and sl.feature.lifecycle
  (<feature> · slSetFeatureLoaded on, off or both; slAllocateResources and slFreeResources as counts,
  ">= 15" where the four bits stopped; a row slShutdown). A feature with nothing to say has no row.
- AdvancedSources: one member a call (Read / NeverCalled / NotHooked), null in every row written before.
  The page says the six in one sentence, each call by its name under what became of it.
- sl.init.preferences has reach BeforeAttach (D129): the game makes the call once, before FrameLedger is
  inside it. No catalog entry waits for a hook any more.
- Privacy Policy 2.19 (wording approved with the plan): what is read for each feature, and two more
  things never read - what identifies the graphics card a game hands over with its question, and the
  content of a graphics resource. "Four further calls" is ten. The Disclaimer stays 2.15.
- Strings in en, vi, ja. LIMITATIONS, the guide, docs 06/08/18, the accuracy block (three copies),
  CLAUDE.md, the changelog.

No native change, no layout change (5), no schema change (23). The Agent's end-to-end test on the
harness's Streamline target stores both facts and all six calls as Read; the FSR target stores NotHooked.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:41:09 +07:00
poli0981andClaude Fable 5.2 eef4266152 feat(overlay): hook slAllocateResources, slFreeResources and slShutdown - a feature's resources allocated and freed and Streamline shut down, counted and nothing else, only once the Agent has asked (beta.45 PR-2; D130) (#428)
Three more patch sites on sl.interposer.dll (family bits 20-22), installed only in a process that was asked for
Advanced metrics. The feature's id is the only argument looked at; the command buffer and the viewport are forwarded
and never read. The two that sit on a game's way out note the call and then call the original, and run nothing after
it. Two four-bit counts in word 1 of the feature's slot, and slShutdowns in the first of three reserved words (layout
5 as it was) with FL_ADV_VALID_SL_SHUTDOWN; all three are a session's and a new request clears them.

Measured (the detours' bodies on the headers, the Overlay's flags, 20 M calls x 3): slAllocateResources +0.70/+0.72/
+0.80 ns not asked, +10.43/+10.53/+10.74 asked; slFreeResources +0.61/+0.84/+0.58, +10.33/+10.57/+10.44; slShutdown
within the bench's noise not asked, +3.39/+3.37/+3.52 asked.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 15:20:31 +00:00
poli0981andClaude Fable 5.2 a4baae26fc feat(overlay): hook slIsFeatureSupported, slIsFeatureLoaded and slSetFeatureLoaded - read only where asked, the adapter never read; slInit not hooked (beta.45 PR-1; D129-D131) (#427)
* feat(overlay): hook slIsFeatureSupported, slIsFeatureLoaded and slSetFeatureLoaded - whether Streamline says a feature is supported and loaded, and the game switching it, read only once the Agent has asked; the adapter a game asks about is never read; slInit is not hooked (beta.45 PR-1; D129-D131)

Three new patch sites on sl.interposer.dll, a row and a family bit each (17-19), installed only in a process that
was asked for Advanced metrics (D111). Bare arguments and results, no vendor struct: the feature's id, the sl::Result
of slIsFeatureSupported (a refusal is the answer), the bool slIsFeatureLoaded wrote when it said OK, the bool the
game passed to slSetFeatureLoaded. sl::AdapterInfo is forwarded and never looked at, and the fields gate refuses the
names of its members in code loaded into a game (D131). Packed into word 1 of the feature's slot (layout 5 as it
was); the switch bits are a session's, the answers the process's.

Also: a stop restores a patch in about 160 ms, and the watchdog's wait for the stop's log lines was two seconds
whatever the number of patches - with fifteen the log lost its last UNHOOK_RESTORED lines. The wait is now a quarter
of a second for every patch the registry can hold.

Measured (the detours' bodies on the headers, the Overlay's flags, 20 M calls x 3): slIsFeatureSupported +1.50/+1.48/
+1.50 ns not asked, +11.97/+11.98/+12.08 asked; slIsFeatureLoaded +1.79/+1.77/+1.89, +12.35/+12.31/+12.33;
slSetFeatureLoaded +1.44/+1.47/+1.80, +11.28/+11.54/+11.45.

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

* fix(harness): compute two feature-slot indices in size_t in the unit probe (Qodana native, bugprone-implicit-widening-of-multiplication-result)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:04:47 +07:00
poli0981andClaude Fable 5.2 b04f9f564c docs: what the owner's eight sessions on 0.1.0-beta.44 showed (item 42) - Streamline's answers about a feature were read in every Streamline session, and the pages that said most sessions would show nothing are corrected (#426)
Read from a copy of the ledger, the Agent's log, eight overlay logs and Windows' application log. Both calls read
on five games; the degrees fix reads right on Cyberpunk 2077; a game with no Streamline says not hooked. Not
exercised: off means off. Not explained: Valor Mortis's crash at 51 s (also on beta.40), Black Myth: Wukong's fault
in Steam's crash handler at exit. HANDOFF's NEXT carries the owner's word on the next version (slInit,
slIsFeatureSupported and other parts, to be planned).

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 14:07:40 +00:00
poli0981andClaude Fable 5.2 b47777e88d docs(handoff): 0.1.0-beta.44's release facts - the tag's run, the digests, the delta, the wiki, what SonarCloud and Qodana said on the release's commit, and the one flaky check on the way (#425)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 12:39:38 +00:00
poli0981andClaude Fable 5.2 f9e9fdb175 release: 0.1.0-beta.44 - what the first real games on beta.43 found, fixed (a field of view in degrees, the count of early abnormal ends, flags none), and Streamline's answers about a feature hooked only where asked (D126-D128): its changelog file, HANDOFF's beta.44 section, owner-only item 42, the release lines (#424)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 12:04:30 +00:00
poli0981andClaude Fable 5.2 99efc08423 feat(advanced): a session shows which version each Streamline feature is and what it requires; Privacy Policy 2.18 (beta.44 PR-3) (#423)
* feat(advanced): a session shows which version each Streamline feature is and what it requires - two catalog entries read inside the game, and for each of the two calls whether it was read, not hooked, or hooked and not asked again; Privacy Policy 2.18 (beta.44 PR-3)

The Agent turns region 5's feature slots into sl.feature.versions and sl.feature.requirements, rows named
<feature> - <member> in the vendor's words; AdvancedSources says for each call which of three things happened,
and the App words hooked-and-not-seen for a start-up call as what it is: the game did not ask again. The Agent's
end-to-end tests run a Streamline target for the first time. Privacy Policy 2.18 names what Streamline answers
about a feature and what of the answer is never read. No layout change (5), no schema change (23).

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

* style(recorder): drop two namespace qualifiers the new using made redundant (Qodana managed, RedundantNameQualifier)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 11:31:47 +00:00
poli0981andClaude Fable 5.2 91204ed8d3 feat(overlay): hook slGetFeatureVersion and slGetFeatureRequirements - Streamline's answers about a feature, read only where asked; never the lists the answer points to (beta.44 PR-2) (#422)
* feat(overlay): hook slGetFeatureVersion and slGetFeatureRequirements - what Streamline answers when a game asks which version a feature is and what it requires, read after the original call and only once the Agent has asked; never the lists the answer points to (beta.44 PR-2)

Two new patch sites on sl.interposer.dll, a row and a family bit each (15, 16), installed only in a process that
was asked for Advanced metrics (D111) and the first two rows the watchdog patches. The answer is read only when
the original returned eOk and the struct carries its own GUID: two versions; the flags, three counts and four
versions of the requirements - every one a member of struct version 1 at each of sixteen upstream tags (D115).
requiredTags and the Vulkan members are never read; no pointer of the game's is followed. Twelve slots in region 5
(layout 5 as it was), kept across a new request.

Measured (the detours' bodies on the headers, the Overlay's flags, 20 M calls x 3): the version +0.58/+0.61/+0.58 ns
not asked, +14.82/+14.54/+14.47 ns asked; the requirements +0.58/+0.63/+0.61 ns not asked, +20.88/+21.01/+20.96 ns
asked.

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

* fix(tests): compute the index of a feature slot in size_t - three products of two 32-bit values used as a pointer offset, in the injected test and the harness (Qodana native, bugprone-implicit-widening-of-multiplication-result)

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:47:32 +00:00
poli0981andClaude Fable 5.2 3f16235c73 fix(advanced): a field of view a game gives in degrees is no longer labelled radians, switching hooking back on starts the count of early abnormal ends again, and a frame-generation configure with no flag says none (beta.44 PR-1; D126-D128) (#421)
What the owner's nine sessions on 0.1.0-beta.43 found. The Overlay does not change.
- D128: a field of view over pi is the number as the game gave it, with a row that says it is not radians; never converted.
- D126: the consent grant sets hook_crash_count to 0 - it was never set back, so one early end was enough once a game had had two.
- D127: a fault while a game is closing, unseen by a hooked session, is written down and not changed.
- The accuracy statement and LIMITATIONS say what was read from real games and what was not.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:11:23 +00:00
poli0981andClaude Fable 5.2 c8d0731ed8 docs(handoff): what the owner's nine sessions on 0.1.0-beta.43 showed - both new hooks read real games, off meant off, and Cyberpunk 2077 gives Streamline its field of view in degrees (item 41) (#420)
Read from a copy of the ledger, the Agent's log, nine overlay logs and Windows' application log.
Not exercised: a configure through the FidelityFX 2.3 loader, a game with neither library.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 09:44:28 +00:00
poli0981andClaude Fable 5.2 e422a416a2 docs(handoff): 0.1.0-beta.43's release facts - the tag's run, the digests, the delta, the wiki, and what SonarCloud and Qodana said on the release's commit (#419)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 07:15:20 +00:00
poli0981andClaude Fable 5.2 6c7ba74eb0 release: 0.1.0-beta.43 - two hooks installed only where asked for (what a game tells Streamline each frame, how it configures FSR frame generation), the guard reads a moving module list again, an FSR UPSCALE counted once (D123-D125): its changelog file, HANDOFF's beta.43 section, owner-only item 41, the release lines (#418)
docs/changelog/0.1.0-beta.43.md takes [Unreleased]; HANDOFF's beta.42 section moves verbatim to docs/handoff/history/0.1.0-beta.42.md and a new START HERE says what the release decided beyond D123-D125, the traps of the train and what is left open; owner-only item 41 is the first real games with the two new hooks, with what each outcome means written before the run.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 06:38:31 +00:00
poli0981andClaude Fable 5.2 3558284a75 feat(advanced): a session shows what the game told Streamline each frame and how it configured FSR frame generation - six catalog entries read inside the game, and for each of the two calls whether it was read, never called or not hooked; Privacy Policy 2.17 (beta.43 PR-4) (#417)
The Agent and the App for the two hooks of #415 and #416. InGameAdvancedSampler makes sl.constants.jitter, .motion_vectors, .depth, .projection, .resets and ffx.framegen.config from members region 5 already had; the count is brought up to the last publication when the session ends. AdvancedSources gains StreamlineConstants and FsrFrameGeneration (AdvancedInGameCall), from the hook families the writer state published and what the publications carried; the session's sources line says it in en, vi, ja. Privacy Policy 2.17 names the two readings and says the two calls are intercepted only once a session with the option on has started in the game; the accuracy block, LIMITATIONS, the guide and docs 06, 08, 18 follow. No schema change (23), no layout change (5).

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 06:22:01 +00:00
poli0981andClaude Fable 5.2 b2e90324c5 feat(overlay): hook ffxConfigure on the four ffx-api modules - how a game configures FSR frame generation, read only while the Agent asks and patched only once it has; never the swapchain, the callbacks, the HUD-less resource or the frame id (beta.43 PR-3) (#416)
Four inventory rows, family FL_HOOK_FFX_CONFIGURE (bit 14), installed only in a process asked for Advanced metrics at least once and published when every loaded ffx-api module is patched. fl_adv_fields.h reads frameGenerationEnabled, allowAsyncWorkloads, flags, onlyPresentGenerated and generationRect of a frame-generation configuration into region 5's ffxFg group, counted at the first module that saw one; the rectangle is kept in one word so it cannot tear, and one that does not fit is four -1. Every configure type is kept for the log (FFX_CONFIGURE). tools/overlay-fields-check.ps1 gains the parameter g and five list entries.

Measured on the headers with the Overlay's flags: +1.7 ns not asked, +15.2 ns on the counted module, +2.7 ns on the forwarded copy.

The test's 'is this export patched' compares the target's bytes with the file's own.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 06:05:06 +00:00
poli0981andClaude Fable 5.2 b4feea1b0b feat(overlay): hook slSetConstants - what a game tells Streamline about each frame, read only while the Agent asks and patched only once it has; never the matrices or the camera's position and axes (beta.43 PR-2) (#415)
A new inventory row, sl.interposer.dll!slSetConstants, family FL_HOOK_SL_CONSTANTS (bit 13). InstallByFamily returns before resolving the symbol in a process never asked for Advanced metrics (D111), so nothing is patched with the option off. The detour checks the request, MayObserve, the struct's GUID and version and the viewport handle's on every call; fl_adv_fields.h reads jitterOffset, mvecScale, cameraNear, cameraFar, cameraFOV, cameraAspectRatio and the seven Booleans into region 5's sl group, summarised for the first viewport seen. tools/overlay-fields-check.ps1 gains the parameter k and thirteen list entries; the camera's names are still refused everywhere.

Measured on the headers with the Overlay's flags: +0.6 ns not asked, +19.6 ns asked on the summarised viewport, +5.8 ns on another.

ctest fl_adv_fields and fl_guard [advanced]: never asked - the export's first 16 bytes in the target are the file's; asked - the first viewport's numbers and none of the second's; no longer asked - the region unchanged; stopped - the bytes restored.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 04:43:24 +00:00
poli0981andClaude Fable 5.2 31d79184eb fix(overlay): an FSR UPSCALE is counted at the first source that saw one - a loader that hands a dispatch on to the leaf's export brought it to two hooked modules, and the frame count would have doubled with frame generation off (beta.43 PR-1, D125; decisions D124-D125) (#414)
g_ffxUpscaleOwner gates the count and the source word through fl::adv::Owns; the FSR 3.0 host is a source like the four leaves; the render size and the quality byte are not gated. Measured on Cyberpunk 2077's loader 2.3.0 for frame-generation dispatches; no title run so far upscales through such a loader, so it is a precaution, held by the stub loader bound through the leaves' exports (hook-harness --ffx-topology 2x-export): 60 presents read as 120 frames before, 60 after.

Measured on the header's Owns with the Overlay's flags: +0.02 to +0.03 ns on the counted module.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 04:22:06 +00:00
poli0981andClaude Fable 5.2 ab8b4ac158 fix(guard): a module list that changed while it was read is read again before the guard refuses (D123) (#413)
* fix(guard): a module list that changed while it was read is read again, at most three times, before the guard refuses - launches were being lost as a safety unhook with no frame recorded (owner decision D123)

Collected::kUnsettled for a module that was in the list and could not be named (until now kIncomplete, an immediate refusal). CheckModules re-reads the whole scan set from a fresh snapshot after kScanRetryPauseMs, up to kMaxUnsettledRereads (3) times; a list still unsettled on the last read refuses kModuleScanFailed with its own signal. A finding - also among the modules that were read from a half-read list - a protected process and a list too long for the buffer still refuse at once; D48's re-read stays one. The launch poll's runtime probe asks again on an unsettled list.

ctest fl_guard [D123]: ten sections against fakes, and the real source against a process that loads and frees a module in a loop (hook-harness --churn-module): about one read in four unsettled, none anything else.

HANDOFF: D123; the Cyberpunk FSR 3 session cannot be run (the game's only FSR upscaler is 2.1), D121 closed.

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

* test(guard): the live D123 case counts its answers with an if-chain - Qodana's switch-enum on a switch that named two of five values

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 04:05:20 +00:00
poli0981andClaude Fable 5.2 6d4e799f68 docs(handoff): what the first four sessions on beta.42 showed - Cyberpunk's upscale was FSR 2.1, built into the game (D121) (#412)
* docs(handoff): what the owner's first four sessions on 0.1.0-beta.42 showed - Cyberpunk's upscale was FSR 2.1, built into the game (D121 answered); the 2.3 loader re-enters the leaf's export; the plane at infinity measured on two titles

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

* docs(handoff): three more starts of Cyberpunk on beta.42 - the game was still on FSR 2 (the settings file says so), and the first start was lost to a module list read while the game was loading: five such ends in the Agent's logs since 2026-11-05, and a decision for the owner

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

* docs(handoff): the owner's screenshot of Cyberpunk's Graphics menu confirms it - Resolution Scaling is FSR 2.1

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

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 03:29:32 +00:00
poli0981andClaude Fable 5.2 e2de7cfbc0 docs(handoff): 0.1.0-beta.42's release facts - the tag's run, the digests, the delta, the wiki run; SonarCloud's one finding fixed (a strlen in a test helper); two transient failures recorded (#411)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 03:05:42 +00:00
poli0981andClaude Fable 5.2 a708ae8fed release: 0.1.0-beta.42 - no new patch site: the session's upscaler label, the patch registry, a native log that outlives the game, FSR's plane at infinity (D119-D122): its changelog file, HANDOFF's beta.42 section, owner-only item 40, the release lines (#410)
docs/changelog/0.1.0-beta.42.md takes [Unreleased]; HANDOFF's beta.41 section moves verbatim to docs/handoff/history/0.1.0-beta.41.md and a new START HERE says what the release decided, what to read in the Cyberpunk log and the design of beta.43's two hooks; owner-only item 40; the release lines in README, LIMITATIONS, ACCESSIBILITY and the accuracy block's copies. No legal version, schema, rules or layout change.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 02:09:22 +00:00
poli0981andClaude Fable 5.2 c74de2cc12 feat(advanced): FSR's depth plane at infinity is stored as +infinity and shown as an infinity sign - FLT_MAX or +infinity in cameraNear / cameraFar is a plane for FSR, where for Streamline it is 'not set' (beta.42 PR-4, D119) (#409)
FL_ADV_FLOAT_INFINITE (0x7F800000) in ffxNearBits / ffxFarBits only; fl::adv::FfxDepthPlaneBits on the ffx route only; InGameAdvancedSampler shows the row as the infinity sign. No field moved, the layout version is unchanged. The layout's comments carry the release numbers of D118 and D122.

Measured on fl_adv_fields.h with the Overlay's flags, old header beside new: no difference beyond the run-to-run spread (+25.0 to +25.4 ns per UPSCALE dispatch with Advanced on, +25.2 to +25.8 before; off unchanged).

Qodana's native report: six false 'never used' on the registry test's stand-in engines switched off for that file with the reason; one vector reserve fixed.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 01:51:25 +00:00
poli0981andClaude Fable 5.2 72ee9964b0 feat(overlay): the native log is whole after a game that simply exits, and says which module was patched and which descriptor types each ffx module was handed - the watchdog flushes when something new was logged (beta.42 PR-3, D121) (#408)
The log held the first half second of a session unless the Agent asked for it or a stop ran, and a game that exits does neither. FlushLogIfNew on the watchdog's tick; the init flush moved before the watchdog exists. Install lines name module!symbol from the inventory row (fl::inventory::NameOfRow; the event's text is 72 characters). fl_ffx_types.h keeps each descriptor type a hooked ffx-api module was handed, per entry point, and the watchdog logs it once (FFX_DISPATCH / FFX_QUERY), with UPSCALE_ROUTE and RUNTIME_CENSUS from words the detours already kept. A diagnostic: the log file and nothing else.

Measured on the header with the Overlay's flags: +3.8 ns per dispatch for a frame's three types; +0.9 ns first slot, +8.4 ns eighth.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 01:36:55 +00:00
poli0981andClaude Fable 5.2 ca7d9cb028 fix(overlay): the patch registry refuses a patch it cannot record and records a patch before it can run - a full table no longer leaves a live patch the stop does not know, and a stop that arrives while a hook goes in can no longer miss it (beta.42 PR-2) (#407)
fl_patch_registry.h: slots Free -> Claimed -> Live -> Retired and one sequence, fl::patch::Install - claim, create, enable, commit, re-read the flag - against a stop that clears the flag and then walks the committed slots, both sequentially consistent. PatchTarget, the loader detour and the three DXGI patches go through it; a patch that did not go in is logged once (PATCH_FAILED); the capacity is asserted against the inventory's row count; READY is written only over INIT and init's failure path stores nothing, so neither overwrites a stop's reason. No hook body changed.

ctest fl_unhook_inline drives the shipped sequence against real MinHook patches (+3 cases).

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 01:17:10 +00:00
poli0981andClaude Fable 5.2 96cb45605d fix(metrics): a session's upscaler is the technology named on the most samples, with that technology's quality and render size - not the first one named beside the others' values (beta.42 PR-1, D120; decisions D119-D122) (#406)
A session that evaluated DLSS briefly and then ran FSR was stored as DLSS with FSR's quality byte and render size. Domain.Metrics.UpscalerChoice picks the modal named technology over the dominant stream; with more than one named, quality and size are read only from the samples that name it, a quality byte of the other family is withheld, and the session is marked settings-changed. One technology named keeps the whole stream, as before. The live card is unchanged.

HANDOFF and 18_GPU_VENDOR_APIS record D119-D122: train B's second step is beta.42 (no new patch site) and beta.43 (the two new hooks).

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 01:00:26 +00:00
poli0981andClaude Fable 5.2 283e8b632e docs(handoff): owner-only items 38 and 39 passed on the owner's word - moved to owner-only-passed with what the sessions covered and what they did not; beta.42 begins with its plan (#405)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 00:31:56 +00:00
poli0981andClaude Fable 5.2 37c013e5e9 docs(handoff): what the owner's sessions on beta.40 and beta.41 show - the sensor-library fix over seven sessions, the first FSR 3.1 title read, Valor Mortis's crash was the game's own (#404)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 00:17:37 +00:00
118 changed files with 14474 additions and 514 deletions

No files matched your search

+6
View File
@@ -263,6 +263,12 @@ resharper_cpp_if_can_be_replaced_by_constexpr_if_highlighting = none
[src/native/{FrameLedger.Injector/src/fl_guard_sources.cpp,FrameLedger.ProcessStats/src/fl_process_stats.cpp,tools/fl-probe-guard/main.cpp,tests/vklayer_test.cpp}]
resharper_cpp_declarator_never_used_highlighting = none
# fl::patch::Install takes its hook engine as a template parameter and calls Create / Enable / Disable on it. The
# test's two stand-in engines are used that way and no other, which ReSharper's "never used" does not follow through a
# dependent call: six reports, one per member (Qodana, 2026-11-12). The members are the test.
[src/native/tests/unhook_inline_test.cpp]
resharper_cpp_declarator_never_used_highlighting = none
# The linter's compiler, not the build's: NVAPI's header makes NvU32 `unsigned int` under clang and `unsigned long`
# under MSVC, which is the compiler that builds this probe - and `%lu` is right for it.
[src/native/tools/fl-probe-nvapi/main.cpp]
+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.41. In the app: Help ▸ Accessibility.*
*Beta software: this page describes version 0.1.0-beta.47. In the app: Help ▸ Accessibility.*
## What FrameLedger aims for
+22
View File
@@ -35,12 +35,34 @@ 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.
| Version | Date | Notes |
|---|---|---|
| `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) |
| `0.1.0-beta.44` | 2026-11-12 | [`docs/changelog/0.1.0-beta.44.md`](docs/changelog/0.1.0-beta.44.md) |
| `0.1.0-beta.43` | 2026-11-12 | [`docs/changelog/0.1.0-beta.43.md`](docs/changelog/0.1.0-beta.43.md) |
| `0.1.0-beta.42` | 2026-11-12 | [`docs/changelog/0.1.0-beta.42.md`](docs/changelog/0.1.0-beta.42.md) |
| `0.1.0-beta.41` | 2026-11-12 | [`docs/changelog/0.1.0-beta.41.md`](docs/changelog/0.1.0-beta.41.md) |
| `0.1.0-beta.40` | 2026-11-12 | [`docs/changelog/0.1.0-beta.40.md`](docs/changelog/0.1.0-beta.40.md) |
| `0.1.0-beta.39` | 2026-11-11 | [`docs/changelog/0.1.0-beta.39.md`](docs/changelog/0.1.0-beta.39.md) |
+23 -1
View File
@@ -20,6 +20,8 @@ A C++ DLL (`FrameLedger.Overlay.dll`) is injected into games the user explicitly
> **Amended 2026-10-03 (owner decision D38): the evidence moved from before the grant to its trial.** "≥ 2 successful Tier-1 sessions" above could never be met by a game blocked at add time — since beta.8 that is every blocked game — nor after a ledger reset. Asked with that, the owner chose: a grant needs no session; the first two hooked sessions under it are a trial, and any end during the trial (a crash, a safety unhook, a floor stop, a new finding, or a stored hooked session with no frames or an abnormal exit) ends the exception **for good** (`games.ac_exception_trial_failed_at`, schema 0017, never cleared). Every other condition above is unchanged, and so is the last sentence.
3. **Never implement evasion.** No manual mapping, no PE header erasure, no thread hiding, no signature obfuscation, no unlinking from the PEB module list. Injection uses documented `LoadLibraryW`. The DLL keeps its real name, real exports, and version info. A performance tool must be *visible* to anti-cheat, not hidden from it. Any PR that makes FrameLedger harder to detect is rejected on principle.
4. **Never read or write game memory outside our own hooks.** We read arguments passed to APIs we hooked and COM/handle objects we legitimately own. No pattern scanning for game internals, no reading player/entity state, no writing to game memory. Ever.
> **Amended 2026-11-13 (owner decision D132): a driver's read-only getter, with the device of the swap chain we hook.** Asked with this rule quoted, the owner ruled that calling NVIDIA's two latency getters (`NvAPI_D3D_GetLatency`, `NvAPI_D3D_GetSleepStatus`) with the device behind a swap chain the Overlay hooks is inside this rule: it reads the driver's report, not game memory, and writes nothing. ~~Nothing shipped does it yet~~ **Shipped since 0.1.0-beta.47 (owner decisions D136, D138–D141)**, after the spike on `hook-harness`, a stub and the installed driver (`spike-notes` §31): only while a session records Advanced metrics (no switch of its own), about once a second on the presenting thread, through an `nvapi64.dll` the game had loaded — one in the game's own folder is refused, and a fault or a call of 2 ms or more ends it until the game exits (`17_HOOK_ENGINE` §Calls the Overlay makes into a driver). **It is the only call of its kind; another needs a ruling of the same kind.** Getters only, never a setter, a marker or a sleep, and never a call that loads `nvapi64.dll` into a game.
5. **The hook must never crash the game.** Every hook body: SEH-guarded, allocation-free, lock-free, no logging, no exceptions crossing the boundary. On repeated faults, self-disable (`17_HOOK_ENGINE` §Fault policy).
6. **FPS display rule (product requirement):** wherever FPS is shown and Frame Generation is active, show *Native FPS*, *Displayed FPS*, and the FG factor together (`62 → 118 FPS (×1.9 FG)`). Never a single inflated number. See `docs/03_METRICS.md`.
@@ -122,6 +124,21 @@ src/
# memory's region 5 - what a hooked game told DLSS and FSR, read by the Overlay
# only while the session asks (ICaptureObserver.WantsInGameAdvanced) - into session
# facts and two adv.* series; reach `Game` in the catalog; no schema change.
# Since 0.1.0-beta.43 also what the game tells Streamline each frame and how it
# configures FSR frame generation, from two calls hooked only once Advanced has been
# asked for; AdvancedInGameCall says of each: read, never called, or not hooked.
# Since 0.1.0-beta.44 also what Streamline answers when the game asks about a
# feature (its version, what it requires), from two more calls hooked the same
# way; ~~a game asks while it starts, so "never called" is the usual answer there~~
# (the games run since ask again later, and are read).
# Since 0.1.0-beta.45 also whether Streamline says a feature is supported and
# loaded, the game switching it, its resources allocated and freed and Streamline
# shut down, from six more calls hooked the same way (D130); slInit is not hooked
# and its entry says why (AdvancedReach.BeforeAttach, D129).
# Since 0.1.0-beta.47 (train C, D136-D141) also what NVIDIA's driver reports about
# 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.
FrameLedger.Infrastructure/ # SQLite, shm reader, vendor APIs, injector interop, parsers,
# and Capture/ (PR-C): ShmRingAttacher/ShmCaptureSink over the
# reader, HeldProcessLivenessSource, TargetResolver (path only,
@@ -178,7 +195,9 @@ tools/ # accuracy-check, changelog-check, chokepoint-che
# agent-cost (D110, 2026-11-11: a developer tool, not a gate - what the shipped
# Agent costs per second of session, Advanced metrics off and on),
# nvapi-readonly-check (D108, 2026-11-11: every NVAPI call of the bridge is on
# nvapi-allowed-calls.txt, and none there writes or identifies),
# nvapi-allowed-calls.txt, and none there writes or identifies; since beta.47 also
# the Overlay - no NvAPI call by name, and the only interface ids it may name are
# the two on overlay-nvapi-allowed.txt),
# overlay-fields-check (D116, 2026-11-12: every member of a vendor's struct the
# Overlay reads for Advanced metrics is in fl_adv_fields.h and on
# overlay-allowed-fields.txt; a camera's position, axes and matrices nowhere)
@@ -192,6 +211,9 @@ tools/ # accuracy-check, changelog-check, chokepoint-che
# (--vulkan since #140, --opengl since #141)
# fl-probe-* -> guard, hook profile, interposer, NVAPI, process
# stats, signer, Vulkan layer; fl-baseline-probe;
# and fl-probe-reflex (2026-11-13, D132: the spike of Reflex route D,
# spike-notes §31 - unshipped, with a stand-in nvapi64.dll among the stubs;
# built from the Overlay's own fl_reflex.h since beta.47);
# vendor-stubs/ -> fixture DLLs with the vendors' export names
rules/detection-rules.json # engine/platform/capability + anticheat blocklist
guide/ # the user guide (beta.12, D44): ~~eight~~ short English pages for players, embedded in the
+66 -6
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.41.*
*Beta software: this page describes version 0.1.0-beta.47.*
## Games it will not measure
@@ -51,6 +51,11 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
game). Unity's crash handler and Chromium's `crashpad_handler` start with every game that has them, so their presence
says nothing. Sessions recorded before 0.1.0-beta.14 keep how they were stored — a few of them may read *crashed*
because Windows logged a memory report about the game. ([details](docs/04_CAPTURE.md))
- **A game that faults while it is closing can read *ended normally* in a session measured from inside the game.**
FrameLedger looks for Windows' crash report when it saves the session, and for such a session that is before
Windows has written it; the same fault in a session that was not measured from inside reads *crashed*. Seen on one
game whose graphics-driver library faults at every exit, measured or not (2026-11-12), and on a second whose
Steam crash handler faults at every measured exit. Not changed yet.
## Frame rate and frame generation
@@ -90,7 +95,9 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
same games as *Render → output resolution* in the accuracy statement; elsewhere it says it was not measured.
- The upscaler is read from the game's calls: DLSS and NIS through NVIDIA Streamline, and FSR through AMD's
FidelityFX libraries. **Intel XeSS is not read** (its licence forbids it), FSR 2 and upscalers built into the
game are not identified, and Vulkan and OpenGL games read N/A. Where no hook saw DLSS but the NVIDIA driver
game are not identified — Cyberpunk 2077's FSR 2.1 is one: its sessions say "unknown" beside a measured render
size — and Vulkan and OpenGL games read N/A. A game that sends FSR upscaling through two unrelated libraries in
one run is counted from the first alone (none is known). Where no hook saw DLSS but the NVIDIA driver
reports it, the page says it is the driver's report.
- **The quality mode** (Quality, Balanced, DLAA, …) is shown only when it is known: the NVIDIA App's override
where the NVIDIA driver reports it applied (marked *· NVIDIA App*, since 0.1.0-beta.24), or the mode the game
@@ -117,8 +124,13 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
- **Ray tracing** is *Yes*, *No* or *N/A* — measured from the game's ray-tracing calls on Direct3D 12, and
N/A where FrameLedger could not look. **Path tracing is never stated as a fact**: there is no API signal
for it. You can correct any of these by hand, and your correction is labelled as yours.
- HDR output, NVIDIA Reflex latency, the video-memory budget Windows gives a game, and shader-compilation
stutter are **not measured yet** — they read N/A. ([Accuracy](legal/ACCURACY.md))
- HDR output, end-to-end latency (click to screen), the video-memory budget Windows gives a game, and
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.
([Advanced metrics](guide/12-advanced-metrics.md))
## The game's memory
@@ -182,7 +194,53 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
library. The session says which it was — nothing seen, or not measured inside the game — and neither means the
game uses no upscaler. They are the game's words, not a check of what the upscaler did; the field of view is a
lowest and highest value, never a line over time; FSR's memory is a point where the game asked, so most sessions
have none. **None of it has been read from a real game yet.**
have none. FSR's upscaling values have been read from real games; **the DLSS options have not been confirmed on
one yet.**
- **What a game tells Streamline each frame, and how it configures FSR frame generation** (since 0.1.0-beta.43)
are read from two calls FrameLedger hooks **only once a session with Advanced metrics on has started in that
game** — a session recorded with the option off puts neither hook in. Streamline's values are those of **the
first viewport that called**: a game with several (split screen, a picture-in-picture view) shows one, and the
count of calls covers all. The frame-generation rows are **what the game asked for** — a game that asks for
generation and gets none still reads "on", and the session's summary is where what was generated is measured. A
setting the game changed during the session reads "on and off". The session's line says, for each of the two,
whether it was read, hooked and never called by the game, or not hooked (the game did not load the library).
Streamline 1.x is not read. Streamline's values have been read from three real games and the frame-generation
configuration from one (2026-11-12); **a configuration that reaches FSR through AMD's 2.3 loader has not been
read from a real game yet.** **A game may give a value in a unit of its own**: Cyberpunk 2077 gives Streamline
its field of view in degrees where NVIDIA's header says radians. A field of view too large to be radians is
shown as the game gave it, with a line saying so, and is never converted (since 0.1.0-beta.44; a session
recorded before keeps the line it was stored with, which labels the degrees as radians). The count of resets is
the number of calls in which the game said so — menus and loading screens raise it.
- **Which version each Streamline feature is, and what it requires** (since 0.1.0-beta.44) are Streamline's
answers to two questions a game asks while it starts — and, in the games run so far, again later. FrameLedger
hooks the two calls only once a session with Advanced metrics on has started in that game. **A game that asks
only at its start shows nothing here**, and the session's line then says the call was hooked and the game did
not ask again; the four Unreal Engine games run on 2026-11-12 asked again and were read, and Cyberpunk 2077
asked again for the requirements and not for the versions. A second session of a game that kept running keeps
what the first one read. The rows are Streamline's answer as the game received it — the versions
of Windows and of the driver are the ones Streamline found — not FrameLedger's own check of the PC. Twelve
features are kept; a thirteenth is not. The lists the answer points to (the buffers, the Vulkan extensions) are
never read, so the rows give how many buffers a feature needs and not which. **The version Streamline gives for
a feature can differ from the file in the game's folder** — three games answered 2.14.16 for DLSS frame
generation while shipping an older plugin; which file that newer one is was not looked into. The games run so
far do not ask Streamline about DLSS upscaling unless they upscale through it, so a game can list frame
generation here and no upscaler.
- **Whether each Streamline feature is supported and loaded, and what the game did with it** (since
0.1.0-beta.45) come from six more calls, hooked the same way — only once a session with Advanced metrics on has
started in that game. **What the game did before that is not seen**: a feature it switched on while it started
has no "switched" row, and resources it allocated then are not counted. The counts are **calls the game made**,
not resources, and each stops at fifteen (shown as `≥ 15`); they and the switching start again with each
session, while the two answers are kept from an earlier session of a game that kept running. "Supported" is
Streamline's answer for the graphics card the game asked about; which card that was is never read, so on a PC
with two cards the row does not say. A refusal is shown by NVIDIA's own name for it
(`eErrorFeatureNotSupported`), and it is the game that was refused, not FrameLedger. None of this says a
feature ran or drew anything. **Read on five games on 2026-11-13**: each asked whether its features are
supported, three asked whether they are loaded, two switched features off and on, one freed a feature's
resources once and one shut Streamline down once. **None allocated a feature's resources after FrameLedger was
in it**, so that row has not been seen in a real game.
- **What a game started Streamline with is not read, and will not be**: the game makes that call once, before
FrameLedger can be inside it — also when FrameLedger starts the game itself. The Advanced page lists the entry
with that reason.
- **The driver's own figures** — the card's firmware and architecture, its memory in detail, what a display can do
with HDR and variable refresh, the driver's settings for the game — exist on **NVIDIA** cards only. On other cards
they read N/A; the card's sensors (fans, voltages, loads) are read on every brand, and none has been tested on an
@@ -261,7 +319,9 @@ a barrier is on its own page: [Accessibility](ACCESSIBILITY.md) (in the app: Hel
- **Some games will not start directly** (seen on two Steam games, 2026-10-19 and 20). Lies of P, started by *Start
directly*, hands itself to Steam within seconds — since 0.1.0-beta.27 the game Steam then starts is recorded —, and
Clair Obscur: Expedition 33 closes within seconds, with or without FrameLedger's hook. Each such start ends a
measured session early, which the crash safety counts: two turn hooking off for the game. Start such a game through
measured session early, which the crash safety counts: two turn hooking off for the game — and since
0.1.0-beta.44 the count starts again each time you switch hooking back on (before, one more such end was enough
once a game had been switched off). Start such a game through
its store (Settings ▸ Games ▸ *Play button*); the notice after Play says when a Steam game may hand itself to Steam.
([details](docs/spike-notes/23-owner-runs-2026-10-20.md))
+25 -4
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.41`** (2026-11-12), an unsigned installer built from that tag with its
> **beta is `0.1.0-beta.47`** (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
@@ -87,8 +87,15 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
> mean, median and peak. The game's other processes (launchers, helpers) are not counted.
> - **Video memory:** in use on the whole graphics card, recorded from Windows and GPU-driver telemetry
> and charted. **Not measured at all:** the video-memory budget Windows gives a game, which frame
> spikes were shader compilation, PC latency (Reflex), and HDR. Stutter count and stutter time are
> spikes were shader compilation, end-to-end PC latency, and HDR. Stutter count and stutter time are
> measured from frame times.
> - **NVIDIA's latency report (only with Advanced metrics on; Direct3D 12; a game that uses NVIDIA Reflex):** how
> 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.
> - **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
@@ -114,7 +121,21 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
> range, field-of-view range, flags and frame time it hands FSR, are read from the arguments of the calls
> FrameLedger intercepts and shown as the game stated them — not checked against what the upscaler did. Most games
> set their DLSS options through a call that cannot be intercepted and show none; the FSR values need FSR 3.1 or
> later through AMD's own library. None of it has been read from a real game yet.
> later through AMD's own library. Since beta.43 also what a game tells NVIDIA Streamline about each frame (jitter,
> motion-vector scale, depth range, field-of-view range, how often it reset the upscaler's history — for the first
> viewport that called, where a game has several) and how it configures FSR frame generation (the settings it asked
> for, not whether frames were generated). Since beta.44 also what Streamline answers when a game asks about a
> feature — its version, and what it requires (graphics APIs, V-Sync, GPU scheduling, Windows and driver versions):
> Streamline's answer as the game received it, not a check of the PC. A game that asks only while it starts has
> none and the session says so; the Unreal Engine games run so far ask again later, and were read. Since beta.45
> also whether Streamline says each feature is supported and whether it is loaded, and what the game did with it
> after FrameLedger attached — switched it on or off, allocated and freed its resources (counted to fifteen), shut
> Streamline down: calls the game made, not a statement that a feature ran or produced anything. FSR's upscaling
> values, Streamline's constants (seven games), its answers about a feature (seven games), the
> frame-generation configuration (one game) and five of beta.45's six calls (five games) have been read from
> real games; no game run so far allocated a feature's resources after FrameLedger attached, and the DLSS
> options have not been confirmed on one yet. A game may give a value in a unit of its own: one gives
> Streamline its field of view in degrees, and it is shown as given.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
@@ -191,7 +212,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
## Install
> **The latest beta is `v0.1.0-beta.41` (2026-11-12); before it `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.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`.
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**.
+8 -2
View File
@@ -25,8 +25,14 @@
-->
<Property Name="sonar.exclusions">src/native/third_party/**,**/Strings.Designer.cs,src/native/tools/hook-harness/dxr_raygen_dxil.h,src/native/tools/vendor-stubs/**,tests/fixtures/**,legal/licenses/**,docs/vendor-exports.json,src/FrameLedger.Infrastructure/Persistence/Migrations/**,build/**,out/**,**/bin/**,**/obj/**,**/TestResults/**</Property>
<!-- Tests repeat their arrange steps on purpose; duplication there is not a defect. -->
<Property Name="sonar.cpd.exclusions">tests/**,src/native/tests/**</Property>
<!--
Tests repeat their arrange steps on purpose; duplication there is not a defect.
HookFamilies.cs is the Domain's mirror of FlHookFamily (ShmLayout.cs): Domain references nothing, so the enum is
written twice by design and MetricEnumMirrorTests fails when the two differ. Six members added at once
(0.1.0-beta.45) were 39 duplicated lines of 1,063 new ones, 3.7 % against the gate's 3 %, and failed it on the
release's commit with no issue open. The mirror is left out of the detection; FlHookFamily itself is not.
-->
<Property Name="sonar.cpd.exclusions">tests/**,src/native/tests/**,src/FrameLedger.Domain/Metrics/HookFamilies.cs</Property>
<Property Name="sonar.sourceEncoding">UTF-8</Property>
+13 -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 | **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)* | **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 |
@@ -687,6 +687,18 @@ From the upscaler hooks we get, per frame:
> Measured on the hook harness with the vendor stub answering as the SDK documents (`fl_guard` "FSR's quality
> mode", by size through the SDK 2.x loader and by ratio through the 1.1.x monolith); a real title is owner-only
> item 21 (Lies of P at Quality, then Performance).
- **One technology's name, quality and size** *(2026-11-12, owner decision D120)*. A session's — and a segment's —
upscaler is **the technology named on the most samples of the dominant stream** (a tie goes to the lower value, as
the quality byte's does), not the first one any record names. While a session names one technology, its quality
and render size are read from the whole stream as before: under frame generation the name sits on one present in
N. When it names **more than one**, the quality and the size are read **only from the samples that name the
chosen one**, a quality byte of the other family is withheld (`UpscalerChoice.QualityFor`), and the session is
marked "settings changed during session". The session this was found on (Dying Light: The Beast, 81 seconds:
DLSS evaluated for most of it, an FSR dispatch for a few seconds) had been stored as "DLSS" with FSR's Balanced
byte and FSR's render size — three true readings of two technologies under one name. What the chosen technology
did not say stays N/A (rule 7). `Domain.Metrics.UpscalerChoice`; the live card still names the first technology
the session saw (`FgLadder.UpscalerIdentity`), which for a session in progress is a different question and was
not changed.
- Resolution changes mid-session (user changed settings, or dynamic resolution scaling) produce **segments**: the session stores a segment list `(startFrame, renderW/H, outputW/H, upscaler, quality)`. Aggregates report the dominant segment plus a "settings changed during session" flag — averaging across a settings change is the classic way benchmark numbers become meaningless.
> **Two segmentation axes exist, they compose in ONE order, and neither document said so until
+12 -1
View File
@@ -761,7 +761,18 @@ Sequential embedded SQL (`Migrations/0001_init.sql`, `0002_*.sql`, …), applied
> 0.1.0-beta.40 (train B) the same row holds what the game told its upscaler** — the session facts of the entries
> whose reach is `Game`, after the driver's, and `sources.inGame` (`Reading`, `NothingSeen`, `NotHooked`; absent in
> a row beta.39 wrote, which reads as "not said") — and its two series are `adv.ffx.upscale.frame_time_delta` and
> `adv.ffx.memory_usage` in `sensor_blobs`. No column and no script: schema 23 as it was. A session deleted
> `adv.ffx.memory_usage` in `sensor_blobs`. **Since 0.1.0-beta.43** `sources` may also hold `streamlineConstants`
> and `fsrFrameGeneration` (`Read`, `NeverCalled`, `NotHooked`; `Application.Advanced.AdvancedInGameCall`) — what
> became, in that session, of the two calls hooked only for Advanced metrics; both absent in a row written before,
> and in a session not measured inside the game. **Since 0.1.0-beta.44** also `streamlineFeatureVersion` and
> `streamlineFeatureRequirements`, the same three values for the two questions a game asks Streamline about a
> feature — where `NeverCalled` is the usual one, a game asking while it starts — and the facts
> `sl.feature.versions` and `sl.feature.requirements`, rows named `<feature> · <member>` in the vendor's words.
> **Since 0.1.0-beta.45** six more keys, the same three values each — `streamlineFeatureSupported`,
> `streamlineFeatureLoaded`, `streamlineSetFeatureLoaded`, `streamlineAllocateResources`, `streamlineFreeResources`,
> `streamlineShutdown`, absent in every row written before — and the facts `sl.feature.support` and
> `sl.feature.lifecycle`, rows named `<feature> · <call>` (`slShutdown` alone for the shutdowns); a count that
> reached its ceiling is the text `≥ 15`. No column and no script: schema 23 as it was. A session deleted
> takes its row with it; a profile no session points to is left, as a hardware snapshot is; the retention sweep
> removes a session's `adv.` series with its other raw series and keeps its row. Written by the Agent only, in the
> session's own transaction (`SqliteSessionRepository.InsertAdvancedAsync`). `LatestVersion` is 23;
+62 -5
View File
@@ -125,14 +125,71 @@ What the region is, as a contract between the two sides:
inside on every attempt — a watchdog killed with its process leaves `seq` odd for good, and what it published
before is still what the game said.
- **Zero is "not read", never a value.** A Streamline `Boolean` and a DLSS preset are stored as the vendor's value
plus one; a float as its bits, with `FL_ADV_FLOAT_NONE` for "none seen" — the vendors' own sentinels are refused in
plus one; a float as its bits, with `FL_ADV_FLOAT_NONE` for "none seen" — and, in `ffxNearBits` / `ffxFarBits` alone, `FL_ADV_FLOAT_INFINITE` (`0x7F800000`, +infinity's own bits) for a plane at infinity *(0.1.0-beta.42, owner decision D119: an engine with an infinite depth hands FSR `FLT_MAX` or +infinity for one plane; for Streamline `FLT_MAX` is "not set" and stays refused)* — the vendors' own sentinels are refused in
the detour and never reach the region; a size of 0 is "not given".
- **A per-frame value is summarised where it is seen**: a flag is an "ever seen" mask, a jitter the largest magnitude,
a field of view its lowest and highest (D114), the reported frame time a count and a sum the watchdog drains.
- **Sized once for the train's three releases.** The members ~~0.1.0-beta.41 and beta.42~~ 0.1.0-beta.42 and
beta.43 fill *(renumbered 2026-11-12, D118: a fix release took beta.41; the comments in `fl_shm.h` and
`ShmLayout.cs` still carry the old numbers until the release that fills each member rewrites them)* (`ffxFg*`,
`sl*`, `features`) are declared now and stay zero until then, so those releases bump no layout.
- **Sized once for the train's three releases.** The members ~~0.1.0-beta.41 and beta.42~~ ~~0.1.0-beta.42 and
beta.43~~ 0.1.0-beta.43 and beta.44 fill *(renumbered twice on 2026-11-12 — D118: a fix release took beta.41;
D122: the second step became two releases, and beta.42 fills none of them. The comments in `fl_shm.h` and
`ShmLayout.cs` carry the new numbers since beta.42)* (`ffxFg*`,
`sl*`, `features`) are declared now and stay zero until then, so those releases bump no layout. **The `sl*` group
is filled since 0.1.0-beta.43** by the `slSetConstants` hook (`17_HOOK_ENGINE` §Hook inventory), under
`FL_ADV_VALID_SL_CONSTANTS`: the call count of every viewport, and for the first viewport seen the resets, the
jitter's largest magnitude, the motion-vector scale, the two depth planes, the field of view's range, the aspect
ratio, and one bit per `Boolean` in each of two words — seen true, seen false. `FlHookFamily` gains
`FL_HOOK_SL_CONSTANTS` (bit 13): the hook is in, which it is only in a process that was asked at least once.
**The `ffxFg*` group is filled since the same release** by the `ffxConfigure` hook, under
`FL_ADV_VALID_FFX_FG_CONFIG`: the frame-generation configures of the one module counted, three switches as "seen
off / seen on" bit pairs (enabled, asynchronous, generated frames only), every flag any configure carried, and
the last generation rectangle as left, top, width, height — **four `-1` for a rectangle with a negative side or
one past 32,767**, never a clipped one. `FL_HOOK_FFX_CONFIGURE` (bit 14) is published when every ffx-api module
the process loaded has its `ffxConfigure` patched.
- **The feature slots are written since 0.1.0-beta.44**: `features` is twelve slots of twenty-four words — word 0
the `sl::Feature` id plus one (0 is an empty slot), word 1 which of the two questions has an answer (bit 0 the
version, bit 1 the requirements), then the two versions, the flags, three counts and four more versions, as
`fl_shm.h` lays them out. Slots fill from 0 in the order the game first asked about each feature; **a new request
does not empty them** — the one group that is a fact about the process and not about a session — and
`FL_ADV_VALID_SL_FEATURES` stays set with them. `FL_HOOK_SL_FEATURE_VERSION` (bit 15) and
`FL_HOOK_SL_FEATURE_REQUIREMENTS` (bit 16) are published with their patches, in a process that was asked.
- **Word 1 of a slot carries more since 0.1.0-beta.45** (no layout change): bit 2 `slIsFeatureSupported` answered,
with the `sl::Result` it gave in bits 8..15 (0 is `eOk`; a refusal is kept, it is the answer; `0xFF` a code a byte
cannot carry); bit 3 `slIsFeatureLoaded` answered and bit 4 what it said; bit 5 the game switched the feature off
through `slSetFeatureLoaded`, bit 6 on. **Bits 5 and 6 are a session's and a new request clears them**; every
other bit of the word is a fact about the process and stays, as the slot does. A feature Streamline refused has
a slot with only that word in it. `FL_HOOK_SL_FEATURE_SUPPORTED` (bit 17), `FL_HOOK_SL_FEATURE_LOADED` (18) and
`FL_HOOK_SL_SET_FEATURE_LOADED` (19) are published with their patches.
- **And two counts** (the same release): bits 16..19 of word 1 are how many times the game allocated the feature's
resources (`slAllocateResources`), bits 20..23 how many times it freed them (`slFreeResources`) — each stops at
15 — and `slShutdowns` (@308, taken from the three reserved words that ended the `sl::Constants` line; two remain)
counts `slShutdown` calls, with `FL_ADV_VALID_SL_SHUTDOWN` (bit 6 of the mask) set once one was seen. All three
are a session's and a new request clears them. `FL_HOOK_SL_ALLOCATE_RESOURCES` (bit 20),
`FL_HOOK_SL_FREE_RESOURCES` (21) and `FL_HOOK_SL_SHUTDOWN` (22) are published with their patches.
- **Reflex latency words (train C; written by the Overlay since 0.1.0-beta.47; owner decisions D136, D138).** The
ten reserved words that ended the first line (@24..63) are `latState`, `latReads`, `latFrames` and seven sums:
simulation, render submit, present, driver, OS render queue, GPU render, and the total from simulation start to
GPU render end. **The layout is still 5**: no offset and no size moved, and the handshake's build id refuses a
mismatched pair before either side reads the other. Unlike every other group here they are **not what the game
passed to a call the Overlay hooks**: the Overlay makes a call of its own, about once a second, on the presenting
thread, to the driver's two read-only getters, through an `nvapi64.dll` the game had already loaded
(`17_HOOK_ENGINE` §Memory / latency). `latState`'s low byte is a `FlLatencyState` — no device, no module, refused
(a module in the executable's own folder, D140), no getter, reading, error, slow (D141), faulted, stalled — and
above it the driver's sleep status as switches *seen on* and *seen off* and the last frame-generation multiplier.
`latFrames` and the sums are **of the newest read not yet published** — zero when no read was made since the
publication before — so a reader divides one publication's sum by its frames and never adds publications up. A
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.
+14 -1
View File
@@ -873,7 +873,20 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
> call* (`Advanced_Status_InGame`): it is not a state of the PC. What became of those entries in one session is in
> that session's sources line on the Session tab (`Advanced_InGameLine` with `AdvInGame_*`): read, the game made none
> of the calls, or the session was not measured inside the game; a session stored before beta.40 has no such
> sentence.
> sentence. **Since 0.1.0-beta.43** a session measured inside the game has one more
> (`Advanced_InGameCallsLine` with `AdvInGameCall_*`): for what the game tells Streamline each frame and for how it
> configures FSR frame generation, each *read*, *hooked - the game did not make the call*, or *not hooked - the
> game did not load the library that has the call*. "Nothing here" then says which of the two it is.
> **Since 0.1.0-beta.44** one more (`Advanced_InGameFeatureCallsLine`): for which version each Streamline feature
> is and for what each requires, the same three — except that hooked and not seen reads *hooked - the game asks
> this while it starts, and did not ask again after FrameLedger attached* (`AdvInGameCall_NotAskedAgain`,
> `AdvancedLabels.InGameStartupCall`): the usual case, and not a finding about the game.
> **Since 0.1.0-beta.45** one more, and one only for six calls (`Advanced_InGameMoreCallsLine`,
> `AdvancedPresenter.MoreCalls`): *Streamline's other calls - read: …; hooked, the game did not make the call: …;
> not hooked: …*, each call under its own name (`slIsFeatureSupported`, a function's name and so not translated)
> in the group that is true of it, and the word for "none" where a group is empty. A session stored before has
> none of the six and no such sentence. The catalog's `sl.init.preferences` carries a reason of its own
> (`AdvReach_BeforeAttach`): *Not read: the game makes this call once, before FrameLedger is inside it*.
>
> **Words.** Every catalog entry, group, reason, source state and driver token is a `Strings.resx` key made from its own
> name (`Adv_<id>`, `AdvGroup_*`, `AdvReach_*`, `AdvSource_*`, `AdvToken_*`) in `en`, `vi`, `ja`; the English label of
+1 -1
View File
@@ -93,7 +93,7 @@ Tails the active files (shared read), level filter, text search, pause autoscrol
2. **Bundle builder** creates `FrameLedger-bugreport-YYYYMMDD-HHmm.zip` in a user-chosen location:
- `logs/` (last 7 days, redacted copies)
- `sysinfo.json` (app + agent + **overlay build id**, OS build, CPU/GPU name, driver version, telemetry source, Vulkan layer state, PawnIO present?, elevation state, locale)
- `overlay-<pid>-*.log` for the last hooked sessions, plus hook fault details and the ring's dropped/fault counters — these are what make injection bugs diagnosable at all. *(The file exists since 2026-09-06 — `17_HOOK_ENGINE` §Native logging: written at init, on the Agent's request at session end, and on the stop; `FAULT` lines carry the exception code and the hook's name, `UNHOOK_*` lines say per patch whether it was restored or left to a later hooker.)*
- `overlay-<pid>-*.log` for the last hooked sessions, plus hook fault details and the ring's dropped/fault counters — these are what make injection bugs diagnosable at all. *(The file exists since 2026-09-06 — `17_HOOK_ENGINE` §Native logging: written at init, on the Agent's request at session end, and on the stop — and since 0.1.0-beta.42 by the Overlay's watchdog whenever something new was logged, so it is whole after a game that simply exits, with each install named by module and symbol and each descriptor type an ffx module was handed; `FAULT` lines carry the exception code and the hook's name, `UNHOOK_*` lines say per patch whether it was restored or left to a later hooker.)*
- `settings.json` (sanitized — no paths)
- optional checkbox: last session metadata + aggregates JSON (never raw blobs by default)
- crash dumps included only when the user ticks the checkbox (size warning shown)
+1
View File
@@ -35,6 +35,7 @@ Targets:
- `hook-harness` → the dummy **D3D11 + D3D12** app, WARP + composition swapchain so it runs headless on CI (`17_HOOK_ENGINE` §Test harness). D3D12 is device → command queue → swapchain, which is the acquisition asymmetry a D3D11-only fixture cannot exercise. ~~Vulkan and OpenGL modes to follow as those hooks land.~~ **`--vulkan --hold-presenting N` since 2026-09-06 (P1 item 3):** a real swapchain on a hidden window through the real loader, reached by `LoadLibraryW("vulkan-1.dll")` so only the vendored headers are needed and CI (no loader) still builds it; exit 77 = cannot run here, which the ctest reads as SKIP. **`--opengl --hold-presenting N` since the same day (P1 item 4):** a real context on a hidden window, `SwapBuffers`'d through gdi32 as a title does, on Microsoft's generic renderer — so it runs on CI.
- `fl-probe-hookprofile` → build-profile probes for `/guard:cf` and `-D_HAS_EXCEPTIONS=0` (`20_OPEN_QUESTIONS` §H1/§H3)
- `fl-probe-guard` → measures the Windows APIs the guard is built on, unelevated (`spike-notes.md` §1). Not the guard, and takes no injection rights.
- `fl-probe-reflex` → the instrument of `spike-notes` §31 (2026-11-13, owner decision D132) — **since the owner said go (D136) it is built from the Overlay's own header, `FrameLedger.Overlay/include/fl_reflex.h`**, so its ctest runs the shipped call sequence with Control Flow Guard enforced; its `--real` also prints which image the two getter addresses lie in (`nvapi64_impl.dll`, not the `nvapi64.dll` that is asked). What it was written as: the call sequence Reflex route D would put into the Overlay — find `nvapi64.dll` only if the process already holds it, resolve the driver's two getters by interface id, call them — in an unshipped probe built with the Overlay's flags. `--stub` runs it against `fl_stub_nvapi64` → `nvapi64.dll` (a stand-in with knobs for a missing getter, an empty report, an error and a call that does not return; its outputs in a directory of their own, so that its `nvapi64.lib` is never beside the vendored one's name) and is ctest `fl_reflex_probe_stub`; `--real` runs it against the installed driver on an NVIDIA adapter, with the probe setting the latency markers a game would, in its own process — a measurement, never a test. It takes the vendored NVAPI headers' include directory and **does not link `nvapi64.lib`**. Nothing shipped includes its header.
- `fl_stub_sl_interposer` → `sl.interposer.dll`, and `fl_stub_sl_common` → `sl.common.dll` (`src/native/tools/vendor-stubs/`). **Fixtures, never shipped**, built under `FL_BUILD_TOOLS`; nothing `12_BUILD` publishes references them. They export the **measured** vendor names from `docs/vendor-exports.json` so the Overlay's symbol resolution is observable, and the second is a **decoy** exporting the same name from a different module — without it, "we resolve module-scoped" is a property no test can falsify. Their **output filenames are the vendor's and their version blocks are ours**: `fl_add_version_resource` takes the real filename so a file called `sl.interposer.dll` in our build tree still says plainly that it is FrameLedger's, which `19_SAFETY` requires of everything we build.
- `fl_stub_ffx_dx12` → `amd_fidelityfx_dx12.dll`, `fl_stub_ffx_upscaler` → `amd_fidelityfx_upscaler_dx12.dll`, `fl_stub_ffx_fg` → `amd_fidelityfx_framegeneration_dx12.dll` — the three AMD **leaves** — and `fl_stub_ffx_loader` → `amd_fidelityfx_loader_dx12.dll`, a **forwarding stand-in** bound to the two 2.x leaves through their FrameLedger-named *direct* entry — the way the real loader was measured to bypass the leaves' exports — so `--hold-presenting-ffx` can push every dispatch through a loader that is hooked along with the leaves and prove the count reads 1× (2026-09-04). Same rules as the Streamline stubs: fixtures, never shipped, vendor filenames with our version blocks. `fl_stub_ffx_fsr3_host` → `ffx_fsr3_x64.dll` (2026-09-05): the FSR 3.0 **host** facade, exporting the four names `SpeaksFsr3Host` probes for through the vendored `fsr3-v3.0.4` header's own `FFX_API`; `--ffx-topology fsr3host|fsr3host+mono` drives it, and `hookinventory-check` Pass C reads it as the export parser's second positive control.
- **`fl_fidelityfx_headers`** → an INTERFACE target over the five vendored FidelityFX ffx-api headers (`src/native/third_party/fidelityfx/`, tag v2.3.0, MIT by exception). Three include directories because upstream's headers include each other by relative path; include directories only and nothing to link — no `.lib` is vendored — and `hookinventory-check` Pass C reads the Overlay's export table because `ffx_api.h` declares its entry points `__declspec(dllexport)` unconditionally.
+4 -1
View File
@@ -357,7 +357,10 @@ from CI.
writes into the checkout, since the scanner walks all of it (`build/`, with the sources CMake fetches there, `out/`,
every `bin/` and `obj/`, `TestResults/`) — SonarCloud also drops what `.gitignore` names (the first run: "63 files
ignored because of scm ignore settings"), and the patterns say it in the file rather than rely on that; the same
duplication exclusions; C++20; UTF-8; the OpenCover paths; the compilation database;
duplication exclusions *(and, since 2026-11-12, `src/FrameLedger.Domain/Metrics/HookFamilies.cs`: the Domain's
mirror of `FlHookFamily`, the same enum twice by design and held together by `MetricEnumMirrorTests`. The six
members 0.1.0-beta.45 added to both were 3.7 % duplication on new code against the gate's 3 %, and failed the gate
on the release's commit with no issue open)*; C++20; UTF-8; the OpenCover paths; the compilation database;
**`sonar.cs.roslyn.ignoreIssues`** — Roslynator, Meziantou, the VS threading and the .NET
analyzers already gate the build, warnings as errors, and what they report at a lower severity is this project's
choice, so only SonarCloud's own rules are imported; and **two rules ignored where they apply by design** — `S8417`
+27
View File
@@ -31,6 +31,7 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
- **Record and header layout:** `static_assert(sizeof(...) == 64)` and `offsetof` assertions for `FlFrameRecord` **and all ~~three~~ ~~four~~ five header structs** *(five since layout 5, 2026-11-11: `FlAdvancedState`, 1472 bytes; what reads and writes it is tested at four levels since 0.1.0-beta.40 — `fl_adv_fields` the Overlay's header alone, `fl_guard` `[advanced]` the injected Overlay with the word off and on, `InGameAdvancedSamplerTests` / `CaptureSessionTests` / `SessionRecorderTests` what the Agent makes of a publication, and `AgentEndToEndTests.WhatTheGameTellsFsrIsStoredOnlyByASessionThatRecordsAdvancedMetrics` the shipped Agent, the real Overlay and the harness: two sessions of one target, the first storing nothing of it)* (`FlShmHandshake`, `FlWriterState`, `FlControlBlock`, and `FlDisplayState` since layout 4, beta.10) — plus D33's `FlTolerance`, mirrored the same way *(corrected 2026-10-04)* — the Agent reads across the process boundary in every one of them. Both halves exist as of 2026-08-05: the native side is `layout_test.cpp` plus the `static_assert`s (ctest `fl_shm_layout`), and the runtime offset dump from `tools/fl-layout-dump` is consumed by `ShmLayoutMirrorTests`, which walks the field list in **both directions** and additionally asserts blittability — `Marshal.SizeOf` and every offset stay correct for a mirror that uses `[MarshalAs(ByValTStr)] string`, while `Unsafe.SizeOf` drops from 64 to 40 and the struct can no longer be read from a mapped view.
- **Fault policy:** injected SEH faults in a fake hook body → counter increments, original still called, self-disable at 3.
- **Hook index verification, by behaviour.** A vtable slot carries no identity, so "check that slot 8 *is* `Present`" is not a question the runtime can answer — the earlier wording here required something unimplementable. What is answerable: patch the slot, call the method, see whether the detour ran (`17_HOOK_ENGINE` §Getting vtable addresses; proved for slots 8, 13 and 22 in `spike-notes.md` §H4). Runs headless on CI via WARP and `CreateSwapChainForComposition`. A deliberate mismatch aborts installation instead of patching.
- **A run that was cut short is not a pass** (2026-11-13). ctest calls a test passed when its process exits with 0, and on that day the development PC's security software removed a freshly linked `fl_guard_test.exe` while the gate ran: ctest printed `fl_guard ... Passed 0.66 sec` for a suite that takes three minutes, and the gate went red only because the next test runs the same executable and could not find it. So **every native test now names the line it ends on** — `fl_test_completes(<test> <regex>…)`, or `fl_catch2_test_completes(<test>…)` for a Catch2 executable (its `All tests passed (` line, or its summary row when a case was skipped, and never a row that names a failure) — and ctest requires that line (`PASS_REGULAR_EXPRESSION`; the helpers and the reasons are in `src/native/CMakeLists.txt`, above `enable_testing()`). Three things hold it: **the configure fails** when a test in `tests/` or `tools/` was registered without one (tried: a test added bare stops CMake with its name); **four canary tests** print what a Catch2 run would — nothing, its last line, a row with a skipped case, a row with a failure beside "passed" — through the same helper, and the two that must be red are `WILL_FAIL`; and the tests that were passing on a line printed in the *middle* of their run (`fl_nvapi_bridge`, `fl_process_stats`, `fl_nvapi_probe`, `fl_signer_probe`) now need that line and, after it, their last one. For `fl_nvapi_probe` this also closes what `fl_nvapi_bridge` was fixed for on 2026-09-25: a pass expression makes ctest ignore the exit code, so a run that printed its branch and then `FAILED` passed. `fl_signer_probe` accepts either ending — its criterion was always that the answers are printed. A `SKIP_RETURN_CODE` still wins over a missing line. **Not covered**: the managed tests (`dotnet test` reports a host that died) and a process that is stopped *after* printing its last line.
- **Every probe must be shown to fail.** A probe that ends in an unconditional assertion is green by construction and its ctest is decorative — `fl_proxy_swapchain` shipped in exactly that state. Before a probe counts as a regression net, break the thing it watches and watch it go red.
## Managed unit tests
@@ -158,6 +159,32 @@ own work item on the STA thread and puts back — and with the keys a parameter,
> Until the run happens, the honest state of this line is *unmeasured*, not *passing*.
3. Results recorded in the release notes ("measured overhead this release: …").
**What a patch costs when it goes in and comes out (since 0.1.0-beta.46) is not the per-present number above**, and
is measured where it happens: `fl_guard`'s Streamline `[advanced]` case prints the microseconds of each install
batch and of the stop's one restore (the Overlay's `PATCH_BATCH` lines), and the time from the unhook request to
`UNHOOKED`; it asserts that every lazily installed patch is under a batch line, that the stop is one, and that the
restore stays under a second — the bound the one-patch-at-a-time stop did not meet on the development PC. In a real
game the same lines are in `logs\overlay-<pid>-….log` — read there on 2026-11-13 for five games: eighteen install
batches, 81–262 ms for sixteen of them and 0.61 s and 1.26 s for two (`17_HOOK_ENGINE` §Unhooking, *Batches*); and
on 2026-11-14 two restores of twenty-nine patches each, 83 ms and 86 ms, when the owner stopped the part inside a
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 — 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
received call; an error; a span not reported; the request off; a second session; the stop; a call of 50 ms (the
last one); a fault (counted once, the hooks stay); a module without the getters; no module (none is loaded); a
module beside the executable (refused, never asked); Direct3D 11 (not read). `fl_reflex_probe_stub` runs the same
header, `fl_reflex.h`, in a process that **enforces Control Flow Guard** — the injected cases do not: `hook-harness`
is not a CFG image. **None of them is a driver.** `fl-probe-reflex --real` is the measurement against the installed
one, run by hand (`spike-notes` §31), and a real game is owner-only item 45.
## Tier cross-validation (accuracy regression net) — **GONE, 2026-08-28, and this is the entry to read before planning P5**
~~Run the same game session with Tier 1 and Tier 2 simultaneously where possible (ETW does not conflict with hooking) and compare frametime distributions: Avg/1% Low must agree within **1%**. Divergence beyond that means one of the two paths is wrong and blocks the release. This is also the check that would have caught the original detection-accuracy problem.~~
+228 -11
View File
@@ -172,6 +172,54 @@ Every hook must be listed here with a purpose. Anything not on this list is not
| ✅ `opengl32.dll!wglSwapBuffers` (2026-09-06, P1 item 4) | The OpenGL present hook (§Presentation). A system module, not a vendor one, so — like the row below — it is deliberately **not** in `FL_HOOK_INVENTORY` and `hookinventory-check` does not cover it; listed here so the table above and these two rows together are the whole inventory |
| ✅ `kernelbase.dll!LoadLibraryExW` (2026-09-06, P1 item 1) | The wake for lazily loaded runtimes and the in-process anti-cheat stop — §DLL entry step 3 above carries the mechanism. **Rule 4:** it reads one argument the API was given (`flags`) and one property of a handle the loader just returned to *its own caller* (the module file name); nothing of the game's. **~~It is the only hook on a system module, and~~ Like `wglSwapBuffers` above it, it is deliberately not in `FL_HOOK_INVENTORY` (corrected 2026-10-04):** that table is *vendor* symbols resolved by name and gated by `hookinventory-check` against `vendor-exports.json`, and `LoadLibraryExW` is neither vendor nor uncertain. It is listed here instead so the table above and this row together are the whole inventory. It **never** installs, uninstalls or patches anything itself (§H2) |
### Calls the Overlay makes into a driver — not hooks, and the only ones
Everything else on this page learns what it learns from the arguments of a call the game made. This is the one
place the Overlay **makes a call of its own** into code that is neither the game's nor FrameLedger's, and it is
listed here so that nobody takes it for a hook or adds a second one without the same ruling
(`CLAUDE.md` rule 4's note of 2026-11-13, owner decisions D132, D136, D138–D141).
| Call | When, where | Rule 4 | What bounds it |
|---|---|---|---|
| **NVIDIA's `NvAPI_D3D_GetLatency` and `NvAPI_D3D_GetSleepStatus`** — the driver's two read-only latency getters (Advanced metrics train C; `fl_reflex.h`; **since 0.1.0-beta.47**) | **Only while a session asks for Advanced metrics** (D138: no switch of its own), only for a Direct3D 12 swap chain whose device is the one the Overlay holds, **about once a second, on the presenting thread, after that present's record is published**. The watchdog finds the addresses once for the process and arms one read at a time; a present pays one relaxed load. The addresses come from an `nvapi64.dll` **the game had already loaded** — asked for by name, never loaded — through its `nvapi_QueryInterface` and the two interface ids of the vendored `nvapi_interface.h`. The Overlay links no NVAPI | The owner's ruling (D132): a driver's read-only getter called with the device behind the swap chain the Overlay hooks reads the driver's report, not game memory, and writes nothing. Getters only — never a setter, a marker or a sleep (`tools/nvapi-readonly-check.ps1` holds which ids code loaded into a game may name: these two). What is read of the two structs is on `tools/overlay-allowed-fields.txt` like every other vendor member | **An `nvapi64.dll` in the executable's own folder is refused** (D140): the driver's is in Windows' directories. **A fault** in a getter is caught by a guard of its own, counted once in `faultCount`, and ends the reads for the process. **One call of 2 ms or more** ends them too (D141). **A call that has not returned after two seconds** is logged, flushed and published as stalled — nothing can stop it, and the presenting thread it holds is the game's. Each is until the game exits |
**Where the addresses are, measured** (`fl-probe-reflex --real`, driver 32.0.16.2114): System32's `nvapi64.dll` is a
shim and answers the two ids with addresses inside **`nvapi64_impl.dll`**, in the driver's own store. So an address
is accepted when it is executable code of an image the process has loaded, and **the Overlay keeps a reference on
that image as well as on `nvapi64.dll`** — two modules the game loaded, never released, for the reason
`ResolveScoped` gives: a presenting thread may be about to call. `nvapi64_impl.dll` is a Control Flow Guard image;
the probe, which enforces CFG, has made the calls from the header that ships, so on this driver the getters are
valid targets. **Not excluded**: a game that enforces CFG on a driver the probe has not been run against — a target
that were not valid is a fast-fail no guard catches.
**In a real game** (the owner, 2026-11-14, Phantom Blade Zero on 0.1.0-beta.47, three sessions, frame generation
×3 and off): the module was found four to five seconds after the attach — `nvapi64.dll` in System32, the getters in
`nvapi64_impl.dll`, as on the probe — a read was made about every second for 344 s, 52 s and 1 119 s, **the slowest
call took 24, 20 and 45 µs**, and no latch fired: no error, no slow call, no fault, no stall. **Cyberpunk 2077 the
same morning**, two sessions (frame generation ×2 and off, 260 s and 581 s): found 4.8 s and 2.6 s after the attach,
the slowest call 34 and 65 µs, no latch. Two Direct3D 11 games and one Direct3D 12 game with no `nvapi64.dll` were
left alone, each with its one line. Two games read, one driver.
**Two more members of the same report, and the multipliers seen (0.1.0-beta.48; owner decisions D142, D144).** In
Phantom Blade Zero the span between the driver's two GPU marks was longer than the frame's whole: it includes the
card's waiting. NVIDIA's header has the figure that does not — `gpuActiveRenderTimeUs`, "excluding the idles in
between" — and beside it `gpuFrameTimeUs`, one frame's GPU end to the next's. Both are read from the report the
getter already filled: **no call is added, and no interface id** (`tools/nvapi-readonly-check.ps1` is unchanged;
the two names are on `tools/overlay-allowed-fields.txt`). The buffer is the Overlay's own, so there is no question
of a member lying past what a game allocated; an older driver leaves both zero, and zero is read as *not given* —
each time has its own count, and neither decides which frames the seven spans are made of. The sleep status'
frame-generation multiplier is now also kept as the set of values a session saw (a session that generated ×2 and
ended in a menu read 1). **One defect fixed with it**: a read that ended after a session's last tick was taken by
the next session as its first point; a new request now drops it. **Measured** (the header's own function, the
Overlay's flags, a report of 62 summed frames, 2 million reports × 3, twice): 393–396 ns before, 429–434 ns after
— **+36 ns a read**, once a second, and after the call's time has been taken, so it cannot reach the 2 ms latch.
The present path is unchanged: one relaxed load.
**The gate.** One word, four states — idle, armed, reading, off (`dllmain.cpp`, above `ReadLatencyOnce`). Only the
watchdog arms; a presenting thread takes *armed* to *reading* by compare-exchange and owns the 15.4 KB report
buffer (static storage, never a game thread's stack) and the read's result until it stores *idle* or *off*; the
watchdog takes the result only when nobody is reading. No lock, and no second read while one is under way.
### Watchdog observations — not hooks, and listed here so nobody mistakes them for one
| Observation | Mechanism | Rule 4 | Why |
@@ -194,12 +242,17 @@ Every hook must be listed here with a purpose. Anything not on this list is not
|---|---|
| NGX: `NVSDK_NGX_D3D11/D3D12/VULKAN_CreateFeature`, `EvaluateFeature`, `ReleaseFeature` | Which NGX feature is *actually created and evaluated per frame*: SuperSampling (DLSS), RayReconstruction (DLSS-D), FrameGeneration (DLSS-G) |
| NGX parameter accessors (`NVSDK_NGX_Parameter_SetI/GetI/SetUI`) — **exported by `sl.common.dll` only; see below** | `Width`/`Height` (render) vs `OutWidth`/`OutHeight` (output), `PerfQualityValue` (quality preset), sharpness |
| ✅ Streamline: `slEvaluateFeature` · ⏳ `slInit`, `slSetFeatureLoaded`, `slSetConstants`, `slGetFeatureRequirements` | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`; since beta.34 `kFeatureDLSS_NR` — DLSS 5's neural rendering, its own fact bit and family `FL_HOOK_SL_NEURAL_RENDERING`, D84; rule 4: the `feature` argument of the API hooked, nothing else). **Built 2026-08-09**, identity only: one MinHook detour on `sl.interposer.dll!slEvaluateFeature`, resolved **module-scoped** and installed lazily by the watchdog. Sets `FL_MEASURED_UPSCALER` + `FL_HOOK_UPSCALER_IDENTITY`; decodes `kFeatureDLSS`/`kFeatureNIS` and reports `FL_UPSCALER_UNKNOWN` for anything else. **Never `FL_UPSCALER_NONE`** — a Streamline-only writer cannot see FFX, XeSS or NGX-direct, and `NONE` is the only one of the three states that may be aggregated as a negative. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks** (`FlControlBlock.advancedRequested`): the `sl::DLSSOptions` a title chains into `inputs` — the struct the quality mode is read from — is read further: `outputWidth`/`outputHeight`, `preExposure`, `exposureScale`, `colorBuffersHDR`, the five presets of version 1, and where the struct's own `structVersion` proves them present `ultraQualityPreset` and `useAutoExposure` (≥ 2) and `alphaUpscalingEnabled` (≥ 3) — §Which struct version carries which field. Rule 4: more members of the same argument of the same call; `fl_adv_fields.h` is the one place, `tools/overlay-fields-check.ps1` holds it. No new patch site. **Measured** (the header's own functions, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3): +9.5–11.7 ns per evaluation that chains the options while asked; with the word at 0, one relaxed load and a branch not taken — below what the bench resolves. Most titles set these through `slDLSSSetOptions`, which is not an export, and read N/A (train D) |
| ✅ Streamline: `slEvaluateFeature` · ~~⏳ `slInit`~~ *(not hooked, and not to be: owner decision D129, 2026-11-12 — its row below says why)*, ~~`slSetFeatureLoaded`~~ *(its own row below since beta.45)*, ~~`slSetConstants`~~ *(its own row below since beta.43)*, ~~`slGetFeatureRequirements`~~ *(its own row below since beta.44, with `slGetFeatureVersion`)* | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`; since beta.34 `kFeatureDLSS_NR` — DLSS 5's neural rendering, its own fact bit and family `FL_HOOK_SL_NEURAL_RENDERING`, D84; rule 4: the `feature` argument of the API hooked, nothing else). **Built 2026-08-09**, identity only: one MinHook detour on `sl.interposer.dll!slEvaluateFeature`, resolved **module-scoped** and installed lazily by the watchdog. Sets `FL_MEASURED_UPSCALER` + `FL_HOOK_UPSCALER_IDENTITY`; decodes `kFeatureDLSS`/`kFeatureNIS` and reports `FL_UPSCALER_UNKNOWN` for anything else. **Never `FL_UPSCALER_NONE`** — a Streamline-only writer cannot see FFX, XeSS or NGX-direct, and `NONE` is the only one of the three states that may be aggregated as a negative. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks** (`FlControlBlock.advancedRequested`): the `sl::DLSSOptions` a title chains into `inputs` — the struct the quality mode is read from — is read further: `outputWidth`/`outputHeight`, `preExposure`, `exposureScale`, `colorBuffersHDR`, the five presets of version 1, and where the struct's own `structVersion` proves them present `ultraQualityPreset` and `useAutoExposure` (≥ 2) and `alphaUpscalingEnabled` (≥ 3) — §Which struct version carries which field. Rule 4: more members of the same argument of the same call; `fl_adv_fields.h` is the one place, `tools/overlay-fields-check.ps1` holds it. No new patch site. **Measured** (the header's own functions, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3): +9.5–11.7 ns per evaluation that chains the options while asked; with the word at 0, one relaxed load and a branch not taken — below what the bench resolves. Most titles set these through `slDLSSSetOptions`, which is not an export, and read N/A (train D) |
| ✅ Streamline: `slSetConstants` (0.1.0-beta.43, Advanced metrics train B; owner decisions D111–D116, D122) | **What the game tells Streamline about a frame**, once per frame and viewport, read from the `sl::Constants` it passes — rule 4: an argument of the call hooked, and of it only the members named here. **Read:** `jitterOffset`, `mvecScale`, `cameraNear`, `cameraFar`, `cameraFOV`, `cameraAspectRatio` and the seven `Boolean`s (`depthInverted`, `cameraMotionIncluded`, `motionVectors3D`, `reset`, `orthographicProjection`, `motionVectorsDilated`, `motionVectorsJittered`). **Never read:** the five matrices (bytes 32..351 of the struct), `cameraPinholeOffset`, and the camera's position and three axes (bytes 368..423) — `tools/overlay-fields-check.ps1` refuses their names anywhere in code loaded into a game, and ctest `fl_adv_fields` publishes two structs that differ in every one of those bytes and gets the same bytes out. **The one row that is not installed unless asked for** (D111): `InstallByFamily` returns before it resolves the symbol in a process the Agent has never asked for Advanced metrics — resolving takes a reference on the module — so with the option off the export's first bytes are the file's (`fl_guard` `[advanced]` reads them from the target). Once asked, the patch goes in on that watchdog tick and stays for the life of the process; the detour forwards without looking while the request is off, and after a stop (`MayObserve`). **Every call** checks the struct's GUID and a `structVersion` of at least 1 before any member is read, and the viewport handle's the same way; every member read is one version 1 carries, so a version-1 struct laid against unreadable memory is read whole without a fault (the same ctest). **Summaries are the first viewport's**: a title with two viewports sets constants for each every frame, and "the last value" across them would flip twice a frame; the call count is of every viewport. `FLT_MAX` is Streamline's "not set" here and is kept nowhere (D119's plane at infinity is FidelityFX's). Family `FL_HOOK_SL_CONSTANTS` (bit 13), published with the patch: it entitles no field of a frame record, and tells "hooked, never called" from "not hooked". **Measured overhead** (the detour's body on the headers, the Overlay's flags, 20 million calls a run, three runs): not asked **+0.57 / +0.60 / +0.58 ns**; asked, the summarised viewport **+19.61 / +19.54 / +19.79 ns**; asked, another viewport +5.83 / +6.01 / +5.62 ns. |
| ✅ Streamline: `slGetFeatureVersion` and `slGetFeatureRequirements` (0.1.0-beta.44, Advanced metrics train B's third step; owner decisions D111–D116, D122) | **What Streamline answers when the game asks about a feature** — which version it is, and what it requires. Two rows, two patches, two detours of one shape: **the original runs first, exactly once, on every path, with both arguments forwarded untouched**, and the struct the game passed is read only when the original said `eOk` — a refusal leaves the struct as the game made it, which is not an answer. Rule 4: an argument of the call hooked, read after the call, and of it only the members named here. **Read from `sl::FeatureVersion`:** `versionSL`, `versionNGX`. **Read from `sl::FeatureRequirements`:** `flags`, `maxNumCPUThreads`, `maxNumViewports`, `numRequiredTags`, `osVersionDetected`, `osVersionRequired`, `driverVersionDetected`, `driverVersionRequired`. **Never read:** `requiredTags` — the pointer the count belongs to — and everything after `driverVersionRequired`: the Vulkan queue counts and the pointers to the names of extensions and features. **No pointer of the game's is followed** (`tools/overlay-fields-check.ps1`, parameters `fv` and `fr`; ctest `fl_adv_fields`: two answers that differ only in those bytes publish the same region, and an answer cut off where the Vulkan members begin, laid against unreadable memory, is read without a fault; the injected `fl_guard` case's stub hands back wild pointers and no fault is counted). **Installed only where asked for** (D111), as `slSetConstants` is: `InstallByFamily` returns before it resolves either symbol in a process the Agent has never asked for Advanced metrics; once in, a patch stays for the life of the process and its detour forwards without looking while the request is off. **They are the first two rows of the table**: a game asks these while it starts, the watchdog patches rows in the table's order, and each patch stops the game's threads for a moment (0.1–0.25 s apart in the owner's logs of 2026-11-12, where `slSetConstants` was the fifth Streamline patch in, 1.9–7.8 s after the attach). *(Since 0.1.0-beta.46 the rows a tick finds go in together, under one stop of the threads — §Unhooking, Batches — so the order no longer decides which row waits behind which; it is still the order of their log lines.)* In a process never asked they are passed over and the order changes nothing. ~~**Most sessions will still have missed the calls** — an attach after the game's start-up is the usual case — and the session then says the call was hooked and the game did not ask again.~~ *(Measured 2026-11-12, the owner's eight sessions on beta.44: both calls were read in six of six Streamline sessions on five games — Unreal's Streamline plugin asks again after the attach, Cyberpunk 2077 asks again for requirements and not for versions. A game that asks only while starting still reads "hooked, not asked again".)* Three conditions before a read, as for `slSetConstants`: the Agent is asking, observing has not stopped, and the struct carries its own GUID and a version of at least 1 on this call (a struct with another GUID is not kept: the injected case sends one). Every member read is version 1's (§Which struct version carries which field). **Twelve slots** in region 5 (`FlAdvancedState.features`, layout 5 as it was), one per feature in the order first asked about; the last answer about a feature is the one kept; a thirteenth feature is not kept. **A new request does not empty them**: what version a feature is and what it requires are facts about the process, and a second session of a game that kept running would otherwise have nothing where the first had the answer — the one group `Reset` leaves, with its bit of the mask. Streamline 1.x is refused before anything is resolved (`SpeaksStreamline2`). Families `FL_HOOK_SL_FEATURE_VERSION` (bit 15) and `FL_HOOK_SL_FEATURE_REQUIREMENTS` (bit 16), each published with its patch; neither entitles a field of a frame record. **Measured overhead** (the detours' bodies on the headers, the Overlay's flags, 20 million calls a run, three runs, eight features asked about in turn): the version — not asked **+0.58 / +0.61 / +0.58 ns**, asked **+14.82 / +14.54 / +14.47 ns**; the requirements — not asked **+0.58 / +0.63 / +0.61 ns**, asked **+20.88 / +21.01 / +20.96 ns**. A game makes these calls a handful of times. |
| ✅ Streamline: `slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded` (0.1.0-beta.45; owner decisions D129–D131) | **Whether a feature is supported, whether it is loaded, and the game switching it on and off.** Three rows, three patches. Rule 4: bare arguments and results of the calls hooked, and no vendor struct at all — the feature's id; the `sl::Result` `slIsFeatureSupported` returned, **every result**, since a refusal is the answer to that question (the original runs first, both arguments forwarded untouched); the `bool` `slIsFeatureLoaded` wrote, read only when it returned `eOk`; the `bool` the game passed to `slSetFeatureLoaded`, noted before the call. **The adapter `slIsFeatureSupported` is asked about is never read** (D131): `sl::AdapterInfo` holds the adapter's LUID or a Vulkan physical device; the detour forwards the reference and `tools/overlay-fields-check.ps1` refuses the names of its members (`deviceLUID`, `deviceLUIDSizeInBytes`, `vkPhysicalDevice`) anywhere in the Overlay and the Vulkan layer — the fixture's adapter carries a wild pointer. **Installed only where asked for** (D111), as the four rows before them. `slIsFeatureSupported` and `slIsFeatureLoaded` follow the two rows of beta.44 at the head of the table; `slSetFeatureLoaded` follows `slSetConstants`. **Kept in word 1 of the feature's slot** (region 5, layout 5 as it was): bit 2 and the result in bits 8..15, bits 3 and 4, bits 5 and 6 — the last two a session's, cleared by a new request; the rest the process's, kept (`fl_adv_fields.h` `kFeatureSessionBits`). A refused feature therefore has a slot now, with nothing in it but that word. The declarations of the three functions are the same from Streamline v2.0.0 to v2.14.16, and `sl::Result` is the same forty codes in the same order at all sixteen tags (`include/sl_result.h`, `05a3c7e3889c` … `8a844b68ff55`), so a code means the same whatever interposer answered. Families `FL_HOOK_SL_FEATURE_SUPPORTED` (bit 17), `FL_HOOK_SL_FEATURE_LOADED` (18), `FL_HOOK_SL_SET_FEATURE_LOADED` (19), each published with its patch. **Measured overhead** (the detours' bodies on the headers, the Overlay's flags, 20 million calls a run, three runs, eight features in turn): `slIsFeatureSupported` — not asked **+1.50 / +1.48 / +1.50 ns**, asked **+11.97 / +11.98 / +12.08 ns**; `slIsFeatureLoaded` — **+1.79 / +1.77 / +1.89 ns**, **+12.35 / +12.31 / +12.33 ns**; `slSetFeatureLoaded` — **+1.44 / +1.47 / +1.80 ns**, **+11.28 / +11.54 / +11.45 ns**. **`slInit` is not a row and will not be** (D129): a game calls it once, before the Overlay is in the process or before a patch can land — launch mode waits for the presentation runtime before it injects, nothing is ever patched on a game's thread (§H2), and a row that exists only for Advanced metrics waits for the Agent's request. **A stop takes about 160 ms for every patch it restores** (measured on the fixture, 0.1.0-beta.45: each `MH_DisableHook` snapshots the system's threads): twelve patches took 1.9 s, fifteen 2.4 s, and the watchdog's wait for the stop's log lines, 2 s until then, is now a quarter of a second for every patch the registry can hold. **Since 0.1.0-beta.46 (D134) a stop restores its patches under one stop of the threads**: eighteen in 76–90 ms on the fixture, where one by one they took 1.37–1.56 s (§Unhooking, Batches). |
| ✅ Streamline: `slAllocateResources`, `slFreeResources`, `slShutdown` (0.1.0-beta.45; owner decision D130) | **The game allocating and freeing a feature's resources, and shutting Streamline down — counted, and nothing else.** Three rows, three patches. Rule 4: the feature's id is the only argument looked at; the command buffer and the viewport of the two resource calls are forwarded and never read (the fixture's command buffer is a wild pointer), and `slShutdown` has no argument. **`slFreeResources` and `slShutdown` are on a game's way out**: each detour notes the call first and then calls the original, exactly once, and runs nothing of ours after it returns; the fixture goes on calling the stub after `slShutdown`, through every detour. **Installed only where asked for** (D111); the last three Streamline rows of the table. **Kept** in word 1 of the feature's slot as two four-bit counts — allocations in bits 16..19, frees in 20..23, each stopping at 15 and never carrying into its neighbour — and, for `slShutdown`, in `FlAdvancedState.slShutdowns` (@308, the first of three reserved words; layout 5 as it was) with `FL_ADV_VALID_SL_SHUTDOWN` (bit 6 of the mask). All three are a session's: a new request clears them. Families `FL_HOOK_SL_ALLOCATE_RESOURCES` (bit 20), `FL_HOOK_SL_FREE_RESOURCES` (21), `FL_HOOK_SL_SHUTDOWN` (22). The three declarations are the same from Streamline v2.0.0 to v2.14.16. **Measured overhead** (the detours' bodies on the headers, the Overlay's flags, 20 million calls a run, three runs): `slAllocateResources` — not asked **+0.70 / +0.72 / +0.80 ns**, asked **+10.43 / +10.53 / +10.74 ns**; `slFreeResources` — **+0.61 / +0.84 / +0.58 ns**, **+10.33 / +10.57 / +10.44 ns**; `slShutdown` — not asked within the bench's noise (+0.06 / −0.12 / +0.04 ns), asked **+3.39 / +3.37 / +3.52 ns**. Inventory 23 → 26 rows; a Streamline title with Advanced metrics asked for now carries thirteen patches on the interposer, and a stop restores each in about 160 ms (the row above). **In real games (2026-11-13: six sessions, five games)** `slAllocateResources` was not called once after the attach, `slFreeResources` once in one game (Phantom Blade Zero, frame generation's) and `slShutdown` once in one (Dying Light: The Beast); no session counted a fault, and the two games that fault while closing did so at the offsets they had before these hooks. Installing the thirteen interposer patches took 0.7 s to 2.8 s of a game's start, 57 to 215 ms a patch. The owner's word on both (2026-11-13): `slAllocateResources` keeps its patch and is looked at again with more sessions (D135); installs and restores are to be batched, one stop of the threads for a batch (D134, 0.1.0-beta.46). |
| ✅ Streamline: `slSetTag` — **and, since 2026-09-05, every tag's TYPE** (`slTagCensus`; a HUD-less / UI tag marks the present `FL_FG_DLSS_G`, rule 4: the same argument) | The **global** resource tags, where a title states the size of the buffer it is upscaling *from*: `kBufferTypeScalingInputColor`'s extent → `renderW/H` — **or, since 2026-09-05, the size the tagged `sl::Resource` declares when the extent is zero** (`TagSize` in `fl_sl_inputs.h`, shared by all three tag routes; GUID-checked; a Resource declaring no size is still the honest unknown). **Built 2026-08-15** (`FL_HOOK_UPSCALER_PARAMS`), and it is an ALTERNATIVE to the local tags in `slEvaluateFeature`'s `inputs`, not a layer over them — `sl_core_api.h:258` says global and local tags "do NOT interact", so a title using one yields nothing from the other and both are read. Published only on a frame where an evaluation was also seen, because a tag is viewport state that outlives any one frame. This row was MISSING from this table while the hook shipped, which is the gap the banner above now names |
| ✅ Streamline: `slSetTagForFrame` — **and every tag's TYPE, as above** | The same global tags through **Streamline 2.8's frame-based entry point**, which deprecates `slSetTag`: `(const FrameToken&, const ViewportHandle&, const ResourceTag*, uint32_t, CommandBuffer*)` — the token first, then exactly `slSetTag`'s list, handed to the same tag walk. **Built 2026-09-04** (`FL_HOOK_UPSCALER_PARAMS`, its own trampoline; the family is now **published when whole** — once every tag export the loaded interposer has is patched — because publishing on the first row entitled records the second was not yet producing, 38 of 41 on the fixture: the ffx leaves' #110 defect again, fixed the same way). Measured need: Dying Light: The Beast (SL 2.8.0) published `Dlss` identity on every batch and the params bit on none across three captures, because a 2.8 title that tags per frame never calls the deprecated export. The token is not read; the frame count stays with `slGetNewFrameToken`. The installer picks this detour by SYMBOL (`kSymbolSlSetTagForFrame`, bound to the row by `static_assert`), not by family, since the two rows share a family bit and differ in signature |
| ✅ **FidelityFX ffx-api: `ffxDispatch` on the FOUR modules a game calls** — `amd_fidelityfx_dx12.dll` (SDK 1.1.x monolith), `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, **and `amd_fidelityfx_loader_dx12.dll`** (added the evening of 2026-09-04: three loader-shipping titles at FSR produced zero dispatches at any leaf export, so the loader is where their calls arrive) · ⏳ FSR 3.0 host route `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` / `ffxFsr3DispatchFrameGeneration` · ~~`ffxFsr2ContextCreate`~~ · ~~`ffxCreateContext`~~ | **Built 2026-09-04** (`HANDOFF` item 7c). One observer behind three trampolines reads the DESCRIPTOR the title passed — head type first, body only after the type matched a constant from the vendored MIT headers (`third_party/fidelityfx/`, tag v2.3.0): **UPSCALE** → identity (`FSR3` from the monolith, `FSR_UNVERSIONED` from the 2.x upscaler DLL, which hosts FSR 3.1 and FSR 4 behind one type) + `renderSize` → `renderW/H` (quality and sharpness `0xFF`: the dispatch carries neither — *since beta.25 the quality byte is the mode the `ffxQuery` row below names for the dispatched size, `0xFF` when none does*) + one COUNT; **PREPARE / PREPARE_V2** → `frameID` counted on a *new* index only — this vendor's `slGetNewFrameToken`, the `fgEvaluations` producer once a title has ever prepared, with the UPSCALE count as the fallback for a title that never does; **FRAMEGENERATION** → `fgMode = FSR_FG` on that present. Rule 4: the argument of the API we hooked, never `context`, `pNext`, a command list or a resource. **Why all four:** a UE5 title ships the two leaves with no loader and calls their exports; a loader-shipping title calls the loader's export and the signed loader reaches its providers through an object, not the leaves' exports (measured: Dying Light: The Beast, KCD2, Wukong). The morning's "never the loader" rested on the export tables alone and was reversed by the run. What guards against a loader that DID re-enter a leaf's export is the K = 1 control with all four hooked and the consumer's `frames/upscale-drained`, both of which read 2× in that case. `ffxCreateContext` is deliberately NOT a row — nothing it carries fills a field the dispatch does not, and its honest family would collide with `slEvaluateFeature`'s under the installer's equality binding. The family is compound (`IDENTITY \| PARAMS \| FG_EVALUATIONS`), pinned by `static_assert`s that also bind the leaf table to the rows both ways and refuse the loader as a row. Streamline keeps precedence for the count once it has ever issued a token, so every §S31-validated title is byte-identical. Second count: the consumer prints `frames/upscale-drained`, the AMD `tokens/batch`. **FSR 3.0 — BUILT 2026-09-05 as a fifth AMD target:** `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` (Cyberpunk's copy; named export, its own descriptor, vendored from tag **`fsr3-v3.0.4`** — the tag whose twelve `ffxFsr3*` declarations match the shipped module, not the `v1.1.4` first named). Rule 4: the detour reads `renderSize` of the descriptor the title passed and nothing else — never the context, a resource or the command list; the offset is pinned to a literal (1256) so a re-vendoring that moved it fails to compile. Same family and publish point as the four rows (`PublishFfxFamilyIfWhole` waits for a loaded host too), keyed by module in the installer; identity `FSR3` as a fact. `ffxFsr3DispatchFrameGeneration` is deliberately not a row (§H11 carries the reversal condition); the `ffx_fsr3upscaler_x64.dll` leaf is the pre-committed alternative if the facade reads silent (row B2) — never both, or `frames/upscale-drained` reads 2.00. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks:** the UPSCALE arm reads the rest of `ffxDispatchDescUpscale` — `enableSharpening`, `sharpness`, `jitterOffset`, `preExposure`, `cameraNear`, `cameraFar`, `cameraFovAngleVertical`, `flags`, `reset`, `frameTimeDelta` — into process-local summaries (an "ever seen" mask, a largest magnitude, a lowest and highest, a count and a sum; one module's dispatches are counted, so a dispatch that reaches the loader and a leaf is one). Never on the FSR 3.0 host's legacy descriptor, which is vouched for through `renderSize` and no further; never a PREPARE descriptor's camera arrays (`tools/overlay-fields-check.ps1` refuses their names anywhere in the Overlay). `cameraNear`/`cameraFar`/`cameraFovAngleVertical` are the depth range and the field of view, not where the camera is; the field of view is kept as a session's range, never a series (D114). **Measured** (as the row above): +22–23 ns per UPSCALE dispatch, i.e. per application frame, while asked; ≤ 0.7 ns, inside the bench's noise, with the word at 0 |
| ✅ **FidelityFX ffx-api: `ffxDispatch` on the FOUR modules a game calls** — `amd_fidelityfx_dx12.dll` (SDK 1.1.x monolith), `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, **and `amd_fidelityfx_loader_dx12.dll`** (added the evening of 2026-09-04: three loader-shipping titles at FSR produced zero dispatches at any leaf export, so the loader is where their calls arrive) · ⏳ FSR 3.0 host route `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` / `ffxFsr3DispatchFrameGeneration` · ~~`ffxFsr2ContextCreate`~~ · ~~`ffxCreateContext`~~ | **Built 2026-09-04** (`HANDOFF` item 7c). One observer behind three trampolines reads the DESCRIPTOR the title passed — head type first, body only after the type matched a constant from the vendored MIT headers (`third_party/fidelityfx/`, tag v2.3.0): **UPSCALE** → identity (`FSR3` from the monolith, `FSR_UNVERSIONED` from the 2.x upscaler DLL, which hosts FSR 3.1 and FSR 4 behind one type) + `renderSize` → `renderW/H` (quality and sharpness `0xFF`: the dispatch carries neither — *since beta.25 the quality byte is the mode the `ffxQuery` row below names for the dispatched size, `0xFF` when none does*) + one COUNT *(since 0.1.0-beta.43, owner decision D125: **counted at the first source that saw an UPSCALE and at no other** — `g_ffxUpscaleOwner`, `fl::adv::Owns`. Cyberpunk 2077's loader 2.3.0 hands a dispatch on to the leaf's export — its frame-generation dispatch types are logged on the loader and on the leaf — so an UPSCALE through such a loader reaches two hooked modules, and one count per module read K = 1 as 2.0 on the fixture bound that way (`--ffx-topology 2x-export`: 60 presents, 120 counted). No title run so far upscales through one; it is a precaution. Measured on the header with the Overlay's flags: +0.02 to +0.03 ns on the module that is counted, about 4 ns less on the forwarded copy)*; **PREPARE / PREPARE_V2** → `frameID` counted on a *new* index only — this vendor's `slGetNewFrameToken`, the `fgEvaluations` producer once a title has ever prepared, with the UPSCALE count as the fallback for a title that never does; **FRAMEGENERATION** → `fgMode = FSR_FG` on that present. Rule 4: the argument of the API we hooked, never `context`, `pNext`, a command list or a resource. **Why all four:** a UE5 title ships the two leaves with no loader and calls their exports; a loader-shipping title calls the loader's export and the signed loader reaches its providers through an object, not the leaves' exports (measured: Dying Light: The Beast, KCD2, Wukong). The morning's "never the loader" rested on the export tables alone and was reversed by the run. What guards against a loader that DID re-enter a leaf's export is the K = 1 control with all four hooked and the consumer's `frames/upscale-drained`, both of which read 2× in that case. `ffxCreateContext` is deliberately NOT a row — nothing it carries fills a field the dispatch does not, and its honest family would collide with `slEvaluateFeature`'s under the installer's equality binding. The family is compound (`IDENTITY \| PARAMS \| FG_EVALUATIONS`), pinned by `static_assert`s that also bind the leaf table to the rows both ways and refuse the loader as a row. Streamline keeps precedence for the count once it has ever issued a token, so every §S31-validated title is byte-identical. Second count: the consumer prints `frames/upscale-drained`, the AMD `tokens/batch`. **FSR 3.0 — BUILT 2026-09-05 as a fifth AMD target:** `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` (Cyberpunk's copy; named export, its own descriptor, vendored from tag **`fsr3-v3.0.4`** — the tag whose twelve `ffxFsr3*` declarations match the shipped module, not the `v1.1.4` first named). Rule 4: the detour reads `renderSize` of the descriptor the title passed and nothing else — never the context, a resource or the command list; the offset is pinned to a literal (1256) so a re-vendoring that moved it fails to compile. Same family and publish point as the four rows (`PublishFfxFamilyIfWhole` waits for a loaded host too), keyed by module in the installer; identity `FSR3` as a fact. `ffxFsr3DispatchFrameGeneration` is deliberately not a row (§H11 carries the reversal condition); the `ffx_fsr3upscaler_x64.dll` leaf is the pre-committed alternative if the facade reads silent (row B2) — never both, or `frames/upscale-drained` reads 2.00. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks:** the UPSCALE arm reads the rest of `ffxDispatchDescUpscale` — `enableSharpening`, `sharpness`, `jitterOffset`, `preExposure`, `cameraNear`, `cameraFar`, `cameraFovAngleVertical`, `flags`, `reset`, `frameTimeDelta` — into process-local summaries (an "ever seen" mask, a largest magnitude, a lowest and highest, a count and a sum; one module's dispatches are counted, so a dispatch that reaches the loader and a leaf is one). Never on the FSR 3.0 host's legacy descriptor, which is vouched Line truncated
| ✅ **FidelityFX ffx-api: `ffxQuery` on the same four modules** (beta.25, owner decision D65) — `amd_fidelityfx_dx12.dll`, `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, `amd_fidelityfx_loader_dx12.dll` | **Built 2026-10-19.** The mode an FSR title runs at reaches the vendor only as an argument of `ffxQuery` — "what render size (`…GETRENDERRESOLUTIONFROMQUALITYMODE`, `0x00010003`) or ratio (`…GETUPSCALERATIOFROMQUALITYMODE`, `0x00010002`) does this mode give at this display size?" — asked before the title sizes its targets; the per-frame dispatch carries the size alone. The detour calls the original FIRST, exactly once, and only when it returned `FFX_API_RETURN_OK` reads the descriptor's type, display size and mode and the values the vendor wrote through the title's own out pointers, into a five-slot table (one per `FfxApiUpscaleQualityMode`); the `ffxDispatch` UPSCALE arm names the ONE mode whose kept answer fits the dispatched `renderSize` (and `upscaleSize`, where stated) as `0x10 + mode` in `upscalerQuality`, else `0xFF` (`03_METRICS` §Upscaling). **Rule 4:** the arguments of the API we hooked — the descriptor the title passed and the out values of that same call — never `context`, a resource or anything the title did not hand the hooked export; nothing of the title's is written, and every read is under the hook's SEH guard. Both query layouts and type ids are pinned to literals by `static_assert`s, identical at SDK v1.1.4 and v2.3.0. **Its own family**, `FL_HOOK_UPSCALER_QUALITY` (bit 11 of `hooksInstalledMask`, mirrored in `FlHookFamily` and `HookFamilies`): `InstallByFamily` binds a row by equality, and the query entitles no measured field by itself — the byte rides under `FL_MEASURED_UPSCALER_PARAMS` from the dispatch arm — so the bit says only that the query was hooked, which tells "never asked" from "could not have seen it ask". Published like the dispatch family, once every loaded leaf is patched (`PublishFfxQueryFamilyIfWhole`); the FSR 3.0 host has no `ffxQuery` and no row (`static_assert`). A loader that passes a query on to a leaf's export refreshes one kept answer twice; nothing is counted, so nothing is counted twice. **Measured overhead** (a copy of the two bodies, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3 runs, every slot holding both a size and a ratio — the worst case): 7.6–8.2 ns added per UPSCALE dispatch, i.e. per application frame, and 1.6 ns per query beside the trampoline; the per-present path gains one load. Harness: `--ffx-query sizes|ratios`; `fl_guard` "FSR's quality mode". **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks:** when the query the vendor answered OK is the upscaler's memory — `FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE` (`0x00010008`, ffx-api 1.1.2) or `…_V2` (`0x00010009`, 2.0) — the `FfxApiEffectMemoryUsage` it wrote through the title's own out-pointer is kept (total and aliasable bytes), one module's queries counted. Only a title that asks is answered: FrameLedger never calls `ffxQuery` itself. The frame-generation memory queries (`0x00020007`, `0x0002000b`) are not read. +4.3–6.1 ns per such query while asked. Harness: `--ffx-memory-query v1|v2`; `fl_guard` "region 5 stays empty until the Agent asks". |
| ~~XeSS: `xessD3D12CreateContext`, `xessD3D12Init`, `xessD3D12Execute`~~ **Closed at the census by licence, 2026-09-04** (`20_OPEN_QUESTIONS` §Scope decisions, `18_GPU_VENDOR_APIS` §Intel XeSS SDK): no hook on any `libxess*.dll` export *(corrected 2026-10-04)* | ~~`outputResolution`, `qualitySetting`, XeSS version; `xess_fg` variants for XeFG~~ |
| ✅ **FidelityFX ffx-api: `ffxConfigure` on the same four modules** (0.1.0-beta.43, Advanced metrics train B; owner decisions D111–D116, D122) | **How the game configures FSR frame generation** — a title calls `ffxConfigure` with a frame-generation descriptor, usually every frame. Rule 4: an argument of the call hooked, and of it only what is named here. **Read**, and only when the header's type is `FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION` (`0x20002`): `frameGenerationEnabled`, `allowAsyncWorkloads`, `flags`, `onlyPresentGenerated`, `generationRect`. **Never read:** `swapChain`, the two callbacks and their contexts, `HUDLessColor`, `frameID`; and of every other configure type — key-value pairs, the distortion field, the camera info — nothing but the header's type. ctest `fl_adv_fields` publishes two descriptors that differ in all of those and gets the same bytes out, and hands the detour a key-value descriptor, which is shorter, without a read past it. **Installed only where asked for** (D111), as `slSetConstants` is: `InstallByFamily` returns before it resolves anything in a process never asked for Advanced metrics, so with the option off the export's first bytes in the target are the file's (`fl_guard` `[advanced]`). Published when every ffx-api module the process loaded is patched (`FL_HOOK_FFX_CONFIGURE`, bit 14), as the dispatch and query families are. **Counted at the first module that saw a frame-generation configure** — an owner slot of its own: the fixture's loader has always handed `ffxConfigure` on to the leaf's export, and Cyberpunk 2077's loader does the same with dispatches, so one call reaches two hooked modules (the injected case reads one configure a frame through the loader, not two). The rectangle is stored in one word, sixteen bits a side, so a publication never carries half of one rectangle beside half of the next; a side that is negative or past fifteen bits makes it four `-1`. The descriptor's type is kept for the log whatever it is (`FFX_CONFIGURE`, §Native logging). The detour consults `MayObserve()` first. **Measured overhead** (the detour's body on the headers, the Overlay's flags, 20 million calls a run, three runs): not asked **+1.72 / +1.68 / +1.78 ns** (the type kept for the log); asked, the counted module **+15.02 / +15.55 / +15.11 ns**; asked, the forwarded copy +2.70 / +2.81 / +2.65 ns; asked, another configure type +2.43 / +2.55 / +2.47 ns. |
| ✅ **Application frames per present** (`fgEvaluations`) — **`sl.interposer.dll!slGetNewFrameToken` since 2026-09-03** | Native vs Displayed frame counts at Tier 1 — see `03_METRICS` §Frame Generation. **The producer is the frame-token export**: Streamline hands a title one token per application frame and the title must ask; the detour counts distinct tokens between two presents (pointer changes, nothing dereferenced), `FL_HOOK_FG_EVALUATIONS` is its family, and it installs on every Streamline 2 title including the ones that evaluate nothing through `slEvaluateFeature`. Rule 4: the out-parameter of an API we hooked. Premise and its gate in `03_METRICS`; pre-committed table in `20_OPEN_QUESTIONS` §S31. *The row as it stood before:* ~~NGX/SL/FFX/XeSS FG feature evaluations per present. **Built 2026-08-15 for Streamline, and MEASURED TO YIELD NOTHING ON THAT ROUTE**~~ — `slEvaluateFeature(kFeatureDLSS_G)` is never called by Cyberpunk 2077 (0 across ~14,000 batches, four FG settings), so this row installs, is honest, and counts zero; see `docs/HANDOFF.md` item 3. Built on the detour that was already there: `kFeatureDLSS_G` contributes to a saturating COUNT in the same word the feature bits live in (`fl_sl_seen.h`) rather than to a bit, because a bit collapses several evaluations between two presents into one — and under multi-frame generation that is the common case, not the edge. The row's family is therefore compound (`FL_HOOK_UPSCALER_IDENTITY \| FL_HOOK_FG_EVALUATIONS`), pinned by a `static_assert` because `hookinventory-check` reads that column as an opaque identifier. **Counts EVALUATIONS, not generated frames** — the 2026-08-14 owner ruling; the multiplier lives in `sl::DLSSGOptions`, which is only reachable by the route §2b refused. ~~Non-NVIDIA FG vendors are **deferred with a written rationale**: `amd_fidelityfx_framegeneration_dx12.dll` 3.1.5 exports only the five generic `ffx*` entry points, identical to five sibling modules, so identity is in the arguments and we have no headers~~ — **AMD has a producer since 2026-09-04** (the FidelityFX row above: the PREPARE dispatch's `frameID`, or the UPSCALE count on a title that never prepares, feeds `fgEvaluations` when Streamline has never issued a token); Intel stays at the census (`20_OPEN_QUESTIONS` §Scope decisions, by licence); the FSR 3.0 host DLL's UPSCALE (`ffxFsr3ContextDispatchUpscale`, since 2026-09-05) counts like an ffx-api UPSCALE when neither Streamline nor a PREPARE has spoken |
> `GetFrameStatistics().PresentCount` is **not** in this inventory and must not be
@@ -323,10 +376,25 @@ v2.8.0, v2.9.0, v2.10.0, v2.10.3, v2.11.1, v2.12.0, v2.14.1, v2.14.16):
| | 3 | v2.4.0 (`27d352db364f`) | `alphaUpscalingEnabled` |
| `sl::Constants` (`include/sl_consts.h`) | 1 | v2.0.0 (`db6f37adcf66`) | every member through `motionVectorsJittered` — the matrices, `jitterOffset`, `mvecScale`, `cameraPinholeOffset`, the camera's position and axes, `cameraNear`, `cameraFar`, `cameraFOV`, `cameraAspectRatio`, `motionVectorsInvalidValue`, the seven `Boolean`s |
| | 2 | v2.4.0 (`bba15338a623`) | `minRelativeLinearDepthObjectSeparation` |
| `sl::FeatureVersion` (`include/sl.h`; `include/sl_core_types.h` from v2.7.2) | 1 | v2.0.0 (`fc2d6ee39fea`) | `versionSL`, `versionNGX` |
| `sl::FeatureRequirements` (the same headers) | 1 | v2.0.0 (`fc2d6ee39fea`) | `flags`, `maxNumCPUThreads`, `maxNumViewports`, `numRequiredTags`, `requiredTags`, `osVersionDetected`, `osVersionRequired`, `driverVersionDetected`, `driverVersionRequired`, then ten Vulkan members from `vkNumComputeQueuesRequired` to `vkFeatures13` |
| | 2 | v2.1.0 (`79037e0974d2`) | `vkNumOpticalFlowQueuesRequired` |
`sl::DLSSOptions` keeps those seventeen declarations, same types and order, through v2.14.16 (`9a875bd4f843`); v2.8.0
only re-spelled the deprecated `sharpness`. `sl::Constants` is unchanged from v2.4.0 through v2.14.16
(`15589e577df9`). Streamline 1.x is refused before any read (`SpeaksStreamline2`).
(`15589e577df9`). Streamline 1.x is refused before any read (`SpeaksStreamline2`). **Since 0.1.0-beta.43 the
Overlay reads `sl::Constants`, and only members of version 1** — nothing of version 2 — so no version test beyond
"at least 1" is needed, and the read ends before `minRelativeLinearDepthObjectSeparation`, the member version 2
added.
**The two answers about a feature** (established 2026-11-12, the same way, over the same sixteen tags):
`sl::FeatureVersion` is two members at every tag, and `sl::FeatureRequirements` is the nineteen of v2.0.0 plus the
one v2.1.0 added, unchanged through v2.14.16 (`a255f5c5e99a`). `sl::Version` is three `uint32_t` — `major`, `minor`,
`build` — in `include/sl_version.h` from v2.0.0 (`deec7cd04363`) to v2.14.16 (`dc3041ae8b44`), and the two functions'
declarations are the same at both ends: `sl::Result slGetFeatureVersion(sl::Feature, sl::FeatureVersion&)` and
`sl::Result slGetFeatureRequirements(sl::Feature, sl::FeatureRequirements&)`. **Since 0.1.0-beta.44 the Overlay reads
both, and only members of version 1**: the read of the requirements ends at `driverVersionRequired`, before the first
Vulkan member, so no version test beyond "at least 1" is needed.
**FidelityFX** (`GPUOpen-LibrariesAndSDKs/FidelityFX-SDK`; tags v1.1.0 — FSR 3.1.0, the first ffx-api — v1.1.1,
v1.1.2, v1.1.3, v1.1.4, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.4.0). The descriptor header carries a `type` and no size
@@ -385,7 +453,7 @@ or version, so the question is whether the declaration ever changed:
| Hook / call | Yields |
|---|---|
| ~~`IDXGIAdapter3::QueryVideoMemoryInfo` (we **call** it, not hook it, once per second from our own thread)~~ | ~~**Per-process VRAM** `CurrentUsage` + `Budget` — previously impossible; now exact~~ **Never built; superseded 2026-10-03 (D43):** the game's memory is read from OUTSIDE the game by the Agent (`18_GPU_VENDOR_APIS` §The game process's memory), so nothing in the Overlay calls it. Only the budget would need it, and that stays open (`20_OPEN_QUESTIONS` §M11) |
| NVAPI Reflex: hook `NvAPI_D3D_SetSleepMode`, `NvAPI_D3D_SetLatencyMarker`; call `NvAPI_D3D_GetLatency` | Reflex on/off + PC latency breakdown. Declarations come from the vendored MIT NVAPI headers (`18_GPU_VENDOR_APIS` §L3); the Overlay links them like any other header. NVIDIA-only — the whole block compiles out to a no-op capability flag elsewhere |
| NVAPI Reflex: ~~hook `NvAPI_D3D_SetSleepMode`, `NvAPI_D3D_SetLatencyMarker`~~; call `NvAPI_D3D_GetLatency` and `NvAPI_D3D_GetSleepStatus` *(the two hooks cannot be: neither function is an export — `20_OPEN_QUESTIONS` §M14. **The calls are made since 0.1.0-beta.47** — §Calls the Overlay makes into a driver, above; owner decisions D132, D136)* | Reflex on/off + PC latency breakdown. Declarations come from the vendored MIT NVAPI headers (`18_GPU_VENDOR_APIS` §L3); the Overlay links them like any other header. NVIDIA-only — the whole block compiles out to a no-op capability flag elsewhere |
### Explicitly not hooked
Input APIs, file I/O, network, memory allocators, window messages beyond what the overlay needs, anything game-specific. Rule 4 in CLAUDE.md.
@@ -630,7 +698,7 @@ Field notes — each of these was a defect in an earlier revision:
header — they are written by the other process, and mixing them into an
Overlay-written line reintroduces exactly the false sharing the split exists to
prevent. Layout is normative in `07_IPC` §A + B.
- **The hot path performs: one QPC read, a few field reads from cached state, one 60-byte store, two relaxed atomic stores and two compiler fences.** No syscall, no allocation, no lock, no logging. Target ≤ 1 µs per present. *(Added 2026-10-04: the summary leaves out the per-present `IDXGISwapChain::GetLastPresentCount` call (§H5, the `dxgiUnseen` count) and the display sample every 500 ms at most (region 4).)*
- **The hot path performs: one QPC read, a few field reads from cached state, one 60-byte store, two relaxed atomic stores and two compiler fences.** No syscall, no allocation, no lock, no logging. Target ≤ 1 µs per present. *(Added 2026-10-04: the summary leaves out the per-present `IDXGISwapChain::GetLastPresentCount` call (§H5, the `dxgiUnseen` count) and the display sample every 500 ms at most (region 4).)* *(Added 2026-11-13, train C, 0.1.0-beta.47: after the store, one relaxed load of the latency gate; and, while a session asks for Advanced metrics and the watchdog armed one, a call into the driver about once a second — §Calls the Overlay makes into a driver. That call is the one thing on this path that is not bounded by FrameLedger's own code: 0.5–2.6 µs measured against the installed driver, and a call of 2 ms or more is the last.)*
- Per-frame mutable state (current upscaler, render res, dispatch counts) lives in a small struct updated by the feature hooks and *read* by the present hook; counters reset at present.
## The watchdog thread — the only thread we add to the game
@@ -694,8 +762,9 @@ Every hook body is wrapped:
```
- Any SEH exception inside our code ⇒ increment `faultCount`, record which hook, **return control to the original function** so the game continues.
- 3 faults total ⇒ set `status = self_disabled`, ~~uninstall all hooks (`MH_DisableHook(MH_ALL_HOOKS)`)~~ restore each patch's prologue only while its bytes are still our jump (compare-and-restore per patch through `StopObserving`, §Unhooking, §H7 — `MH_ALL_HOOKS` would have removed an overlay chained after us; corrected 2026-09-27), stop writing, stay dormant. The Agent sees the flag and finalizes the session as `degraded`.
- 3 faults total ⇒ set `status = self_disabled`, ~~uninstall all hooks (`MH_DisableHook(MH_ALL_HOOKS)`)~~ restore each patch's prologue only while its bytes are still our jump (compare-and-restore per patch through `StopObserving`, §Unhooking, §H7 — `MH_ALL_HOOKS` would have removed an overlay chained after us; corrected 2026-09-27; since 0.1.0-beta.46 the patches that are still ours come out together, under one stop of the threads — §Unhooking, Batches), stop writing, stay dormant. The Agent sees the flag and finalizes the session as `degraded`.
- Never `__try` around the call to the original function — only around *our* code, so we never mask a game bug as ours or vice versa.
- **One exception, since train C (2026-11-13): the two driver getters the Overlay calls itself** (§Calls the Overlay makes into a driver) are under a guard of their own, `fl_reflex.h`'s, with the same filter. They are not "the original function" — the game did not make these calls, we did, so a fault in them is ours to answer for. It is counted once through `NoteFault`, and the read is switched off for the process in the same breath, so that one fault cannot become the three that self-disable. **A caught fault does not give back a lock the driver held**: the guard is containment, not safety, which is why nothing is called again after it.
- The trampoline call to the original is always executed exactly once, on every path, including error paths.
## Unhooking
@@ -714,6 +783,94 @@ Every hook body is wrapped:
> foreign one in ctest `fl_unhook_inline` (the vtable form stays in `fl_unhook_preserves_foreign`), and
> against the injected Overlay in ctest `fl_guard` `[log]`, where every patch reads `UNHOOK_RESTORED`
> because the harness is alone in its process.
>
> **The registry refuses what it cannot hold, and a patch is registered before it can run (0.1.0-beta.42,
> `fl_patch_registry.h`).** The registry was an array and a counter, and two things were wrong with it — found by
> reading the code for the plan of the next two hooks, not by a failure. **Full meant silent:** `RegisterPatch`
> wrote its entry only while it fitted, after `PatchTarget` had already enabled the hook, so a 49th patch would
> have been live and unknown to the stop, with no line anywhere. (Twenty patch sites exist; the rule no longer
> depends on that count being right, and a `static_assert` now checks the capacity against the inventory's own row
> count plus the seven sites that are not rows.) **Enabled before registered:** `PatchTarget` enabled the hook,
> re-read `g_observing`, and registered last; a stop between the re-read and the registration walked a table
> that did not hold the patch yet, and the patch stayed in after "stopped". The DXGI three and the loader detour
> registered after enabling too, with no re-read at all.
>
> One sequence now, `fl::patch::Install`: **take a slot — no slot, no patch, nothing created — create, enable,
> commit the slot, then re-read the flag.** The stop clears the flag and then walks the committed slots. Each side
> writes and then reads what the other wrote, sequentially consistent, so at least one sees the other: the walk
> restores the patch, or the installer finds the flag clear and takes its own patch out (and retires the slot,
> so the walk does not report it as somebody else's). A slot whose patch failed is free again; one that was ever
> live is never reused — the walk reads it without a lock. Nothing is created once observing is off. A patch
> that did not go in is logged once per target and reason, `PATCH_FAILED a=<reason>` (`2` stopped, `3` registry
> full, `4` create failed, `5` enable failed, `6` the stop arrived meanwhile); until now every such failure was
> silent. The three DXGI patches are still enabled together and keep the same rules by hand; when any step of
> theirs fails, whatever a partial enable left in is taken out — it used to stay, unregistered, with init
> reporting failure. And two stores that could overwrite a stop's reason no longer do: `READY` is written only
> over `INIT`, and init's failure path stores nothing. No hook body changed. ctest `fl_unhook_inline` drives
> the shipped sequence against real MinHook patches: a full registry leaves the target's bytes untouched and
> MinHook unasked; a stop arranged between the enable and the re-read ends with the function unpatched; a failed
> patch gives its slot back; a slot is invisible to the walk until committed.
>
> **Batches, 0.1.0-beta.46 (owner decision D134): one stop of the game's threads for a group of patches.** MinHook
> writes a jump with every other thread of the process stopped — a snapshot of the system's threads, then a
> suspend, a context read and a resume for each of the process's — and `MH_EnableHook` / `MH_DisableHook` for one
> target do all of that for one jump. The owner's logs of 2026-11-13 put a number on it: the thirteen Streamline
> patches took 0.74 s to 2.8 s of a game's start, 57 to 215 ms each, and a stop restored its patches the same way.
> MinHook 1.3.4 can queue — `MH_QueueEnableHook` / `MH_QueueDisableHook` mark a hook, `MH_ApplyQueued` executes
> every mark under one stop — and `fl_patch_registry.h` now has the two sequences that use it:
> `fl::patch::Batch` (`Add`: slot and create, nothing marked; `Commit`: enable them all) and
> `fl::patch::RestoreAll`, which is the stop's walk. `InstallUpscalerHooks` queues every row a tick finds
> something for and commits once, before the families that are published "when whole"; `InstallRtHooks` batches
> its two; `StopObserving` calls `RestoreAll`. A patch's `HOOK_INSTALLED` line, family bit and latch still come in
> that order and only once it is in. The loader detour, OpenGL and the three DXGI patches of init are as they were.
>
> **What the queue makes dangerous, and what the code therefore never does** (the plan was reviewed against
> `hook.c` before a line was written, and its first form was refused). `MH_ApplyQueued` applies **every** hook
> whose mark differs from its state — the process has one table, not one per caller. So (1) **no mark is ever left
> standing**: a hook that failed to enable has its mark removed, or the next apply — the stop's own — would enable
> it; (2) **only a patch that is still ours is ever marked for a restore** (`StillOurs`, as before; §H7), and
> nothing is marked "all" — the refused draft marked everything and then un-marked what it must not restore, and
> un-marking a hook that is already out marks it for *enabling*: the stop would have put a patch back in after the
> stop; (3) **mark, apply and commit happen inside a gate** (`MinHookEngine::BeginQueue`, a slim lock taken
> exclusively) so the watchdog's apply cannot execute the stop's marks nor the stop's the watchdog's. The gate is
> held for one apply and never across a symbol lookup, which takes the loader's lock. It is the one lock in the
> Overlay, and it is on no hook body's path: the only way from a hook to it is the stop itself, which already
> waited for MinHook's own lock and a stop of the threads for every patch. Its owner re-enters it without
> waiting. **The verdict on an install is the engine's, not the bytes'**: a foreign overlay patching over us a
> moment after the apply would read as "not in", and treating that as a failure would mark a restore nobody had
> compared. `MH_ApplyQueued` stops at the first hook that fails and says only that one did; the ones after it
> are then enabled — or, in the stop, restored — one at a time, so one bad patch still costs one patch.
> The write-then-read pair is unchanged: the stop clears the flag and then walks; `Commit` commits its slots and
> then re-reads the flag, and takes out — compared first — what it put in when the flag is clear. A stop that
> lands before the commit enables nothing.
>
> **Measured** on `hook-harness`'s Streamline target, the development PC, three runs before and after (`fl_guard`
> `[advanced]` prints them): the nine Advanced-only patches went in one by one over 0.60 s / 0.70 s / 0.60 s
> from the first log line to the ninth, 76–88 ms each; as one batch they take **81 / 90 / 78 ms**. The stop restored
> eighteen patches in 1.37 s / 1.56 s / 1.37 s; under one apply, **77 / 90 / 76 ms** — and from the Agent's request
> to `UNHOOKED`, 1.27–1.48 s became 94–110 ms. One stop of the threads costs what it cost for one patch, whether it
> covers four, nine or eighteen. A new log line says so in the field: `PATCH_BATCH install` / `restore`, `a` the
> microseconds, `b` the patches. ~~**Not measured:** a real game — how long one stop of the threads is with a few
> hundred of them, and whether any title minds patches arriving together (owner-only item 44).~~ **In real games**
> (the owner's five sessions of 2026-11-13 on 0.1.0-beta.46 — Hogwarts Legacy, Phantom Blade Zero, Black Myth:
> Wukong, Cyberpunk 2077, Clair Obscur: Expedition 33; eighteen install batches of two to sixteen patches): every
> batch went in whole, with the hooks beta.45 installed and no `PATCH_FAILED`; **sixteen batches cost 81–262 ms
> whatever they held**, which is what one patch cost in the same game before. Streamline's thirteen, first line to
> last on beta.45 against the one batch now: Phantom Blade Zero 0.74–0.85 s → 88 ms, Cyberpunk 2077 1.18 s → 93 ms
> (with three more patches in the batch), Black Myth: Wukong 1.65 s → 188 ms (twelve), Hogwarts Legacy 2.80 s →
> **1.26 s**. That last one and a batch of three in Cyberpunk 2077 (**0.61 s**) are not explained: the cost does
> not follow the count — sixteen patches in 93 ms, three in 609 ms — and **the log cannot tell one long stop from an
> apply that failed part-way and was finished one patch at a time**, because a batch writes a line only for a patch
> that fails for good. **Since 0.1.0-beta.47 the line says which** (owner decision D137): `install` or `restore` is a batch that went under its one apply; `install singly` or `restore singly` is one whose apply said it had failed, and the high half of `b` then counts the patches handed to MinHook one at a time (`b=0x0003000d`: thirteen in, three of them singly) — attempts, not stops: MinHook makes no stop for a patch the failed apply had already done. So a long `a=` on a plain `install` line is one long stop of the threads. ~~**Still not measured: the restore in a real game**~~ **The restore in a real game** (the owner, 2026-11-14,
> Phantom Blade Zero, twice): twenty-nine patches out under one apply of **83 ms and 86 ms**, every one restored,
> none declined, and the game went on for minutes and closed cleanly (owner-only item 44 (d)). One more thing the
> queue changes for the better: MinHook's single-target disable does not move a thread that is suspended inside
> the patched bytes (`hook.c` passes the enable action to its thread fix-up in both directions); the queued apply
> does. ctest `fl_unhook_inline` drives `Batch` and `RestoreAll` against real MinHook (three in under one apply,
> a duplicate target refused without holding the others up, a foreign patch left byte for byte) and against a
> model of MinHook's table for what real MinHook cannot be made to do on demand: an apply that fails halfway or
> not at all, a stop inside the apply, a committed patch that is already out — the refused draft's failure — and
> that no mark is ever standing or made outside the gate.
~~`FlRequestUnhook()` (or the control flag) ⇒ `MH_DisableHook(MH_ALL_HOOKS)`, restore vtable entries **only where they are still ours**, flush the ring, set status.~~ *(Corrected 2026-10-04: both reach `StopObserving` — compare-and-restore per patch as the note above says, then the status; there is no `MH_ALL_HOOKS`, no vtable entry and no ring flush. The watchdog flushes the native log on its way out.)* **The DLL is not `FreeLibrary`'d from the live process** — a thread could still be inside a trampoline. It goes dormant and unloads with the process. This is deliberate and documented.
@@ -742,6 +899,12 @@ before it. And when the slot has changed, going dormant costs nothing: we stay
loaded anyway, and our detour remains in someone else's chain doing nothing
harmful.
> **Said plainly, 2026-11-13: for the inline patches that re-check has never been made.** MinHook owns the write
> window — it stops the threads, changes the protection and writes — and `StillOurs` is asked before it is called,
> not inside. Between the two a foreign overlay could patch over us, on a thread MinHook has not stopped yet. The
> batches of 0.1.0-beta.46 neither close that window nor widen it: the comparison and the write are apart by one
> stop of the threads, as they were for each patch, once instead of once a patch.
Verified by `hook-harness --probe-unhook` (ctest `fl_unhook_preserves_foreign`),
which simulates the foreign hooker rather than depending on RTSS being
installed, so it is deterministic and runs on CI. Both halves are asserted: we
@@ -753,13 +916,23 @@ compare-and-restore that never restores is not a fix.
No logging in hook bodies. A small fixed-size in-memory ring of structured events (hook installed, symbol missing, fault, unhook) is flushed to `logs\overlay-<pid>-*.log` by the init thread at session end, on unhook, or on Agent request — never mid-frame.
> **Built 2026-09-06 (P1 item 4), as specified, with the details a bug report needs.** A ring of 256 ×
> 64-byte events (`qpc`, code, two operands, a 40-char name) appended with one `fetch_add` from init and
> ~~64-byte events (`qpc`, code, two operands, a 40-char name)~~ 96-byte events (`qpc`, code, two operands, a
> 72-char name — 64 bytes and 40 characters until beta.42) appended with one `fetch_add` from init and
> watchdog paths and from a hook's **SEH handler** — `NoteFault` records the exception code and the hook's
> `__func__` — never from a hook body. Codes: `RING_CREATED`, `PRESENT_HOOKS`, `HOOK_INSTALLED` (one per
> patch, with the target address), `SYMBOL_MISSING` (once per pair, and only when the module IS mapped),
> `FAULT`, `STOP` (the reason), `UNHOOK_RESTORED` / `UNHOOK_DECLINED` (one per patch), `LOADER_DETOUR`,
> `SUPERVISION_LOST`, and since beta.24 `STOP_FLUSHED` (the last line after a stop: `a=1` when the stop had finished
> writing). **Three flush points, none on a present path:** the end of `InitThread` (so the
> `SUPERVISION_LOST`, since beta.24 `STOP_FLUSHED` (the last line after a stop: `a=1` when the stop had finished
> writing), and since beta.42 `PATCH_FAILED` (a patch that did not go in, once per target and reason — §Unhooking)
> and `FFX_DISPATCH`, `FFX_QUERY`, `UPSCALE_ROUTE`, `RUNTIME_CENSUS` (the note at the end of this section), and
> since beta.43 `FFX_CONFIGURE` — each configure type a hooked ffx module was handed, in a process where
> `ffxConfigure` is hooked at all (one asked for Advanced metrics) — and since beta.46 `PATCH_BATCH`: one line an
> apply, `install` or `restore`, `a` the microseconds it took and `b` the patches it covered (§Unhooking, Batches).
> **`LATENCY` (train C, 0.1.0-beta.47)**: one line each time the state of the driver read changes — `a` the
> `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.
> **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),
> and the watchdog on its way out after any stop. Appended, never recreated; events overwritten before a
@@ -770,15 +943,59 @@ No logging in hook bodies. A small fixed-size in-memory ring of structured event
> it reads 0. When the stop ran on a presenting thread — `MayObserve`'s one-frame safety stop — the watchdog's one
> final flush could run while that thread was still writing, and the lines after it (the kernelbase loader detour is
> the last patch) reached the ring after the last flush ever made. The stop now says when its last line is in, and
> wakes the watchdog; the final flush waits for that, bounded at 2 s, then writes `STOP_FLUSHED`. And each slot has a
> wakes the watchdog; the final flush waits for that, bounded at 2 s *(a quarter of a second for every patch the registry can hold since beta.45; the stop is one apply since beta.46 and the bound is for its fallback)*, then writes `STOP_FLUSHED`. And each slot has a
> commit word written after its fields: `LogNote` claims a slot with one `fetch_add` and fills it afterwards, so a
> flush on another thread could print a slot still being filled. A flush now prints only slots whose writer has
> finished — an ordinary flush stops at the first that is not, for the next one; the final flush names it in a `#`
> line. Nothing on a present path changed. Path: `%LOCALAPPDATA%\FrameLedger\logs\overlay-<pid>-<yyyymmdd-hhmmss>.log`,
> resolved by `SHGetKnownFolderPath` (§S21's rule, not the environment). No allocation: static ring,
> static 64 KiB format buffer, static path. The CaptureHost prints the file and its `FAULT` / `STOP` /
> `UNHOOK_*` / `SYMBOL_MISSING` / `SUPERVISION_LOST` lines at the end of every session
> `UNHOOK_*` / `SYMBOL_MISSING` / `PATCH_FAILED` / `SUPERVISION_LOST` lines at the end of every session
> (`Consume/OverlayLog.cs`).
>
> **The log outlives the game, and says what each ffx module was handed (0.1.0-beta.42, owner decision D121).**
> Cyberpunk 2077, set to FSR upscaling with FSR frame generation, was recorded with frame generation measured and
> the upscaler "unknown": PREPARE and FRAMEGENERATION dispatches arrived and no UPSCALE ever did. The log could
> not say why. **It ended half a second into the session** — written at the end of init, then only when the Agent
> asked or a stop ran, and a game that exits does neither: the watchdog dies with the process. And **it could not
> have said much**: the two one-target rows logged their symbol and every other row the word `hook`, so four ffx
> modules were one indistinguishable line each. Four changes, none of them a new patch site:
>
> 1. **A fourth flush point: the watchdog, on any tick that finds something new in the ring** (`FlushLogIfNew`:
> one load on an uneventful tick, no file opened). Events are few and bounded — installs, first sights, three
> faults at most — so this is a handful of appends a session. The init thread's flush moved to **before** the
> watchdog is created: `FlushLog`'s state belongs to one thread at a time, and with the watchdog flushing on its
> first tick the old order could run two at once.
> 2. **Every install line names its module and its symbol** — `amd_fidelityfx_dx12.dll!ffxDispatch` — built at
> compile time from the inventory row's own two spellings (`fl::inventory::NameOfRow`), so no second list of
> names exists. The same name is on the `UNHOOK_*` and `PATCH_FAILED` lines. The event's text grew from 40 to
> 72 characters for it (an event is 96 bytes; the ring 24 KiB, static), and `PatchTarget` lost its default
> name, so a new call site cannot log `hook`.
> 3. **`FFX_DISPATCH` / `FFX_QUERY`: each descriptor type a hooked ffx-api module was handed, once**
> (`fl_ffx_types.h`). Text = the module, `b` = the type (`0x10001` UPSCALE, `0x20004` / `0x2000c` PREPARE,
> `0x20003` FRAMEGENERATION, …); `a` ≠ 0 with `b=0` says what did not fit (`1` a ninth distinct type, `2` a
> type of zero). The detour keeps the value of `type` — the member it reads already to choose an arm — in the
> first free of eight slots per module and entry point; the watchdog writes it. A query's type is kept whatever
> the vendor answered. `UPSCALE_ROUTE` names each source an UPSCALE came from, once (the FSR 3.0 host has no
> descriptor type, so this is the only line that says its export was called), and `RUNTIME_CENSUS` repeats the
> census word (`b`) whenever it gains a bit — both from words the detours kept before, at no cost to a hook.
> 4. **`PATCH_FAILED`** (§Unhooking) is the fourth: a patch that did not go in used to leave no line at all.
>
> **This is a diagnostic, not a measurement, and it is not behind the Advanced-metrics switch** — like
> `HOOK_INSTALLED`, it reaches the log file and nothing else: no record, no region of the shared memory, no session.
> Rule 4: the only thing read is `type`, of a descriptor handed to a hooked call. Rule 5: no allocation, no lock,
> no logging in the body; a type already kept costs loads and no write.
>
> **Measured overhead** (on `fl_ffx_types.h` itself with the Overlay's compile flags — `/O2 /GS /guard:cf
> /Qspectre`, 50 million calls a run, three runs, i7-14700KF): a frame's three dispatch types in turn, **+3.8 ns a
> dispatch** (3.79 / 3.87 / 3.81); a type in the first slot +0.9 to +1.0 ns; in the eighth, the worst steady
> state, +8.1 to +8.4 ns. A new type costs one compare-exchange, once per type and module.
>
> ctest `fl_ffx_types` (the header, including eight threads meeting the same six types at once: each kept exactly
> once) and `fl_guard` `[log]`: a harness on the 1.1.x monolith, generating frames and asking a ratio query, is
> supervised and told **nothing else** — no flush request, no stop — and its log holds the two install lines by
> module and symbol, the three dispatch types and the query type once each, the route and the census; the process
> is then killed and the file is as it was, one header, no `STOP`.
> **Tests and the real logs folder (2026-09-15).** The injection tests use the shipped Overlay, so their harness
> logs land in the user's real `logs\` too: measured that day, 2506 overlay logs, **2492 of them hook-harness's**,
+126 -19
View File
@@ -715,9 +715,10 @@ every `nvapi.` row; nothing is estimated in its place (FR-4.9).
| Train | Release | What | Its gate |
|---|---|---|---|
| A | 0.1.0-beta.39 | read by the Agent only — NVAPI and LibreHardwareMonitor — storage, the page. **Nothing changes in code loaded into a game** | this section |
| B | 0.1.0-beta.40, ~~.41, .42~~ .42, .43 *(three releases since D113, 2026-11-11; one was planned. Renumbered 2026-11-12, D118: 0.1.0-beta.41 is a fix release for the sensor library, not part of the train)* | inside the game: more fields of the Streamline and FidelityFX calls already hooked, and new hooks on functions `sl.interposer.dll` **exports** (`17_HOOK_ENGINE` §Hook inventory's ⏳ rows); shared-memory layout 5 — §Train B below | a plan of its own; overhead measured; each release after the first waits for the owner's run of the one before |
| C | ~~0.1.0-beta.41~~ ~~0.1.0-beta.43~~ 0.1.0-beta.44 *(D118)* | Reflex latency per frame | a spike, then the owner's go or no |
| D | ~~0.1.0-beta.42~~ ~~0.1.0-beta.44~~ 0.1.0-beta.45 *(D118)* | the Streamline feature state behind `slGetFeatureFunction` — DLSS frame generation's, DLSS's, Reflex's | a spike, then the owner's go or no |
| B | 0.1.0-beta.40, ~~.41, .42~~ ~~.42, .43~~ .42, .43, .44 *(three releases since D113, 2026-11-11; one was planned. Renumbered 2026-11-12, D118: 0.1.0-beta.41 is a fix release for the sensor library, not part of the train. **Four since D122, the same day**: the second step is beta.42 — no new patch site — and beta.43, the two new hooks; the third step is beta.44)* | inside the game: more fields of the Streamline and FidelityFX calls already hooked, and new hooks on functions `sl.interposer.dll` **exports** (`17_HOOK_ENGINE` §Hook inventory's ⏳ rows); shared-memory layout 5 — §Train B below | a plan of its own; overhead measured; each release after the first waits for the owner's run of the one before |
| B, a fourth step | 0.1.0-beta.45 *(D130, 2026-11-12)* | six more of Streamline's core calls — is a feature supported, is it loaded, the game switching it, its resources allocated and freed, Streamline shut down | hooks installed only where asked for, as in the second and third steps; `slInit` is not among them (D129) |
| C | ~~0.1.0-beta.41~~ ~~0.1.0-beta.43~~ ~~0.1.0-beta.44~~ ~~0.1.0-beta.45~~ after 0.1.0-beta.45 *(D118, D122, D130)* | Reflex latency per frame | a spike — written beside beta.45, a document only — then the owner's go or no |
| D | ~~0.1.0-beta.42~~ ~~0.1.0-beta.44~~ ~~0.1.0-beta.45~~ ~~0.1.0-beta.46~~ after train C *(D118, D122, D130)* | the Streamline feature state behind `slGetFeatureFunction` — DLSS frame generation's, DLSS's, Reflex's | a spike, then the owner's go or no |
Rules 4 and 5, the hook inventory, the measured overhead and the anti-cheat guard bind B, C and D exactly as they bind
every hook. `sl::Constants` is read without its camera position, axes and matrices: where the camera is, is where the
@@ -752,7 +753,7 @@ planning, the design reviewed against the code before it was approved.
`ICaptureObserver.WantsInGameAdvanced`; `CaptureSession` writes the word either way as the ring is attached, before
its first guard result, and from then on carries each publication of region 5 on `CaptureProgress.InGameAdvanced`
— one instance a publication, the same one on the ten ticks between two. `Application.Capture.InGameAdvancedSampler`
turns a publication into what a session stores: the session facts of the thirteen `Game` entries below, in the
turns a publication into what a session stores: the session facts of the thirteen `Game` entries below (nineteen since 0.1.0-beta.43, twenty-one since 0.1.0-beta.44, twenty-three since 0.1.0-beta.45), in the
vendor's own words (a preset is its letter, a member its name), and two series —
`adv.ffx.upscale.frame_time_delta`, the mean of one second's dispatches, and `adv.ffx.memory_usage`, a point for
each second the game asked. The facts are one list until a field they are made of moves, so the recorder's context
@@ -764,6 +765,56 @@ planning, the design reviewed against the code before it was approved.
`NotHooked`. The page says it in the session's sources line and, on Sources, that such an entry is read inside a
game FrameLedger measures when the game makes the call. The aliasable part of FSR's memory is published and not
shown: the catalog has one memory entry.
**The second step, 2026-11-12 (0.1.0-beta.43, PR-4).** Six more entries have reach `Game`: `sl.constants.jitter`,
`.motion_vectors`, `.depth`, `.projection`, `.resets` and `ffx.framegen.config`, from the two calls hooked only
for Advanced metrics (`17_HOOK_ENGINE` §Hook inventory, `slSetConstants` and `ffxConfigure`). The sampler makes
them from members region 5 already had (layout 5 as it was; schema 23 as it was): a switch is `on`, `off` or
`on_and_off` from the two words of what was seen, the flags are AMD's own names, the rectangle is the last one
the game gave and is left out where the capture side could not state it, the field of view is a range (D114).
**A field of view over π is said as given (owner decision D128, 0.1.0-beta.44).** Both vendors' headers say
radians; Cyberpunk 2077 gives Streamline 51–90, and the row read `51.0055 – 90 rad (2922.4° – 5156.6°)`. Such a
value is now the number alone, with a second row (`cameraFOV unit`, token `not_radians`) that says what it is
not; it is never converted, which would store this project's guess at the unit as the game's word. A
frame-generation configure that set no flag has a `flags` row of `none`, as an upscale does.
**A count is not part of what makes the facts new** — `sl.constants.resets` grows all session, and a context
rewritten on each would be one a second — so `InGameAdvancedSampler.Conclude` brings it up to the last
publication once, when the session ends. `AdvancedSources.StreamlineConstants` and `.FsrFrameGeneration`
(`AdvancedInGameCall`; null in every row written before, and in a session not measured inside the game) say for
each call which of three things happened: `Read`; `NeverCalled` — the capture side published the hook's family
(`FlHookFamily.SlConstants`, `.FfxConfigure` in the writer state's mask) and no publication carried the group; or
`NotHooked` — the family was never published, which is a game that did not load the library, a Streamline 1.x
interposer, or a patch that was refused. The page says it in one more sentence of the session's sources line.
**The third step, 2026-11-12 (0.1.0-beta.44).** Two more entries have reach `Game`: `sl.feature.versions` and
`sl.feature.requirements`, from what Streamline answers `slGetFeatureVersion` and `slGetFeatureRequirements`
(`17_HOOK_ENGINE` §Hook inventory). The sampler makes them from region 5's twelve feature slots (layout 5 and
schema 23 as they were): rows named `<feature> · <member>`, the feature by NVIDIA's constant (`kFeatureDLSS_G`;
`feature 4242` for an id this build has no name for), a version as `major.minor.build`, the requirement flags by
their enumerators. A version of all zeros is the vendor's "none" and has no row — a feature with no NGX model, a
requirement nobody stated — except `versionSL`; a count of 0 is a count. One bit of the mask covers both
questions, so which was answered is told by the slots (`InGameAdvancedSampler.FeatureCall`), and
`AdvancedSources.StreamlineFeatureVersion` and `.StreamlineFeatureRequirements` say for each: `Read`;
`NeverCalled` — hooked, and the game did not ask after that, ~~**the usual case, because a game asks while it
starts**~~ *(not the usual case: measured 2026-11-12, six of six Streamline sessions on five games read both, bar
Cyberpunk 2077's version question)*, and the page words it as "did not ask again"; or `NotHooked`. The slots are not emptied by a new request, so a second
session of a game that kept running stores what the first one read. `sl.init.preferences` stays unread (D112).
**The fourth step, 2026-11-12 (0.1.0-beta.45).** Two more entries have reach `Game`, from six calls
(`17_HOOK_ENGINE` §Hook inventory): `sl.feature.support` — `<feature> · slIsFeatureSupported`, the `sl::Result`
by NVIDIA's enumerator (`eOk`, `eErrorFeatureNotSupported`; `result 40` for a number past the forty this build
names, `result 255` for a code a byte could not carry), and `<feature> · slIsFeatureLoaded`, `on` or `off` — and
`sl.feature.lifecycle` — `<feature> · slSetFeatureLoaded` (`on`, `off`, `on_and_off`: what the game asked for
during the session, not the state it left), `· slAllocateResources` and `· slFreeResources` (a count; `≥ 15`
where the four bits stopped), and a row `slShutdown` with the number of shutdowns. All of it is word 1 of the
twelve feature slots and one word that was reserved (layout 5 and schema 23 as they were). A feature with nothing
to say has no row and a fact with no row is not stored. `AdvancedSources` has one member a call
(`StreamlineFeatureSupported`, `…Loaded`, `StreamlineSetFeatureLoaded`, `StreamlineAllocateResources`,
`StreamlineFreeResources`, `StreamlineShutdown`), `Read` / `NeverCalled` / `NotHooked` as before and null in a
row written before; the page says the six in one sentence. The switching and the counts are a session's — the
capture side clears them at a new request — so, unlike the answers, a second session does not inherit them.
`sl.init.preferences` now has reach `BeforeAttach` (D129): not a later release, never.
**Measured 2026-11-13** (six Streamline sessions on five games; `HANDOFF` item 43): `slIsFeatureSupported` was
read in every one — refusals among the answers, `eErrorFeatureMissing` for ImGUI, NIS and DeepDVC —
`slIsFeatureLoaded` in three games, `slSetFeatureLoaded` in two (every feature off and on), `slFreeResources`
and `slShutdown` once in one game each, and `slAllocateResources` in none.
- **D113 — three releases, because a new patch site cannot be proven in CI.** A crash in a game under the user-mode
anti-cheat exception's trial ends that exception for good (D38), and every release already means restarting the
game. **beta.40**: more fields of calls *already* hooked — `sl::DLSSOptions` where the game chains it into
@@ -771,6 +822,13 @@ planning, the design reviewed against the code before it was approved.
page; **no new patch site**. **~~beta.41~~ beta.42**: `slSetConstants` and `ffxConfigure`. **~~beta.42~~
beta.43**: `slGetFeatureVersion` and `slGetFeatureRequirements` — the owner's words: a release of their own, still
hooked. Each starts when the owner says the one before passed its owner-only item.
- **D122 — the second step is two releases** (owner decision 2026-11-12, after the owner's sessions on beta.40
and beta.41 and a review of the draft against the code). **0.1.0-beta.42 adds no patch site**: the session's
upscaler label (D120, `03_METRICS` §Upscaling), a patch registry that refuses what it cannot register, a native
log that survives the game's exit and says which descriptor types each ffx module saw — because Cyberpunk 2077,
set to FSR upscaling, was named "unknown" and nothing in the field could say why (D121) — and FSR's infinite depth
plane (D119). **0.1.0-beta.43 is `slSetConstants` and `ffxConfigure`**, begun only when that log was read. The
third step (`slGetFeatureVersion`, `slGetFeatureRequirements`) is beta.44, train C beta.45, train D beta.46.
- **D118 — 0.1.0-beta.41 is a fix release, and the train's numbers move by one** (owner decision 2026-11-12). The
owner's first evening with beta.40 showed the sensor library being closed under its other users (the paragraph on
`LhmLibrary` below; `20_OPEN_QUESTIONS` §M13); told that the fix would take the number D113 had given the train's
@@ -781,6 +839,20 @@ planning, the design reviewed against the code before it was approved.
into a game stayed 0.1.0-beta.40's, line for line, in a release that fixes something else).
- **D112 — `slInit` is not hooked in train B.** A game calls it before FrameLedger attaches, so its preferences
would almost never be seen. If it is ever hooked: `applicationId`, `projectId` and the paths are never read.
- **D129 — `slInit` is not hooked at all** (owner decision 2026-11-12, asked to reopen D112 and shown what was
found). No mode of the shipped product is in the game in time: *Play ▸ Start directly* does not create the game
suspended — it waits for the presentation runtime, runs the guard, then injects; nothing is ever patched on a
game's thread, so a hook lands some hundred milliseconds after its module appears (`17_HOOK_ENGINE`, the loader
lock); and a hook that exists only for Advanced metrics waits for the Agent's request, which comes after the
attach. A hook on it would be a patch that reads nothing. `sl.init.preferences` says so in the catalog. Most of
what it would have told is read another way: which features are loaded (`slIsFeatureLoaded`), and whether a
newer plugin than the game's own is in use (the versions of 0.1.0-beta.44).
- **D130 — six more core calls in one release, 0.1.0-beta.45**: `slIsFeatureSupported`, `slIsFeatureLoaded`,
`slSetFeatureLoaded`, `slAllocateResources`, `slFreeResources`, `slShutdown`. Trains C and D come after it; train
C's spike is written beside it, as a document.
- **D131 — the adapter a game asks `slIsFeatureSupported` about is never read**: `sl::AdapterInfo` holds its LUID
or a Vulkan physical device. The feature's id and the result are all that is kept, and a build check refuses the
names of the struct's members in the code loaded into a game.
- **D114 — the field of view is a session's range**, lowest to highest, never a series: a series would say when the
player aimed.
- **D115 — a tail member is read only where it is proven to be there** (`17_HOOK_ENGINE` §Which struct version
@@ -788,10 +860,28 @@ planning, the design reviewed against the code before it was approved.
- **D116 — "never the camera" is a build check**, as "never a setter" is (D108): `tools/overlay-fields-check.ps1` —
every read of a vendor struct in one header, each allowed member named and used, the camera's names refused
anywhere in the Overlay and the Vulkan layer, no copy of `sl::Constants` by value. *(Built 2026-11-12:
twenty-eight members on `tools/overlay-allowed-fields.txt`; `12_BUILD` gate 14f.)*
twenty-eight members on `tools/overlay-allowed-fields.txt`; `12_BUILD` gate 14f. Fifty-six since 0.1.0-beta.44,
with the two answers about a feature.)*
- **What will read N/A, and says why.** Many titles set their DLSS options through `slDLSSSetOptions`, which is not
an export (train D), so `sl.dlss.*` is filled only for a title that passes its options with the evaluate call.
`slGetFeatureVersion` and `slGetFeatureRequirements` are calls a game makes while starting.
- **Privacy Policy 2.19** at beta.45 (approved with that release's plan): 2.18 named two of Streamline's answers
about a feature; whether it is supported and loaded, the game switching it, allocating and freeing its resources
and shutting Streamline down are in neither list, so they are named — with two more things never read: what
identifies the graphics card a game hands over with its question, and the content of a graphics resource.
- **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.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
low-latency state; never a time of day, never an input's moment. The Disclaimer drops "API arguments and nothing
else" for what is true, and §2 gains the paragraph on the one call the component makes itself: where, how often,
on which thread, what it never calls, what ends it, and that a call which never returned could not be stopped.
- **Privacy Policy 2.17** at beta.43 (approved with that release's plan): 2.16 listed DLSS's and FSR's upscaling
parameters by name, and Streamline's per-frame constants and the frame-generation configuration are in neither
list, so they are named — and §4 says the two calls are intercepted only once a session with the option on has
started in the game.
- **Privacy Policy 2.16** at beta.40, once for the three releases: with Advanced metrics on, for a game FrameLedger
injects into, the parameters the game gives its upscaler and frame generation through the intercepted calls are
*stored* — sizes, presets, exposure, sharpening, the jitter's, the depth's and the field of view's ranges, flags,
@@ -814,7 +904,8 @@ the catalog differ in either direction. **Reach** is where a value can be read f
(the Agent's own process), `AgentElevated` (the same, as administrator with PawnIO), `Game` (read inside a game
FrameLedger measures, from the arguments of a call the Overlay hooks, while the session records Advanced metrics —
since 0.1.0-beta.40), `HookedCall` (an argument of a call the Overlay already hooks, not read yet), `NewHook` (a hook
that is not built — Train B), `Spike` (Trains C and D), `Refused`, `Deferred`, `Identifier` (D104), `PlayerState`
that is not built — Train B; no entry carries it since 0.1.0-beta.45), `BeforeAttach` (a call the game makes once,
before FrameLedger is inside it, so no hook could read it — D129), `Spike` (Trains C and D), `Refused`, `Deferred`, `Identifier` (D104), `PlayerState`
(rule 4), `Licence`, `NotInHeaders`. ~~Only the first two are read by a build of Train A.~~ The first three are read
(`AdvancedMetric.IsRead`).
@@ -977,24 +1068,40 @@ that is not built — Train B), `Spike` (Trains C and D), `Refused`, `Deferred`,
| Id | What it is | Scope | Source | Reach | Unit |
|---|---|---|---|---|---|
| `sl.constants.jitter` | The jitter offsets the game gave Streamline | SessionFact | Streamline | NewHook | Text |
| `sl.constants.motion_vectors` | Motion-vector scale, and whether they are 3D, dilated, jittered | SessionFact | Streamline | NewHook | Text |
| `sl.constants.depth` | Near and far planes, and whether depth is inverted | SessionFact | Streamline | NewHook | Text |
| `sl.constants.projection` | Field of view, aspect ratio, orthographic or not | SessionFact | Streamline | NewHook | Text |
| `sl.constants.resets` | How often the game reset the upscaler's history | SessionFact | Streamline | NewHook | Count |
| `sl.feature.versions` | Each Streamline feature's version and its NGX model version | SessionFact | Streamline | NewHook | Table |
| `sl.feature.requirements` | What each Streamline feature requires: operating system, driver, buffers | SessionFact | Streamline | NewHook | Table |
| `sl.init.preferences` | The preferences the game started Streamline with | SessionFact | Streamline | NewHook | Text |
| `ffx.framegen.config` | The game's FSR frame-generation configuration | SessionFact | FidelityFx | NewHook | Text |
| `sl.constants.jitter` | The jitter offsets the game gave Streamline | SessionFact | Streamline | Game | Table |
| `sl.constants.motion_vectors` | Motion-vector scale, and whether they are 3D, dilated, jittered | SessionFact | Streamline | Game | Table |
| `sl.constants.depth` | Near and far planes, and whether depth is inverted | SessionFact | Streamline | Game | Table |
| `sl.constants.projection` | Field of view, aspect ratio, orthographic or not | SessionFact | Streamline | Game | Table |
| `sl.constants.resets` | How often the game reset the upscaler's history | SessionFact | Streamline | Game | Count |
| `ffx.framegen.config` | The game's FSR frame-generation configuration | SessionFact | FidelityFx | Game | Table |
| `sl.feature.versions` | Each Streamline feature's version and its NGX model version | SessionFact | Streamline | Game | Table |
| `sl.feature.requirements` | What each Streamline feature requires: operating system, driver, buffers | SessionFact | Streamline | Game | Table |
| `sl.feature.support` | Whether Streamline says each feature is supported, and loaded | SessionFact | Streamline | Game | Table |
| `sl.feature.lifecycle` | Each feature switched on or off, its resources allocated and freed, Streamline shut down | SessionFact | Streamline | Game | Table |
| `sl.init.preferences` | The preferences the game started Streamline with | SessionFact | Streamline | BeforeAttach | Text |
| `sl.constants.camera` | Camera position, axes and matrices | SessionFact | Streamline | PlayerState | Text |
**Inside the game: what the graphics driver reports, asked for by the part inside the game itself** *(train C,
owner decisions D132, D136, D138 — `17_HOOK_ENGINE` §Calls the Overlay makes into a driver; since 0.1.0-beta.47)*
Not an argument of a hooked call: the Overlay calls the driver's two read-only latency getters about once a second,
only while a session records Advanced metrics, only for a Direct3D 12 game that had already loaded the driver's
`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:
reading it takes a patch at an address learned at run time, which is refused.
| Id | What it is | Scope | Source | Reach | Unit |
|---|---|---|---|---|---|
| `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 |
**Inside the game: routes a spike decides**
| Id | What it is | Scope | Source | Reach | Unit |
|---|---|---|---|---|---|
| `nvapi.reflex.mode` | Reflex: low-latency mode, boost, the frame-rate limit | SessionFact | Nvapi | Spike | Text |
| `nvapi.reflex.sleep_status` | What the driver's low-latency state is | SessionFact | Nvapi | Spike | Text |
| `nvapi.reflex.frame_report` | Latency per frame: simulation, render submit, present, driver, OS queue, GPU render | Series, one per device | Nvapi | Spike | Microseconds |
| `sl.dlss.optimal_settings` | The render size and sharpness DLSS recommends | SessionFact | Streamline | Spike | Text |
| `sl.dlss.vram_estimate` | DLSS's own estimate of its video memory | Series | Streamline | Spike | Mebibytes |
| `sl.dlssg.options` | DLSS frame generation: mode, frames to generate | SessionFact | Streamline | Spike | Text |
@@ -1004,7 +1111,7 @@ that is not built — Train B), `Spike` (Trains C and D), `Refused`, `Deferred`,
| `sl.dlssd.options` | Ray reconstruction's options | SessionFact | Streamline | Spike | Text |
| `sl.nis.options` | NVIDIA Image Scaling's options | SessionFact | Streamline | Spike | Text |
| `sl.deepdvc.options` | RTX Dynamic Vibrance's options | SessionFact | Streamline | Spike | Text |
| `sl.reflex.state` | Reflex through Streamline: availability and its frame reports | SessionFact | Streamline | Spike | Table |
| `sl.reflex.state` | Reflex through Streamline: availability and its frame reports | SessionFact | Streamline | RefusedRoute | Table |
| `sl.pcl.markers` | PC-latency markers the game sets | Series | Streamline | Spike | Count |
**Closed by a licence**
+35 -1
View File
@@ -60,10 +60,30 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> at once), waits `kScanRetryPauseMs` (250 ms), takes a **fresh** scan set and scans it whole. A member still unreadable
> then refuses `kProcessUnreadable`, as before; one that has gone is not in the new set; a target that has gone leaves
> no set, which refuses `kProcessTreeUnavailable`. **`ERROR_ACCESS_DENIED` — a protected process — is never retried**,
> and no other answer of any source is. The sentence above stands: every failure still means REFUSE; what changed is
> and no other answer of any source is *(one more since D123, below)*. The sentence above stands: every failure still means REFUSE; what changed is
> how many times "still loading" is asked before it counts as one. ctest `fl_guard` `[D48]` holds both directions,
> against fakes and against the real source (a process created suspended, a pid with no process).
>
> **Amended 2026-11-12 (owner decision D123): a module list that changed while it was read is read again, at most
> three times — never a pass.** The module check lists a process's modules and then asks each one's name. A game at
> its launch loads and unloads modules for seconds, and a module that was in the list and could not be named a
> moment later made the whole answer "incomplete": a refusal before injection, or — 0.5 s after it, at the first
> supervision scan — a safety unhook with no frame recorded, the game then running on unrecorded. **Five such ends
> in one PC's Agent logs in a week** (Phantom Blade Zero three times on 2026-11-05, Crown & Coin on 11-10,
> Cyberpunk 2077 on 11-12), and twice in this repository's own gate. Asked with that, the owner chose: read it
> again. Such a list is now `Collected::kUnsettled`; the pass finishes — **a blocklisted module among those that
> were read still refuses at once** — waits `kScanRetryPauseMs`, takes a fresh scan set and reads it whole, up to
> `kMaxUnsettledRereads` (3) times: four reads and 750 ms of pauses at most. A list still unsettled on the last
> read refuses `kModuleScanFailed` ("a module list kept changing while it was read"). **What did not change:** a
> list too long for the guard's buffer is still `kIncomplete` and refuses at once (a second read would be as
> long); a protected process still refuses at once; D48's re-read is still one for the whole check; every read is
> of the whole scan set, and the read that allows is one in which every member was read whole and none held a
> finding. A failure to read is still never a pass — what changed is how many times a list that is moving is
> asked before it counts as unreadable. The launch poll's presentation-runtime probe treats an unsettled list as
> "ask again" rather than deciding on half of one. ctest `fl_guard` `[D123]`: against fakes, every direction
> above; against the real source, a process that loads and frees a module in a loop — read some 3,600 times in
> three seconds, about one read in four is unsettled and none is anything else.
>
> **Launch mode (2026-09-06, P1 item 2) does not weaken this.** `FlGuardedInjectWhenReady` polls
> the same enumeration to learn *when* the launched target has mapped a presentation runtime, and a
> failing enumeration there means "not yet" — the poll continues. That is not a pass: the poll
@@ -1214,6 +1234,20 @@ outlives a rules change, a game update and *Change executable*; §What a finding
hooked session's early abnormal end; the policy counted them, and two turned hooking off. It cannot tell either from
the hang it exists for, so it stands as written; whether a witness — the same executable started again within
seconds — may exempt a hand-off is the owner's decision, not taken. Users are told in `LIMITATIONS.md` §Play.
- **The count starts again when the user switches hooking on (owner decision D126, 0.1.0-beta.44).** Until then
`hook_crash_count` only ever grew: Lies of P had two such ends on 2026-10-19/20 (the hand-off above), its user
switched hooking on again, and on 2026-11-12 one more early end — the game's own crash, by the owner, after a shader
failed to compile — switched it off at once, under a reason that says *twice*. The consent grant, the only
statement that turns hooking on, now sets the count to 0 (`SqliteGameConsentStore`). The policy still only
disables, a block is still never cleared, and the user-mode exception's trial (D38) keeps its own record, which
nothing sets back.
- **A fault while the game is closing is not seen by a hooked session (owner decision D127: written down, not
changed in 0.1.0-beta.44).** Hogwarts Legacy faults in the driver's `_nvngx.dll` at exit — six times in Windows'
application log since 2026-11-06, hooked or not. The one unhooked session reads `crashed`; the five hooked ones
read `normal` with exit code 0: the witness is looked for when the session is saved, which for a hooked session
is before Windows has written the event. Looking again later would make every session of such a game `crashed`,
and under a user-mode exception that ends the exception for good for a fault no hook caused — so it is a decision
of its own, not a fix to slip in beside two new hooks.
- **What reads as a crash changed in beta.14, in both directions** (`04_CAPTURE` §Crash & exit classification): a
Windows report that is not a crash (a memory-leak or hang report) no longer makes one, and an engine's crash reporter
started by a game that then left does — Unreal's crash ended with exit code 3 and read `normal`. Both feed this policy,
+12 -2
View File
@@ -1549,6 +1549,16 @@ probe never showed a deadlock.
> real-game leg — a title that pulls Streamline or D3D12 in lazily, hooked through the wake — which the
> `loader detour:` report line will show as a non-zero wake count with the family present from the first
> bucket.
>
> **0.1.0-beta.46 (owner decision D134): one suspension for a batch, and the rule is as it was.** The rows a
> watchdog tick finds are enabled under one `MH_ApplyQueued` — one stop of the threads where there was one a row
> (`17_HOOK_ENGINE` §Unhooking, Batches). Still only on the watchdog, never from the detour and never on a game's
> thread; the gate around the queue is not held across a symbol lookup, so it is never held with the loader's lock
> wanted. What a stop of the threads costs in a real game was read from the owner's logs of 2026-11-13: 57 to
> 215 ms, thirteen times over for a Streamline title until this release. **On beta.46, the same evening** (five
> games, eighteen batches): 81–262 ms a batch for sixteen of them, and two that took 0.61 s and 1.26 s while their
> game was loading — one stop where there were three and thirteen, and still a second of every thread of Hogwarts
> Legacy standing still. Not explained (`17_HOOK_ENGINE` §Unhooking, Batches).
### H11 ◐ · XeFG and FSR3-FG identity — **AMD built 2026-09-04 through the ffx-api leaves, complete 2026-09-06; Intel closed by licence; FSR 3.0 host route built 2026-09-05**
@@ -1861,9 +1871,9 @@ Moved verbatim, in this order.
| M10 ❓ | **§CPU — is the CPU temperature this build reads the right sensor, and does it read at all on the owner's machine?** `LhmCpuTemperatureReader` (2026-09-21) opens a CPU-only LibreHardwareMonitor `Computer` when the Agent is elevated AND `PawnIo.IsInstalled`, takes the package sensor (`CPU Package` / `Core (Tctl/Tdie)`) and falls back to the hottest core. It was written against LHM's sensor names and a fake `ILhmComputer`; **no elevated run with PawnIO has been taken.** | **The measurement is one session:** Agent elevated, PawnIO installed, a five-minute capture with HWiNFO or Ryzen Master open beside it. Pre-committed: `max_cpu_temp` within 3 °C of the reference's package peak → keep; a core sensor picked where a package sensor exists, or a reading tens of degrees off (a distance-to-TjMax sensor mistaken for a temperature) → fix `Pick` and re-run; nothing read at all → `cpu_temp` stays N/A and `legal/ACCURACY.md` says processor temperature is not measured. CPU **load** and memory are not in question: `TheRealCountersAnswerOnThisMachine` reads them on every gate run. |
| M11 🅓 | **The game's VRAM budget and `budget_exceeded_pct` (FR-4.5's second half), 2026-10-03.** D43 reads the game's usage from outside (the `GPU Process Memory` counters); the budget the OS grants the process is what DXGI's `QueryVideoMemoryInfo` returns to the *calling* process (§M7), so only an in-process call — the Overlay's background thread, which today only checks for a stop — or `D3DKMTQueryStatistics`' `PROCESS_SEGMENT_GROUP` query (documented "Reserved for system use") could read it. **Deferred by decision:** neither is built; `vram_budget_exceeded_pct` stays NULL and the budget N/A, and the in-process route would change what the Disclaimer says the Overlay's thread does. Reopening it needs that decision, not a measurement. | — |
| 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. |
| 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. |
| 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 |
+454 -96
View File
@@ -80,86 +80,156 @@ owner-only items stay below; the history of every train, the passed owner-only i
| `§beta.38`, `§NEXT` (the owner's request of 2026-11-11, the four trains) | [`handoff/history/0.1.0-beta.38.md`](handoff/history/0.1.0-beta.38.md) |
| `§beta.39`, train B's plan as approved (its `§NEXT`) | [`handoff/history/0.1.0-beta.39.md`](handoff/history/0.1.0-beta.39.md) |
| `§beta.40`, what the owner's first sessions with it showed, train B's traps | [`handoff/history/0.1.0-beta.40.md`](handoff/history/0.1.0-beta.40.md) |
| `§beta.41`, what the owner's sessions on beta.40 and beta.41 showed, the plan of 2026-11-12 (D119–D122) | [`handoff/history/0.1.0-beta.41.md`](handoff/history/0.1.0-beta.41.md) |
| `§beta.42`, what the owner's seven sessions on beta.42 showed (D121 answered, the guard's lost launches), beta.43's design as planned | [`handoff/history/0.1.0-beta.42.md`](handoff/history/0.1.0-beta.42.md) |
| `§beta.43`, what the owner's nine sessions on beta.43 showed, session by session (item 41), the traps of that train | [`handoff/history/0.1.0-beta.43.md`](handoff/history/0.1.0-beta.43.md) |
| `§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) |
| `§Owner-only`, an open item | [§Owner-only](#owner-only--no-pr-can-close-these) below |
| `§Owner-only`, a passed item (3, 12, 14–19) | [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) |
| `§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) |
| `Dnn` | [§Decisions index](#decisions-index) below |
---
## **START HERE** — 2026-11-12, 0.1.0-beta.41: one fix — the sensor library is no longer closed under its other users
## **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.41.md`; this is what no other file carries.* 0.1.0-beta.40 was released in the
small hours of 2026-11-12 and the owner ran it that same night on eight games, as administrator with PawnIO — the
first elevated run there has been. A copy of the ledger and the Agent's log showed the in-game readings working
(Lies of P, the first real game read) and **a defect of train A that only that elevation can show**: three
LibreHardwareMonitor `Computer`s in one Agent, and the library's per-process state closed by one under the others.
This release is that fix and nothing else: #400 (0.1.0-beta.40's release facts; two comparisons SonarCloud flagged),
#401 (`LhmLibrary`), and this one. **Everything about train B — what was built, what the owner's sessions showed,
the traps — is [`handoff/history/0.1.0-beta.40.md`](handoff/history/0.1.0-beta.40.md)**; the fix is
[`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics and [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md)
§M13.
*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
### What this release decided, beyond D136–D141
- **D118 — the fix is released at once as 0.1.0-beta.41, and train B's numbers move by one.** D113 had named
beta.41 for the train's second release. Told so, the owner chose to release the fix now. The train's second
release is **beta.42**, its third **beta.43**, train C **beta.44**, train D **beta.45**. Released changelogs and
moved HANDOFF sections keep the numbers of their day; so do the comments in `fl_shm.h` and `ShmLayout.cs` (the
members "0.1.0-beta.41" and "beta.42" fill), **deliberately**: touching them would have changed source that is
loaded into a game in a release that says the game-side code is beta.40's line for line. The release that fills
a member rewrites its comment.
- **The reads of the sensor library are not put under one lock**, only its opens and closes. A lock around every
read would have put a session's once-a-second poll behind the Advanced reader's, undoing the separate threads
that keep a hanging sensor from holding up the other reader.
- **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 39** (this fix, on the PC that showed the fault) **and the rest of item 38** (an FSR 3.1+
title; two sessions of one running game; the cost; the values of Lies of P against the game's own settings).
2. **0.1.0-beta.42 — train B's second release — when the owner says item 38 passed**: `slSetConstants` and
`ffxConfigure`. A plan of its own first. What it must settle, beside what
[`handoff/history/0.1.0-beta.40.md`](handoff/history/0.1.0-beta.40.md) §NEXT lists (`kMaxPatches = 48`, the window
of `sl::Constants` pinned outside the camera members, the per-call overhead, the gate's list for the two new
structs):
- **`FLT_MAX` in an FSR depth plane.** Lies of P gave `cameraFar = 10` and no `cameraNear`; most likely the
plane at infinity is `FLT_MAX`, which the Overlay refuses as "nobody set this". Decide whether it is stored as
"infinite" — an Overlay change, with its overhead stated.
- **Valor Mortis.** One exit by access violation 51 seconds after injection under beta.40, none under an earlier
build, not attributed. Its crash count is 1; a second such end switches its hooking off. Before adding a hook
to that game's process, ask the owner whether it happened again.
- **The release numbers in the comments** of `fl_shm.h`, `ShmLayout.cs`, `hook-harness` and `guard_test.cpp` for
the members that release fills (D118).
3. **0.1.0-beta.43 — the third — when the owner says the one before passed**: `slGetFeatureVersion` and
`slGetFeatureRequirements`.
4. **Trains C and D** (beta.44, beta.45) each begin with a spike and end in the owner's go or no.
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.~~ **Recorded 2026-11-12: 0.1.0-beta.41 was released
2026-11-11T22:38:39Z** (05:38 on the 12th in the owner's time zone) from the signed tag on `a6b95e8` (#402), by
run 43111028661 — 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 shipped natives carry `FL_BUILD_ID v0.1.0-beta.41`. The delta
from beta.40 is 807,692 bytes beside a full package of 110,708,416 — "Delta processed 0452 files. 0022 patched,
0430 unchanged". The wiki was published by run 43113525941. The rehearsal on the release branch (run 43108189693)
had made a delta of 841,038 bytes with the same file counts.
- **The fix has not been seen to work.** It was written from the log's timing; the fault needs an elevated Agent with
PawnIO. Item 39 is the check, and `20_OPEN_QUESTIONS` §M13 stays open until then.
after this text. Record them in the next pull request, with what SonarCloud and Qodana said.~~ **Recorded
2026-11-14: 0.1.0-beta.47 was released 2026-11-14T01:11:19Z** (08:11 in the owner's time zone) from the signed
tag on `3d7c273` (#446), by run 43537436561 — green at the first attempt, one run for the one tag push. Eight
assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed; the four shipped natives carry
`FL_BUILD_ID v0.1.0-beta.47`. The delta from beta.46 is 1 820 144 bytes beside a full package of 110 795 507 —
"Delta processed 0452 files. 0024 patched, 0428 unchanged". The wiki was published by run 43539059710. The
rehearsal on the release branch (run 43534606602, at `43426fe`, the released tree) had made a delta of 1 838 295
bytes with the same file counts. **SonarCloud answered on `3d7c273`: the quality gate passed and no issue is open
on `main`. Qodana's two reports, CodeQL and `check` are green on that commit.** On the way the advisory checks
found three things after local gates were green (§Traps), and no required check failed.
- **The release branch's local gate was red once, for a reason outside the code** (2026-11-14 07:20): the freshly
linked `fl_guard_test.exe` was gone from the build tree seconds after the gate began — Windows Defender's log has
three configuration changes at 07:20:53–56 and no detection; which security program removed the file is not
known, and nothing of its settings was looked at further or touched. `fl_guard` ended after 0.72 s **and was
counted as failed, not passed**: the rule of #438 (a native test names the line it ends on) did what it was
written for. Run again, the gate was green.
- ~~**No real game has run the read.**~~ Two have (Phantom Blade Zero and Cyberpunk 2077, 2026-11-14). **The accuracy
statement, `LIMITATIONS.md` and the guide still say no real game had been read**: true when written, to be
brought up to date with the next release, as beta.46's pages were.
- **In Phantom Blade Zero the driver's *GPU render* span is longer than its total** (item 45): shown as reported,
not explained. In Cyberpunk 2077 it is not. The owner's answer: read the driver's active time (NEXT 2).
- **The Agent's samples are 1.32 s apart while `sensor_blobs.hz` says 1.0** (seen 2026-11-14 in the `t_ms` series,
in sessions back to beta.42). Not looked into: whether anything reads `hz` as the spacing.
- **No test runs the whole path through the real Agent**: the injected tests stop at the shared memory and the
sampler's start from it; no end-to-end case loads the stand-in module under an Agent session.
- **Two install batches of beta.46 took 0.61 s and 1.26 s and nothing explains them** (Hogwarts Legacy, Cyberpunk
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".** They have been read on one PC and compared with nothing. The
owner's to reword.
- **SonarCloud's `csharpsquid:S3869` on `ParentDump.cs`** is open on `main` until the owner accepts it again (item 38
(j); the owner said on 2026-11-12 that they will). Until then `main`'s `sonarcloud` job is red on that one line.
- **Items 36 (d) (`LogNoteW`) and 37 are still open**; the ledger shows part of 37 (e) happened — the elevated
groups opened and read — and nothing of it was compared with another tool. The alpha line still rests (D98).
sensors "have never been read on real hardware"** — the owner's to reword. The alpha line still rests (D98).
**Owner-only:** item 39 — beta.41 on the PC that showed the fault: several sessions as administrator with PawnIO,
the Advanced page open and closed between them, and the Agent's log afterwards.
**Owner-only:** what is left of item 45 (Reflex off in a game's menu; off means off; how it felt); one session
each of Valor Mortis and Black Myth: Wukong with hooking off; what item 41 left unexercised;
item 40 (d).
## Owner-only — no PR can close these
*The items that passed — 3, 12, 14–19 — moved verbatim to [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) on 2026-10-19 (D66); the numbers are kept, and a number is never reused.*
*The items that passed — 3, 12, 14–19, and 38 and 39 on 2026-11-12 — moved verbatim to [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) (the first eight on 2026-10-19, D66); the numbers are kept, and a number is never reused.*
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
`main`, so the gate that makes the anti-cheat blocklist un-removable is advisory.
@@ -458,43 +528,302 @@ the Advanced page open and closed between them, and the Agent's log afterwards.
answered on 2026-11-11; what is left for a real game is the hooked session and the elevated one. (g) **The words**: the `vi` strings read as a Vietnamese
speaker would write them; the `ja` strings marked `review`. (h) **A copy of the ledger** (`--data-dir`) that holds
such a session: the page is there, opens on *Session*, and *This PC* says it is a copy.
38. **beta.40, Advanced metrics inside a real game** (D111–D116; train B's first release — beta.41 is not begun
until this passes). (a) **The update from beta.39**: the terms window shows the **Privacy Policy 2.16** once, and
not the Disclaimer; a game that was **running across the update** is refused until it is restarted, with the
reason, and measured normally after. (b) **The option off, a hooked game that uses DLSS or FSR**: the game runs
and is measured as in beta.39; the session is not on the Advanced page's list; nothing in the Agent's or the
Overlay's log mentions the upscaler's options. (c) **The option on, a title that upscales through FSR 3.1 or
later** (AMD's `amd_fidelityfx_*.dll` in its folder; a title on the older FSR 3.0 interface, such as one that
ships `ffx_fsr3_x64.dll` alone, is expected to show none): on *Session*, under Upscaling, sharpening on or off
and its strength against the game's own setting; the field of view as a range, against the game's slider (it is
the **vertical** angle, in radians with degrees beside it) — and wider after zooming or aiming; the near and far
planes; the flags; the chart of the frame time the game reported beside the session's own frame time; FSR's
memory only if the game asks for it. (d) **The option on, a DLSS title**: most are expected to say *the game made
none of the calls these are read from*. If one shows rows, this is the first sight of them anywhere: the output
size against the display resolution, the preset letters against the NVIDIA app's override or the DLSS
indicator, HDR input against the game's HDR setting. Write down which title did. (e) **The sentence under the
session** says which of the three it was, and the session's summary still names the upscaler and its quality as
before. (f) **Two sessions of one game that kept running**, both with the option on: the second one's field-of-
view range and counts are its own, not the first one's carried over. (g) **A game under the user-mode anti-cheat
exception**, the option on: it runs, the session is hooked, and its trial is not ended by anything new. (h) **What
it costs**: the game's own frame rate with the option on and off, and the Agent's processor time in a hooked
session (NFR-2: 2.5 % of one core). (i) **The words**: the fourteen new `vi` strings and the Settings text; the
`ja` ones are marked `review`. (j) **SonarCloud**: accept `csharpsquid:S3869` on
`src/FrameLedger.Infrastructure/Diagnostics/ParentDump.cs` again — the same call the acceptance of beta.24 covers,
raised anew because #398 moved it (`13_CI_CD` §SonarCloud says why it is safe); until then `main`'s reliability
rating on new code shows E for that one line.
39. **beta.41, the sensor library on the PC that showed the fault** (D118; `20_OPEN_QUESTIONS` §M13). (a) **The
update from beta.40**: no terms window, the ledger opens as before; a game running across the update is refused
until restarted, as after every update. (b) **As administrator with PawnIO, Advanced metrics on**: five or more
sessions of different games, some with the Advanced page left open on *This PC* throughout, some with it closed,
one started within a few seconds of another ending. **Afterwards the Agent's log (Logs page, or
`agent-<date>.log`) holds no `advanced: a device is left alone` and no `advanced: the sensor library did not
open`**, and every one of those sessions has its processor, memory and motherboard readings on *Session* (about
two hundred series; a session with seventeen is the fault). (c) **The page after a session ends**: the
processor's rows on *This PC* are still there and still moving, without reopening the page. (d) **Not as
administrator**: nothing differs from beta.40 — the card's sensors and the driver's figures, and *Sources* says
why the rest is not read. (e) While there, the part of item 37 (e) nobody has done: a few of the processor's and
the motherboard's values beside HWiNFO.
40. **beta.42 — the log that answers D121, the label, the plane at infinity** (D119–D122). (a) **The update from
beta.41**: Help ▸ Check for updates, *Restart to update* with no game running; no terms window. (b) **Cyberpunk
2077 with FSR upscaling** (FSR 3 or 4, with or without FSR frame generation — as it was when the upscaler read
"unknown"): one session of a few minutes of play, then **quit the game from its own menu**. Nothing else is
needed: `%LOCALAPPDATA%\FrameLedger\logs\overlay-<pid>-….log` of that session is what is read. If the session
now names FSR, say so — nothing in this release should have changed that. (c) **A game that gave one depth
plane** — Lies of P, Clair Obscur or Dying Light: The Beast, FSR upscaling, **Advanced metrics on**: the
session's Advanced page shows both planes, one of them "∞". If it still shows one, the missing plane is not
`FLT_MAX` and the log of (b)'s kind says nothing about it — say so. (d) **A session that changes upscaler** —
Dying Light: The Beast as it was (DLSS evaluated, then FSR), or any game switched between DLSS and FSR in its
menu during one session: the summary names the one that ran longest, with that one's quality and render size,
and says *settings changed during session*. (e) **Any hooked game, ended by quitting it**: its overlay log has
lines after the first second — `HOOK_INSTALLED` with a module and a function, `RUNTIME_CENSUS` — and no
`PATCH_FAILED`; if there is one, its `a=` number is the reason.
**Four sessions were run on 2026-11-12 and read the same morning** (START HERE §What the owner's first four
sessions on beta.42 showed): (a) happened — the sessions carry the beta.42 build; (b) read, and D121 answered:
the session upscaled with FSR 2.1, built into the game; (c) Lies of P and Dying Light show `cameraNear = ∞`;
(e) all four logs are whole and none has a `PATCH_FAILED`. **(d) was not exercised**, and the owner has not
said the item passed.
41. **beta.43 — the first real games with the two new hooks, and the guard's re-read** (D123–D125). **Not first on
a game under the user-mode exception's trial** (D38): a crash there ends the exception for good. (a) **The
update from beta.42**: Help ▸ Check for updates, *Restart to update* with no game running; **the terms window
shows once, with Privacy Policy 2.17**. (b) **The guard**: over the games played, the Agent's log
(`logs\agent-<date>.log`) has no session that ended at a game's launch with `guard=ModuleScanFailed`. If one
does, its signal now says which kind — *kept changing while it was read* (four reads were not enough) or *came
back incomplete* — say which. (c) **A Streamline game with Advanced metrics on** (Dying Light: The Beast, or
Cyberpunk 2077 with DLSS): a session of a few minutes, quit from the game's menu. Its Advanced page shows the
Streamline rows — jitter, motion vectors, depth, projection, resets — and the line under the session says
*read*. **Read them for sense**: a field of view between about 0.3 and 2.5 rad, an aspect ratio near the
screen's, a jitter under 1, planes that are not both zero. Values that make no sense mean the game's struct is
not laid out as the one FrameLedger was built against: say so, with the numbers, and do not run further games.
(d) **FSR frame generation on** (Cyberpunk 2077 or Lies of P), Advanced metrics on: the page shows the
frame-generation rows — on, asynchronous or not, the flags, the rectangle — and the line says *read*. (e) **The
three answers of the line**: a game with neither library says *not hooked* for both; a game where it says
*hooked — the game did not make the call* for a library the game plainly uses is a finding, not a pass — say
which game. (f) **Off means off**: with Advanced metrics off, **start a game afresh** and record a session; it
has no Advanced button, and its `logs\overlay-<pid>-….log` has no `HOOK_INSTALLED` line naming `slSetConstants`
or `ffxConfigure`. (A game that was already running when a session with the option on was recorded keeps the
two patches until it exits — that is by design, and its log will have the lines.) (g) **Nothing else moved**:
no crash, no `PATCH_FAILED` in any overlay log, frame rates and the frame-generation factor as on beta.42 for
the same game and settings.
**What each outcome means, written before the run.** (c) or (d) empty with *not hooked*: the log of that
session says why — no `HOOK_INSTALLED` for the function (the library is a 1.x interposer or lacks the export)
or a `PATCH_FAILED` (its `a=` number is the reason). Empty with *hooked — the game did not make the call*: the
game reaches Streamline or FSR by a way that does not pass the export — beta.44's plan needs to know. A crash,
or a game that will not start: say so at once; *Disable all hooking* (Settings ▸ Capture) and switching Advanced
metrics off are the two ways to run without the hooks, and which of them cured it says which hook it was.
**Nine sessions were run on 2026-11-12 and read the same afternoon** ([`handoff/history/0.1.0-beta.43.md`](handoff/history/0.1.0-beta.43.md) §What the owner's nine
sessions on beta.43 showed): (a) happened — Privacy Policy 2.17 accepted once, at the update; (b) held — no
`guard=ModuleScanFailed` since the update; (c) read on Phantom Blade Zero, Cyberpunk 2077 and Hogwarts Legacy,
every value sane but one: **Cyberpunk 2077 gives its field of view in degrees** (51–90), and the page labels it
radians — the struct is laid out as expected, the label is wrong; (d) read on Lies of P, **not exercised through
the FidelityFX 2.3 loader**; (e) the three answers were each seen and none is a finding, **a game with neither
library was not run**; (f) held on Lies of P started afresh; (g) no `PATCH_FAILED`, no fault, frame rates as
before — Lies of P's 35 s end with exit code 3 is, by the owner, the game's own crash after a shader failed to
compile, and Hogwarts Legacy's fault at exit is in Windows' log six times since 2026-11-06, hooked or not.
**Judged passed 2026-11-12, on the owner's word to go on if it did**; the two parts in bold stay open.
42. **beta.44 — the two questions about a feature in real games, and what the nine sessions found, fixed**
(D126–D128). **Not first on a game under the user-mode exception's trial** (D38): a crash there ends the
exception for good. (a) **The update from beta.43**: Help ▸ Check for updates, *Restart to update* with no game
running; **the terms window shows once, with Privacy Policy 2.18**. (b) **Cyberpunk 2077 with Advanced metrics
on**, a session of a minute or two: its Advanced page shows the field of view as the game gives it —
`51.0055 – 90`, or whatever the game's setting makes it — with a line under it that says *Not radians*, and no
"rad" beside the number. The two sessions of 2026-11-12 keep `51.0055 – 90 rad (2922.4° – 5156.6°)`: they were
stored that way. (c) **Any Streamline game with Advanced metrics on** (Phantom Blade Zero, Hogwarts Legacy,
Cyberpunk 2077): the line under the session has one more sentence — *Which version each Streamline feature is:
…. What each requires: ….* — and for each it says *read*, or *hooked - the game asks this while it starts, and
did not ask again after FrameLedger attached*. **The second is the expected answer** for a game that was already
past its start-up when FrameLedger attached; it is not a failure. If it says *read*: the page lists features by
NVIDIA's names (`kFeatureDLSS`, `kFeatureDLSS_G`) with versions and requirements — check that the driver version
it shows as *detected* is the installed driver's, and that Streamline's version is the game's `sl.*.dll` file
version. (d) **Which games, if any, say *read***: nothing to set up — FrameLedger attaches as soon as it sees the
game — but say, for each Streamline game run, which of the two answers each call got. Hogwarts Legacy loaded its
Streamline library some six seconds after FrameLedger attached on 2026-11-12, so it is the likeliest to say
*read*; Phantom Blade Zero and Cyberpunk 2077 had it loaded already. (e) **A game with no Streamline** (Lies of P, Kingdom Come:
Deliverance II): both say *not hooked*. (f) **Off means off**: with Advanced metrics off, **start a game
afresh** and record a session; its `logs\overlay-<pid>-….log` has no `HOOK_INSTALLED` line naming
`slGetFeatureVersion`, `slGetFeatureRequirements`, `slSetConstants` or `ffxConfigure`. (g) **Nothing else
moved**: no crash, no `PATCH_FAILED` in any overlay log, frame rates and the frame-generation factor as on
beta.43 for the same game and settings. With Advanced metrics on, a Streamline game's log has
`slGetFeatureVersion` and `slGetFeatureRequirements` as its **first two** Streamline `HOOK_INSTALLED` lines.
(h) **The count of early ends** (D126) is not something to provoke: if a game whose hooking you switched back
on ends once within a minute of starting, hooking stays on; a second such end switches it off, as before.
**What each outcome means, written before the run.** (c) *not hooked* on a Streamline game: the log says why —
no `HOOK_INSTALLED` for the function (a 1.x interposer, or the export is missing) or a `PATCH_FAILED`. (c) and
(d) both *did not ask again* on every game: the calls are made before any attach can be in — then these two
hooks give nothing in attach mode, and whether they are worth their two patches is the owner's to say before
train C. *Read* with numbers that make no sense (a driver version that is not the installed one, a feature
named `feature <number>`): say so with the numbers — an id with no name only means NVIDIA added a feature this
build does not know. A crash, or a game that will not start: say so at once; *Disable all hooking*
(Settings ▸ Capture) and switching Advanced metrics off are the two ways to run without the hooks, and which
of them cured it says which hook it was.
**Eight sessions were run on 2026-11-12 and read the same evening** ([`handoff/history/0.1.0-beta.44.md`](handoff/history/0.1.0-beta.44.md) §What the owner's
eight sessions on beta.44 showed): (a) happened — Privacy Policy 2.18 accepted once; (b) held — Cyberpunk 2077 reads
`51.0055 – 90` and *not radians*; (c), (d) **both questions read on five games, six sessions of six** — the
expected answer was the other one — with the driver, Windows and NGX versions agreeing with the PC, and one
reading no file could give: frame generation's Streamline plugin is 2.14.16 on three games that ship an older
one; Cyberpunk's version question was *not asked again*; (e) held on Kingdom Come: Deliverance II; (g) no
`PATCH_FAILED`, no fault, the two rows first; (h) seen for real — Valor Mortis's second early end switched
hooking off, the owner switched it on, the count is 0. **(f) was not exercised.** Valor Mortis crashed 51 s
into a hooked session exactly as on beta.40, and Black Myth: Wukong faults in Steam's crash handler at every
exit: neither is explained, and neither began with this release. **Taken as passed on the owner's "update and
go on", 2026-11-12**; (f) and the two comparisons stay open.
43. **beta.45 — six more Streamline calls in real games** (D129–D131). **Not first on a game under the user-mode
exception's trial** (D38): a crash there ends the exception for good. (a) **The update from beta.44**: Help ▸
Check for updates, *Restart to update* with no game running; **the terms window shows once, with Privacy Policy
2.19**. (b) **Any Streamline game with Advanced metrics on** (Phantom Blade Zero, Clair Obscur, Valor Mortis,
Black Myth: Wukong, Cyberpunk 2077), a session of a few minutes that includes **changing a graphics setting
that touches frame generation or DLSS** if the game lets you: its Advanced page has two more tables —
*Whether Streamline says each feature is supported, and loaded* (`kFeatureDLSS_G · slIsFeatureSupported` =
`eOk`, `· slIsFeatureLoaded` = *On* or *Off*) and *Each feature switched on or off, its resources allocated and
freed, Streamline shut down* — and the line under the session ends with one more sentence: *Streamline's other
calls - read: …; hooked, the game did not make the call: …; not hooked: ….* Say, for each game, which calls
are in which group. (c) **Check one number you can know**: a feature the game has switched off in its own menu
and that reads *On* under `slIsFeatureLoaded`, or the reverse, is worth saying — "loaded" is Streamline's word
for the plugin being in, not for the feature being in use, and what a real game does here is not known.
(d) **A game with no Streamline** (Lies of P, Kingdom Come: Deliverance II): all six are in *not hooked*.
(e) **The way out**: close each game the way you usually do. **Black Myth: Wukong and Hogwarts Legacy already
fault while closing** (Steam's `crashhandler64.dll`, `_nvngx.dll`); what matters is whether anything is
*different* — a new fault in Windows' application log (Event Viewer ▸ Windows Logs ▸ Application, *Application
Error*) naming another module, a game that hangs on exit, a game that used to close cleanly and does not.
(f) **Off means off**: with Advanced metrics off, **start a game afresh** and record a session; its
`logs\overlay-<pid>-….log` has no `HOOK_INSTALLED` line naming any of the ten: `slSetConstants`, `ffxConfigure`,
`slGetFeatureVersion`, `slGetFeatureRequirements`, `slIsFeatureSupported`, `slIsFeatureLoaded`,
`slSetFeatureLoaded`, `slAllocateResources`, `slFreeResources`, `slShutdown`. (This is item 42 (f), which was
not run.) (g) **Nothing else moved**: no crash, no `PATCH_FAILED` in any overlay log, frame rates and the
frame-generation factor as on beta.44 for the same game and settings; with Advanced metrics on the log ends
with an `UNHOOK_RESTORED` line for each patch and no "the stop was still writing". (h) **The Advanced page's
catalog**: *The preferences the game started Streamline with* reads *Not read: the game makes this call once,
before FrameLedger is inside it*.
**What each outcome means, written before the run.** A call in *hooked, the game did not make the call* in
every game: the game does that before FrameLedger is in, or never — then that hook gives nothing in attach
mode, and whether it keeps its patch is the owner's to say. `slIsFeatureSupported` with a result that is not
`eOk` for a feature the game then uses: say which — the row is Streamline's answer to the game, and the game
may have asked about another graphics card. A count of `≥ 15`: the game allocates or frees every few frames;
the number stopped, nothing is wrong. *Not hooked* on a Streamline game: the log says why — no `HOOK_INSTALLED`
for the function (a 1.x interposer, or the export is missing) or a `PATCH_FAILED`. **A new fault on the way
out, a hang on exit, or a crash in play**: say so at once, with the game; switching Advanced metrics off and
starting the game afresh runs it without any of the ten hooks, and if that cures it the hook is one of the
six new ones or the four before — the overlay log's last `HOOK_INSTALLED` lines and Windows' fault entry say
which is nearer. A game that will not start at all: *Disable all hooking* (Settings ▸ Capture).
**Seven sessions were run on 2026-11-13 and read the same day** ([`handoff/history/0.1.0-beta.45.md`](handoff/history/0.1.0-beta.45.md) §What the owner's
seven sessions on beta.45 showed): (a) happened — Privacy Policy 2.19 accepted once; (b) five Streamline games, six sessions —
`slIsFeatureSupported` read in all, `slIsFeatureLoaded` in three games, `slSetFeatureLoaded` in two,
`slFreeResources` and `slShutdown` once in one game each, **`slAllocateResources` in none**; (d) held on Kingdom
Come: Deliverance II; (e) **nothing different**: Hogwarts Legacy and Black Myth: Wukong fault while closing in
the same module at the same offset as before, the other four games leave no fault; (g) no `PATCH_FAILED`, no
fault counted, rates as before — and no session was stopped while its game ran, so the part about
`UNHOOK_RESTORED` lines was not exercised and was worded wrongly. **(f) was not exercised; (c) and (h) are the
owner's to say.** Taken as passed on the owner's "check the logs and go on", 2026-11-13; (f) stays open.
`slAllocateResources` keeps its patch (D135, the same day).
44. **beta.46 — hooks in and out under one stop of the threads, in real games** (D134). **Not first on a game under
the user-mode exception's trial** (D38): a crash there ends the exception for good. (a) **The update from
beta.45**: Help ▸ Check for updates, *Restart to update* with no game running; **the terms window does not
show** (nothing new is read). (b) **Any Streamline game with Advanced metrics on** (Hogwarts Legacy first — its
thirteen patches took 2.8 s on beta.45 — then Phantom Blade Zero, Cyberpunk 2077, Dying Light: The Beast, Black
Myth: Wukong): play as usual and close the game. Its `logs\overlay-<pid>-….log` has `PATCH_BATCH install`
lines, and the `sl.interposer.dll` `HOOK_INSTALLED` lines above each carry **the same time** to the thousandth
of a second, not times 0.06–0.2 s apart. Say the `a=` of each `PATCH_BATCH` line: it is the microseconds the
game's threads were stopped for that batch. (c) **How the game's start feels**: no worse than on beta.45 — the
hitching while a game with Streamline starts should, if anything, be shorter. (d) **A stop while the game
runs**, which no session has exercised since beta.43: with a game running and being recorded, switch *Disable
all hooking* on in Settings ▸ Capture; the part inside the game stops at its next safety scan, within 30
seconds. The game must go on running without a freeze of seconds; the log then has `STOP`, an `UNHOOK_RESTORED`
line for every patch, one `PATCH_BATCH restore` line and `STOP_FLUSHED … a=1`. Switch it back off afterwards. (e) **A game with no
Streamline** (Kingdom Come: Deliverance II, Lies of P): its FSR rows are under `PATCH_BATCH` lines as well, and
the session reads as before. (f) **Nothing else moved**: no crash, no `PATCH_FAILED`, no `UNHOOK_DECLINED`
unless another overlay is running, the same hooks in `HOOK_INSTALLED` as on beta.45 for the same game, frame
rates and the frame-generation factor as before, the Advanced rows as before. (g) **Off means off** (item 43
(f), never run): with Advanced metrics off, start a game afresh; no `HOOK_INSTALLED` line names any of the ten
Advanced-only calls.
**What each outcome means, written before the run.** A `PATCH_BATCH install` whose `a=` is about what one
patch cost on beta.45 (60 000–220 000) is the expected answer: one stop of the threads. An `a=` of a second or
more: one stop is long in that game — say which game and the number; it is still one where there were thirteen,
but it is what would decide whether batches need a ceiling. `HOOK_INSTALLED` lines of one batch with different
times: the batch fell back to one patch at a time — the log then also has a `PATCH_FAILED` — say so with the
log. A game that hitches at its start as it did not on beta.45, or freezes at (d): say so at once, with the
game; 0.1.0-beta.45 is the build without this change. A hook that was in on beta.45 and is not on beta.46
(compare the `HOOK_INSTALLED` lines), or a session that reads *not hooked* where it read *read*: the batch lost
a patch — the log's `PATCH_FAILED` line names it and why. A crash in play or at exit that is new: say so at
once; *Disable all hooking* runs the game with nothing patched after the start.
**Five sessions were run on 2026-11-13 and read the same day** ([`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md)
§What the owner's five sessions on beta.46 showed): (a) held — the terms window did not show; (b) five Streamline games — every batch's lines carry one
time; `a=` is 81 417–261 920 for sixteen of the eighteen batches, **1 260 835 for Hogwarts Legacy's thirteen
and 608 700 for three of Cyberpunk 2077's**, neither explained — and the sentence above about a fallback is
wrong: a batch finished one patch at a time leaves no line unless a patch fails for good, so the log cannot say
which of the two a long `a=` was; (f) held — no crash in play, no `PATCH_FAILED`, no `UNHOOK_DECLINED`, the
same hooks as on beta.45, rates and factor as before, the two known faults on the way out at their old offsets.
**(d), (e) and (g) were not exercised; (c) is the owner's to say.** Not passed: (d) is the half of this release
that no real game has run.
**2026-11-14, three more sessions (203–205), read the same morning — (d) is still not exercised.** *Disable all
hooking* was switched on **before** the games were started, not while one was being recorded: Cyberpunk 2077
(06:34) and Phantom Blade Zero (06:38) were each recorded as `RefusedKillSwitch` — tier 2, nothing injected, no
overlay log for either process, which is FR-2.4 doing what it says and not what (d) asks. With the switch off
again, Phantom Blade Zero (06:46, 518 s) was hooked from its start to its exit: twenty-two patches under one
batch of 84 ms and ray tracing's two under one of 81 ms, ×3.0 at 89 → 268, no fault, a clean exit — and **no
`STOP`, no `UNHOOK_RESTORED`, no `PATCH_BATCH restore` line**, because nothing stopped it while it ran. Windows'
application log has no fault since 06:30. **How (d) is run**: start the game with the switch **off** and wait
until FrameLedger shows it recording; **then**, with the game still running, switch *Disable all hooking* on;
play on for half a minute; switch it off; close the game.
**2026-11-14, the second try (sessions 206 and 207, Phantom Blade Zero): (d) held, twice.** The game started with
the switch off and was being recorded; 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 at one time, one `PATCH_BATCH
restore` — `a=83309` and `a=85578`, `b=0x1d` — and `STOP_FLUSHED … a=1`; no `UNHOOK_DECLINED`. Both sessions
ended `KillSwitchEngaged`, tier 1, no fault, nothing dropped; the game ran on for three and four minutes and
closed with nothing in Windows' application log. Whether a hitch was felt at the stop is the owner's to say.
**Taken as passed for what 0.1.0-beta.47 was held on** — (a), (b), (d), (f). **(e) and (g) were never run**: they
are (f) and (g) of item 45.
45. **beta.47 — NVIDIA's latency report, read inside a game** (D132, D136, D138–D141). **Cyberpunk 2077 first**
(D136), **and not first on a game under the user-mode exception's trial** (D38): a crash there ends the exception for good.
This is the first release in which the part inside a game *makes a call of its own* — into the graphics driver,
about once a second, on the game's presenting thread — so read (a) before (b). (a) **The update**: Help ▸ Check
for updates, *Restart to update* with no game running; **the terms window shows once, with Privacy Policy 2.20
and Disclaimer 2.16** — the Disclaimer's §2 has a new paragraph, *One call it makes itself, into the graphics
driver*. Settings ▸ *Advanced metrics* says the same in its description. (b) **Cyberpunk 2077, Advanced metrics
on, frame generation OFF, Reflex on in the game's menu**, five minutes of play, then close the game as usual.
Its `logs\overlay-<pid>-….log` has `LATENCY` lines: *reading the driver's latency report*, and two more with
the end of two paths — `…\System32\nvapi64.dll` and `…\nvapi64_impl.dll`. On the Advanced page, the session
has a group **Latency**: the table *What the driver's low-latency state is* (five rows by NVIDIA's names, and
`fgMultiplier`) and, in the chart's list, *Latency per frame* with seven lines. The line under the session ends
with *NVIDIA's latency report, which FrameLedger asks the graphics driver for inside the game: read.* Say the
*total* line's usual value, and **whether the game felt any different with the option on** — a hitch once a
second is the thing to look for. (c) **The same with frame generation ON** (DLSS ×2 or more): the driver's
pacer is another thread, and this is the arrangement the probe could not make. (d) **Reflex switched off in the
game's menu**, if the game lets you: say what the line reads — *read* or *asked, and the driver reported no
frame*; both are possible and neither is wrong. (e) **Only after (b) and (c) are clean, a second game** that
uses Reflex through Streamline (Phantom Blade Zero, Clair Obscur, Black Myth: Wukong, Hogwarts Legacy). (f) **A
game that is not Direct3D 12 or has no NVIDIA library** (Kingdom Come: Deliverance II, Lies of P): the line
reads *not read*, with which of the two. (g) **Off means off**: with Advanced metrics off, start a game afresh;
its log has no `LATENCY` line. (h) **Nothing else moved**: no fault counted, frame rates and the
frame-generation factor as before, the game closes as it did.
**What each outcome means, written before the run.** *Read*, with a total of a few to a few tens of
milliseconds that moves with the frame rate: route D works in a real game; what comes next — more titles, the
session summary — is the owner's to say. *Asked, and the driver reported no frame* in a game whose Reflex is
on: the driver has a report for another object than the device FrameLedger holds; nothing is harmed, and the
title is not readable this way. *Not read — the game has not loaded nvapi64.dll* in Cyberpunk 2077: what its
files said did not happen at run time; another title is tried. *Stopped — a call took N µs*: **one call of a few
thousand microseconds, once, is most likely a pause of the game's thread on a busy PC** (`spike-notes` §31, *A
run on a busy PC*) — start the game again and see whether it repeats; if it repeats, or N is ten thousand or
more, the driver holds the call in that game and **route D stops for it** — say so with the number. *Stopped — a
call into the driver faulted*, or a fault counted in the session: **route D stops** (the commitment of §30) —
say so at once, with the log. **A game that freezes** with a `LATENCY` line saying a call has not returned, or
that freezes at all with the option on and not with it off: close it, say so at once; Advanced metrics off is
the way to play it, and route D ends. **A hitch once a second** with the option on that is not there with it
off: say so at once — the two-millisecond latch did not catch what a player can feel. **The game closing by
itself a second or two after it starts, only with the option on** (Windows' Application log: exception
`0xc0000409`): a Control Flow Guard refusal of the call — say so at once with the entry; that game enforces
what the probe could only check for this driver. Spans that make no sense — a part larger than the total, a
line that is always zero: say which; they are the driver's numbers and are shown as it reported them.
**Three sessions were run on 2026-11-14 and read the same morning — in Phantom Blade Zero, not Cyberpunk 2077**
(sessions 208–210, Direct3D 12, Streamline 2.14.1). **The read works in a real game.** (a) held: the terms were
accepted once, Disclaimer 2.16 and Privacy Policy 2.20. In all three the overlay log has `LATENCY … reading the
driver's latency report` four to five seconds after the attach, with `C:\WINDOWS\SYSTEM32\nvapi64.dll` and
`…\nvapi64_impl.dll` on the two lines after it, and **no later `LATENCY` line**: no error, no slow call, no
fault, no stall. Each session's line reads *read*, and the slowest call into the driver was **24, 20 and 45 µs**.
Frame generation on: session 208, ×3.0 at 85 → 256 — and the driver's own `fgMultiplier` read 3. Off: sessions
209 and 210, multiplier 1. Seven series in each, 227 / 24 / 823 points: 90 %, 62 % and 98 % of the Agent's own
once-a-second samples (the short session spent its first seconds before the module was found). With frame
generation ×3: total 23.4 ms, simulation 4.4, render submit 10.3, present 0.7, driver 10.9, OS queue 13.0, GPU
render 11.5 (means). The driver's switches: `bLowLatencyMode`, `bUseGameSleep` and `bFullscreenIFlip` *on at
times, off at others*; `bFsVrr` and `bCplVsyncOn` *off* — so in a game the low-latency switch does read on,
which it never did for the probe. No fault counted, nothing dropped, a normal exit each time, nothing about the
game in Windows' application log; rates as on beta.46 for the same game.
**One outcome the list above names: a part larger than the total.** *GPU render* reads 16.4 ms where the *total*
reads 5.4 ms (session 209), and about equals it in session 210 (16.0 against 15.9 ms). The span is the driver's
`gpuRenderStartTime` to `gpuRenderEndTime`, and in this game that start lies **before** the frame's own
simulation start: it reads like the time between two frames' GPU ends, idle time included — a reading, not a
fact; the driver has a field of its own for the active time (`gpuActiveRenderTimeUs`), which FrameLedger does
not read. It is shown as the driver reported it. The spans also overlap — render submit, driver and OS queue
together are longer than the total — so they are not parts that add up, and the page does not say they are.
**Not run**: Cyberpunk 2077, which (b) and (c) name; (d) Reflex off in the game's menu; (f) a game that is not
Direct3D 12 or has no NVIDIA library; (g) off means off. **Not said**: whether the game felt any different with
the option on. Not passed as written; what the three sessions were run for is answered.
**Five more sessions the same morning (211–215), read at 09:15: Cyberpunk 2077 twice, and three games the
read must leave alone.** (b), (c) **Cyberpunk 2077** (Streamline 2.14.1, DLSS): session 211 with frame
generation ×2.0 for 42 % of it (166 → 330) and menus for the rest, session 212 without, at 238 FPS. The module
was found 4.8 s and 2.6 s after the attach, in the same two files; each session's line reads *read*; **the
slowest call took 34 and 65 µs**; no later `LATENCY` line. 190 of 195 and 429 of 438 samples carry a report.
The total: 13.5 ms while frames were generated, 4.1 ms in the menus, 11.7 ms at 238 FPS without generation.
**GPU render is 2.7 ms there and never longer than the total** (0 of 429 samples; 1 of 190) — so what the
three sessions above showed is Phantom Blade Zero's, not the route's. `bLowLatencyMode` *on* throughout. The
table's `fgMultiplier` reads **1 in the session that held ×2 for 105 seconds**: the row keeps the last value
read, and that session ended in a menu — a row that lists what was seen would not mislead. D137's first
Cyberpunk batches: eight of them, 85–221 ms, every one `install` in one apply; beta.46's 0.61 s did not recur.
(f) **Not Direct3D 12**: Crown & Coin (213) and Psycho-Sleuth (214), both Direct3D 11 — one `LATENCY no
Direct3D 12 device` line each, nothing after it, the session's line reads *not read — not Direct3D 12*.
**Direct3D 12 with no NVIDIA library**: Dread Fields (215) — `the game has not loaded nvapi64.dll`, said once,
*not read*. The three ran at the same time and were recorded apart. (h) held in all five: no fault counted,
nothing dropped, normal exits, nothing in Windows' application log.
**A correction to the paragraph above**: the Agent's samples are **1.32 s apart, not one second** (the `t_ms`
series; so in every session looked at back to beta.42, while `sensor_blobs.hz` says 1.0 — not looked into),
so the shares are 227 of 258, 24 of 39 and 823 of 846 samples, and the gaps are the first seconds of a session.
**The owner's answer on the *GPU render* line (2026-11-14): read the driver's active time** — planned as one
train with what else is open. **Left of this item**: (d) Reflex off in the game's menu, (g) off means off, and
the owner's word on how the games felt; the owner runs what is left once, with that train's release.
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
headers **and** `amd64/nvapi64.lib`; Windows 11 is the **measurement scope** only —
@@ -626,6 +955,35 @@ Where each owner decision is recorded — the file and its section, and a label
| D115 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Which struct version carries which field | a tail member of a vendor struct is read only where the upstream tags prove it is there |
| D116 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | "never the camera" is a build gate: `tools/overlay-fields-check.ps1` |
| D118 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | told that the sensor-library fix would take the number D113 gave train B's second release, the owner chose to release it at once as 0.1.0-beta.41: the train's second and third releases are beta.42 and beta.43, train C beta.44, train D beta.45 |
| D119 | [`07_IPC.md`](07_IPC.md) §Region 5 | `FLT_MAX` (or +infinity) in an FSR depth plane is stored and shown as "infinite" — three engines pass it for the plane at infinity; for FSR only: for Streamline `FLT_MAX` is the "not set" sentinel and stays absent |
| D120 | [`03_METRICS.md`](03_METRICS.md) §Upscaling | a session's upscaler is the technology named on the most samples, and its quality and render size are read from that technology's samples — not the first one named, with the others' values beside it |
| D121 | [`HANDOFF.md`](HANDOFF.md) §NEXT | Cyberpunk 2077 was set to FSR upscaling and FrameLedger named none: a detection gap, to be investigated — which first needs a native log that survives the game's exit |
| D122 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | train B's second step is split: **beta.42** has no new patch site (D119–D121 and the patch registry's hardening); **beta.43** is the two new hooks, begun only after the owner has run Cyberpunk on beta.42 and its log was read. The third release is beta.44, train C beta.45, train D beta.46 |
| D123 | [`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Pre-injection checks, check 1 | a module list that changed while the guard read it is read again, at most three times, before it refuses — five real sessions on one PC in a week had ended as a safety unhook with no frame recorded; a list that never settles still refuses, and nothing else about what refuses changed |
| D124 | [`HANDOFF.md`](HANDOFF.md) §NEXT | the guard's re-read (D123) ships with 0.1.0-beta.43 and not as a release of its own — the train's numbers do not move a third time; until then a launch can still be lost that way on beta.42 |
| D125 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory | an FSR UPSCALE is counted at the first source that saw one and at no other — a precaution for a loader that hands a dispatch on to the leaf's export (Cyberpunk 2077's 2.3.0 does, for frame generation); no title run so far upscales through one |
| D126 | [`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Crash & stability safety | the count of early abnormal ends starts again when the user switches hooking on (the consent grant sets it to 0) — it was never set back, so a game once switched off was switched off again by every single such end, under a reason that says "twice" (Lies of P, 2026-11-12) |
| D127 | [`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Crash & stability safety | a fault while a game is closing, which a hooked session does not see (Hogwarts Legacy, the driver's `_nvngx.dll`, hooked or not), is written down and not changed in 0.1.0-beta.44 — seeing it would end a user-mode exception for a fault no hook caused; a decision of its own |
| D128 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | a field of view over π is shown as the game gave it, with a row that says it is not radians, and is never converted — Cyberpunk 2077 gives Streamline degrees; converting would store a guess at the unit as the game's word |
| D129 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | `slInit` is not hooked at all — asked to reopen D112 and shown that no shipped mode is in the game in time (launch mode waits for the presentation runtime, no patch is ever made on a game's thread, an Advanced-only hook waits for the Agent's request), the owner kept it out; a hook there would be a patch that reads nothing |
| D130 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | six more Streamline core calls are hooked in one release, 0.1.0-beta.45 — `slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded`, `slAllocateResources`, `slFreeResources`, `slShutdown`; trains C and D come after it, and train C's spike is written beside it as a document |
| D131 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory | the adapter a game asks `slIsFeatureSupported` about (`sl::AdapterInfo`: a LUID, or a Vulkan physical device) is never read — the feature's id and the result only; a build check refuses the struct's member names in code loaded into a game |
| D132 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14, `CLAUDE.md` rule 4's note of 2026-11-13 | Reflex route D goes to a spike on `hook-harness` and a stub first — and the ruling a go needed: calling a driver's read-only getter with the device of the swap chain the Overlay hooks is inside rule 4. No real game before the owner has seen the result |
| D133 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14, [`spike-notes/30-reflex-latency.md`](spike-notes/30-reflex-latency.md) | Reflex route C (the Overlay calling `slReflexGetState`) is refused; the no-injection ETW route stays closed, and §G with it |
| D134 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Unhooking, *Batches* | installs and restores are batched through MinHook's queue — one stop of the game's threads for a batch, not one a patch — in a pull request of its own, measured, released alone (0.1.0-beta.46) |
| D135 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory | `slAllocateResources` keeps its patch although no game called it in the first six sessions; looked at again when there are more |
| D136 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14, [`spike-notes/31-reflex-route-d-harness.md`](spike-notes/31-reflex-route-d-harness.md) §The question for the owner | Reflex route D goes on to one real title, Cyberpunk 2077 — a plan of its own first, no code before it is approved, and no release carrying it before item 44 (d) has been run |
| D137 | [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Unhooking, *Batches* | the `PATCH_BATCH` line says how a batch ended — one apply, or finished one patch at a time — after two batches in real games took 0.61 s and 1.26 s and the log could not say which; with the next release, not one of its own |
| D138 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M14, [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md) §The train after 0.1.0-beta.46 | the Reflex read has no switch of its own: it is part of Advanced metrics — so 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 (item 45), not a limit in code |
| 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`) |
---
+62
View File
@@ -0,0 +1,62 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.42 was cut, 2026-11-12 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.42] - 2026-11-12
**The forty-second pre-release: groundwork, and a log that can answer a question.** Four changes, none of which
adds a hook to a game. A session that saw two upscalers is now named after the one it ran — one real session had
been stored as "DLSS" with FSR's quality mode and FSR's render size. The part of FrameLedger inside the game can no
longer leave a hook in after it has stopped. Its log is now written during the session rather than only at the
start and the end, so it is whole after a game that simply exits, and it says which module each hook went into and
what kinds of call each AMD FidelityFX module received. And with **Advanced metrics** on, an FSR depth plane at
infinity is shown as "∞" where it used to be missing. The same unsigned installer: verify its hash against
`SHA256SUMS.txt`, then *More info → Run anyway*.
**What it is not, yet.** It does not fix a game whose upscaler reads "unknown" — Cyberpunk 2077 set to FSR is the
one known — it makes the next session of such a game say why, in `logs\overlay-<pid>-….log`. The two new readings
planned for Advanced metrics (the frame-generation settings a game gives FSR, and what a game tells Streamline
about each frame) are the next pre-release, after that log has been read. No real game has been run on this
build: the changes inside the game were tested with FrameLedger's own test program, and their cost was measured
on the code itself (about 4 billionths of a second per FidelityFX call for the log's new lines; nothing measurable
for the rest). Everything 0.1.0-beta.41's notes say is not yet done still stands.
**Updating from `0.1.0-beta.41`:** Help ▸ Check for updates, then *Restart to update* with no game running. No
terms to read again, no change to the ledger (schema 23), the detection rules stay at `2026.11.2`. **The code
loaded into a game changed in this release** — the first time since 0.1.0-beta.40 — so a game that was running
during the update keeps the old part until it is started again. Sessions already stored are not rewritten: one
that was named after the wrong upscaler keeps that name.
### Added
- **Advanced metrics: FSR's depth plane at infinity is shown as "∞".** Engines with an infinite depth range tell
FSR that one of the two camera planes is at infinity, and FrameLedger took that value for "not set" — so a
session's depth range showed one plane where the game had given two. The plane at infinity is now stored and
shown as such. Only for FSR, and only while Advanced metrics is on; nothing else about what is read changed.
### Changed
- **The Overlay's log is whole after a game exits, and says more.** The log FrameLedger's part inside the game
writes (`logs\overlay-<pid>-….log`) used to hold only the first half second of a session unless the session
ended while the game was still running: a game that exits takes the thread that writes the log with it. It is
now written during the session, whenever something new was noted. Each hook that went in is named by its module
and function (four AMD modules used to be four identical lines), a hook that could not go in says why, and the
log lists which kinds of call each AMD FidelityFX module received and which upscaling and frame-generation
modules the game loaded, and when. This is for finding out why a game's upscaler reads "unknown" — nothing in
it is a measurement, and nothing from it is stored in a session. Measured cost: about 4 billionths of a second
per FidelityFX call.
### Fixed
- **The part inside the game can no longer leave a hook in after it has stopped.** Two gaps in how the Overlay keeps
track of its own patches, found by reading the code and not by a failure: a patch made while the table of patches
was full would have been made anyway and never taken out, and a stop that arrived at the exact moment a hook was
going in could miss it. A patch now takes its place in the table before it is made — no place, no patch — and is
recorded before it can run, so the stop either removes it or the installer does. A patch that could not be made
is written to the Overlay's log with the reason, where it used to be silent. No hook's own code changed.
- **A session that saw two upscalers is named after the one it ran, with that one's quality and render size.** The
session's upscaler used to be the first one FrameLedger saw named, while the quality mode and the render size
came from whichever frames carried them. A game that evaluated DLSS briefly and then ran FSR was stored as "DLSS"
with FSR's quality and FSR's render size. The name is now the technology named on the most frames, the quality
and the size are read from that technology's frames only, and such a session is marked "settings changed during
session". What that technology did not say reads N/A rather than borrowing the other's value. Sessions already
stored are not rewritten.
+86
View File
@@ -0,0 +1,86 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.43 was cut, 2026-11-12 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.43] - 2026-11-12
**The forty-third pre-release: a game that was still loading is no longer lost, and two more readings inside the
game.** Two fixes first. A game that FrameLedger looked at while it was still loading its modules could be left
unrecorded — the session ended as a safety stop with nothing in it; FrameLedger now reads the list again before it
gives up, and what stops a session has not changed. And an FSR upscale is counted once per frame whichever way the
game's FidelityFX loader passes it on. Then, with **Advanced metrics** on, a session of a game measured from inside
also keeps what the game tells NVIDIA Streamline about each frame and how it configures FSR frame generation —
from two calls FrameLedger hooks only once Advanced metrics has been asked for in that game. The same unsigned
installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
**What it is not, yet.** The two new readings have been tested with FrameLedger's own test program and **have not
been run in a real game**: this release is the first time either hook is put into one. They are what the game
asked for, not a check of what happened, and Streamline's values are those of the first view a game draws.
Streamline 1.x is not read. Where the game's camera is, which way it looks and its matrices are never read — they
sit in the same data, and a check in the build refuses code that names them. The cost was measured on the code
itself: about 20 billionths of a second per frame for Streamline's call and 15 per call for FSR's while the option
is on, under 2 while it is off; nothing measurable for the two fixes. A game whose FSR is built in (Cyberpunk 2077's
FSR 2.1) still reads "unknown" as its upscaler. Everything 0.1.0-beta.42's notes say is not yet done still stands.
**Updating from `0.1.0-beta.42`:** Help ▸ Check for updates, then *Restart to update* with no game running. **The
terms are shown once: Privacy Policy 2.17**, which names the two new readings. No change to the ledger (schema 23),
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
- **Advanced metrics: a session now shows what the game told Streamline each frame and how it configured FSR frame
generation.** For a game FrameLedger measures from inside, a session recorded with **Advanced metrics** on keeps
— beside what the game told DLSS and FSR — the largest jitter offset, the motion-vector scale and how motion
vectors are stored, the near and far planes and whether depth is inverted, the range of the field of view, the
aspect ratio, whether the projection is orthographic and how often the game reset the upscaler's history
(Streamline); and whether FSR frame generation was configured on, whether it may run asynchronously, its flags,
whether only generated frames are presented, and the part of the picture it generates in. A setting the game
changed during the session reads *on and off*. The line under the session now also says, for each of the two,
whether it was read, hooked and never called by the game, or not hooked because the game did not load the
library — so an empty page says which it is. These are what the game asked for, not a check of what happened;
neither has been confirmed on a real game yet. Never read: where the camera is, which way it looks, its
matrices.
- **The terms are shown once after this update: Privacy Policy 2.17.** It names the two new readings above and says
that the two calls they come from are intercepted in a game only once a session with Advanced metrics on has
started there. Nothing is sent anywhere, as before.
- **Advanced metrics, inside the game: how the game configures FSR frame generation** (the part inside the game;
what a session shows of it comes with the same release). With **Advanced metrics** on, FrameLedger now also
reads, from the call a game makes to configure AMD's frame generation, whether generation is on, whether it may
run asynchronously, its flags, whether only generated frames are presented, and the part of the picture it
generates in. Nothing else of that call is read. Like the Streamline hook, this one is put into a game only once
Advanced metrics has been asked for. Measured cost: about 15 billionths of a second per call while the option is
on, under 2 while it is off.
- **Advanced metrics, inside the game: what the game tells NVIDIA Streamline about each frame** (the part inside the
game; what a session shows of it comes with the same release). With **Advanced metrics** on, FrameLedger now also
reads, from a call a Streamline game makes every frame, the size of the jitter, the motion-vector scale, the depth
range, the range of the field of view, the aspect ratio and seven on/off settings (inverted depth, how motion
vectors are stored, whether the upscaler's history was reset). It never reads where the game's camera is, which
way it looks, or its matrices, which sit in the same data — a check in the build refuses any code that names
them. This is the first reading that needs a hook of its own, and that hook is put into a game only once
Advanced metrics has been asked for: with the option off, nothing in the game is touched for it. Measured cost:
about 20 billionths of a second per frame while the option is on, under one billionth while it is off.
### Fixed
- **FSR upscaling is counted once per frame whichever way the game's FidelityFX loader passes it on.** Newer
FidelityFX loaders hand a call on to the library behind them in a way that brought the same upscale to
FrameLedger twice; with frame generation off, the count of frames the game rendered would have doubled — Native
FPS twice too high. Seen in how Cyberpunk 2077's loader passes on its frame-generation calls; no game tested so
far upscales through such a loader, so this is a precaution. The upscale is now counted where the game calls it,
and nowhere else. (Owner decision D125. Measured cost: none that can be told from noise.)
- **A game is no longer left unrecorded because it was still loading when FrameLedger looked at it.** Before it
hooks a game, and again right after, FrameLedger lists the modules the game has loaded and checks them against
the anti-cheat list. A game that is starting loads and unloads modules for several seconds, and when the list
changed in the middle of being read FrameLedger treated it as unreadable and stopped: the session ended as a
safety stop with nothing recorded, and the game ran on unmeasured until it was restarted. It now reads the list
again — up to three more times, a quarter of a second apart — and only stops if the list never holds still. What
stops a session has not changed: an anti-cheat module found in any read stops it at once, a protected process
still stops it at once, and a list that cannot be read in the end is still a stop, never a pass. (Owner decision
D123; seen five times in one PC's logs in a week.)
- **A test of the Overlay's log reads its lines without `strlen`.** The helper that looks for a line in the log
took its text as C strings and measured one with `strlen`; it takes strings now. Test code only: nothing in the
installed software changes. (Found by SonarCloud after 0.1.0-beta.42 was merged.)
+83
View File
@@ -0,0 +1,83 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.44 was cut, 2026-11-12 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.44] - 2026-11-12
**The forty-fourth pre-release: what the first real games on 0.1.0-beta.43 showed, fixed — and two more readings
inside the game.** Nine sessions on five games were read the day 0.1.0-beta.43 came out. Its two new readings
worked on four of them; three things did not read right, and are fixed first. Cyberpunk 2077 tells NVIDIA
Streamline its field of view in degrees, and FrameLedger labelled the number as radians: a value too large to be
radians is now shown as the game gave it, and says so. A game whose hooking had once been switched off after two
early ends was switched off again by every single one after that: the count now starts again each time you switch
hooking back on. And an FSR frame-generation configuration with no flag set now says *None*. Then, with
**Advanced metrics** on, a session of a game measured from inside can also keep what Streamline answers when the
game asks **which version a feature is and what it requires** — from two more calls FrameLedger hooks only once
Advanced metrics has been asked for in that game. The same unsigned installer: verify its hash against
`SHA256SUMS.txt`, then *More info → Run anyway*.
**What it is not, yet.** **Most sessions will show nothing of the two new readings.** A game asks Streamline about
its features while it starts, and FrameLedger is usually not in the game yet; the session then says the call was
hooked and the game did not ask again — which is the expected answer, not a fault. They have been tested with
FrameLedger's own test program and **have not been run in a real game**: this release is the first time either
hook is put into one. What they give is Streamline's answer as the game received it — not FrameLedger's own check
of the PC — and never the lists that answer points to (which buffers, which Vulkan extensions). A game that faults
while it is closing can still read *ended normally* in a session measured from inside; that is written down, not
changed. The two Cyberpunk 2077 sessions recorded on 0.1.0-beta.43 keep the line they were stored with. The cost
was measured on the code itself: 15 and 21 billionths of a second per call while the option is on, under 1 while
it is off, for calls a game makes a handful of times. Everything 0.1.0-beta.43's notes say is not yet done still
stands.
**Updating from `0.1.0-beta.43`:** Help ▸ Check for updates, then *Restart to update* with no game running. **The
terms are shown once: Privacy Policy 2.18**, which names the two new readings. No change to the ledger (schema 23),
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 calls are hooked inside a game, only where Advanced metrics was asked for** (Advanced metrics train B,
the third step): `slGetFeatureVersion` and `slGetFeatureRequirements` of `sl.interposer.dll` — what Streamline
answers when a game asks which version a feature is and what it requires. The original call runs first and its
answer is read only when it succeeded: the feature's Streamline and NGX versions; the graphics APIs it supports,
whether V-Sync must be off and hardware-accelerated GPU scheduling on, how many threads, viewports and buffers,
and the Windows and driver versions found beside the ones required. **The lists the answer points to — the
buffer tags, the names of Vulkan extensions and features — are never followed.** As with `slSetConstants`,
neither patch is made in a game no session has asked, and each stays for the life of the process once made. A
game asks these while it starts, so the two rows are the first the Overlay patches — and most sessions, attached
later, will still not see the calls. Nothing is shown of them yet: the Agent and the App read them in the next
pull request. No layout change (5), no schema change (23).
- **A session shows which version each Streamline feature is, and what it requires** (Advanced metrics). Two
catalog entries are now read inside the game: `sl.feature.versions` and `sl.feature.requirements` — Streamline's
answers to the two questions a game asks about a feature, in NVIDIA's own names (`kFeatureDLSS_G · versionNGX`,
`kFeatureDLSS · driverVersionRequired`). The line under the session says for each of the two calls whether it was
read, not hooked, or — the usual case — *hooked — the game asks this while it starts, and did not ask again after
FrameLedger attached*. **Most sessions will show nothing here**: a game asks before FrameLedger is in it. A game
that asks later is read then, and a second session of a game that kept running keeps what the first read. The
Agent's end-to-end tests now run a Streamline target as well as an FSR one.
### Changed
- **Privacy Policy 2.18**: it names what Streamline answers about a feature — the features asked about, their
versions, what each requires — and what of that answer is never read (the lists it points to: the buffers' names,
the names of Vulkan extensions and features); "two further calls" is four. The terms window shows once after the
update. The Disclaimer stays 2.15.
- **Switching hooking back on starts the count of early abnormal ends again** (owner decision D126). The count was
never set back, so a game that had once been switched off — after two ends within 60 seconds of injection — was
switched off again by every single such end after its user switched it on, under a reason that still said
"twice". Seen on 2026-11-12: Lies of P, two ends in October, one crash of its own that day. Two are needed again
each time. Nothing else about the rule moves: it only switches off, an anti-cheat block is never cleared, and the
user-mode exception's trial keeps its own record.
### Fixed
- **A field of view a game gives in degrees is no longer labelled radians** (Advanced metrics; owner decision
D128). Cyberpunk 2077 gives NVIDIA Streamline 51–90 where the library expects radians, and the session read
`51.0055 – 90 rad (2922.4° – 5156.6°)`. A value too large to be radians is now shown as the game gave it, with a
line that says it is not radians, and is not converted. Sessions recorded on 0.1.0-beta.43 keep the line they
were stored with.
- **An FSR frame-generation configuration with no flag set says "None"** (Advanced metrics). The row was missing,
where an upscale with no flag has always said so.
- **The accuracy statement and the limitations no longer say that what a game tells Streamline, and how it
configures FSR frame generation, have not been read from a real game**: they were, on 2026-11-12 — three games
and one. What is still unconfirmed is named: the DLSS options, and a configuration that reaches FSR through
AMD's 2.3 loader. A fault while a game is closing, which a session measured from inside the game does not see,
is written down as a limit (owner decision D127: not changed in this release).
+80
View File
@@ -0,0 +1,80 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.45 was cut, 2026-11-12 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.45] - 2026-11-12
**The forty-fifth pre-release: what a game does with NVIDIA Streamline's features.** With **Advanced metrics** on,
a session of a game measured from inside can now also keep, for each Streamline feature the game asks about or
controls: whether Streamline says it is **supported** — in NVIDIA's own word, a refusal included — whether it is
**loaded**, whether the game **switched it on or off** while it ran, how many times the game **allocated and
freed** what the feature needs, and how many times it **shut Streamline down**. They come from six more calls,
which FrameLedger hooks only once Advanced metrics has been asked for in that game. The pages that said most
sessions would show nothing of 0.1.0-beta.44's two readings are corrected: the first real sessions read both in
every Streamline game. The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info →
Run anyway*.
**What it is not, yet.** The six new calls have been tested with FrameLedger's own test program and **have not
been run in a real game**: this release is the first time any of them is patched in one, and it is six at once.
Two of them sit on a game's way out — freeing a feature's resources, shutting Streamline down — and two of the
games run so far already fault while closing without them; whether anything changes there is for the first real
sessions to say. What is shown are **calls the game made after FrameLedger was in it**, counted to fifteen: not
what the game did while it started, and not a statement that a feature ran or drew anything. **What a game
started Streamline with is not read and will not be**: the game makes that call once, before FrameLedger can be
inside it, and the Advanced page now says so instead of "a later release". Which graphics card a game asks about
is never read. The cost was measured on the code itself: at most 13 billionths of a second per call while the
option is on, under 2 while it is off, for calls a game makes a few times a second at most. A stop restores every
patch, each taking about a sixth of a second, and a Streamline game with Advanced metrics on now has six more of
them; the Overlay's log waits for them.
Everything 0.1.0-beta.44's notes say is not yet done still stands.
**Updating from `0.1.0-beta.44`:** Help ▸ Check for updates, then *Restart to update* with no game running. **The
terms are shown once: Privacy Policy 2.19**, which names the new readings and two things that are never read. No
change to the ledger (schema 23), 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
- **Three more of Streamline's calls are hooked inside a game, only where Advanced metrics was asked for** (owner
decisions D129–D131): `slIsFeatureSupported`, `slIsFeatureLoaded` and `slSetFeatureLoaded` — whether Streamline
says a feature is supported (its answer, a refusal included), whether it is loaded, and the game switching a
feature off and on while it runs. No vendor struct is read for these: the feature's id, a result code, a yes or
no. **The adapter a game names when it asks whether a feature is supported is never read**, and the build now
refuses code that names what identifies it. As with the four hooks before them, none of the three patches is made
in a game no session has asked. Nothing is shown of them yet: the Agent and the App read them in a later pull
request. No layout change (5), no schema change (23).
- **And three more, counted only**: `slAllocateResources`, `slFreeResources` and `slShutdown` — how many times a
game allocated and freed a feature's resources (up to fifteen each) and how many times it shut Streamline down.
The feature's id is the only argument looked at; the two that sit on a game's way out note the call and then
call the original, and run nothing after it. Six new calls in all in this release, each patched only where a
session asked.
- **`slInit` is not hooked, and will not be** (D129). A game starts Streamline once, before FrameLedger can be in
it — also when FrameLedger starts the game itself — so a hook there would be a patch that reads nothing. The
Advanced page's entry for what a game started Streamline with now gives that reason instead of "a later release".
- **A session shows whether each Streamline feature is supported and loaded, and what the game did with it**
(Advanced metrics). Two catalog entries are read from the six calls above: `sl.feature.support` — Streamline's
answer by NVIDIA's own name (`kFeatureDLSS_G · slIsFeatureSupported` = `eOk`; a refusal is named, and it is an
answer) and whether the feature is loaded — and `sl.feature.lifecycle` — the game switching a feature on, off or
both, how many times it allocated and freed the feature's resources (`≥ 15` past fifteen), and how many times it
shut Streamline down. The line under the session names the six calls in one sentence: read; hooked, the game did
not make the call; not hooked. They begin when FrameLedger is in the game — what a game did while it started is
not there — and they are calls the game made, not a statement that a feature ran. Not confirmed on a real game.
### Fixed
- **A stop that restores many patches no longer leaves its last lines out of the Overlay's log.** Restoring a patch
takes about 160 ms, and the wait for the stop's log lines was two seconds whatever the number of patches: with
fifteen the log ended "the stop was still writing". The patches were restored; the log did not say so. The wait
is now sized to the number of patches a game can hold.
### Changed
- **Privacy Policy 2.19**: it names, for each Streamline feature a game asks about or controls, whether Streamline
says it is supported and loaded, the game switching it on or off, and how many times its resources were allocated
and freed, and how many times the game shut Streamline down — and two more things that are never read: what
identifies the graphics card a game hands over with its question, and the content of a graphics resource. "Four
further calls" is ten. The terms window shows once after the update. The Disclaimer stays 2.15.
- **The limitations, the accuracy statement and the user guide no longer say that most sessions will show nothing
of what Streamline answers about a feature.** 0.1.0-beta.44's notes expected that, because a game asks while it
starts. The first real sessions (2026-11-12, five games) read both answers in every Streamline session: the
Unreal Engine games ask again later. The pages now say what was seen — and two things the readings showed: the
version Streamline gives for a feature can be newer than the file in the game's folder, and a game that does not
upscale through Streamline lists frame generation there and no upscaler. No code changes.
+42
View File
@@ -0,0 +1,42 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.46 was cut, 2026-11-13 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.46] - 2026-11-13
**The forty-sixth pre-release: hooks go into a game together, and come out together.** Putting a hook in or taking
it out stops every thread of the game for a moment. Until now that happened once for every hook: in the first real
sessions on 0.1.0-beta.45 the thirteen NVIDIA Streamline hooks took between 0.7 and 2.8 seconds of a game's start,
and stopping a session took about a sixth of a second for each hook. The hooks FrameLedger finds something for at
one moment are now put in under **one** stop of the game's threads, and a stop takes all of them out under one.
This release is that change and nothing else in the part that runs inside a game; the pages are also brought up to
date with what those first sessions showed. The same unsigned installer: verify its hash against `SHA256SUMS.txt`,
then *More info → Run anyway*.
**What it is not, yet.** It has **not been run in a real game**. On FrameLedger's own test program nine hooks go
in within 78–90 thousandths of a second where they took 0.6–0.7 seconds, and eighteen come out within 76–90 where
they took 1.4–1.6 seconds; how long one stop of the threads is in a game with a few hundred of them, and whether
any game minds its hooks arriving together, are for the first real sessions to say. Nothing new is read and
nothing a hook reads has changed, so the terms are the ones you accepted. Of 0.1.0-beta.45's six new readings five
have now been read in real games; no game run so far set up a feature's resources after FrameLedger was in it, so
that row has not been seen. Everything 0.1.0-beta.45's notes say is not yet done still stands.
**Updating from `0.1.0-beta.45`:** Help ▸ Check for updates, then *Restart to update* with no game running. **The
terms are not shown again** (Privacy Policy 2.19 as before). No change to the ledger (schema 23), 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.
### Changed
- **Hooks go into a game together, and come out together** (owner decision D134). Putting a hook in or taking it
out stops every thread of the game for a moment, and until now that happened once for every hook: the thirteen
Streamline hooks took 0.7 to 2.8 seconds of a game's start in real sessions (2026-11-13), and stopping a session
took about a sixth of a second for each hook — two to three seconds, sometimes on the thread that draws. The
hooks a moment finds are now put in under **one** stop of the threads, and a stop takes all of them out under
one. On FrameLedger's own test program: nine hooks in 78–90 ms where they took 0.6–0.7 s; eighteen out in
76–90 ms where they took 1.4–1.6 s. What a hook reads and when it is installed are unchanged, and no hook's own
code changed. The log of the part inside the game has a new line for each such moment (`PATCH_BATCH`, with the
time it took and the number of hooks). **Not run in a real game yet.**
- **The limitations, the accuracy statement and the user guide say what the first real sessions on 0.1.0-beta.45
showed** (2026-11-13, six games): five of its six new readings were read in real games — every Streamline game
asked whether its features are supported — and no game allocated a feature's resources after FrameLedger was in
it, so that row has not been seen. No code changes.
+92
View File
@@ -0,0 +1,92 @@
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.47 was cut, 2026-11-14 (D66). CHANGELOG.md lists every release. -->
## [0.1.0-beta.47] - 2026-11-14
**The forty-seventh pre-release: with Advanced metrics on, FrameLedger reads NVIDIA's own report of where a frame's
time goes.** On an NVIDIA card, in a Direct3D 12 game that uses NVIDIA Reflex, a session recorded with *Advanced
metrics* on now also stores how long the graphics driver says each stage of a frame took — simulation, render
submit, present, driver, the operating system's queue, the graphics card — as seven lines under *Latency* on the
Advanced page, with a table of the driver's low-latency state. **They are the driver's numbers, not a measurement
by FrameLedger**, and they are not the delay from a click to the screen. The same unsigned installer: verify its
hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
**This is the first release in which the part inside a game makes a call of its own.** Until now it only read what
a game itself passed to the graphics calls FrameLedger intercepts. To read this report it asks the graphics driver,
about once a second, on the game's own thread that presents its frames — two functions of the driver that only
read. It reaches them through NVIDIA's library only where the game had already loaded it, and never loads that
library itself; a copy sitting in the game's own folder is not the driver's and is not used. It is built to step
back rather than disturb a game: a request that takes two thousandths of a second or more, or that goes wrong, is
the last one until the game is closed, and the session says so. **With Advanced metrics off — the default — none
of this happens.** The Disclaimer and the Privacy Policy say all of it; the terms window shows once.
**What it is not, yet.** **No real game has been read.** The reading was written and tested against FrameLedger's
own test program with a stand-in for NVIDIA's library, and measured with a test tool against one driver on one
card (GeForce RTX 5080, driver 32.0.16.2114): there a request takes about three millionths of a second, and none
took a thousandth while the tool, like a game using Reflex, slept between frames. What a game's own threads, frame
generation, another driver or another card do with it is for the first real sessions to say; a game that enforces
Windows' Control Flow Guard on a driver that tool was not run against is not covered. On a busy PC the
two-thousandths limit will now and then switch the reading off for a pause that was Windows' and not the driver's;
the session then says *stopped* with the time, and the next start of the game reads again. The session summary's
latency fields still read N/A, and nothing here is read on Direct3D 11, Vulkan or OpenGL. No test runs the whole
path from the game to the ledger through the real capture agent; the Japanese texts are new and unreviewed.
**Also in this release.** The log of the part inside a game now says how a group of hooks went in or came out —
in one go, or one hook at a time — after two groups in the first real sessions on 0.1.0-beta.46 took far longer than
the rest and the log could not say why. And 0.1.0-beta.46's other half has now been seen in a real game: stopping
the part inside a running game took all twenty-nine hooks out under one stop of 83–86 thousandths of a second,
twice, and the game went on.
**Measured overhead this release.** A presented frame: one more read of one word; too small to measure on the
test program. The request to the driver, once a second while Advanced metrics is on: 2.5–2.6 millionths of a second
at the median after a frame that slept, 8–67 at worst, in three runs alone; 3.4 and 130 on a busy PC. Not measured
in a game.
**Updating from `0.1.0-beta.46`:** Help ▸ Check for updates, then *Restart to update* with no game running. **The
terms are shown once** — Privacy Policy 2.20 and Disclaimer 2.16. 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.
### Changed
- **The log of the part inside a game says how a group of hooks went in or came out** (owner decision D137). Since
0.1.0-beta.46 hooks are put into a game in groups, the game's threads stopped once for a group. In the owner's
first sessions two groups took much longer than the others (0.6 s and 1.3 s against 0.1-0.3 s), and the log
could not tell one long stop from a group that had to be finished one hook at a time. The `PATCH_BATCH` line now
reads `install` or `restore` for a group that went in one go, and `install singly` or `restore singly`, with a
count, for one that did not. Nothing else about hooking changed, and what a game is measured by is the same.
### Fixed
- **For developers: a native test that is cut short no longer counts as passed.** The quality gate's native tests
were judged by their exit code alone, and a test program that was stopped early with a clean exit code read as
*Passed* - seen once, when security software removed the test program while the gate ran. Every native test now
has to print the line it ends on, a test added without one stops the build's configure step, and four tests
exist only to prove the rule goes red when it should. Nothing a user installs changed.
### Added
- **The part inside a game can read NVIDIA's own latency report, with Advanced metrics on** (owner decisions D132, D136,
D138-D141). While a session records Advanced metrics, and only then, it asks the graphics driver about once a
second for its report of a frame's stages - simulation, render submit, present, driver, the operating system's
queue, the graphics card - and for its low-latency state. It is a call FrameLedger makes itself, on the thread
that presents the game's frames, through NVIDIA's `nvapi64.dll` only where the game had already loaded it;
Direct3D 12 only. A copy of that library sitting in the game's own folder is refused. A call that faults or takes
two milliseconds is the last one until the game is closed. **The Advanced page shows it** under *Latency*: seven
lines, one a stage, and a table of the driver's low-latency state; the line under a session says what became of
the read - read, the driver reported no frame, not read and why, or stopped and why. They are the driver's
numbers, not a measurement by FrameLedger, and no real game had been read when this was written. **Privacy
Policy 2.20 and Disclaimer 2.16** say what is stored and what the part inside a game now does; the terms window
will show once.
- **For developers: room in the shared memory for NVIDIA Reflex latency** (owner decisions D136, D138). Ten reserved
words of the block that carries Advanced metrics from a game are now named for the driver's latency report -
where the read stands, and a sum for each stage of a frame. Nothing writes them yet and nothing reads them; the
shared memory's layout version did not change.
- **For developers, nothing a user installs: a probe for NVIDIA Reflex latency** (owner decision D132). An
unshipped tool, `fl-probe-reflex`, and a stand-in `nvapi64.dll` among the test fixtures measure what it would take
to read the driver's latency report from inside a game - on FrameLedger's own test program and against the
installed driver, never in a game. What it found is `docs/spike-notes/31-reflex-route-d-harness.md`. A further
leg (owner decision D139) measured the same reads while the probe itself used Reflex's sleep, as a game does:
the reads do not wait behind it. The owner has said to go on to a real game (D136); that work is not in any
release yet. Nothing in the App, the Agent or the part that runs inside a game changed.
+131
View File
@@ -0,0 +1,131 @@
# HANDOFF history — 0.1.0-beta.41
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.42 was cut, 2026-11-12 (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 release numbers are those of the hour it was written**: its item 3 calls train B's third step beta.43 and its item 4 calls trains C and D beta.44 and beta.45 — since D122, later the same day, they are beta.44, beta.45 and beta.46, and beta.43 is the two new hooks.*
## **START HERE** — 2026-11-12, 0.1.0-beta.41: one fix — the sensor library is no longer closed under its other users
*Status is `docs/changelog/0.1.0-beta.41.md`; this is what no other file carries.* 0.1.0-beta.40 was released in the
small hours of 2026-11-12 and the owner ran it that same night on eight games, as administrator with PawnIO — the
first elevated run there has been. A copy of the ledger and the Agent's log showed the in-game readings working
(Lies of P, the first real game read) and **a defect of train A that only that elevation can show**: three
LibreHardwareMonitor `Computer`s in one Agent, and the library's per-process state closed by one under the others.
This release is that fix and nothing else: #400 (0.1.0-beta.40's release facts; two comparisons SonarCloud flagged),
#401 (`LhmLibrary`), and this one. **Everything about train B — what was built, what the owner's sessions showed,
the traps — is [`handoff/history/0.1.0-beta.40.md`](handoff/history/0.1.0-beta.40.md)**; the fix is
[`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics and [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md)
§M13.
### What this release decided
- **D118 — the fix is released at once as 0.1.0-beta.41, and train B's numbers move by one.** D113 had named
beta.41 for the train's second release. Told so, the owner chose to release the fix now. The train's second
release is **beta.42**, its third **beta.43**, train C **beta.44**, train D **beta.45**. Released changelogs and
moved HANDOFF sections keep the numbers of their day; so do the comments in `fl_shm.h` and `ShmLayout.cs` (the
members "0.1.0-beta.41" and "beta.42" fill), **deliberately**: touching them would have changed source that is
loaded into a game in a release that says the game-side code is beta.40's line for line. The release that fills
a member rewrites its comment.
- **The reads of the sensor library are not put under one lock**, only its opens and closes. A lock around every
read would have put a session's once-a-second poll behind the Advanced reader's, undoing the separate threads
that keep a hanging sensor from holding up the other reader.
### NEXT
1. ~~**The owner runs item 39** (this fix, on the PC that showed the fault) **and the rest of item 38** (an FSR 3.1+
title; two sessions of one running game; the cost; the values of Lies of P against the game's own settings).~~
**Both passed on 2026-11-12, on the owner's word** ("Bạn có thể đánh dấu là pass và tiếp tục") after the thirteen
sessions below; [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) says what those sessions covered and
what they did not.
2. **Planned and approved 2026-11-12 (D119–D122): the second step is two releases.** **0.1.0-beta.42 has no new
patch site** — five pull requests: (1) the session's upscaler label (D120); (2) the Overlay's patch registry
refuses a patch it cannot register, and registers before it enables; (3) the native log is flushed whenever
something new was logged, every inventory row's install line names its module and symbol, a failed patch says
why, and the first sight of each ffx descriptor type on each module is logged — so that one Cyberpunk session on
beta.42 says where its upscale goes (D121); (4) FSR's infinite depth plane (D119); (5) the release, owner-only
item 40. **0.1.0-beta.43 is the two new hooks** and begins only when that log was read; its design — reviewed
against the code, which changed it — is in the plan of that day and below. What the review found that the first
draft had wrong: there is no "dominant segment" (segments split on output size only), so the label is the modal
name over the dominant stream; the patch table drops a patch silently when full; the init thread's flush runs
after the watchdog starts; a second NaN pattern for "infinite" would have been dropped by the Agent — real
+infinity is stored instead; the new rows must be gated before `ResolveScoped`, which takes a module reference a
call; `slSetConstants` needs the struct's GUID checked on every call; `ffxConfigure` needs an owner slot of its
own; summaries across viewports must come from the first viewport seen.
~~**0.1.0-beta.42 — train B's second release — when the owner says item 38 passed begins now, with its plan**~~: `slSetConstants` and
`ffxConfigure`. A plan of its own first. What it must settle, beside what
[`handoff/history/0.1.0-beta.40.md`](handoff/history/0.1.0-beta.40.md) §NEXT lists (`kMaxPatches = 48`, the window
of `sl::Constants` pinned outside the camera members, the per-call overhead, the gate's list for the two new
structs):
- ~~**`FLT_MAX` in an FSR depth plane.** Lies of P gave `cameraFar = 10` and no `cameraNear`; most likely the
plane at infinity is `FLT_MAX`, which the Overlay refuses as "nobody set this". Decide whether it is stored as
"infinite" — an Overlay change, with its overhead stated.~~ *(Decided, D119, and built in beta.42:
`FL_ADV_FLOAT_INFINITE`, shown "∞". Whether Lies of P's missing plane IS `FLT_MAX` is still the hypothesis it
was — item 40 reads it.)*
- ~~**Valor Mortis.** One exit by access violation 51 seconds after injection under beta.40, none under an earlier
build, not attributed. Its crash count is 1; a second such end switches its hooking off. Before adding a hook
to that game's process, ask the owner whether it happened again.~~ **Answered by the owner, 2026-11-12: it was
the game's own — a shader-compilation error on entering the game, shown in the game's own crash dialog.** Not
FrameLedger's. It ran normally under beta.41 afterwards. Its crash count still stands at 1, because the crash
policy counts an abnormal end within 60 seconds of injection whoever caused it: a second one, from any cause,
switches its hooking off, and the owner then switches it on again from the game's page.
- **The release numbers in the comments** of `fl_shm.h`, `ShmLayout.cs`, `hook-harness` and `guard_test.cpp` for
the members that release fills (D118).
3. **0.1.0-beta.43 — the third — when the owner says the one before passed**: `slGetFeatureVersion` and
`slGetFeatureRequirements`.
4. **Trains C and D** (beta.44, beta.45) each begin with a spike and end in the owner's go or no.
### 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.~~ **Recorded 2026-11-12: 0.1.0-beta.41 was released
2026-11-11T22:38:39Z** (05:38 on the 12th in the owner's time zone) from the signed tag on `a6b95e8` (#402), by
run 43111028661 — 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 shipped natives carry `FL_BUILD_ID v0.1.0-beta.41`. The delta
from beta.40 is 807,692 bytes beside a full package of 110,708,416 — "Delta processed 0452 files. 0022 patched,
0430 unchanged". The wiki was published by run 43113525941. The rehearsal on the release branch (run 43108189693)
had made a delta of 841,038 bytes with the same file counts.
- ~~**The fix has not been seen to work.** It was written from the log's timing; the fault needs an elevated Agent with
PawnIO. Item 39 is the check, and `20_OPEN_QUESTIONS` §M13 stays open until then.~~ **The owner's first seven
sessions on beta.41 show no fault** (2026-11-12, 06:38–07:01, read from the Agent's log and a copy of the ledger):
not one `advanced:` line, and every session with the option on stored its 212 or 213 series, the processor's 119
among them. On beta.40 the same morning the processor device faulted out after **each** of the six sessions
recorded between 04:34 and 05:07. The rarer fault — the reader failing to open — was one session in sixteen, so
seven clean ones do not yet say it is gone. ~~Whether item 39 has passed is the owner's to say.~~ The owner
marked it passed the same day.
- **What those sessions say of train B's first release** (the same log and ledger; the owner named which games are
first-person — Kingdom Come: Deliverance II, Cyberpunk 2077, Dying Light: The Beast, Valor Mortis — the rest
third-person, and Psycho-Sleuth 2D):
- **The first FSR 3.1 title read: Kingdom Come: Deliverance II** (FSR 3.1 chosen in the game;
`amd_fidelityfx_upscaler_dx12.dll` 4.0.2 behind the loader). Performance mode, 1280×720 to 2560×1440;
sharpening on at 0.5; `cameraNear` 0.05 and `cameraFar` 8000 — **both planes, the only title that gives both**;
one vertical field of view for the whole session, 63.1°; a reported frame time of 16.67 ms. A 41-second session
of the same game that never left its menu read nothing and says so.
- **Dying Light: The Beast** upscaling with FSR: sharpening off, 75.4°–78° vertical, 7.5 ms. **Clair Obscur**:
sharpening off, 5.7°–90.7° over four minutes. So far the two first-person titles hold a narrow range and the
two third-person ones a wide one (Lies of P 21.6°–73.7°) — what one would expect of cutscene and aiming
cameras, and no more than that: four titles.
- **Three engines give `cameraFar` alone, as a small number** — 10 (Lies of P), 1 (Clair Obscur), 0.1 (Dying
Light) — which is the near plane of an inverted, infinite depth with the other plane at `FLT_MAX`. That is the
case beta.42's plan has to decide.
- **Clair Obscur reports a frame time of 0.001 ms in some seconds.** It is what the game hands FSR, stored as it
was said; the lowest value of that series is not a frame time anyone saw.
- **Cyberpunk 2077 read nothing**, with FSR frame generation running and the render size known: its upscaling did
not come through an ffx-api upscale dispatch in those sessions. Which upscaler it was set to is the owner's to
say; `ffxConfigure` (beta.42) is where its frame generation would be read.
- **One session of Dying Light names DLSS as its upscaler and carries FSR's quality byte and render size** (81
seconds, both an FSR dispatch and a DLSS evaluation seen, "settings changed" not set). Not this train's code —
the session summary's choice between two upscalers seen in one session — and not looked into. **The owner,
2026-11-12: Dying Light and Expedition 33 were set, in the game, to FSR upscaling with DLSS frame generation.**
So "FSR beside DLSS frame generation" in their other sessions is the setting, not a misreading; in this one the
summary picked the wrong one of the two for its upscaler line, which is still to be looked at.
- **A session without consent says so**: two Cyberpunk sessions before its consent dialog was accepted are
Tier 2, and their Advanced row says *not measured inside the game*. **The option off stored nothing** again,
this time on a title that upscales with FSR 3.1 (Dying Light, beta.41).
- **`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".** They have been read on one PC and compared with nothing. The
owner's to reword.
- **SonarCloud's `csharpsquid:S3869` on `ParentDump.cs`** is open on `main` until the owner accepts it again (it was item
38 (j), the one part of that item not done; the owner said on 2026-11-12 that they will). Until then `main`'s `sonarcloud` job is red on that one line.
- **Items 36 (d) (`LogNoteW`) and 37 are still open**; the ledger shows part of 37 (e) happened — the elevated
groups opened and read — and nothing of it was compared with another tool. The alpha line still rests (D98).
**Owner-only:** ~~item 39~~ passed 2026-11-12, with item 38. Nothing new is open from this release; items 36 (d)
and 37 still are.
+204
View File
@@ -0,0 +1,204 @@
# HANDOFF history — 0.1.0-beta.42
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.43 was cut, 2026-11-12 (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 item 2 says 0.1.0-beta.43 is "under way"**: it was released the same day, and what it built and decided is HANDOFF.md's section for it.*
## **START HERE** — 2026-11-12, 0.1.0-beta.42: no new patch site — the label, the registry, a log that outlives the game, the plane at infinity
*Status is `docs/changelog/0.1.0-beta.42.md`; this is what no other file carries.* The owner marked items 38 and 39
passed on 2026-11-12 and train B's second step was planned the same morning. A review of the draft against the code
changed it, and the owner split it (D122): **this release adds no patch site**, and the two new hooks are
0.1.0-beta.43. Four pull requests and this one: #406 (the session's upscaler label, D120; the decisions D119–D122),
#407 (the patch registry), #408 (the native log and the descriptor-type census, D121), #409 (FSR's plane at
infinity, D119; Qodana's native report). **What the owner's sessions on beta.40 and beta.41 showed, and the plan as
approved, are [`handoff/history/0.1.0-beta.41.md`](handoff/history/0.1.0-beta.41.md)**; what each pull request built
is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Unhooking and §Native logging, [`03_METRICS.md`](03_METRICS.md)
§Upscaling and [`07_IPC.md`](07_IPC.md) §Region 5.
### What this release decided, beyond D119–D122
- **The descriptor-type census is not behind the Advanced-metrics switch.** It is a diagnostic that reaches the log
file and nothing else — no record, no shared memory, no session — like `HOOK_INSTALLED`. Behind the switch it
could not answer D121 for a session recorded with the switch off, which is most of them. Its cost was measured
and stated instead (+3.8 ns a dispatch).
- **The log's text grew to 72 characters; nothing else about the ring did.** 256 events, static, 24 KiB.
- **A slot of the patch registry that was ever live is never reused**, and a failed create or enable leaves the
hook created in MinHook as it always did. Both are the smaller change: the first keeps the stop's walk lock-free
without a second word per slot, the second changes no failure path that has never been seen to run.
- **The live card still names the first upscaler a session saw** (`FgLadder.UpscalerIdentity`). The stored
session's name is the modal one (D120); for a session in progress the question is a different one.
- **Qodana's "never used" on the registry test's stand-in engines is switched off for that file**, not answered by
turning the template into function pointers: the header is loaded into a game, and D100 changes such code only
for a defect.
### What the owner's first four sessions on beta.42 showed (2026-11-12, 09:40–09:53)
Dying Light: The Beast, Kingdom Come: Deliverance II, Cyberpunk 2077 and Lies of P, each quit from its own menu;
read from the four `overlay-<pid>-….log` files, a copy of the ledger, and — for Cyberpunk — the game's own settings
file and executable on disk. All four hooked, no fault, no `PATCH_FAILED`, the Agent's log without an `advanced:`
line.
- **D121 is answered, and it is not a detection gap: in that session Cyberpunk 2077 upscaled with FSR 2.1, which is
compiled into the game.** Its `UserSettings.json`, written when the session ended, has `ResolutionScaling = FSR2`,
`FSR2 = Quality`, `FrameGeneration = FSR3`, `FSR3_FrameGeneration = true` — FSR **2** for the upscale, FSR **3**
for frame generation only. Quality is a ratio of 1.5, and the session's render size is 1707×960 at 2560×1440.
`Cyberpunk2077.exe` carries FSR 2's own function names (`ffxFsr2GetJitterPhaseCount`,
`ffxFsr2GetUpscaleRatioFromQualityMode`) and names one FidelityFX module, the loader; its folder has no FSR 2
DLL. **The log says the same from the other side**: the loader (2.3.0), the upscaler leaf (4.1.1) and the
frame-generation leaf (4.0.1) were all patched; the loader and the frame-generation leaf were handed `0x20004`
(PREPARE) and `0x20003` (FRAMEGENERATION); the loader and the upscaler leaf were asked `0x10002` (the ratio of a
quality mode) once at start; **no module was ever handed `0x10001`**, and there is no `UPSCALE_ROUTE` line. The
NVIDIA driver's words for the session say DLSS was not running. So the upscale goes through no export at all —
the case `LIMITATIONS.md` already names ("FSR 2 and upscalers built into the game are not identified"), and
"unknown" beside a measured render size is the true reading. ~~**The owner had said FSR 3 or 4; that the setting is
FSR 2.1 is read from the file, and is the owner's to confirm.**~~ **Confirmed by the owner the same morning with
a screenshot of the game's Graphics menu: Resolution Scaling reads "AMD FidelityFX Super Resolution 2.1"** (the
file's `FSR2`), with its own quality and sharpening rows under it. Nothing to fix for it in beta.43.
- **The loader of SDK 2.3 passes a dispatch on to the leaf's export — the older loader does not — and that is a
double count waiting for the first title that upscales through it.** In Cyberpunk each frame-generation dispatch
type is logged on the loader AND on the frame-generation leaf: the game calls the loader, the loader calls the
leaf's exported `ffxDispatch`. In Kingdom Come and Dying Light (loader 1.0.2) the UPSCALE is logged on the loader
alone, which is what `fl_hook_inventory.h` measured in September and what the fixture's loader stub copies.
Frame generation is unharmed — PREPARE is counted by its frame number, FRAMEGENERATION is a bit, and the
session's factor is ×2.0001. **An UPSCALE is counted once per hooked module that sees it**
(`g_ffxSeen`'s count): through a 2.3 loader that would be two a frame, and with frame generation off — no
PREPARE, so the count falls back to UPSCALE dispatches — the application-frame count would double. Not
observed: no UPSCALE was dispatched. **One session answers it: Cyberpunk with Resolution Scaling set to FSR 3
and frame generation off** — the log shows whether `0x10001` is on both modules, and the session's frame
counts show whether it was counted twice. If so, the fix is beta.43's: count at the first module seen, as
`fl::adv::Owns` already does for the Advanced reads.
- **The plane at infinity is measured, not a hypothesis any more (D119).** Lies of P: `cameraNear = ∞`,
`cameraFar = 10`. Dying Light: `cameraNear = ∞`, `cameraFar = 0.1`. Both gave one plane on beta.41. Kingdom
Come still gives both as numbers (0.05 and 8000). Clair Obscur was not run.
- **The logs are whole.** Each has its installs by module and symbol, the census as it grew, and lines long after
the first second — Dying Light's first UPSCALE at 71.6 s, Kingdom Come's at 37.5 s, when play began. One line
looks odd and was not looked into: Cyberpunk's frame-generation leaf's `ffxDispatch` is at `0x241cde7ba10`, far
from where the other modules sit (`0x7ff…`); the patch went in and was called.
- **Dying Light was named FSR, Quality, with DLSS frame generation ×3.99** — its settings as the owner gave them.
No session changed upscaler part-way, so D120's case was not exercised.
### And three more starts of Cyberpunk 2077, 10:05–10:15 the same morning
Asked for as "Resolution Scaling = FSR 3, frame generation off". Read the same way.
- **The game was still on FSR 2.** After the last of them `UserSettings.json` has `ResolutionScaling = FSR2`,
`FSR2 = Performance` (it was `Quality` at 09:50), `FSR3 = Auto` untouched, `FrameGeneration = Off`. So the quality
and the frame generation were changed and the upscaler was not: **the owner's screenshot of the menu, taken after
them, shows Resolution Scaling = "AMD FidelityFX Super Resolution 2.1", Performance, Frame Generation Off** —
the file's `FSR2` is the menu's FSR 2.1. Both
stored sessions (215 s and 158 s, attached to a game already running) agree with FSR 2.1 built in and frame
generation off: every hook in, **not one ffx dispatch or query of any type**, no Streamline evaluation, no render
size, upscaler "unknown", factor 1.0 from Streamline's frame tokens, ~290 FPS. **So the 2.3 loader's double count
is still unobserved either way**: what answers it is a session in which `UserSettings.json` says
`ResolutionScaling = FSR3` afterwards.
- **The first start was lost to the transient this file recorded an hour earlier — in a real session this time.**
10:05:20 the game appeared; the Overlay went in at 10:05:23; 0.47 s later it was told to stop, and the Agent's
log says why: `SafetyUnhook; Discarded (tier 1, exit=UnhookedSafety, frames=0); guard=ModuleScanFailed/a module
list came back incomplete`. The Overlay's log shows the four patches restored within 0.75 s. The game ran on
unrecorded for two minutes until the owner restarted it. **It is not new and not rare**: the Agent's logs kept on
this PC (2026-11-05 onwards) hold five such ends — Phantom Blade Zero three times on 2026-11-05 (two safety
unhooks and one refusal before injection), Crown & Coin on 2026-11-10, Cyberpunk today — beside the two test
runs. Each is a module list read while the target was still loading modules, at a launch. **The question for the
owner is no longer hypothetical**: a list that cannot be read is not a finding, and rule 2 treats it as a refusal
so that an unreadable game is never hooked; reading it again a bounded number of times before refusing would
keep that — a list that stays unreadable still refuses — and stop losing sessions to a moment of loading. It
changes what the guard does on a check, so it is the owner's decision, and it is not made here. *(Made the same
day: D123, §NEXT item 1b.)*
### NEXT
1. ~~**The owner runs item 40** — above all **one session of Cyberpunk 2077 with FSR upscaling** on beta.42, then
quits the game the ordinary way. Its `logs\overlay-<pid>-….log` is what beta.43 waits for.~~ **Run 2026-11-12;
the section above is what it showed.** What is left of item 40 is (d), a session that changes upscaler, and
the owner's word on the rest.
1a. ~~**Before beta.43's plan: one session of Cyberpunk 2077 with Resolution Scaling = FSR 3, frame generation
off** (the second bullet above), and a second with it on. It says whether FrameLedger names FSR 3 there —
the route through the loader that D121 was first taken to be about — and whether the 2.3 loader counts an
UPSCALE twice. *(Tried 2026-11-12 10:08 and 10:12: the game was still on FSR 2 — the section above. The check
that the right thing ran is the file: `ResolutionScaling = FSR3`.)*~~
**It cannot be run, the owner said the same day: Cyberpunk 2077 has FSR 2.1 as its only FSR upscaler and
FSR 3.1 as frame generation only — two separate settings, not a pair; there is no FSR 3 under Resolution
Scaling.** So D121 is closed for good — every Cyberpunk session upscaling with FSR reads "unknown", by the
limit `LIMITATIONS.md` states — and **no title run so far upscales through a 2.3 loader**. The double
count stays unobserved. What IS measured is that this loader hands a frame-generation dispatch to the leaf's
export; an UPSCALE through the same `ffxDispatch` would take the same path. beta.43's plan therefore counts
an UPSCALE at the first hooked module that sees it (as `fl::adv::Owns` does) as a precaution, with a fixture
whose loader forwards to the leaf's export — rather than wait for a session that cannot be had.
1b. ~~**The owner's decision on the guard's module-list read** (the section above): refuse at the first incomplete
list, as now, or read again a bounded number of times first. If the second, it is a pull request of its own
in the guard (`FrameLedger.Injector`), with `19_SAFETY` amended in it, before or with beta.43.~~ **Decided
2026-11-12 — read again (D123) — and built the same day**: `Collected::kUnsettled`, up to three re-reads,
`19_SAFETY` amended. Not released: it ships with the next pre-release, and until then a launch can still be
lost this way on beta.42. What the owner then checks is the Agent's log: no `guard=ModuleScanFailed` end at a
game's launch, and if one comes its signal now says which kind — *kept changing while it was read* (four reads
were not enough) or *came back incomplete* (more modules than the guard's buffer holds).
2. **0.1.0-beta.43 — planned and approved 2026-11-12 (D123–D125), and under way.** The guard's re-read (D123,
#413) ships with it and not on its own (D124). Five pull requests after it: (1) an UPSCALE is counted at the
first source that saw one (D125) — the fixture's loader bound through the leaves' exports read K = 1 as 2.0
before it; (2) `slSetConstants`; (3) `ffxConfigure` on the four ffx modules; (4) the Agent, the App and the
Privacy Policy 2.17, whose wording the plan carried and the owner approved with it; (5) the release, owner-only
item 41. The design is the one below, as the review of 2026-11-12's first plan left it; nothing in the logs
changed it except D125.
~~**Read that log, then plan 0.1.0-beta.43**~~ — `slSetConstants` and `ffxConfigure`, and the fix for D121 if the
log shows the route. What to look for: which `HOOK_INSTALLED` lines there are (which of the four ffx modules and
the FSR 3.0 host were patched); the `FFX_DISPATCH` lines — is `b=0x10001` (UPSCALE) on any module, or only
`0x20004` / `0x2000c` / `0x20003`; an `UPSCALE_ROUTE` line; `PATCH_FAILED`; the last `RUNTIME_CENSUS` word.
**No UPSCALE type anywhere and no route line means the upscale does not come through any export the Overlay
patches** — statically linked, or a module the inventory does not name — and then the fix is not a new arm in
a detour. The design for the two hooks, as the review left it, is the plan of 2026-11-12 (moved with the
section above) and these points: the new rows are gated at the top of `InstallByFamily`, **before**
`ResolveScoped`, and installed only once the process was ever asked; hook families 13 and 14 with latches of
their own; `slSetConstants` checks the struct's GUID and `structVersion ≥ 1` on every call and reads only
`jitterOffset`, `mvecScale`, `cameraNear` … `cameraAspectRatio` and the seven Booleans — never bytes 368..423,
pinned by `offsetof` of the allowed members; summaries from the first viewport seen; `ffxConfigure` has an
owner slot of its own and reads `frameGenerationEnabled`, `allowAsyncWorkloads`, `flags`,
`onlyPresentGenerated`, `generationRect` and nothing else; the detours also consult `MayObserve()`;
`overlay-fields-check` gains three parameter names, `structType` among the shared members and an `offsetof` per
listed `sl::Constants` member. The registry holds 48 and the worst case becomes 25
(`kPatchSitesOutsideTheInventory` stays 7; the inventory's row count goes from 13 to 18 and its
`static_assert` says so).
3. **0.1.0-beta.44** — `slGetFeatureVersion` and `slGetFeatureRequirements` — when the owner says beta.43 passed.
4. **Trains C and D** (beta.45, beta.46) each begin with a spike and end in the owner's go or no.
### 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.~~ **Recorded 2026-11-12: 0.1.0-beta.42 was released
2026-11-12T02:31:07Z** (09:31 in the owner's time zone) from the signed tag on `a708ae8` (#410), by run
43139775713 — 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.42`. The
delta from beta.41 is 710,943 bytes beside a full package of 110,716,228 — "Delta processed 0452 files. 0023
patched, 0429 unchanged". The wiki was published by run 43142009098. The rehearsal on the release branch (run
43137520796) had made a delta of 735,485 bytes with the same file counts.
- **No real game was run on this build.** The four changes were tested with the harness and the cost measured on
the headers. Item 40 is the first real session.
- **Whether the missing plane of Lies of P, Clair Obscur and Dying Light is `FLT_MAX`** is still the reading their
small `cameraFar` values point to, not a measurement. Item 40 (c).
- **A flake with a cause now, and a question in it for the owner.**
`ShmDrainIntegrationTests.TheGuardInjectsTheOverlayAndTheReaderDrainsRealFrames` was red once in this release's
local gate (and once on 2026-11-11, when the assertion did not yet print the verdict): the supervisor's first
re-scan, 0.8 s after the injection, came back `ModuleScanFailed` — *a module list came back incomplete* — while
the harness was still loading modules. The same gate was green on the same code before and after. In the test
it is a re-run. **In a real session the same answer is a safety unhook**: a re-scan that cannot read the module
list of a game that is still running stops the session (`19_SAFETY` §During a session; D48 covers only a game
that has exited). Whether the guard should read the list a second time before refusing is a change to rule 2's
checks and is the owner's to decide; nothing was changed. **A second one within the hour, in the gate of the pull
request that records the release's facts:**
`ToolhelpProcessSnapshotSourceTests.ThisProcessIsInTheSnapshotWithItsNormalisedImagePathAndACreationTime` got an
empty snapshot — `ToolhelpProcessSnapshotSource.Take` returns an empty list when the snapshot cannot be taken or
walked, and says nothing. Green on the run after. Both are Windows refusing, for a moment, to enumerate something
on a PC that was building, testing and running FrameLedger itself at once; what an empty snapshot does to the
watcher's tick in a real session was not looked into.
- ~~**SonarCloud has not answered for #406–#409**: `main`'s `sonarcloud` job was cancelled by the next merge each
time. It runs to its end on this release's commit; read it then.~~ **It answered on `a708ae8`: the quality gate
passed, and one issue was open on `main`** — `cpp:S5813`, a `strlen` in the helper the new log case of
`guard_test.cpp` reads lines with (#408). Fixed in the pull request that records these facts: the helper takes
strings. **`csharpsquid:S3869` on `ParentDump.cs` is no longer open** — SonarCloud shows it accepted at
2026-11-11T21:13Z (04:13 on the 12th, the owner's time), which is before the texts that still called it open
were written; they were not checked against SonarCloud then. **Qodana's two reports are green on the release's
commit**; the native one was red from #407 to #408 on seven problems in test code, answered in #409.
- **`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. ~~**SonarCloud's `csharpsquid:S3869` on
`ParentDump.cs`** is the owner's to accept.~~ *(Done — the line above.)* **Items 36 (d) and 37 are still open.** The alpha line still rests
(D98).
**Owner-only:** item 40.
+154
View File
@@ -0,0 +1,154 @@
# HANDOFF history — 0.1.0-beta.43
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.44 was cut, 2026-11-12 (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 item 2 says 0.1.0-beta.44 is planned**: it was released the same day, and what it built and decided is HANDOFF.md's section for it.*
## **START HERE** — 2026-11-12, 0.1.0-beta.43: two hooks installed only where asked for, the guard reads a moving list again, an UPSCALE counted once
*Status is `docs/changelog/0.1.0-beta.43.md`; this is what no other file carries.* The owner ran beta.42 the morning
it was released; seven sessions, a copy of the ledger and the logs answered D121 (Cyberpunk 2077's FSR is 2.1, built
into the game), showed the guard losing launches to a module list that moved while it was read, and showed the
FidelityFX 2.3 loader handing a call on to the leaf's export. The owner decided D123–D125 and approved the plan the
same morning, Privacy Policy 2.17's wording with it. Five pull requests and this one: #413 (the guard reads again,
D123), #414 (an UPSCALE is counted at the first source that saw one, D125; D124), #415 (`slSetConstants`), #416
(`ffxConfigure` on the four ffx-api modules), #417 (the Agent, the App, Privacy Policy 2.17). **What the owner's
sessions on beta.42 showed, and the design as planned, are
[`handoff/history/0.1.0-beta.42.md`](handoff/history/0.1.0-beta.42.md)**; what each pull request built is
[`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Pre-injection checks,
[`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory (the two rows, with their measured cost) and
[`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B.
### What this release decided, beyond D123–D125
- **A hook that exists only for Advanced metrics is not put into a game that was never asked.** The two rows are
gated at the top of `InstallByFamily`, before the symbol is resolved (resolving holds the module). Once a
session with the option on has started in a process, the patch goes in on that watchdog tick and **stays for the
life of the process**: a later session with the option off finds the detour there, forwarding without looking.
Removing a patch between sessions would be a second patch event in a running game for nothing gained. So "off
means off" (D111) is, for these two: nothing read, nothing published — and, in a game no session ever asked,
nothing patched. Privacy Policy 2.17 §4 says it that way.
- **Privacy Policy 2.17, not 2.16 stretched.** beta.40's plan had 2.16 stand "once for the three releases"; its
text then listed DLSS's and FSR's parameters by name, and neither list holds Streamline's constants or the
frame-generation configuration. The plan of beta.43 carried the new sentences and the owner approved them with it.
**beta.44 reads feature versions and requirements — check 2.17's lists the same way before assuming it covers
them.**
- **For each of the two calls a session says which of three things happened** (`AdvancedInGameCall`): read; hooked
and the game never called; not hooked. "Not hooked" is three causes the session does not tell apart — the game
did not load the library, a Streamline 1.x interposer (refused), a patch the registry refused — and the Overlay's
log does: a `HOOK_INSTALLED` line naming the function, or a `PATCH_FAILED`.
- **A count is not part of what makes a session's facts new.** `sl.constants.resets` grows all session; the
recorder's context would be rewritten each second. `InGameAdvancedSampler.Conclude` brings it up to date once, at
the end. A session recovered after a crash holds the count as of the last time some other field moved — a lower
bound.
- **Streamline's summaries are the first viewport's**, and the configure count has an owner slot of its own (the
2.3 loader would otherwise bring one configure to two modules, as D125's dispatch).
- **The accuracy statement no longer says nothing of what a game tells its upscaler was read from a real game.**
FSR's upscaling values were (beta.41, beta.42: Lies of P, Dying Light: The Beast, Kingdom Come: Deliverance II).
The DLSS options, Streamline's constants and the frame-generation configuration are still unconfirmed, and the
three copies say so.
### Traps this train left
- **An unpatched export may already begin with a jump.** The loader stub's `ffxConfigure` starts with `E9` in the
file: "the first byte is not a jump" is not a test of "not patched". `ReadTargetExportBytes` compares the target's
bytes with the file's own (`inFile`).
- **A branch stacked on a pull request that is then squashed**: `git rebase --onto origin/main <the old tip>`, and
`git diff <old tip> <squash>` empty says the gate that ran still stands.
- **`mcp__ccd_pr__set_auto_merge` says "not bound" for a pull request opened from a script**: `gh pr merge <n>
--auto --squash`. A run's artifacts while it is still in progress: `gh api
repos/…/actions/artifacts/<id>/zip`.
- **clang-format re-wraps what an edit script wrote**, so a second script's anchors must be read from the formatted
file; a multi-file script that fails part-way has already written the earlier files.
- **One local gate printed 871 App tests where every other printed 872**, green. Not looked into.
### What the owner's nine sessions on beta.43 showed (2026-11-12)
Run 15:42–16:21 in the owner's time zone, read the same afternoon from a copy of the ledger (sessions 171–179), the
Agent's log, the nine overlay logs and Windows' application log. Advanced metrics was on for the first eight and off
for the last.
| # | Game | What it showed |
|---|---|---|
| 171 | Phantom Blade Zero, 649 s, DLSS frame generation ×3.0 | Streamline 2.14.1: **read** — jitter ≤ 0.47, motion-vector scale 0.0009 / 0.0016, near 0.01 and far 75,000 with depth inverted, field of view 0.6545–1.3612 rad, aspect 1.7767, 1 reset. FSR frame generation: hooked on the loader and both leaves, the game never called |
| 172 | Lies of P, 35 s, exit code 3 | 542 frames, nothing evaluated. **The owner: the game crashed after a shader failed to compile.** The crash policy counted it and turned the game's hooking off (below) |
| 173 | Lies of P, 130 s | Tier 2 — hooking was off; the owner switched it on again at 16:02 |
| 174 | Lies of P, 94 s, FSR 3 + FSR frame generation ×2.0 | **`ffxConfigure` read** on the one-module `amd_fidelityfx_dx12.dll`: frame generation on and off, not asynchronous, generated frames not presented alone, 2560 × 1440 at 0, 0; the log has `FFX_CONFIGURE` types `0x10007` and `0x20002`. Streamline: not hooked (the game has none) |
| 175 | Cyberpunk 2077, 72 s, no upscaler named, no frame generation | Streamline 2.14.1: **read** — jitter ≤ 0.5, motion-vector scale 1 / 1, near 0.02 and far 16,000 inverted, aspect 1.7778, **field of view 51.0055–90**, 2,575 resets |
| 176 | Cyberpunk 2077, 145 s, DLSS + DLSS frame generation ×2.0 | the same values; 1,821 resets. FSR frame generation: hooked on the loader and both leaves, never called |
| 177 | Kingdom Come: Deliverance II, 135 s, FSR | Streamline: not hooked. `ffxConfigure` hooked on the loader and the upscaler, never called — the game ships no frame generation |
| 178 | Hogwarts Legacy, 158 s, DLSS frame generation ×4.0 | Streamline 2.14.16: **read** — jitter ≤ 0.47, field of view 0.8872–2.0071 rad, aspect 1.7763, near 0.01 and far 75,000 inverted, 11 resets. `ffxConfigure` hooked on `amd_fidelityfx_dx12.dll`, never called |
| 179 | Lies of P, 129 s, **Advanced metrics off**, a new Agent, the game started afresh | no Advanced row; bits 13 and 14 clear in `hooks_installed_mask`; the log has `ffxDispatch` and `ffxQuery` and **no `ffxConfigure` line** |
- **The two hooks did what they were built to do on four real games**, three Streamline builds apart (2.14.1 twice,
2.14.16) and one FSR library. No `PATCH_FAILED`, no fault counted, in nine logs. `legal_acceptance` holds Privacy
Policy 2.17 accepted once, four seconds after the update; no session since the update ended with
`guard=ModuleScanFailed` (the day's one is beta.42's, at 10:05).
- **Cyberpunk 2077 gives Streamline its field of view in degrees.** The vendor's header says radians; the game
passes 51–90. Every other field of the same struct is sane (the aspect ratio beside it is 1.7778), so the layout
is not in question — the game's unit is. The page prints `51.0055 – 90 rad (2922.4° – 5156.6°)`: **a defect of
the label, not of the reading**, and beta.44's first pull request. The two stored sessions keep the string they
were stored with.
- **A resets count has no denominator.** 2,575 in a 72 s session that was mostly menus and 1,821 in 145 s on
Cyberpunk, beside 1 and 11 on the two Unreal games. It is what the game said (`reset == eTrue`, the first
viewport's calls); the page does not say out of how many calls.
- **A frame-generation configuration with no flag set has no flags row**, where an upscale with none says `none`.
- **Lies of P's 35 s end turned its hooking off, and one such end is now enough.** `hook_crash_count` is never set
back: the game's two ends of 2026-10-19/20 (`19_SAFETY` §Crash & stability safety, the hand-off to Steam) had
brought it to 2, the owner had switched hooking on again, and today's single early end made 3 — at or over
`CrashesToDisable`, so hooking went off at once, under a reason that says *twice*. Whether switching hooking back
on starts the count again is the owner's decision; it is asked with beta.44's plan.
- **Hogwarts Legacy faults in the driver's `_nvngx.dll` as it exits, hooked or not.** Windows' application log has
the same fault (0xc0000005 at +0x6aa85, `_nvngx.dll` 32.0.16.2114) six times since 2026-11-06, each at the end
of one of the game's seven recorded sessions — the first of them session 131, which nothing was injected into.
That one reads `crashed`; the five hooked ones, today's 178 among them, read `normal` with exit code 0, the
fault logged in the second the session was saved. **Why a hooked session does not see the crash event that an
unhooked one does was not looked into.**
- **Frame rates as before**, where the settings were: Lies of P 59 → 118 (beta.42: 58.9 → 118.0), Kingdom Come 59.3
(59.4), Hogwarts Legacy 58.8 → 235.8 at ×4 (alpha.3: 56.1 → 225.1). Phantom Blade Zero's factor moves between
sessions under the driver's dynamic mode (×2.9 to ×4.1 since 2026-11-05) and Cyberpunk was run with other settings.
- **Not exercised**: a configure through the FidelityFX 2.3 loader (Cyberpunk 2077 with FSR frame generation) — the
configure count's owner slot has not met a real game; a game with neither library; Dying Light: The Beast.
Phantom Blade Zero and Hogwarts Legacy name no upscaler beside DLSS frame generation, as on every release before.
### NEXT
1. ~~**The owner runs item 41**~~ **Run and read 2026-11-12** (§What the owner's nine sessions on beta.43 showed).
The owner's word was to go on if it passed, and it is judged passed: both hooks read real games, nothing
failed to patch, off meant off. What was not exercised is listed there and stays open.
2. **0.1.0-beta.44** — first the field of view a game gives in degrees (and what else the nine sessions found),
then `slGetFeatureVersion` and `slGetFeatureRequirements`. Both are calls a game makes while starting, so most
sessions will have missed them: plan what "not seen" says. ~~**Planned with the owner before any code.**~~ **The
plan was approved 2026-11-12 with three decisions, D126–D128** (the count of early abnormal ends starts again
at a grant; the fault at exit is written down only; a field of view over π is shown as given), and with Privacy
Policy 2.18's wording. Four pull requests: the fixes; the two hooks in the Overlay; the Agent, the App and the
policy; the release.
3. **Trains C and D** (beta.45, beta.46) each begin with a spike and end in the owner's go or no.
### 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 of #413–#417 (the
`sonarcloud` job on `main` is cancelled by the next merge, so it answers on the release's commit).~~ **Recorded
2026-11-12: 0.1.0-beta.43 was released 2026-11-12T06:57:57Z** (13:57 in the owner's time zone) from the signed
tag on `6c7ba74` (#418), by run 43169675460 — 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.43`. The delta from beta.42 is 1,934,264 bytes beside a full package of 110,736,398 —
"Delta processed 0452 files. 0025 patched, 0427 unchanged". The wiki was published by run 43171842051. The
rehearsal on the release branch (run 43167388933, the same tree before it was rebased onto #417's squash) had
made a delta of 1,944,086 bytes with the same file counts. **SonarCloud answered on `6c7ba74`: the quality gate
passed and no issue is open on `main`. Qodana's two reports are green on that commit**, and were on #417's.
- ~~**No real game was run on this build.** Two new patch sites, tested with the harness and the stubs; their cost
measured on the headers. Whether a real `sl.interposer.dll` 2.x lays `sl::Constants` out as the vendored header
does is checked on every call by the struct's GUID and version, not by a real game yet.~~ **Nine sessions on five
games, 2026-11-12** (§What the owner's nine sessions on beta.43 showed): interposers 2.14.1 and 2.14.16 lay the
struct out as the header does. **The accuracy statement's three copies and `LIMITATIONS.md` still say Streamline's
constants and the frame-generation configuration "have not been confirmed" on a real game** — reworded with
beta.44's first pull request. **`docs/LIST_GAME_TESTED.md` is as of 2026-11-06**: refreshing it is a new copy and
the owner's review.
- **Item 40 (d)** — a session that changes upscaler — was not exercised, and the owner has not said item 40 passed.
**Items 36 (d) and 37 are still open.**
- **What an empty process snapshot does to the watcher's tick in a real session** was not looked into
(`ToolhelpProcessSnapshotSource.Take` returns an empty list and says nothing; seen once in a test on 2026-11-12).
- **`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 item 41 left unexercised — (d) through the FidelityFX 2.3 loader, (e) a game with neither library; item 40 (d).
+182
View File
@@ -0,0 +1,182 @@
# HANDOFF history — 0.1.0-beta.44
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.45 was cut, 2026-11-12 (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 says 0.1.0-beta.45 is planned**: it was released the same day, and what it built and decided is HANDOFF.md's section for it.*
## **START HERE** — 2026-11-12, 0.1.0-beta.44: what the first real games on beta.43 found, fixed; Streamline's answers about a feature, hooked only where asked
*Status is `docs/changelog/0.1.0-beta.44.md`; this is what no other file carries.* The owner ran nine sessions on
beta.43 the afternoon it was released and said: read them, write down the result, go on if it passes. They were read
from a copy of the ledger, the Agent's log, nine overlay logs and Windows' application log (#420); item 41 was judged
passed, and the owner decided D126–D128 and approved the plan the same afternoon, Privacy Policy 2.18's wording with
it. Four pull requests and this one: #421 (the fixes: a field of view in degrees, the count of early abnormal ends,
`flags` of `none`; D126–D128), #422 (`slGetFeatureVersion` and `slGetFeatureRequirements` in the Overlay), #423
(the Agent, the App, Privacy Policy 2.18). **What the nine sessions showed, session by session, is
[`handoff/history/0.1.0-beta.43.md`](handoff/history/0.1.0-beta.43.md)**; what each pull request built is
[`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §Crash & stability safety,
[`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory (the row of the two calls, with their measured cost) and
[`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B.
### What this release decided, beyond D126–D128
- **What is read of these two calls is the answer, and only a good one.** The detours call the original first and
read the struct the game passed when it returned `eOk`; a refusal leaves the struct as the game made it, and the
fixture's stub leaves 99s in it to prove nothing of a refused answer is kept. The pointers the answer carries —
the list of required buffer tags, the names of Vulkan extensions and features — are never followed; the stub's
are wild, and no fault is counted.
- **The feature slots are the one group of region 5 a new request does not empty.** Every other group is a
session's — ranges, counts, switches seen. Which version a feature is and what it requires are facts about the
process, and a game asks once: a second session of a game that kept running would have nothing where the first
had the answer. `Reset` keeps the slots and their bit of the mask. They were read only while a session asked.
- **The two rows are the first of the table, because rows are patched in the table's order.** Nothing in the
Overlay paces the installs: the 0.1–0.25 s between `HOOK_INSTALLED` lines in the owner's logs is MinHook stopping
every thread of the game for each patch. In a process that was asked, the two calls a game makes while starting
are the ones that cannot wait behind five others; in a process never asked, the two rows are passed over before
anything is resolved.
- **"Hooked, and the game did not call" has words of its own for a call made while starting**
(`AdvInGameCall_NotAskedAgain`). For a call made every frame it is a finding about the game; for these two it is
what every late attach will say. One bit of the mask covers both questions, so which was answered is told by the
slots (`InGameAdvancedSampler.FeatureCall`).
- **Privacy Policy 2.18, not 2.17 stretched**: 2.17 says "two further calls" and lists what they give. 2.18 also
says what of the answer is never read.
- **The rows are the vendor's words**: `kFeatureDLSS_G · versionNGX`, the requirement flags by their enumerators,
an id this build has no name for as `feature <number>`. A version of all zeros has no row, except `versionSL`.
- **The Agent's end-to-end tests run a Streamline target now** (until this release only an FSR one): the constants
and the two answers, through the shipped Agent and the real Overlay.
- **A field of view over π is two rows** (D128): the number, and `cameraFOV unit` with the token `not_radians` —
a token replaces a row's value in the App, so a note beside a number is a row of its own.
- **The count of early abnormal ends is set back by the consent grant and by nothing else** (D126) — the one
statement that turns hooking on. `hook_autodisabled_reason` and `_at` stay as the row's history; the App shows
them only while hooking is off.
### Traps this train left
- **`vswhere -latest` names SQL Server Management Studio on this PC.** Ask for the C++ tools as `build.ps1` does
(`-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`). The `x64-release` preset writes no
`compile_commands.json`: `ninja -C build/native/x64-release -t commands FrameLedger.Overlay` gives the Overlay's
flags for a bench.
- **Run clang-format on the native files an edit script wrote before the gate** — the format check comes after the
native build and tests, and a miss costs the whole run.
- **`tools/resx-gen.ps1` needs `-Resx src/FrameLedger.App/Strings.resx`**; started without it from a shell that
has no console it waits for the missing parameter until it is stopped.
- **A Python script passed to a shell as a here-document loses its backslashes** before Python sees them: write
the script to a file.
- **`gh pr checks --watch` returns at once when no check has started yet**; wait a moment before starting it.
- **Qodana's native report is advisory, and auto-merge does not wait for it.** On #422 it reported three
`bugprone-implicit-widening-of-multiplication-result` in the test and the harness (an index into the feature
slots computed as a product of two 32-bit values: compute it in `size_t`) while the required checks were still
running; auto-merge was switched off until the fix was pushed. A finished job's log while its run is still going:
`gh api repos/…/actions/jobs/<id>/logs --allow-escape-sequences`; the report's SARIF is a zip inside the
artifact's zip.
- **GPG's pinentry timed out once** (the cache had expired); the second attempt went through when the owner was
at the keyboard.
### What the owner's eight sessions on beta.44 showed (2026-11-12)
Run 19:52–20:46 in the owner's time zone, read the same evening from a copy of the ledger (sessions 181–188), the
Agent's log, eight overlay logs and Windows' application log. Advanced metrics was on throughout.
| # | Game | What it showed |
|---|---|---|
| 181 | Phantom Blade Zero, 796 s, DLSS frame generation ×4.0 | Streamline 2.14.1. **Both questions read**: versions of `kFeatureReflex`, `kFeatureDLSS_G`, `kFeaturePCL`; requirements of those and `kFeatureDeepDVC`. The constants as on beta.43 |
| 182 | Clair Obscur: Expedition 33, 107 s, FSR + DLSS frame generation ×3.0 | Streamline 2.7.30. **Both read** (`kFeatureDLSS_G`, `kFeatureReflex`, `kFeaturePCL`); the constants and FSR's upscale values read beside them |
| 183 | Valor Mortis (Microsoft Store), 51 s, **crashed** — exit code `0xC0000005` | Streamline 2.14.1. Both read before it ended. The game's second early abnormal end, so hooking went off (below) |
| 184 | Valor Mortis, 935 s, ×6.0 | hooking switched on again at 20:11; both read; ended normally |
| 185 | Black Myth: Wukong, 167 s, ×4.0 | Streamline 2.7.4. Both read |
| 186 | Cyberpunk 2077, 257 s, DLSS + DLSS frame generation ×2.0 | **The field of view reads `51.0055 – 90` with a row `cameraFOV unit` = *not radians*** (D128). Requirements **read** for `kFeatureDLSS`, `kFeatureDLSS_RR`, `kFeatureDLSS_G`, `kFeatureReflex`, `kFeatureNIS`; the version question *hooked, not asked again* |
| 187, 188 | Kingdom Come: Deliverance II, 39 s and 289 s | no Streamline: the constants and both questions *not hooked*; `ffxConfigure` hooked and never called. Neither session reached an FSR dispatch (the upscaler's first query came 11 s before the second one ended) |
- **The two questions were read in six of six Streamline sessions, on five games** — the plan, the release notes
and four documents said most sessions would show nothing, because a game asks while it starts. Unreal's
Streamline plugin (four of the five games) asks again after the attach, and Cyberpunk 2077 asks for requirements
again; only Cyberpunk's version question was *not asked again*. The three answers of the line were each seen.
The documents are corrected in the same pull request as this text.
- **What was read agrees with the PC.** `driverVersionDetected` 621.14.0 is the snapshot's driver
(`32.0.16.2114`), `osVersionDetected` 10.0.29648 its Windows build, `versionNGX` of `kFeatureDLSS_G` the file
version of the game's `nvngx_dlssg.dll` (310.9.1, 310.6.0), `versionSL` of Reflex and PCL the interposer's.
- **`kFeatureDLSS_G`'s `versionSL` is 2.14.16 on three games that ship 2.14.1 or 2.7.30** (Phantom Blade Zero,
Valor Mortis, Clair Obscur): Streamline answers for a newer frame-generation plugin than the game's own folder
holds. Which file that is was not looked into — an updated plugin delivered by NVIDIA's app is the likely one.
It is the first value of this kind that a file's version could not have given.
- **No Unreal game asked about `kFeatureDLSS`.** Their DLSS upscaling does not go through Streamline (Cyberpunk's
does: it is asked about, and the session names DLSS). That is the likely reason Phantom Blade Zero, Hogwarts
Legacy, Valor Mortis and Black Myth: Wukong name no upscaler beside DLSS frame generation — the question left
open since beta.43. Naming it would take a hook on NGX, which this project does not have.
- **Valor Mortis crashed 51 s into a hooked session, as it did on beta.40.** Session 141 (2026-11-12 02:44,
beta.40: `0xC0000005` after 51 s, 498 frames) and session 183 (20:09, beta.44: the same code after 51 s, 8,077
frames); the session after each ran normally under the same build. So it is not this release's hooks. Whether
FrameLedger has any part in it is not known: Windows logged no event for either (a Store package), and there is
no unhooked start to compare. **The crash policy did what D126 says**: today's was the game's second early end, so
hooking went off at 20:09:52; the owner switched it on at 20:11:03 and the count is 0.
- **Black Myth: Wukong faults in Steam's `crashhandler64.dll` as it exits** (0xc0000409 at +0x39b49) — at each of
its three recorded exits, all hooked (beta.40 twice, beta.44 once); each session reads `normal`, the shape D127
wrote down for Hogwarts Legacy. **There is no unhooked exit to compare**: one session of it with hooking off
would say whether FrameLedger has a part.
- **No `PATCH_FAILED`, no fault counted, in eight logs**; Privacy Policy 2.18 was accepted once, eight seconds
after the update. The two new rows are the first Streamline `HOOK_INSTALLED` lines of every log. Frame rates as
before where the settings were: Clair Obscur 106 → 323 (beta.41: 106 → 318), Valor Mortis 39.6 → 237 (37.7 →
228). Wukong's native rate was 90 where beta.40's two sessions had 124; nothing says whether the scene and
settings were the same.
- **Not exercised: off means off** — every session had Advanced metrics on. And, from item 41: a configure through
the FidelityFX 2.3 loader.
### NEXT
1. ~~**The owner runs item 42**~~ **Run and read 2026-11-12** (§What the owner's eight sessions on beta.44
showed): both hooks read real games — far more often than planned for — the degrees fix reads right on
Cyberpunk 2077, a game with no Streamline says *not hooked*. *Off means off* was not exercised.
2. **The next version, by the owner's word of 2026-11-12: `slInit`, `slIsFeatureSupported` "and some other parts"**
— said the evening beta.44 came out, to be done if beta.44 passed, and then "update and go on" once these
sessions were in. It reopens D112 (`slInit` is not hooked in train B; if ever: never `applicationId`,
`projectId`, the paths), and `slIsFeatureSupported` is handed an `sl::AdapterInfo` whose `deviceLUID` and
`vkPhysicalDevice` are not to be read (D104). ~~**Planned with the owner before any code**: which other parts,
what of each is read, the Privacy Policy's wording, and where train C goes.~~ **Planned and approved 2026-11-12
(D129–D131)**: `slInit` stays out — shown why it cannot be seen, the owner chose so; six calls go in, in one
release, **0.1.0-beta.45** — `slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded`,
`slAllocateResources`, `slFreeResources`, `slShutdown`; Privacy Policy 2.19's wording approved with the plan.
Pull requests: three hooks, three hooks, the Agent and the App with the policy, the release.
3. **Train C (Reflex latency per frame)**: its spike is written beside beta.45, a document only; code waits for the
owner's go after reading it. **Train D** after that, the same way.
### 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-12: 0.1.0-beta.44 was released 2026-11-12T12:24:26Z** (19:24 in the owner's time zone) from the signed
tag on `f9e9fdb` (#424), by run 43214789700 — 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.44`. The delta from beta.43 is 1,866,183 bytes beside a full package of 110,750,960 —
"Delta processed 0452 files. 0025 patched, 0427 unchanged". The wiki was published by run 43217647799. The
rehearsal on the release branch (run 43204362797, at `56b1157` — the released tree but for two namespace
qualifiers #423 dropped afterwards) had made a delta of 1,878,774 bytes with the same file counts. **SonarCloud
answered on `f9e9fdb`: the quality gate passed and no issue is open on `main`. Qodana's two reports are green on
that commit.** Qodana found two things on the way, each fixed before its pull request merged: three index
products in the injected test and the harness (#422, native), and two namespace qualifiers a new `using` made
redundant (#423, managed) — #423's auto-merge was held until that report was in. **`check` failed once on
#424**, a pull request that changes no code: the CaptureHost's launch-mode end-to-end test
(`LaunchModeStartsTheHarnessItselfAndReportsWhatRanUnhooked`) read 19.8 presented frames a second from the
harness on a slow runner where it asks for more than 30; the job was run again and passed. A rate asserted
against a wall clock on a shared runner — the one flake of this train, not looked into further.
- ~~**No real game was run on this build.** Two new patch sites, tested with the harness and the stub; their cost
measured on the headers.~~ **Eight sessions on six games, 2026-11-12** (§What the owner's eight sessions on
beta.44 showed). **The release notes on GitHub still say "most sessions will show nothing of the two new
readings"** — a prediction the sessions did not bear out; `docs/changelog/0.1.0-beta.44.md` is a released file
and is not edited, and the published notes were left as they are.
- **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). Looking
again later would make every session of Hogwarts Legacy `crashed`, and under a user-mode exception would end the
exception for a fault no hook caused; the decision is the owner's, and is not taken.
- ~~**Phantom Blade Zero and Hogwarts Legacy name no upscaler beside DLSS frame generation**, as on every release
before; not looked into.~~ **Likely answered 2026-11-12**: no Unreal game asks Streamline about `kFeatureDLSS`, so
their DLSS upscaling does not pass through the calls this project hooks.
- **`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.**
- **What an empty process snapshot does to the watcher's tick in a real session** was not looked into (seen once in
a test on 2026-11-12).
- **`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 42 (f), and one session each of Valor Mortis and Black Myth: Wukong with hooking off; what
item 41 left unexercised; item 40 (d).
+175
View File
@@ -0,0 +1,175 @@
# HANDOFF history — 0.1.0-beta.45
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.46 was cut, 2026-11-13 (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 says 0.1.0-beta.46 is to come**: it was released the next day, and what it built and decided is HANDOFF.md's section for it.*
## **START HERE** — 2026-11-12, 0.1.0-beta.45: six more of Streamline's calls, hooked only where asked; `slInit` stays out; the Reflex spike as a document
*Status is `docs/changelog/0.1.0-beta.45.md`; this is what no other file carries.* The owner ran eight sessions on
beta.44 the evening it was released and said: add the three new ones, update, go on. They were read from a copy of
the ledger and the logs (#426); asked to reopen D112, the owner was shown why `slInit` cannot be seen and chose to
leave it out (D129), chose six other calls for one release (D130), and approved the plan with Privacy Policy 2.19's
wording. Four pull requests and this one: #427 (`slIsFeatureSupported`, `slIsFeatureLoaded`, `slSetFeatureLoaded`
in the Overlay; D129–D131), #428 (`slAllocateResources`, `slFreeResources`, `slShutdown`), #429 (the Agent, the
App, Privacy Policy 2.19), #430 (train C's spike, a document: `spike-notes` §30). **What the eight sessions on
beta.44 showed, session by session, is [`handoff/history/0.1.0-beta.44.md`](handoff/history/0.1.0-beta.44.md)**;
what each pull request built is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory (the two rows of the six
calls, with their measured cost) and [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B (the fourth step).
### What this release decided, beyond D129–D131
- **Everything the six calls give is word 1 of a feature's slot, and one reserved word.** Bits 2–4 the two answers
(supported, with the `sl::Result` in bits 8..15; loaded and its value), bits 5–6 the game switching the feature
off and on, bits 16..19 and 20..23 two counts that stop at fifteen and never carry; `slShutdowns` took the first
of three reserved words (@308). Layout 5 and schema 23 as they were. **The answers are the process's and a new
request keeps them; the switching, the counts and the shutdowns are a session's and a new request clears them.**
- **A refusal is the answer.** `slIsFeatureSupported`'s detour calls the original first and keeps whatever it
returned; the page names it by NVIDIA's enumerator (forty codes, the same order at sixteen upstream tags from
v2.0.0 to v2.14.16), `result <n>` past the list, 255 for a code a byte could not carry.
- **The two calls on a game's way out note the call, then call the original, and run nothing after it** —
`slFreeResources` and `slShutdown`. The fixture shuts Streamline down and goes on using the stub through every
detour.
- **The adapter is never read** (D131), and the build refuses the names of `sl::AdapterInfo`'s members in the code
loaded into a game (`overlay-fields-check`); the fixture hands a wild LUID pointer.
- **A stop restores its patches one after another, about 160 ms each.** MinHook stops every thread of the process
for each `MH_DisableHook`. With six more patches the stop's last log lines were cut at the two seconds the
Overlay waited for them; the wait is now sized to the patch table (`250 ms × kMaxPatches`). The patches were
always restored; `UNHOOKED` is written after the last. **Not changed, and proposed**: queueing the restores (and
the installs) so the threads are stopped once — a change to the hook engine's order of operations, which wants
its own pull request, its own measurement and the owner's word. Until then a stop in a Streamline game with
Advanced metrics on takes two to three seconds on the thread that stops.
- **Six calls are one sentence on the page**, each by its function's name under which of three things became of
it; a row stored before this release has none of the six and no such sentence.
- **`AdvancedReach.BeforeAttach` is a reason of its own** for `sl.init.preferences`: not "a later release". No
catalog entry carries `NewHook` any more; the value stays, for rows a later train may add.
- **Where the rows sit in the table** (rows are patched in its order): the two questions after beta.44's two, at
the head; `slSetFeatureLoaded` after `slSetConstants`; the three counted calls last of the Streamline block.
- **Train C's spike is a reading** (`spike-notes` §30): hooking NVAPI's or Streamline's latency functions is
refused or is train D's wrapper; the Overlay calling `slReflexGetState` breaks the vendor's thread contract;
what remains is the Overlay calling two driver getters with the game's device, and a no-injection ETW route
that gives half the number. It ends in three questions that are the owner's.
### Traps this train left
- **The catalog table of `18_GPU_VENDOR_APIS` is compared with the catalog row for row by a test**: a catalog
entry and its row go in the same commit, or the Application tests are red.
- **Qodana's native report again found an index into the feature slots computed as a 32-bit product** (#427, the
harness's probe): write `size_t{2} * FL_ADV_FEATURE_WORDS`. It is advisory and auto-merge does not wait for it;
both reports were read before each merge.
- **A second `region` inside the probe's block is C4456**, and warnings are errors: name the inner one otherwise.
- **A test method over sixty lines is MA0051** in the test projects too; split the assertions by what they cover.
- **The injected test waits for the stop**: with eighteen patches a stop takes about three seconds, so its wait is
200 iterations.
- **The shell tool refuses `sleep N; command`**: wait in a background `until` loop.
- **After a lower pull request is squashed**, `git diff <old tip> origin/main` empty proves the squash is the
branch; then `git rebase --onto origin/main <old tip> <next branch>` and a forced push with lease.
### What the owner's seven sessions on beta.45 showed (2026-11-13)
The owner ran seven sessions on six games the day after the release and said: check the logs and go on. Read from
a copy of the ledger (sessions 190–196), the seven overlay logs, the Agent's log and Windows' application log —
no FrameLedger binary was run against the owner's data. **Every session is hooked, `normal`, with no fault
counted, no dropped record and no `PATCH_FAILED`; the count of early ends is 0 on all six games.** The update
showed the terms once: Privacy Policy 2.19 was accepted at 07:23:36.
| Game (session, length) | Interposer | `slIsFeatureSupported` | `slIsFeatureLoaded` | `slSetFeatureLoaded` | allocate | free | shutdown |
|---|---|---|---|---|---|---|---|
| Phantom Blade Zero (190, 2 h 48 min; 191, 1 h 32 min) | 2.14.1 | **read** — Reflex, DLSS frame generation, PCL `eOk`; ImGUI and DeepDVC `eErrorFeatureMissing` | **read** — Reflex, frame generation *on* | not called | not called | **read** — frame generation, 1 | not called |
| Cyberpunk 2077 (193, 7 min) | 2.14.1 | **read** — frame generation, DLSS, ray reconstruction, Reflex `eOk`; NIS `eErrorFeatureMissing` | **read** — the four *on* | **read** — the four, *on and off* | not called | not called | not called |
| Dying Light: The Beast (194, 4 min) | 2.8.0 | **read** — DLSS, frame generation, PCL, Reflex, NIS `eOk` | not called | **read** — all five, *on and off* | not called | not called | **read** — 1 |
| Hogwarts Legacy (195, 4 min) | 2.14.16 | **read** — frame generation, Reflex, DeepDVC, DLSS 5's `kFeatureDLSS_NR`, PCL `eOk`; ImGUI `eErrorFeatureMissing` | **read** — the first four *on* | not called | not called | not called | not called |
| Black Myth: Wukong (196, 3 min) | 2.7.4 | **read** — frame generation, Reflex, PCL `eOk` | not called | not called | not called | not called | not called |
| Kingdom Come: Deliverance II (192, 4 min) | none | not hooked | not hooked | not hooked | not hooked | not hooked | not hooked |
- **`slIsFeatureSupported` was read in every Streamline session, and `slAllocateResources` in none.** Item 43
wrote the meaning of that before the run: a call no game makes after the attach gives nothing in attach mode, and
whether it keeps its patch is the owner's to say. `slFreeResources` and `slShutdown` were each read once, in one
game each; `slIsFeatureLoaded` in three games, `slSetFeatureLoaded` in two.
- **A refusal reads as one.** Phantom Blade Zero and Hogwarts Legacy ask about `kFeatureImGUI`, Streamline's
debug overlay, and are told it is missing; Cyberpunk 2077 is told the same of NIS, which Dying Light is told is
supported. Phantom Blade Zero is told DeepDVC is missing although Streamline answered its requirements.
- **The count says how often, not when.** Dying Light's one shutdown and Phantom Blade Zero's one freeing of frame
generation's resources may each be the game closing; nothing in a session says. Dying Light switched all five
features off and on.
- **The way out is as it was.** Hogwarts Legacy faulted at its exit in `_nvngx.dll`, `0xc0000005` at offset
`0x6aa85` — the offset of its six before, since 2026-11-06, hooked or not — and Black Myth: Wukong in
Steam's `crashhandler64.dll`, `0xc0000409` at `0x39b49`, the offset of its three before (Steam's file is now
11.23.65.88). Windows' log has no fault for the other four games; the two hooks on a game's way out were in all
five Streamline games.
- **Rates are where they were**, for what a comparison without the same scene is worth: Phantom Blade Zero ×4 at
64 → 255 (beta.44: 63 → 251), Wukong 85 → 341 (90 → 361), Cyberpunk 2077 164 → 327 (137 → 275), Dying Light ×4
at 48 → 194 (beta.42: 54 → 216), Kingdom Come 58.8 presented (59.3).
- **An install stops the game's threads once a patch, as a restore does.** The thirteen interposer patches took
0.74 s on Phantom Blade Zero, 1.2 s on Cyberpunk 2077, 1.7 s on Dying Light and Wukong (twelve there) and
**2.8 s on Hogwarts Legacy** — 57 to 215 ms a patch, while the game starts. That is the cost the proposal to
queue patches (§What this release decided) would cut, measured on real games.
- **No stop was exercised.** Every session ended with the game closing, so no log has an `UNHOOK_RESTORED` line.
Item 43 (g) said a log "ends with an `UNHOOK_RESTORED` line for each patch": that is true only of a session
stopped while its game runs, and the item was worded wrongly.
- **Not exercised: off means off** — Advanced metrics was on in every session. **Not visible in the data**: (c), whether *loaded* agrees with the game's own menu, and (h), the
catalog's wording on the page — both are what the owner sees.
- **For train C's spike**: Streamline says Reflex is supported in all five games and loaded in the three that
ask; Cyberpunk 2077 and Dying Light switch it off and on (`spike-notes` §30 has the note).
### NEXT
1. ~~**The owner runs item 43**~~ **Run and read 2026-11-13** (§What the owner's seven sessions on beta.45
showed): five of the six calls read in real games, nothing different on the way out, no fault. *Off means off*
was not exercised, and `slAllocateResources` was called by no game.
2. ~~**The owner reads `spike-notes` §30 and answers its three questions.**~~ **Answered 2026-11-13 (D132,
D133)**: route D goes to a spike on `hook-harness` and a stub — the owner ruled that a driver's read-only getter
called with the device of the hooked swap chain is inside rule 4 — and no real game is touched before the owner
has seen its result (`spike-notes` §31, to be written after 0.1.0-beta.46 is tagged); route C is refused; the
ETW route stays closed. No shipped code changes for the spike.
3. ~~**The stop's cost** (above): whether to batch the restores is the owner's to say.~~ **Decided 2026-11-13
(D134): batch them, installs too** — a pull request of its own, measured on the harness, released alone as
**0.1.0-beta.46**. The plan was reviewed against MinHook's source before it was approved: `MH_ApplyQueued`
applies every entry whose queued state differs, not only the caller's, so the queue-to-apply sequence is
serialised, only targets that are still ours are ever queued for a restore, and nothing is queued "for all".
4. **`slAllocateResources` keeps its patch** (D135); looked at again with more sessions.
5. **Train D** after train C, the same way: a spike first.
### 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-12: 0.1.0-beta.45 was released 2026-11-12T16:40:42Z** (23:40 in the owner's time zone) from the signed
tag on `550d830` (#431), by run 43257803723 — 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.45`. The delta from beta.44 is 1,762,465 bytes beside a full package of 110,767,499 —
"Delta processed 0452 files. 0024 patched, 0428 unchanged". The wiki was published by run 43261335359. The
rehearsal on the release branch (run 43253780609, at `f4e3fe2`, the released tree) had made a delta of 1,779,418
bytes with the same file counts. **Qodana's two reports are green on `550d830`.** On the way Qodana's native
report found two index products in the harness's probe (#427), fixed before that pull request merged; every
later report was clean, and each was read before its merge. No required check failed on this train.
**SonarCloud's quality gate failed on `550d830`, on one condition: duplicated lines on new code, 3.7 % where the
gate allows 3 %.** No issue is open and coverage on new code is 98.6 %. The 39 lines are the six new members of
`FlHookFamily` (`ShmLayout.cs`) and of its Domain mirror `HookFamilies` — two enums that are the same on purpose
(Domain references nothing, and `MetricEnumMirrorTests` fails when they differ), which six members at once took
over a threshold that two at a time had stayed under. The job is advisory and the release was already cut. The
pull request that records this leaves the Domain's mirror out of duplication detection, with the reason in
`SonarQube.Analysis.xml` and in `13_CI_CD` §SonarCloud; **whether the gate is green again is for the analysis of
that commit on `main` to say**, and it is not in this text. *(It said so the same night: green on `d3e8dd3`,
duplicated lines on new code 0.0 %, no issue open.)* One more thing the train showed: main's branch
protection wants a pull request up to date, so of two that were green at once the second (#430) had to be
rebased after the first merged, and ran its checks again.
- ~~**No real game was run on this build.** Six new patch sites, tested with the harness and the stub; their cost
measured on the headers.~~ **Seven sessions on six games, 2026-11-13** (§What the owner's seven sessions on
beta.45 showed). The published release notes say the six calls "have not been run in a real game"; a released
file is not edited.
- **`slAllocateResources` has a patch no game has used**: not called after the attach in any of six sessions on
five games. ~~Whether it stays is the owner's.~~ It stays for now (D135, 2026-11-13).
- **Off means off (item 42 (f)) has never been exercised on a real game**; it is item 43 (f) now, for all ten.
- **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.**
- **What an empty process snapshot does to the watcher's tick in a real session** was not looked into (seen once in
a test on 2026-11-12).
- **`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 43; the three questions of `spike-notes` §30; one session each of Valor Mortis and Black
Myth: Wukong with hooking off; what item 41 left unexercised; item 40 (d).
+247
View File
@@ -0,0 +1,247 @@
# HANDOFF history — 0.1.0-beta.46
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.47 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 §The train after 0.1.0-beta.46 says the release is held**: item 44 (d) was run on 2026-11-14 and 0.1.0-beta.47 was released that day; what it built and decided is HANDOFF.md's section for it.*
## **START HERE** — 2026-11-13, 0.1.0-beta.46: patches go in and come out under one stop of the game's threads; Reflex route D goes to a harness spike
*Status is `docs/changelog/0.1.0-beta.46.md`; this is what no other file carries.* The owner ran seven sessions on
beta.45 the day after it was released and said: check the logs and go on. They were read from a copy of the ledger
and the logs (#433), and the same day the owner took four decisions on what they showed (D132–D135) and approved
the plan. Two pull requests and this one: #433 (what the sessions showed; the decisions; rule 4's note in
`CLAUDE.md`), #434 (the batches, D134). **What the seven sessions on beta.45 showed, session by session, is
[`handoff/history/0.1.0-beta.45.md`](handoff/history/0.1.0-beta.45.md)**; what the batches are, what the queue
makes dangerous and what was measured is [`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Unhooking, *Batches*.
### What this release decided, beyond D132–D135
- **The first design was wrong, and reading MinHook's source before writing a line is what found it.** It marked
every hook for disabling and then un-marked the ones it must not restore. `MH_ApplyQueued` applies every hook
whose mark differs from its state; un-marking a hook that is already out marks it for *enabling*, and the stop's
own apply would have put a patch back in after the stop — logged as "declined", with the status `UNHOOKED`. The
rules that replaced it are in `fl_patch_registry.h`: no mark left standing, only a patch that is still ours
marked for a restore, nothing marked "all", and mark–apply–commit inside a gate.
- **The gate is the Overlay's one lock, and it is on no hook body's path.** A slim lock, exclusive, held for one
apply, never across a symbol lookup (the loader's lock). The one way from a hook to it is the stop, which always
waited for MinHook's own lock and a stop of the threads. Its owner re-enters it without waiting: a slim lock taken
twice by one thread never returns.
- **The verdict on an install is the engine's, not the bytes'.** Reading the target back after the apply would take
a foreign overlay that patched over us in that instant for a failure, and mark a restore nobody had compared.
- **An apply stops at its first failure and says only that one failed.** The hooks after it are enabled — in the
stop, restored — one at a time, so one bad patch still costs one patch, and a stop still takes everything out.
- **One stop of the threads costs what it cost for one patch**: 77–91 ms on the fixture for four, nine or eighteen.
What it costs in a game with a few hundred threads is not known; the `PATCH_BATCH` line's `a=` is there to say.
- **Init's three DXGI patches, the loader detour and OpenGL are as they were** — three already went in together,
the other two are one each. Ray tracing's two are a batch of their own, apart from the upscaler rows', so that a
batch's size in a test does not depend on which tick a D3D12 device appeared in.
- **`fl_guard`'s timing assertion is on the restore only** (under a second for eighteen patches): the time from an
Advanced request to its families includes the wait for the watchdog's tick, and batching changes the tick's
phase, so that number went *up* in the test while the install itself went from 0.6 s to 0.08 s. The install is
asserted by count — every lazily installed patch under a `PATCH_BATCH` line — not by time.
- ~~**The spike of route D is still to be written**~~ **The spike of route D was run the same day** (`spike-notes`
§31; `tools/fl-probe-reflex`, ctest `fl_reflex_probe_stub`): a decision table written before the runs, a stand-in
`nvapi64.dll`, then the installed driver in the probe's own process. None of §30's stop conditions fired. Two
things it decided that a plan must keep: **the call belongs on the presenting thread, once a second** — a call
the driver holds stops the thread that made it, so not the watchdog, and at a microsecond or so it needs no thread
of its own — and **the newest frames of a report are not final** (one run read a span of half an hour in the
newest frame). Rule 4's note (D132) is in `CLAUDE.md`; nothing shipped calls a driver.
### Traps this train left
- **GPG's agent had restarted and the pinentry timed out three times in a row**; nothing could be committed until
the owner unlocked the key (`echo test | gpg --clearsign` in the owner's own terminal). Say so and go on with
what needs no commit — planning did not.
- **A here-document still eats backslashes** (a `\n` inside a C++ string in an edit script): write the script to a
file. It cost one failed edit again.
- **A Catch2 `WARN` longer than the console's width wraps**, and a filter on its first words loses the number at
its end: keep a measured line short.
- **To measure the old build beside the new one**: `git stash push -- <the changed sources>`, build, run the one
test case by name (its `INFO` log prints when a new assertion fails, which it does on the old build), `git stash
pop`, build again.
- **SonarCloud's gate was red on #434 before it merged, on three things it was right about**: a `LARGE_INTEGER`
initialised with `{}` and read through `QuadPart` (cpp:S6232 - write `{.QuadPart = 0}`, as the rest of the file
does since #336), a `strlen` in a test, and a test model indexed with what a lookup returned unchecked. Its job is
advisory and auto-merge does not wait for it: the pull request was held until the fix was analysed.
- **`docs/14_TESTING` and the changelog are where a non-per-present cost goes**; "measured overhead" in a pull
request body means what the change can move — here the install and the stop, not a present.
### What the owner's five sessions on beta.46 showed (item 44, read 2026-11-13)
The owner updated at 20:29 (+07) the day of the release, ran five Streamline games with Advanced metrics on — one
session each, four to nine minutes, sessions 198–202 — and said: check and go on. Read from a copy of the ledger
and the logs, and from Windows' application log. None of the five is under the user-mode exception.
| Session | Game | Install batches in the log's order: `a=` in microseconds · patches | The interposer's patches on beta.45, first line to last |
|---|---|---|---|
| 198 | Hogwarts Legacy | **1 260 835 · 13** (Streamline) — 261 920 · 3 — 227 061 · 2 | 2.80 s, 0.19–0.31 s a patch |
| 199 | Phantom Blade Zero | 81 417 · 3 — 92 512 · 6 — 88 455 · 13 (Streamline) — 99 253 · 2 | 0.74 s and 0.85 s |
| 200 | Black Myth: Wukong | 187 931 · 12 (Streamline) — 157 010 · 3 — 109 025 · 2 | 1.65 s |
| 201 | Cyberpunk 2077 | 93 168 · 16 (Streamline's thirteen and the FSR loader's three) — **608 700 · 3** — 177 970 · 3 — 120 878 · 2 | 1.18 s |
| 202 | Clair Obscur: Expedition 33 | 168 527 · 3 — 165 405 · 16 (Streamline's thirteen and FSR frame generation's three) — 218 172 · 2 | no session on beta.45 |
- **The batches went in whole.** In every log the `HOOK_INSTALLED` lines above a `PATCH_BATCH install` carry one
time to the thousandth of a second; there is no `PATCH_FAILED` and no `UNHOOK_DECLINED`; and the hooks are the
ones beta.45 installed for the same game, compared name for name (four games; Clair Obscur had no log on beta.45).
- **Sixteen of the eighteen batches cost 81–262 ms, whatever they held** — two patches or sixteen. That is what one
patch cost in the same game on beta.45, as expected.
- **Two did not, and neither is explained.** Hogwarts Legacy's thirteen took **1.26 s** — under half the 2.8 s they
took one by one, and about five times what one stop cost in that game the same afternoon. Three of Cyberpunk
2077's took **0.61 s**, which is what three patches cost there one by one. **The log cannot tell one long stop
from an apply that failed part-way and was finished one patch at a time**: a batch writes a line only for a patch
that fails for good (item 44's text said a fallback leaves a `PATCH_FAILED`; that was wrong). What speaks for one
long stop: the queued apply fails only where a page's protection cannot be changed, and thirteen single stops in
Hogwarts Legacy would have cost 2.5 s or more. *A reading, not a measurement*: a stop waits until every thread of
the game has taken its suspension, and how long that takes follows what the game is doing at that instant — both
happened while the game was loading — and not how many patches the stop covers.
- **What that means for a ceiling on a batch** (item 44's own words for a second or more, written before the run):
the eighteen batches say the cost does not follow the count — sixteen patches in 93 ms, three in 609 ms — so
splitting a batch would add stops, not shorten one. What is missing is the line that says how a batch ended.
- **Nothing else moved.** All five hooked, `normal`, no fault counted, no record dropped. Rates and factor beside
each game's earlier sessions: Cyberpunk 2077 149 → 298 (×2.0) beside 164 → 327 and 137 → 275; Hogwarts Legacy
61 → 245 (×4.0) beside 59 → 236; Black Myth: Wukong 78 → 315 (×4.0) beside 85 → 341; Phantom Blade Zero 87 → 261
(×3.0) beside 81 → 244 at ×3.0 on beta.43; Clair Obscur 112 → 339 (×3.0) beside 106 → 323 on beta.44.
- **The way out is as it was.** Hogwarts Legacy faults in `_nvngx.dll` at `0x6aa85` and Black Myth: Wukong in
Steam's `crashhandler64.dll` at `0x39b49` — the module and the offset of every build read so far. The other
three games leave nothing in Windows' application log.
- **The Advanced rows are as on beta.45**, and Clair Obscur gave its first reading of the six calls (interposer
2.7.30): `slIsFeatureSupported` and `slIsFeatureLoaded` read, among them a feature no session had named before,
`kFeatureLatewarp` (Streamline's answer: `eErrorFeatureMissing`). `slAllocateResources` and `slShutdown` were
called in none of the five (D135 stands). That game's `hook_crash_count` of 3 is old: it dates from 2026-10-20
and is the same in the copy read for item 43.
- **Not exercised: the stop.** Every session ended with its game exiting; no log has a `STOP` or a `PATCH_BATCH
restore` line. **`RestoreAll` has still run in no real game** — item 44 (d). Nor (e), a game with no Streamline,
nor (g), off means off: `telemetry.advanced` was on throughout. (c), how a game's start feels, is the owner's to
say. (a) held: the terms window did not show.
### The train after 0.1.0-beta.46: Reflex route D in a game, and D137 (plan approved 2026-11-13)
*Nothing of this is in a release. The release pull request is not opened before the owner has run item 44 (d).*
**Where it stands (2026-11-14):** all five are merged — #440 (PR-0), #441 (D137), #442 (the words), #443 (the
Overlay), #444 (the Agent, the App, the legal texts, owner-only item 45); `main` is `cd4f69a`. What is left is the
release, which waits for the owner: **item 44 (d) was tried on 2026-11-14 and not exercised** (the switch was on
before the games started — item 44's last paragraph). **Not verified by any test: the whole path through the real Agent** —
the injected tests stop at the shared memory, the sampler's tests start from it; no end-to-end case loads the
stand-in module under an Agent session. The Japanese strings are new and unreviewed, as every `ja` string is.
The owner approved the plan the evening item 44 was read. Its order: **PR-0** the decisions and the probe's leg
with a sleep (done: `spike-notes` §31 — no stop condition) → **PR-1** D137 → **PR-2** the words in region 5, written
by nobody → **PR-3** the Overlay, the gates, the fixtures → **PR-4** the Agent, the App, strings, documents, legal
texts and owner-only item 45 → **the release, held**. What the plan's review against the source decided — a draft
of mine was wrong in six places — and that no other file carries yet:
- **Resolve on the watchdog, once for the process; call on the presenting thread.** The watchdog asks Windows for
an `nvapi64.dll` that is *already loaded* (never loads it), only while a session asks for Advanced metrics and a
Direct3D 12 device is held; it keeps one reference and never releases it; it refuses a module in the executable's
own folder (D140); it fetches `nvapi_QueryInterface` and the two ids under a guard and checks with `VirtualQuery`
that both addresses lie inside ~~that module~~ an image the process has loaded. "No getter" and "refused" are
final for the process; "no module" is asked again each second. **Found when the header was run against the
installed driver: `nvapi64.dll` is a shim and the two getters are in `nvapi64_impl.dll`** (`spike-notes` §31,
*What moving the sequence into the Overlay found*) — so the check accepts another loaded image, a reference is
kept on that image as well, and the code that is called *is* a Control Flow Guard image (the plan's review had
reasoned from the shim, which is not).
- **One atomic gate with four states** — idle, armed, reading, off — not a busy flag beside accumulators (two
presenting threads could read back to back, and the watchdog could drain half a read). The watchdog drains only
when it sees *idle* and arms at most once a second by its own clock (the loader detour wakes it more often); a
present does one relaxed load, takes *armed* to *reading*, reads into a static buffer (the report is 15.4 KB: never
on a game thread's stack), and stores *idle* or *off*. A request that goes off takes *armed* back.
- **After the record is published, and only for a swap chain whose device is the one held** (`g_d3d12Device` is the
first device seen, not "this chain's": a flag in the chain's slot, set in `ResolveApi`).
- **The latches, each until the game exits**: a fault in a getter (its own guard with `FlFilter`; counted once
through `NoteFault`, so the session shows it and it cannot reach the three that self-disable); one call of 2 ms or
more (D141); the watchdog finding *reading* on two ticks running — logged and flushed at once, published as
stalled, and **nothing can stop a call that does not return**. An error status or an empty report is recorded and
reading goes on.
- **What D141 costs, measured once on a busy PC** (`spike-notes` §31, *A run on a busy PC*): the 2 ms latch will
sometimes fire on a pause that was Windows' and not the driver's — a few sessions in a hundred at worst, by a
reading of one run. The owner chose one call over two knowing it errs towards the game; item 45's outcomes must
say how the two are told apart (the microseconds published with *slow*). **Asked again with this run in hand,
the owner kept it: one call (2026-11-13). Do not re-ask.**
- **The summary**: only frames newer than the last one summed; the two newest of a report skipped (§31: not final);
a zero end point is "span not reported" (published as all ones), not a refused frame; a frame is refused for a
span that runs backwards, one over a second, or no total; frame ids that go backwards restart the sequence.
- **Layout 5 stays**: the ten reserved words of region 5's first line take it (`slShutdowns` is the precedent; the
handshake compares the build id anyway, and a trial must be removable without a layout 7). The sleep interval is
not stored. No new request word (D138). `FL_HOOK_REFLEX`, `FL_MEASURED_LATENCY` and `reflexLatencyUs` stay unset:
there is no hook, and the numbers are a series beside the frames; `sessions.reflex_active` stays NULL.
- **Managed side**: a new reach, `GameDriver`, not a relaxed test of `Game` (whose meaning is "the arguments of a
call the Overlay hooks"); `nvapi.reflex.frame_report` as seven series, `nvapi.reflex.sleep_status` as a table of
switches *seen on / seen off*; `nvapi.reflex.mode`, `sl.reflex.state` and `sl.pcl.markers` become *refused* with
the reason; `InGameAdvancedSampler.Take` must read the latency state when the mask is zero and keep the new bit
out of `SawAnything`.
- **The gates**: `overlay-fields-check` learns the two NVAPI structs (`frameID` joins the shared members; `version`
is written outside the header); `nvapi-readonly-check` gets a pass over the Overlay — no `NvAPI_*(` token, every
id that equals one of `nvapi_interface.h`'s on a list of exactly two, `Sleep` a writer verb; `hookinventory-check`
refuses an `nvapi` import. The injected tests prove nothing about Control Flow Guard (the harness does not enforce
it): the probe includes the header that ships, so `fl_reflex_probe_stub` tests the shipped sequence under it.
- **The legal texts change in PR-4** (Disclaimer 2.16, Privacy Policy 2.20, the accuracy statement): the part
inside the game now *makes a call of its own*, once a second, on the game's presenting thread.
### NEXT
1. ~~**The owner runs item 44**~~ **Read 2026-11-13** (§What the owner's five sessions on beta.46 showed): the
install half held in five games. **Still to run, the owner's: (d) a stop while a game runs** — *Disable all
hooking* with a game being recorded — which is the half of beta.46 no real game has exercised; (e) a game with
no Streamline; (g) off means off. Not first on a game under the user-mode exception's trial (D38).
~~**Proposed, not done: `PATCH_BATCH` says how the batch ended**~~ **Decided the same evening (D137):
`PATCH_BATCH` says how the batch ended** — under one apply, or finished one patch at a time, and how many — so
that a long `a=` can be read. It goes with the next release, not in one of its own. **Written 2026-11-13**:
`install` / `restore` for one apply, `install singly` / `restore singly` with the count in the high half of `b`
(`17_HOOK_ENGINE` §Unhooking, *Batches*). It explains nothing about the two long batches already seen; it makes
the next one readable.
2. ~~**The spike of Reflex route D on `hook-harness`**~~ **Done 2026-11-13** (`spike-notes` §31): on the harness
and against the installed driver the two getters are harmless, cost about a microsecond and return a readable
report, and the Direct3D 12 device the Overlay holds is what the driver takes. **The owner's next word is go or no
for one real title** — a go is a plan of its own before any code (where the numbers go, the Disclaimer's and the
Privacy Policy's wording, `nvapi-readonly-check` over the Overlay). Routes C and E are closed (D133).
**The owner said go on 2026-11-13 (D136): a plan first, for Cyberpunk 2077.** No code before the plan is
approved, and no release that carries it before item 44 (d) — the stop while a game runs — has been run.
**The plan was approved the same evening, with D138–D141** (§The train after 0.1.0-beta.46).
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 — 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-13: 0.1.0-beta.46 was released 2026-11-13T11:10:28Z** (18:10 in the owner's time zone) from the signed
tag on `47f010a` (#435), by run 43412434074 — 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.46`. The delta from beta.45 is 634,023 bytes beside a full package of 110,767,120 —
"Delta processed 0452 files. 0021 patched, 0431 unchanged". The wiki was published by run 43414965433. The
rehearsal on the release branch (run 43409330961, at `7b4ecd7`, the released tree) had made a delta of 668,012
bytes with the same file counts. **SonarCloud answered on `47f010a`: the quality gate passed and no issue is open
on `main`. Qodana's two reports are green on that commit.** On the way SonarCloud was red on #434 (six issues
in the new code, fixed before it merged — §Traps), and no required check failed.
- **A local gate once counted `fl_guard` as passed after 0.66 s** (2026-11-13 17:30, the spike's branch). The
security software on the development PC was switched on for three minutes while the gate ran; the freshly linked
`fl_guard_test.exe` was removed from the build tree, **ctest reported the run that was cut short as `Passed`**
(the suite takes 181 s), and the gate went red only because the next test, `fl_prescan`, runs the same executable
and could not find it. Run again with that software off, the gate was green. Nothing was changed for it: a test
whose process ends early with a zero exit code is a pass to ctest, and the suite has no line it must print to
count. ~~Worth a guard of its own (a `PASS_REGULAR_EXPRESSION` on Catch2's last line, or a minimum number of test
cases); proposed, not done.~~ **Done the same evening, on the owner's word**: every native test names the line it
ends on and ctest requires it; a test registered without one fails the configure; four canaries prove the rule
red and green (`14_TESTING` §Native unit tests; `src/native/CMakeLists.txt`). Two things it turned up: four tests
passed on a line they print in the middle of their run, and `fl_nvapi_probe` passed whatever it printed after its
branch line — a pass expression makes ctest ignore the exit code.
- ~~**No real game was run on this build.**~~ Five were, on 2026-11-13 (above): the order in which patches reach a
game changed for every game, and the five took it. **The restore under one apply has run in no real game.**
- **Two batches took 1.26 s and 0.61 s and nothing explains them** (Hogwarts Legacy, Cyberpunk 2077); the log has
no line that tells a long stop from a batch finished one patch at a time.
- **Off means off has never been exercised on a real game** (item 43 (f), now item 44 (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).
- **For the inline patches the comparison has never been re-made under the write window** (`17_HOOK_ENGINE`
§Compare-and-restore says so now): MinHook owns that window.
- **`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.**
- **What an empty process snapshot does to the watcher's tick in a real session** was not looked into (seen once in
a test on 2026-11-12).
- **`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 44 (d), (e), (g) and what (c) felt like — **(d) is what the next release waits for**; item 45 once that release exists; the go or no on `spike-notes` §31 (one real title); one session each of Valor Mortis and
Black Myth: Wukong with hooking off; what item 41 left unexercised; item 40 (d).
+38 -2
View File
@@ -1,6 +1,6 @@
# Owner-only items that passed
*Moved verbatim from `docs/HANDOFF.md` §Owner-only on 2026-10-19 (beta.24, owner decision D66): the items the owner reported passed or took, numbers kept — a number is never reused. The open ones stay in `docs/HANDOFF.md`.*
*Moved verbatim from `docs/HANDOFF.md` §Owner-only on 2026-10-19 (beta.24, owner decision D66): the items the owner reported passed or took, numbers kept — a number is never reused. The open ones stay in `docs/HANDOFF.md`. Items that passed later are added below as they pass (38 and 39 on 2026-11-12).*
3. ~~**Which titles** go in `blockedExecutables` — a product decision with false-refusal
consequences. The list ships empty until it is taken.~~ **Taken 2026-09-25 (D30):** per-title
@@ -66,4 +66,40 @@
page and choose its longest session, switch the page's tabs; visit the Dashboard a few times, then end a session —
one "Session saved". (e) The Privacy Policy 2.11 is shown once after the update. (f) The `ja` strings marked
`review`.
38. ~~**beta.40, Advanced metrics inside a real game**~~ **Passed 2026-11-12** — the owner ran it on ten games over one night (beta.40, then beta.41), was shown what a copy of the ledger and the Agent's log said of those sessions, and answered: "Bạn có thể đánh dấu là pass và tiếp tục." What the sessions covered: (b) the option off storing nothing, on a DLSS title and on an FSR 3.1 one; (c) three titles upscaling through FSR 3.1 — Kingdom Come: Deliverance II (chosen in the game), Dying Light: The Beast and Clair Obscur: Expedition 33, the last two with **FSR upscaling beside DLSS frame generation, which is how the owner had set them in the game** — and Lies of P through FSR 3; (d) every DLSS title saying *the game made none of the calls*, none chaining its options into the evaluation; (e) the sentence under the session in each of its three forms; (g) Girls' Frontline 2 under the user-mode exception. **Not exercised, and passed on the owner's word**: (f) two sessions of one game that kept running; (h) the cost; (i) the words. **(j) is not done**: the SonarCloud acceptance is still the owner's to click, and stands in HANDOFF §Left open. Valor Mortis's one crash was the game's own (a shader-compilation error, its own crash dialog — the owner). *(The item as written:)* (D111–D116; train B's first release — beta.41 is not begun
until this passes). (a) **The update from beta.39**: the terms window shows the **Privacy Policy 2.16** once, and
not the Disclaimer; a game that was **running across the update** is refused until it is restarted, with the
reason, and measured normally after. (b) **The option off, a hooked game that uses DLSS or FSR**: the game runs
and is measured as in beta.39; the session is not on the Advanced page's list; nothing in the Agent's or the
Overlay's log mentions the upscaler's options. (c) **The option on, a title that upscales through FSR 3.1 or
later** (AMD's `amd_fidelityfx_*.dll` in its folder; a title on the older FSR 3.0 interface, such as one that
ships `ffx_fsr3_x64.dll` alone, is expected to show none): on *Session*, under Upscaling, sharpening on or off
and its strength against the game's own setting; the field of view as a range, against the game's slider (it is
the **vertical** angle, in radians with degrees beside it) — and wider after zooming or aiming; the near and far
planes; the flags; the chart of the frame time the game reported beside the session's own frame time; FSR's
memory only if the game asks for it. (d) **The option on, a DLSS title**: most are expected to say *the game made
none of the calls these are read from*. If one shows rows, this is the first sight of them anywhere: the output
size against the display resolution, the preset letters against the NVIDIA app's override or the DLSS
indicator, HDR input against the game's HDR setting. Write down which title did. (e) **The sentence under the
session** says which of the three it was, and the session's summary still names the upscaler and its quality as
before. (f) **Two sessions of one game that kept running**, both with the option on: the second one's field-of-
view range and counts are its own, not the first one's carried over. (g) **A game under the user-mode anti-cheat
exception**, the option on: it runs, the session is hooked, and its trial is not ended by anything new. (h) **What
it costs**: the game's own frame rate with the option on and off, and the Agent's processor time in a hooked
session (NFR-2: 2.5 % of one core). (i) **The words**: the fourteen new `vi` strings and the Settings text; the
`ja` ones are marked `review`. (j) **SonarCloud**: accept `csharpsquid:S3869` on
`src/FrameLedger.Infrastructure/Diagnostics/ParentDump.cs` again — the same call the acceptance of beta.24 covers,
raised anew because #398 moved it (`13_CI_CD` §SonarCloud says why it is safe); until then `main`'s reliability
rating on new code shows E for that one line.
39. ~~**beta.41, the sensor library on the PC that showed the fault**~~ **Passed 2026-11-12** — the same answer. Seven sessions on beta.41 as administrator with PawnIO, no `advanced:` line in the Agent's log, 212 or 213 series in each session with the option on; on beta.40 the same morning the processor device faulted out after each of six sessions. **Not exercised**: (c) the page after a session was not looked at by anyone but the owner; (d) the unelevated run; (e) no value beside HWiNFO — that stays item 37 (e). The rarer fault, the reader failing to open, was one session in sixteen; `20_OPEN_QUESTIONS` §M13 keeps the count. *(The item as written:)* (D118; `20_OPEN_QUESTIONS` §M13). (a) **The
update from beta.40**: no terms window, the ledger opens as before; a game running across the update is refused
until restarted, as after every update. (b) **As administrator with PawnIO, Advanced metrics on**: five or more
sessions of different games, some with the Advanced page left open on *This PC* throughout, some with it closed,
one started within a few seconds of another ending. **Afterwards the Agent's log (Logs page, or
`agent-<date>.log`) holds no `advanced: a device is left alone` and no `advanced: the sensor library did not
open`**, and every one of those sessions has its processor, memory and motherboard readings on *Session* (about
two hundred series; a session with seventeen is the fault). (c) **The page after a session ends**: the
processor's rows on *This PC* are still there and still moving, without reopening the page. (d) **Not as
administrator**: nothing differs from beta.40 — the card's sensors and the driver's figures, and *Sources* says
why the rest is not read. (e) While there, the part of item 37 (e) nobody has done: a few of the processor's and
the motherboard's values beside HWiNFO.
+71
View File
@@ -63,6 +63,77 @@ 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.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
points approved with the plan of 2026-11-13). Every earlier version could say that the component reads only what a
game passes to the graphics calls it intercepts. With Advanced metrics on, in a Direct3D 12 game that had loaded
NVIDIA's driver library, it now also asks the driver, about once a second, for the driver's report of the last
frames' stages and its low-latency state. So: the **Privacy Policy** (2.20) names what a session stores of it —
durations and five switches, never a time of day, never the moment of an input — in §1's item on Advanced metrics
and in §4's list of what the component observes. The **Disclaimer** (2.16) changes three places: "What it observes
inside the game" names the report; the sentence "API arguments and nothing else" is replaced by what is true; and
§2, after the paragraph on the background thread, gains the paragraph on this call — that it is made on the game's
presenting thread, through a library the game loaded and FrameLedger never loads, that two files are kept loaded
for it, that it calls nothing that sets or delays, what ends it, and **that a call which never returned could not be
stopped**. The accuracy statement loses "PC latency (Reflex)" from "not measured at all" — end-to-end latency
still is not measured — and gains the item saying these are the driver's numbers, read from no real game when it
was written.
### What version 2.19 of the Privacy Policy changed (0.1.0-beta.45)
**Six more calls read inside the game, only while Advanced metrics is on** (train B's fourth step, owner decisions
D129–D131; the wording approved with the plan of 0.1.0-beta.45). Version 2.18 named Streamline's answers to two
questions about a feature — its version, what it requires — and "four further calls". This release reads two more
answers and four things the game does, none of which is in that list, so the version moves. §1's item on Advanced
metrics gains, **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**. It also says
two more things that are never read: **what identifies the graphics card that the game hands over with its
question** — `slIsFeatureSupported` takes an `sl::AdapterInfo`, the adapter's LUID or a Vulkan physical device,
which D131 forbids and a check in the build refuses by name — and **the content of a graphics resource**: the two
resource calls take a command buffer and a viewport, forwarded and never looked at. §4's "four further calls" is
ten, its "two questions" are four, and its list of what is stored names the new facts and repeats that what
identifies the card is not among them. What the game started Streamline with (`slInit`) is not in the policy
because it is not read, and will not be (D129). The accuracy block's item says what the new rows are — calls the
game made, counted to fifteen, not a statement that a feature ran. The Disclaimer stays 2.15. §2 is unchanged:
nothing is sent.
### What version 2.18 of the Privacy Policy changed (0.1.0-beta.44)
**Two more calls read inside the game, only while Advanced metrics is on** (train B's third step, owner decisions
D126–D128 beside it; the wording approved with the plan of 0.1.0-beta.44). Version 2.17 named Streamline's per-frame
constants and the frame-generation configuration, and "two further calls"; this release reads what Streamline
**answers** when the game asks about a feature, which is in neither list, so the version moves. §1's item on
Advanced metrics gains **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. It also says what of that answer is never read: **the lists it
points to** — the buffers' names, the names of Vulkan extensions and features — which a check in the build holds
(the count of required buffers is read; its list is not). §4's "two further calls" is four, and its list of what is
stored names the versions and requirements. The versions of Windows and of the driver are the ones Streamline
reports to the game; FrameLedger already stores the driver's version with a session's hardware. The accuracy
block's item says what these are — Streamline's answers, not a check of the PC — and that a game asks while it
starts, so most sessions have none. The Disclaimer stays 2.15. §2 is unchanged: nothing is sent.
### What version 2.17 of the Privacy Policy changed (0.1.0-beta.43)
**Two more calls read inside the game, only while Advanced metrics is on** (train B's second step, owner decisions
D122–D125; the wording approved with the plan of 0.1.0-beta.43). Version 2.16 named what a session stores of DLSS and
of FSR's upscaling item by item, and neither list holds what this release reads, so the version moves rather than
the words being stretched. §1's item on Advanced metrics gains **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. The sentence on what is never read (where the camera is, which way it looks, its matrices) stands as
it was: those sit in the same data as Streamline's constants, and a check in the build refuses code that names them.
§4 says what is new about *how*: until now every parameter read was of a call FrameLedger intercepted anyway; these
two calls are intercepted in a game **only once a session with the option on has started there**, and with the
option off nothing in the game is touched for them. The accuracy block's item on what a game tells its upscaler
names the two, and no longer says none of it was read from a real game — FSR's upscaling values were, on
0.1.0-beta.41 and beta.42. The Disclaimer stays 2.15, as before. §2 is unchanged: nothing is sent.
### What version 2.16 of the Privacy Policy changed (0.1.0-beta.40)
**Advanced metrics inside the game** (train B, owner decisions D111–D116; the content approved with the plan, once
+2
View File
@@ -53,3 +53,5 @@ Each section below lives in its own file under `docs/spike-notes/`, moved verbat
| §27 | Switching to Games, and a language change that lands elsewhere (2026-11-06, beta.34) | [`spike-notes/27-games-page-2026-11-06.md`](spike-notes/27-games-page-2026-11-06.md) |
| §28 | The main line on .NET 11's release — the whole gate, and what the analyses read (2026-11-11, beta.37, D94–D96) | [`spike-notes/28-dotnet11-main.md`](spike-notes/28-dotnet11-main.md) |
| §29 | C# 15 against the checks — the canary, and where its constructs would go (2026-11-11, beta.37, D96) | [`spike-notes/29-csharp15-canary.md`](spike-notes/29-csharp15-canary.md) |
| §30 | Reflex latency per frame — the routes there are, and what each would cost; a reading, nothing run (2026-11-12, beside beta.45, D130; §M14) | [`spike-notes/30-reflex-latency.md`](spike-notes/30-reflex-latency.md) |
| §31 | Reflex route D on the harness — the driver's two getters called from an unshipped probe, against a stand-in module and the installed driver; no game touched (2026-11-13, after beta.46, D132; §M14) | [`spike-notes/31-reflex-route-d-harness.md`](spike-notes/31-reflex-route-d-harness.md) |
+177
View File
@@ -0,0 +1,177 @@
## 30 · Reflex latency per frame — the routes there are, and what each would cost *(2026-11-12, written beside 0.1.0-beta.45, owner decision D130; `20_OPEN_QUESTIONS` §M14)*
**Why this was written.** Train C of Advanced metrics is "Reflex latency per frame" (`18_GPU_VENDOR_APIS` §The
trains). §M14 asks whether any route to it stays inside rules 4 and 5, and pre-commits the answer for the case
that none does. The owner decided on 2026-11-12 (D130) that this spike is written beside 0.1.0-beta.45 **as a
document**, and that no code of train C is written until the owner has read it and said go or no.
**What this is, and what it is not.** A reading — of the vendored NVAPI headers
(`src/native/third_party/nvapi/nvapi.h`, `nvapi_interface.h`), of Streamline's public headers and plugin source
at tag `v2.14.16` (`include/sl_reflex.h`, `include/sl_pcl.h`, `source/plugins/sl.reflex/reflexEntry.cpp`,
`source/plugins/sl.pcl/pclstats.h`, `pclImpl.h`; fetched through GitHub's API, not vendored), of this
repository's own hook engine, and of a copy of the owner's ledger; one file on the dev box was looked at, the
export table of the installed `nvapi64.dll`. **Nothing was run in a game and no shipped code changed.** Every
"unknown" below is unknown, not assumed either way.
### What Reflex's numbers are, and who holds each
| What | Where it lives | The catalog entry that wants it |
|---|---|---|
| **The per-frame report**: for each of the last 64 frames, the times of input sample, simulation start/end, render submit start/end, present start/end, driver start/end, OS render queue start/end, GPU render start/end, and two durations (`gpuActiveRenderTimeUs`, `gpuFrameTimeUs`) | The **driver**. A program gets it by calling `NvAPI_D3D_GetLatency(pDev, NV_LATENCY_RESULT_PARAMS*)` with the game's own device; Streamline's `slReflexGetState` makes that call and hands the same 64 reports back as `sl::ReflexState::frameReport` | `nvapi.reflex.frame_report`, `sl.reflex.state` |
| **The driver's low-latency state**: low-latency mode on, the last sleep interval, whether the game calls the sleep, the frame-generation multiplier last used | The driver: `NvAPI_D3D_GetSleepStatus(pDev, …)` | `nvapi.reflex.sleep_status` |
| **What the game asked for**: low latency or low latency with boost, the frame-rate limit, whether markers may steer the driver | Only the **arguments** of `NvAPI_D3D_SetSleepMode` or of Streamline's `slReflexSetOptions` — no getter returns boost or the limit | `nvapi.reflex.mode` |
| **The markers the game sets** each frame (simulation start … present end, the latency ping, the flash trigger) | The arguments of `NvAPI_D3D_SetLatencyMarker` / `slPCLSetMarker`; the PCL plugin also writes each as an ETW event | `sl.pcl.markers` |
`FlFrameRecord.reflexLatencyUs` (@48, "0 = unavailable") has waited for this since the record was designed, and
`03_METRICS` lists *PC latency* as "mean/p95 of `reflexLatencyUs` when Reflex reports it". **A report cannot go
into its own frame's record**: the driver completes a frame's report after that frame's GPU work ends, several
presents after the record was written, and a ring record is never rewritten. Whatever route is taken, latency
arrives as a series beside the frames, not as a column of them.
### What the owner's sessions already say
From 0.1.0-beta.44's `sl.feature.versions` / `sl.feature.requirements` (sessions 181–186 of the ledger's copy;
`docs/HANDOFF.md`, item 42):
| Game (session) | Interposer | Asked Streamline about `kFeatureReflex` | about `kFeaturePCL` |
|---|---|---|---|
| Phantom Blade Zero (181) | 2.14.1 | version and requirements | version and requirements |
| Clair Obscur: Expedition 33 (182) | 2.7.30 | version and requirements | version and requirements |
| Valor Mortis (183, 184) | 2.14.1 | version and requirements | version and requirements |
| Black Myth: Wukong (185) | 2.7.4 | version and requirements | version and requirements |
| Cyberpunk 2077 (186) | 2.14.1 | requirements only | not asked |
So **every Streamline game run asks about Reflex**, and the four Unreal Engine games about PCL as well. That a
game asks about a feature is not that it uses it; 0.1.0-beta.45's `slIsFeatureLoaded` and `slSetFeatureLoaded`
rows will say whether Reflex and PCL are loaded and switched, on the owner's next sessions. No session says
anything about a game that uses Reflex without Streamline: none of the hooks sees NVAPI.
**Added 2026-11-13, from the first sessions on 0.1.0-beta.45** (190–196): Streamline answers `eOk` for
`kFeatureReflex` in all five Streamline games run, and `slIsFeatureLoaded` says it is loaded in the three that ask
(Phantom Blade Zero, Cyberpunk 2077, Hogwarts Legacy); Cyberpunk 2077 and Dying Light: The Beast switch it off and
on through `slSetFeatureLoaded`. `kFeaturePCL` is supported in the four games that ask about it. Loaded is still
not in use: whether a game sets markers is what no hook sees.
### The routes
**A — hook NVAPI's own functions** (`SetLatencyMarker`, `SetSleepMode`; what `17_HOOK_ENGINE` §Memory / latency
still names). The `nvapi64.dll` on the dev box (driver 32.0.16.2114, its export table dumped for this note)
exports two functions, `nvapi_QueryInterface` and `nvapi_Direct_GetMethod` — §M14 said one — and no latency
function: each of those is an address `nvapi_QueryInterface` returns for an id (`nvapi_interface.h`:
`NvAPI_D3D_GetLatency` is `0x1a587f9c`). A hook on one is a patch at an address
learned at run time — the class refused on 2026-08-09 — or a wrapper returned from a hooked
`nvapi_QueryInterface`, which is a write to what the game receives (rule 4). **Refused, as §M14 pre-committed.**
**B — hook Streamline's Reflex and PCL functions** (`slReflexSetOptions`, `slPCLSetMarker`, `slReflexGetState`).
None is an export of `sl.interposer.dll`. The game gets each through the exported `slGetFeatureFunction(feature,
name, &fn)`, and Streamline's own header does that **once**: `SL_FEATURE_FUN_IMPORT_STATIC` keeps the pointer in
a function-local static after the first call. Two consequences. A hook on `slGetFeatureFunction` could only see
the game's calls by handing back a wrapper — train D's question (§M15), which needs rule 4 amended. And a hook
that exists only for Advanced metrics is installed after the attach (D111), by which time a game that has
presented a frame has fetched its functions: **the same reason `slInit` is not hooked (D129) applies to the
fetch.** Not a route for train C; it stays train D's, and this finding weakens train D as well.
**C — the Overlay calls `slReflexGetState` itself**, having asked the interposer's exported, documented-thread-safe
`slGetFeatureFunction` for it. No patch, no wrapper, and Streamline uses the device it already holds. But the
header says of `slReflexGetState`: *"This method is NOT thread safe"*, and the source shows why — the function
**writes** two fields of the plugin's context (`lowLatencyAvailable`, `latencyReportAvailable`) from the result
of the two driver calls it makes, with no lock, and then calls into the PCL plugin. The game calls the same
function from a thread FrameLedger cannot know (the call is not hooked), so the Overlay cannot keep its call
from overlapping the game's. It would be FrameLedger breaking the vendor's stated contract inside the game, and
writing plugin state the game reads back. **Recommended refused**, on the header's own words.
**D — the Overlay calls the driver's two getters itself**: `NvAPI_D3D_GetLatency` and `NvAPI_D3D_GetSleepStatus`,
resolved through `nvapi_QueryInterface` of an `nvapi64.dll` **the game already loaded** (never loaded by
FrameLedger), with the device of the swap chain the Overlay already hooks. This is §M14's "route to try first".
What it would be:
- **No patch and no new hook.** Two calls, both getters; `tools/nvapi-readonly-check.ps1`'s list (D108) would
gain them, and the check would have to cover the Overlay as well as the bridge. The Overlay would not link
`nvapi64.lib`: it needs the two ids and the two structs from the vendored MIT headers.
- **It works without Streamline** — any Direct3D game that uses Reflex — and not on Vulkan (the Vulkan layer has
no NVAPI device; Reflex there is a Vulkan extension, a different study).
- **It gives** the report (`nvapi.reflex.frame_report`) and the sleep status (`nvapi.reflex.sleep_status`), and
through them most of `sl.reflex.state`. **It does not give** what the game asked for (boost, the limit:
`nvapi.reflex.mode` stays N/A, with the reason) or a count of markers.
- **First of its kind in two ways**, and both are the owner's to rule on. The Overlay would call a *vendor's
driver interface on its own initiative* inside the game — today it only forwards the game's calls and reads
their arguments. And it would use *the game's device object* for a call the game did not make: rule 4 allows
"COM/handle objects we legitimately own", and the device is the game's. The nearest precedent is the read of
`IDXGISwapChain::GetLastPresentCount` on the hooked chain (rule 6, 2026-09-06), a getter on the game's swap
chain inside the present detour.
- **Unknown, and what the spike would have to measure**: which object NVAPI wants for a Direct3D 12 game (the
device behind the queue the swap chain was made on — not verified); whether the getters are safe on a thread
that is not the game's — the header is silent; Streamline's own plugin calls them on whatever thread the game
asks for its state while the render thread sets markers, which suggests the driver tolerates it, and is an
inference; what a call costs, on the presenting thread or on the Overlay's own; what it returns in a game that
never set a marker (the header: valid only after markers with rising frame ids); whether a call that blocks
in the driver can be bounded — an SEH guard does not bound a wait.
- **How often**: one call returns 64 frames. At 240 presents a second that is four calls a second to lose none;
once a second keeps the newest 64 and says how many it skipped.
- **What else moves**: a series through region 5 (a layout change, or the reserved words), the Agent's sampler,
the page; the Disclaimer's sentence about what the Overlay's own thread does (a version of its own, the
owner's wording); the Privacy Policy (what is stored: times, no content).
**E — from outside the game: the PCL statistics ETW provider.** Streamline's PCL plugin (and the Reflex SDK's
`pclstats.h` in a game without Streamline) registers `PCLStatsTraceLoggingProvider`
(`{0d216f06-82a6-4d49-bc4f-8f38ae56efab}`) and writes an event for every marker (`PCLStatsEvent`: `Marker`,
`FrameID`), which is what NVIDIA's own overlay listens to. No injection, so it would also be the only route for
a game the guard refuses. What it costs:
- **It gives the game-side markers only** — simulation, render submit, present, the ping. The driver, OS queue
and GPU times are not in these events; NVIDIA's overlay has them from the driver.
- **A trace session needs administrator rights** (or membership of *Performance Log Users*); the Agent is
unelevated by default (D34).
- **Listening changes what the game does.** Enabling the provider sets the game's `g_PCLStatsEnable`, and its own
ping thread then posts a registered window message — or, where the game chose a key, `F13`–`F15` key messages
— to the game's window every 100–300 ms. It is the game's code and the vendor's design, and it is what any
listener causes; FrameLedger would still be the cause, in a game it is not even injected into.
- **It reopens a closed decision**: ETW left the product on 2026-08-27/28 (Tier 2 is not a measurement;
`20_OPEN_QUESTIONS` §G keeps the question of a no-injection measurement).
**F — NVAPI from the Agent.** `NvAPI_D3D_GetLatency` takes the game's device. Another process has none. Not a
route.
### What each catalog entry would become
| Entry | Route A, B | C | D | E |
|---|---|---|---|---|
| `nvapi.reflex.frame_report` | refused | (refused) | **read**, Direct3D | game-side times only |
| `nvapi.reflex.sleep_status` | refused | part | **read**, Direct3D | — |
| `nvapi.reflex.mode` | refused | — | N/A: no getter returns it | — |
| `sl.reflex.state` | refused | (refused) | the same numbers, under the NVAPI entries | — |
| `sl.pcl.markers` | refused | — | — | counted |
### What this reading settles, and what it leaves to the owner
- **Settled by reading**: A and B are the refused classes; C breaks the vendor's own contract; F does not exist.
§M14's pre-committed "no route without a patch at a run-time address" does **not** fire — D has no patch and E
has no injection — so the entries do not go to N/A on this document alone.
- **The owner's**, because each crosses a line the rules draw today:
1. **Route D — go to a spike, or no?** A go means: `hook-harness` and a stub `nvapi64.dll` first (the call
made, the report read, the overhead measured against NFR-1, a blocked call and a missing module shown to be
harmless), then one real title of the owner's choice, never first in a game inside the anti-cheat
exception's trial (D38). Pre-committed for that spike: a fault or a hang attributable to the call, an
overhead above NFR-1, or a Direct3D 12 device that cannot be obtained without reading what rule 4 forbids
→ Reflex latency stays N/A and the page says why. A go also needs the owner's ruling that calling a
driver getter with the game's device is inside rule 4, asked with the rule quoted, as §M15 asks for its
own amendment.
2. **Route C — recorded as refused?** (Recommended: yes.)
3. **Route E — leave §G closed, or reopen it for latency markers?** (Recommended: leave it; the route gives
the smaller half of the number and makes a game post messages to itself.)
- **Not looked into**: Reflex on Vulkan; AMD Anti-Lag 2 and Intel XeLL, which have their own interfaces; what
`nvapi_Direct_GetMethod` is (the vendored headers do not declare it; the vendored import library names it; nothing here
would use it); what a
real game's interposer and its Reflex and PCL plugins export (the above is the headers' and the source's word,
not a dump of a game's files).
### The owner's answers (2026-11-13, D132 and D133)
1. **Route D: go — to the spike on `hook-harness` and a stub first.** With it the ruling a go needed: calling a
driver's read-only getter with the device of the swap chain the Overlay hooks is inside rule 4 (`CLAUDE.md`
carries the note). No real game until the owner has seen the spike's result; no shipped code changes for it.
2. **Route C: refused.**
3. **Route E: left closed**; §G is not reopened.
The spike is [`spike-notes` §31](31-reflex-route-d-harness.md), run on 2026-11-13: none of the stop conditions
above fired on the harness, and it ends in the question of one real title.
@@ -0,0 +1,221 @@
## 31 · Reflex route D on the harness — the driver's two getters, called from a probe *(2026-11-13, after 0.1.0-beta.46, owner decisions D132, D133; `20_OPEN_QUESTIONS` §M14)*
**Why this was measured.** §30 read the routes to Reflex latency per frame and left one that needs no patch: the
Overlay calling the driver's two getters, `NvAPI_D3D_GetLatency` and `NvAPI_D3D_GetSleepStatus`, with the device of
the swap chain it hooks. The owner said go on 2026-11-13 (D132) — **to a spike on the harness first** — and ruled
that such a call is inside rule 4 (`CLAUDE.md`, the rule's note). This is that spike. **No shipped code changed and
no game was touched**: the call sequence lives in an unshipped probe, and nothing loaded into a game includes it.
**The instrument.** `src/native/tools/fl-probe-reflex` (built with the Overlay's flags; ctest
`fl_reflex_probe_stub` for the half a build machine can run):
- `fl_reflex_candidate.h` — what would move into the Overlay: find `nvapi64.dll` **if the process already holds
it** (never load it), ask its export `nvapi_QueryInterface` for the two getters by the ids of the vendored
`nvapi_interface.h`, call them SEH-guarded, summarise the sixty-four frames. It does not link `nvapi64.lib`:
the static library loads the DLL itself, from a trusted location and with a signature check.
- `--stub`: against `tools/vendor-stubs/stub_nvapi64.cpp`, a stand-in module with knobs for what a driver cannot be
made to do on demand.
- `--real`: against the installed driver on this PC's NVIDIA adapter, **with the probe playing the game's part** —
it loads `nvapi64.dll`, calls `NvAPI_Initialize`, and **sets latency markers on its own device** for a few
hundred frames. That is a write, and it is said here plainly: a getter has nothing to return without it, the
process is the probe's own, and no shipped binary contains the call (D108's read-only rule is about the Agent's
bridge; rule 4's note is about a game). The owner was told and approved it with the plan.
### The decision table, written before any run
| # | Measured | Outcome → consequence |
|---|---|---|
| M1 | Stub: the module absent; a getter absent; an error; a report of nothing; sixty-four reports; both device kinds | Anything called or loaded when the module is absent, or a wrong classification → the candidate is wrong and is fixed before any driver run. Otherwise: these cases are harmless as written. |
| M2 | Stub: a call that does not return for 1.5 s, made on a thread of its own and made by a thread that has other work | Made by the busy thread, that thread stands still → **the call may not be made on the Overlay's watchdog** (it supervises, installs and flushes): a thread of its own, or the presenting thread if M6 allows. A thread of its own is a second background thread, and the Disclaimer's sentence about "one" changes. |
| M3 | Real: the getters **before** `NvAPI_Initialize` | A fault → a game that holds the module but has not initialised it would fault under us, and the Overlay cannot initialise NVAPI itself (not a getter): **route D stops** unless initialisation can be known without a call. An error status → harmless: read as "not available". |
| M4 | Real: initialised, 120 frames, **no marker** | Zero frames or an error → as the header says: a game that does not use Reflex reads N/A. Frames with content → record what the driver fills in by itself. |
| M5 | Real: 300 frames **with markers** | Frames with sensible spans → the report is readable by a third party in the process. Zero frames → markers alone are not enough (a sleep mode is needed too): route D reads only games that set one, and the note says so. |
| M6 | Real: the cost of one call (2000 calls, on the presenting thread) | NFR-1 allows 1 µs a present. Once a second on the presenting thread costs `call / presents-a-second` a present: at 60 a second a call may cost 60 µs. Median within that → the presenting thread, once a second, is allowed. Above it, or a worst case over 1 ms → **never on the presenting thread**; a thread of its own (M2). |
| M7 | Real: the getters on another thread four times a second for 60 s, beside a thread that presents and sets markers | **Any fault → route D stops** (pre-committed, §30). Error statuses or empty reports → recorded; they decide whether a read is trusted. Frames a second beside the poller more than 0.5 % below alone → the rate is too high or the route too costly: lower it and measure again, or stop. |
| M8 | Real, Direct3D 12: read with the device, read with the queue, markers on each | The device works → the Overlay already holds it (`g_d3d12Device`). **Only the queue works → Direct3D 12 is out of reach**: the Overlay does not hold the queue (`ResolveApi`: `GetDevice` does not return it) and may not go looking for it. Route D would then be Direct3D 11 only. |
| M9 | Real: the unit of the report's times | The gap between two frames' `simStartTime` against the probe's own frame time. Whatever it is, is recorded; a unit that cannot be told → the spans are not shown as times. |
Not in this spike, whatever it shows: anything in a game; where the numbers would go (shared memory, the Agent, the
page); the wording of the Disclaimer and the Privacy Policy. Those are a plan of their own, after the owner's go.
### Results
**Where.** The dev box of §Environment: Windows 11 Pro build 29648, RTX 5080, NVIDIA driver 32.0.16.2114
(`nvapi64.dll` of the same version), 2026-11-13. `--stub` on software devices; `--real` three times (and a fourth,
shorter, after a fix to the probe — row M6), on the NVIDIA
adapter, each with a 256×256 composition swap chain presented without a wait — some 14,000 to 17,000 frames a
second, which is what makes the cost of anything beside it visible and is nothing like a game.
| # | What was seen | Against the table |
|---|---|---|
| M1 | Stub, all 20 checks pass: with the module absent `Resolve` says so, calls nothing and loads nothing; a module without the getters is refused whole; an error comes back as the error; a report of nothing is zero frames; sixty-four reports are read as the header lays them out; the driver is handed the device and only the device, Direct3D 11 and Direct3D 12 alike; no device, no call. | Harmless as written. |
| M2 | A call held for 1.5 s on a thread of its own: another thread ticked 16 times in its first second. The same call made by that ticking thread: **0 ticks** in the second. | **Not on the watchdog.** A thread of its own, or the presenting thread (M6). |
| M3 | The getters **before** `NvAPI_Initialize`, with the module loaded: both resolve, `GetLatency` returns `NVAPI_OK` and sixty-four empty frames. No fault, three runs. | Harmless: an uninitialised NVAPI reads as "nothing reported". |
| M4 | Initialised, 120 frames, no marker: `NVAPI_OK`, zero frames with anything; the sleep status is `NVAPI_OK` with every field zero. | As the header says. A game that does not use Reflex reads N/A, and the read costs it nothing else. |
| M5 | 300 frames with markers, **no sleep mode set**: sixty-four frames, the newest one or two ids behind the last frame drawn. Per frame the driver fills simulation end, render submit start/end, present start/end, driver end, OS queue start/end and GPU start/end; `inputSampleTime` and `driverStartTime` stay zero (the probe sets no input marker). | **Readable by a third party in the process, from markers alone.** |
| M6 | 2000 calls back to back on the presenting thread: `GetLatency` median **0.50 µs** in the three runs (mean 0.53–0.54, worst 1.2 / 1.5 / 3.0 µs) and **1.50 µs in a fourth**, made that evening after a fix to the probe, with the PC doing other things (mean 1.54, worst 70 µs); `GetSleepStatus` median 0.10 µs in all four, worst 0.7 / 0.8 / 62 / 12 µs. | **Far within NFR-1 once a second**: at 60 presents a second a call may cost 60 µs, and the medians are 0.5–1.5. **Not within it at every present**: the fourth run's median alone is over the microsecond NFR-1 allows a present, and single calls of 62 and 70 µs were seen. Once a second is what is proposed. |
| M7 | 60 s, four reads a second from another thread beside the presenting, marker-setting thread, three runs: **228 reads each, none not OK, none faulted, none empty**; worst read 103 / 112 / 248 µs on the polling thread; no marker error. Frames a second beside the poller against alone: −1.3 % (one 60 s leg against one 5 s leg), then in six alternating 10 s legs −1.4 % and −0.6 % — **with single legs between +5.9 % and −9.9 %**. | **No fault: the route does not stop.** The half-percent line cannot be read off this: the loop's own drift from leg to leg is ten times it, in both directions. So a dose was measured instead — next row. |
| M7b | The same poller **never pausing**: 38.3 million reads in 30 s (**1.28 million a second**), none not OK, none faulted, worst read 2.7 ms; frames a second −3.3 % (legs −1.1 %, −5.3 %, −3.7 %). | Three hundred thousand times the proposed rate costs about three percent of an uncapped loop. Four reads a second is that divided by 320,000: not measurable, and not half a percent. **The driver also took 38 million reads beside some three million marker calls without an error** — the concurrency §30 could only infer. |
| M8 | Direct3D 12: markers set with the **device** — no error; read with the device and read with the queue both return the same sixty-four frames; the sleep status is `NVAPI_OK` with either; markers set with the queue work as well and are read back with the device. | **The device works**, and it is the object the Overlay already holds. |
| M9 | `simStartTime` of two neighbouring frames 91 and 43 apart in two runs where the probe measured 81 and 64 µs a frame, and the absolute values are the time of day (1 794 560 148 756 529 on 2026-11-13). | **Microseconds, on the clock of the Unix epoch.** Spans are differences of two of them. |
**One thing seen that is not understood.** In the first of the three runs the newest frame of the Direct3D 11
report had a `presentEndTime` 1 844 674 519 µs — half an hour — after its own `simStartTime`; the other two runs
show 36–72 µs there, and the Direct3D 12 reads 46–51 µs every time. The frame was the newest in the report, read
within microseconds of being presented. Whatever it was, **the newest frames of a report are not final**: a reader
must not take the last few as complete, and must refuse a span that no frame can have.
### What this settles, and what it does not
- **Settled, on this driver and this adapter**: the two getters can be found without loading anything and called
with a Direct3D 11 device or the Direct3D 12 device the Overlay holds; they do not fault before initialisation,
without markers, or beside a thread that sets markers at 16,000 frames a second; a call costs half a microsecond
to a microsecond and a half;
the report is readable from markers alone and its unit is known. None of §30's stop conditions fired: no fault or
hang attributable to the call, no overhead near NFR-1, and the Direct3D 12 device is the one already held.
- **Decided by M2 and M6 together**: the call belongs on the **presenting thread, once a second** — a microsecond
or so a second, with a worst case seen of 70 µs — not on the watchdog and not on a new thread. So the Disclaimer's "one background thread"
would not change; what would change is its list of what the part inside the game does at a present.
- **Not settled, because only a game can say**: a game's own device — many threads, deferred contexts, a device a
game is about to release; what a real title's report holds (input sample, the GPU times of a real frame, frame
generation's `aiFrameTimeUs`); whether a title that uses Reflex through Streamline alone leaves `nvapi64.dll`
findable by name (not looked at); a driver other than 32.0.16.2114, and any card but this
one; a call that blocks — the stub shows what a block does to its thread, and nothing here made the driver block.
- **Not looked into**: Direct3D 11 in the Overlay, which keeps no D3D11 device today (`ResolveApi` releases it):
reading there means holding one, a reference the Overlay does not take now; and the incomplete newest frame above.
### The question for the owner
**Go to one real title, or stop here?** A go means a plan of its own before any code: the two calls in the present
detour once a second, **only while a session asks for Advanced metrics** (D111), only where the game already
loaded `nvapi64.dll`, Direct3D 12 first (the device is already held); a place for the numbers — a series beside the
frames, since a report arrives after its frame's record is written (§30); `nvapi-readonly-check` extended to the
Overlay and taught that `Sleep` is a writer; the Disclaimer's and the Privacy Policy's wording; the first run on a
title of the owner's choosing that is not inside the anti-cheat exception's trial (D38), with what each outcome
means written before it. A no leaves `nvapi.reflex.*` and `sl.reflex.*` at N/A with the reason, and this note as
the record of why it was within reach.
**Answered 2026-11-13 (owner decision D136): go, to a plan.** The title is Cyberpunk 2077. No code before the plan
is approved, and no release that carries the calls before a stop while a game runs has been exercised on
0.1.0-beta.46 (owner-only item 44 (d)).
### The leg with a sleep (owner decision D139) — the table, written before the run
The plan's review found the largest thing the runs above never touched: **no run set a sleep mode or called
`NvAPI_D3D_Sleep`**, and a game that uses Reflex does both, every frame. If the driver makes a getter wait behind
the game's sleep, a read on the presenting thread holds a present for as long as the sleep lasts. The owner said:
measure it in the probe first (D139). The probe plays the game's part once more — `NvAPI_D3D_SetSleepMode` (low
latency on, a minimum interval of 4 166 µs, markers used) and `NvAPI_D3D_Sleep` at the start of every frame, on its
own Direct3D 12 device, in its own process. **Both are writes**, as the markers were; no shipped binary contains
either, and the sleep mode is switched back off before the device is released.
| # | What is measured | What it decides |
|---|---|---|
| S1 | The sleep mode takes: `SetSleepMode` returns OK, the sleep status then reads low-latency on, and a frame takes about the interval | Not OK, or the status does not change → the leg did not exercise a sleep; said so, nothing concluded from S2–S4. |
| S2 | The two getters on the thread that sleeps and presents: one `GetLatency` after each of 2000 frames, and 2000 calls back to back | **Median above 60 µs → stop** (NFR-1 at 60 presents a second). **Any call of 2 ms or more → stop**: on a presenting thread that is the latch of D141, in every game that uses Reflex. |
| S3 | The getters on **another** thread four times a second for 20 s, and without a pause for 10 s, while the first thread sleeps and presents — against the same two runs on the same device **before** the sleep mode was set | **A fault → stop** (§30). Reads of 2 ms or more that the control does not have → the getter waits behind the sleep: **stop**, and the note says the route reads only games that do not sleep. Reads of 1 ms or more at the same rate as the control → the scheduler, not the sleep. |
| S4 | What the report holds once the game sleeps: frames with anything, and the sleep status's fields | Recorded: it is what a real title's report would look like more closely than M5's. An empty report → a sleep mode changes what markers alone gave; recorded, the reader's "nothing reported" covers it. |
A stop here means no Overlay code is written and the owner is asked again.
### The leg with a sleep — results
Three runs of `fl-probe-reflex --real 10` on 2026-11-13 (RTX 5080, driver 32.0.16.2114), the leg after R5.
**No stop condition fired.**
| # | What was seen | Reading |
|---|---|---|
| S1 | `SetSleepMode` returned OK in all three runs. A frame then took 4 159 µs (the interval asked for is 4 166), 4 037–4 041 of them inside `NvAPI_D3D_Sleep`; no sleep error. The sleep status afterwards: interval 4 166 µs, `bUseGameSleep` 1 — and **`bLowLatencyMode` 0**, although the mode was set with it on. | The sleep was exercised: the thread stood inside it 97 % of the time. **The status's low-latency field is not the flag the game set**, on this driver; why is not known. It is shown as the driver's word, never as "the game switched Reflex on". |
| S2 | One `GetLatency` after each of 2000 sleeping frames, on the thread that sleeps and presents: median **2.5 / 2.6 / 2.6 µs**, mean 2.7–2.8, worst 66.9 / 16.8 / 8.0 µs, none of 2 ms. Back to back: median 0.7 µs (worst 10.2 / 81.6 / 4.1); `GetSleepStatus` median 0.2 µs. | Far inside both limits. A read after a frame that slept costs four or five times a read made back to back — a cold cache, by the look of it — and that is the Overlay's case: **about 2.6 µs, once a second**. |
| S3 | From another thread while the first slept and presented at 240 frames a second. Four reads a second for 20 s: 80 reads a run, none not OK, none faulted, worst 64 / 82 / 12 µs (the control before the sleep mode: 92 / 209 / 119 µs). Without a pause for 10 s: **10.26 / 10.26 / 10.43 million reads**, none not OK, none faulted, worst 442 / 635 / 286 µs, **none of a millisecond** (the control: 9.97 / 9.94 / 9.89 million, worst 1 605 / 1 390 / 203 µs, one read of a millisecond in two of the three runs). | **The getter does not wait behind the sleep.** Thirty-one million reads were made while another thread was inside the sleep nearly all the time, and none took a millisecond; the slow reads there are belong to the control. |
| S4 | The report: sixty-four frames with content. `driverStartTime` is filled in all sixty-four — it was zero in M5, without a sleep mode; `inputSampleTime` in none (the probe sets no input marker). Simulation start to present end 102–151 µs, to GPU end 150–191 µs; `gpuActiveRenderTimeUs` 0. | With a sleep mode the driver span is reported. A reader that treats a zero end point as "span not reported" covers both shapes. |
**What it does not say**: a game's own sleep, on a game's own threads, with a real frame's work between the sleep
and the present; frame generation's pacer; another driver. Those are what the first real title is for (D136).
### What moving the sequence into the Overlay found (2026-11-13, the same evening)
The call sequence became `FrameLedger.Overlay/include/fl_reflex.h`, with one check the candidate did not have: that
the two addresses the module answers with are code of the module. **Run against the installed driver, that check
refused the driver.** `C:\Windows\System32\nvapi64.dll` is a shim: it answers both ids with addresses inside
`nvapi64_impl.dll`, in the driver's own store (`…\DriverStore\FileRepository\nv_dispi.inf_amd64_…`), an image of
its own. Three consequences, all in the header now:
- An address is accepted when it is **executable code of an image the process has loaded** — which still refuses
the heap, a stack and nowhere — not only when it is inside `nvapi64.dll`.
- **A reference is kept on that image too.** The addresses are code only while `nvapi64_impl.dll` stays loaded, and
what the shim does with it when a game unloads NVAPI was not looked at.
- **The note above was wrong about Control Flow Guard.** It reasoned from `nvapi64.dll`, which is not a CFG image;
the code that is called is in `nvapi64_impl.dll`, which is one (`dumpbin`: instrumented, a function table of
5 332 entries). The probe enforces CFG and has made the calls from the shipped header, so on this driver the two
getters are valid targets. A game that enforces CFG, on a driver the probe was not run against, is not covered:
a target that were not valid is a fast-fail no guard catches.
The stand-in module answers with addresses of its own, which is why the stub leg could not find this; only the
real run could. The probe's `--real` now prints the image each address lies in.
### A run on a busy PC, and what it says about the 2 ms latch (D141)
The run that confirmed the corrected header (`Resolve` OK, the reads as before) was made while a native build and an
injected test ran on the same PC — the probe's own loop made 9 000 frames a second where it had made 16 000. It is
the only run so far that was not alone, and it is the nearer one to a game:
| | Alone (three runs) | Busy (one run) |
|---|---|---|
| `GetLatency` after a sleeping frame, on the thread that sleeps and presents (2000 reads) | median 2.5–2.6 µs, worst 8–67 µs | median 3.4 µs, worst 130 µs, none of 2 ms |
| From another thread without a pause, while the first sleeps: reads of 1 ms or more / of 2 ms or more | 0 / 0 in 10.3 million | **536 / 25 in 2.9 million**, worst 3.5 ms |
| The same before the sleep mode was set | 1 / 0 in 9.9 million | 6 / 2 in 3.2 million, worst 2.2 ms |
| Four reads a second for 20 s | worst 12–82 µs | worst 110 µs, none of 1 ms |
**A reading, not a measurement of a game**: a thread that does nothing but call is taken off its processor now and
then on a busy PC, and a read that was under way then is as long as the pause. Twenty-five such pauses of 2 ms or
more in ten seconds of calling is 2.5 a second; a read of 3 µs made once a second is inside one of them about once
in a hundred thousand reads. **So the latch of D141 will, on a busy PC, sometimes switch the read off for a pause
that was Windows' and not the driver's** — of the order of a few sessions in a hundred, for sessions of two hours,
if a game's presenting thread is paused as often as this probe's poller was; a presenting thread usually is not.
The session then says *stopped: slow* with the microseconds, and the next start of the game reads again. That is the
trade the owner chose with D141 (one call, not two): it errs towards the game. The number published with the state
is what tells the two apart afterwards — a driver that holds a call does it again and for longer; a pause is a few
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
@@ -22,7 +22,7 @@ The link under them, *Read what the hook does and does not do*, opens the safety
| **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 |
| **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. 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 |
| **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 |
## Data
+1 -1
View File
@@ -32,7 +32,7 @@ While the game runs, a notice may say *hooking refused*.
| The game runs in an app container, or Windows protects it in a way the component can neither load into nor hook. | Nothing: an older Microsoft Store app (UWP), or a game under code protection, is recorded, not measured ([Limitations](../LIMITATIONS.md#xbox-app-and-microsoft-store-games)). |
| **Disable all hooking** is on. | Switch it off in Settings ▸ Capture. |
| The game was already running when FrameLedger was updated. | Close the game and start it again. |
| Hooking was switched off after the game crashed twice soon after it started. | Switch it on again in the game's page if the cause may be gone — after a driver update, for example. |
| Hooking was switched off after the game crashed twice soon after it started. | Switch it on again in the game's page if the cause may be gone — after a driver update, for example. The count starts again when you do (since 0.1.0-beta.44). |
| Hooking was switched off after **Play** started the game directly twice, and each time the game handed itself to Steam or closed at once. | Switch it on again, and set Settings ▸ Games ▸ **Play button** to *Through the store*: some Steam games will not start any other way. |
| The game's file is gone. | If only its drive letter changed, FrameLedger follows it within about 15 seconds; otherwise **Change executable…** on the game's page. |
| The component could not be loaded into the game. | [Report a problem](#report-a-problem). |
+73
View File
@@ -45,10 +45,71 @@ also keeps what the game itself handed to DLSS and FSR:
- **FSR** — sharpening (on or off, and how strong), the largest jitter offset, the exposure, the near and far planes,
the **range** of the field of view over the session, the flags of the call, the frame time the game reported, and
FSR's own video memory at the moments the game asked for it.
- **Streamline** (NVIDIA's library that games use for DLSS; since 0.1.0-beta.43) — what the game tells it about
each frame: the largest jitter offset, the motion-vector scale and how the motion vectors are stored, the near and
far planes and whether depth is inverted, the **range** of the field of view, the aspect ratio, whether the
projection is orthographic, and how many times the game reset the upscaler's history (a camera cut, a loading
screen). Where a game draws several views, these are the first view's.
- **FSR frame generation** (since 0.1.0-beta.43) — how the game configured it: on or off, whether it may run
asynchronously, its flags, whether only generated frames are presented, and the part of the picture it generates
in. A setting the game changed during the session reads *on and off*. This is what the game **asked for**; how
many frames were generated is in the session's summary, as before.
- **Streamline's features** (since 0.1.0-beta.44) — what Streamline answered when the game asked about a feature:
which version it is (Streamline's own, and the DLSS model's), and what it requires — the graphics APIs it works
with, whether V-Sync must be off, whether hardware-accelerated GPU scheduling must be on, how many threads,
viewports and buffers, and the Windows and driver versions Streamline found beside the ones the feature needs.
The features carry NVIDIA's own names: `kFeatureDLSS` is DLSS, `kFeatureDLSS_G` DLSS frame generation,
`kFeatureDLSS_RR` ray reconstruction, `kFeatureReflex` Reflex. A game asks these while it starts; many ask
again later, and then they are read. Where a game asks only at its start, the line under the session says
*hooked — the game asks this while it starts, and did not ask again*. The version shown is the one Streamline
reports, which can be newer than the file in the game's folder.
- **Whether a feature is supported and loaded, and what the game did with it** (since 0.1.0-beta.45) — two more
tables, one row for each feature and call. `kFeatureDLSS_G · slIsFeatureSupported` is Streamline's answer in
NVIDIA's own word: `eOk` is yes, and a refusal is named (`eErrorFeatureNotSupported`, `eErrorFeatureMissing`).
`· slIsFeatureLoaded` is *on* or *off*. `· slSetFeatureLoaded` says whether the game switched the feature *on*,
*off* or *on and off* during the session; `· slAllocateResources` and `· slFreeResources` count how many times it
set up and released what the feature needs (up to 15, then `≥ 15`); `slShutdown` counts how many times it shut
Streamline down. These begin when FrameLedger is in the game: what the game did while it started is not there.
In the games run so far every one asks whether its features are supported; the other rows appear in some games
and not in others, and no game has shown an allocation.
These are the game's own words to the upscaler, shown in the vendor's notation (`preExposure`, preset `K`).
FrameLedger does not check what the upscaler did with them.
The last four are read from calls FrameLedger hooks **only for Advanced metrics** — ten calls in all: in a game
where no session has been recorded with the option on since it started, those hooks are not there. The line under
the session says, for each call, whether it was *read*, *hooked — the game did not make the call*, or *not hooked —
the game did not load the library that has the call*; the six calls of 0.1.0-beta.45 are named in one sentence,
under which of the three happened to each.
### What NVIDIA's driver says about each frame's stages
On an NVIDIA card, in a **Direct3D 12** game that uses **NVIDIA Reflex**, a session with Advanced metrics on also
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*.
Three things to know about them:
- **They are the driver's numbers, not FrameLedger's.** FrameLedger does not measure these stages; it stores what
the driver reports and has not checked it against another tool. They are not the delay from a click to the screen.
- **FrameLedger asks for them from inside the game**, about once a second — the one thing it does in a game that is
not reading what the game itself passes along. It asks only through NVIDIA's library where the game had already
loaded it, and never loads that library itself. A copy of the library sitting in the game's own folder (some
mods put one there) is not the driver's, and FrameLedger does not use it.
- **It switches itself off rather than disturb the game.** If one request takes two thousandths of a second or
more, or goes wrong, FrameLedger makes no further request until the game is closed. The line under the session
then says *stopped*, and why; the next time the game starts it reads again. On a busy PC this can happen for a
pause that was Windows' and not the driver's.
The line under the session says what happened: *read*; *asked, and the driver reported no frame* (the game does not
use Reflex); *not read* with the reason — the game does not present through Direct3D 12, it has not loaded NVIDIA's
library, or that library is in the game's own folder; or *stopped*.
**Many games will show nothing here**, and the line under the session says why: *the game made none of the calls
these are read from* — most games set their DLSS options through a call FrameLedger cannot see, and only games that
use FSR 3.1 or later through AMD's own library show the FSR rows — or *the session was not measured inside the game*.
@@ -57,6 +118,13 @@ It never means the game uses no upscaler; the session's summary still names the
**Where the camera is, which way it looks and its matrices are never read.** The field of view is kept as a lowest
and a highest value, never as a line over time.
**A game may use a unit of its own.** NVIDIA's and AMD's libraries expect the field of view in radians, and
FrameLedger shows it that way with the degrees beside it. Some games give degrees instead (Cyberpunk 2077 does, to
Streamline): a value too large to be radians is shown as the game gave it, with a line that says *Not radians*, and
is not converted — FrameLedger shows what the game said, not what it may have meant. The number of **resets** is
the number of calls in which the game told the upscaler to drop its history; menus and loading screens raise it. A
frame-generation configuration with no flag set says *None*.
A session's summary has an **Advanced metrics…** button that opens that session here.
## Sources
@@ -70,6 +138,11 @@ comes from, and whether it is read. Where it is not, the reason is written out:
- **not present on this PC** — the driver's own figures exist on NVIDIA cards only;
- **read inside a game FrameLedger measures, when the game makes the call** — what the game tells DLSS and FSR
(above). Some further readings inside the game **come with a later release**;
- **read inside a game FrameLedger measures, from the graphics driver** — NVIDIA's latency report (above);
- **not read: it would take a patch at an address found while the game runs, or a call the vendor forbids from
outside the game's own threads** — what the game asked of Reflex, and Reflex's state through Streamline;
- **the game makes this call once, before FrameLedger is inside it** — what the game started Streamline with. It is
not read, and no later release will read it;
- **never read** — a serial number, a display's identification data, which other programs are encoding, the camera's
position in the game. FrameLedger does not read these at all.
+24 -3
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.41`** (2026-11-12), an unsigned installer built from that tag with its
> **beta is `0.1.0-beta.47`** (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
@@ -86,8 +86,15 @@
> mean, median and peak. The game's other processes (launchers, helpers) are not counted.
> - **Video memory:** in use on the whole graphics card, recorded from Windows and GPU-driver telemetry
> and charted. **Not measured at all:** the video-memory budget Windows gives a game, which frame
> spikes were shader compilation, PC latency (Reflex), and HDR. Stutter count and stutter time are
> spikes were shader compilation, end-to-end PC latency, and HDR. Stutter count and stutter time are
> measured from frame times.
> - **NVIDIA's latency report (only with Advanced metrics on; Direct3D 12; a game that uses NVIDIA Reflex):** how
> 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.
> - **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
@@ -113,7 +120,21 @@
> range, field-of-view range, flags and frame time it hands FSR, are read from the arguments of the calls
> FrameLedger intercepts and shown as the game stated them — not checked against what the upscaler did. Most games
> set their DLSS options through a call that cannot be intercepted and show none; the FSR values need FSR 3.1 or
> later through AMD's own library. None of it has been read from a real game yet.
> later through AMD's own library. Since beta.43 also what a game tells NVIDIA Streamline about each frame (jitter,
> motion-vector scale, depth range, field-of-view range, how often it reset the upscaler's history — for the first
> viewport that called, where a game has several) and how it configures FSR frame generation (the settings it asked
> for, not whether frames were generated). Since beta.44 also what Streamline answers when a game asks about a
> feature — its version, and what it requires (graphics APIs, V-Sync, GPU scheduling, Windows and driver versions):
> Streamline's answer as the game received it, not a check of the PC. A game that asks only while it starts has
> none and the session says so; the Unreal Engine games run so far ask again later, and were read. Since beta.45
> also whether Streamline says each feature is supported and whether it is loaded, and what the game did with it
> after FrameLedger attached — switched it on or off, allocated and freed its resources (counted to fifteen), shut
> Streamline down: calls the game made, not a statement that a feature ran or produced anything. FSR's upscaling
> values, Streamline's constants (seven games), its answers about a feature (seven games), the
> frame-generation configuration (one game) and five of beta.45's six calls (five games) have been read from
> real games; no game run so far allocated a feature's resources after FrameLedger attached, and the DLSS
> options have not been confirmed on one yet. A game may give a value in a unit of its own: one gives
> Streamline its field of view in degrees, and it is shown as given.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
+32 -7
View File
@@ -1,6 +1,6 @@
# FrameLedger — Disclaimer
**Version:** 2.15 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.16 · **Effective:** {{RELEASE_DATE}}
## 0. This is pre-release software
@@ -43,11 +43,11 @@ Be precise about what that does and does not promise, because the shorter versio
Install it somewhere only you can write to, and verify the published SHA-256 checksums.
**What it observes inside the game:** arguments the game passes to graphics APIs we intercept (presentation, upscaling, ray tracing, pipeline creation).
**What it observes inside the game:** arguments the game passes to graphics APIs we intercept (presentation, upscaling, ray tracing, pipeline creation) — and, only while Advanced metrics is on, one thing that is not an argument: the graphics driver's own report of how long the stages of the game's last frames took, which the component asks NVIDIA's driver for itself (§2 says exactly how).
**What it reads about the game from outside it, in every session:** the game process's own memory use — its dedicated and shared video memory and its working sets, the figures Windows' Task Manager shows — from Windows' performance counters and process-memory information. For a game it does not inject into, FrameLedger opens the game's process for this with the least access Windows offers, once a second, and closes it again; it reads nothing inside the process.
> **What of that list is observed today is stated once, in §4 below** (the block `legal/ACCURACY.md` carries, dated). The list here describes what the software is designed to observe, and the boundary — API arguments and nothing else — holds for all of it.
> **What of that list is observed today is stated once, in §4 below** (the block `legal/ACCURACY.md` carries, dated). The list here describes what the software is designed to observe, and the boundary — API arguments, and the one report asked of the graphics driver that the line above names; nothing of the game's own memory — holds for all of it.
**What it never does:** read or write the game's memory outside those API arguments; read save files, input, chat, or network traffic; modify game behavior; hide itself from any security software; or install a kernel driver of its own.
@@ -72,7 +72,11 @@ FrameLedger is designed to reduce that risk substantially:
the game exits.
- FrameLedger contains **no evasion techniques of any kind** — it does not hide, rename, obfuscate, or disguise itself. It is intended to be plainly identifiable to any security software that looks.
For completeness about what it *does* run inside the game: besides the intercepted calls themselves, the component starts **one background thread**. It wakes once a second, or when the game loads a library, and then: checks FrameLedger's own shared memory for a request to stop and for the heartbeat of the safety scan described above; asks Windows, by name, whether the graphics, upscaling and frame-generation libraries it knows about are loaded, and puts its interception into the ones that are (for ray tracing it creates one command list on the game's own Direct3D 12 device, to find the functions to intercept); writes its counters to FrameLedger's shared memory; and writes FrameLedger's own log file. It does not scan the game's memory, list the modules or processes on the system, or query Windows services — deliberately, because software that does those things from inside a game process looks like the thing this tool is trying not to be mistaken for.
For completeness about what it *does* run inside the game: besides the intercepted calls themselves, the component starts **one background thread**. It wakes once a second, or when the game loads a library, and then: checks FrameLedger's own shared memory for a request to stop and for the heartbeat of the safety scan described above; asks Windows, by name, whether the graphics, upscaling and frame-generation libraries it knows about are loaded, and puts its interception into the ones that are (for ray tracing it creates one command list on the game's own Direct3D 12 device, to find the functions to intercept); writes its counters to FrameLedger's shared memory; and writes FrameLedger's own log file.
**One call it makes itself, into the graphics driver — only while Advanced metrics is on.** In a Direct3D 12 game that had already loaded NVIDIA's driver library (`nvapi64.dll`), the component asks that library — by name, among what the game loaded; it never loads it — for two of the driver's read-only functions, and keeps the library and the driver file those functions are in from being unloaded for as long as the game runs. Then, about once a second, **on the game's own thread that presents its frames**, right after a frame has been handed over, it calls them: one returns the driver's report of how long the stages of the last frames took, the other the driver's low-latency state. It calls no function that sets, marks or delays anything. A library of that name sitting in the game's own folder is not the driver's and is not called. What this costs the game is the length of that call, once a second — a few millionths of a second where it was measured. A call that faults is caught, counted once, and not repeated; a call that takes two thousandths of a second or more is the last one until the game is closed. **A call that never returns would hold the game's presenting thread, and FrameLedger cannot stop it** — it has not happened in any test, and it is said here because it is the one thing in this component whose length FrameLedger's own code does not bound. With Advanced metrics off — the default — none of this happens.
It does not scan the game's memory, list the modules or processes on the system, or query Windows services — deliberately, because software that does those things from inside a game process looks like the thing this tool is trying not to be mistaken for.
- FrameLedger injects into a game only after you enable that game individually. For every other game — and for any game where the safety checks refuse — it records the session's start, end and duration together with whatever hardware sensor readings your machine provides and the game's own memory use as Windows reports it (§1), and reports every other measurement as not available. **There is no measurement mode that works without injecting**; an earlier version of this document described one, and it was never built. FrameLedger never estimates a value it could not measure, and it always shows which of the two modes produced a session. Neither mode requires administrator rights.
**However, these protections cannot be complete:**
@@ -121,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.41`** (2026-11-12), an unsigned installer built from that tag with its
> **beta is `0.1.0-beta.47`** (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
@@ -195,8 +199,15 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
> mean, median and peak. The game's other processes (launchers, helpers) are not counted.
> - **Video memory:** in use on the whole graphics card, recorded from Windows and GPU-driver telemetry
> and charted. **Not measured at all:** the video-memory budget Windows gives a game, which frame
> spikes were shader compilation, PC latency (Reflex), and HDR. Stutter count and stutter time are
> spikes were shader compilation, end-to-end PC latency, and HDR. Stutter count and stutter time are
> measured from frame times.
> - **NVIDIA's latency report (only with Advanced metrics on; Direct3D 12; a game that uses NVIDIA Reflex):** how
> 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.
> - **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
@@ -222,7 +233,21 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
> range, field-of-view range, flags and frame time it hands FSR, are read from the arguments of the calls
> FrameLedger intercepts and shown as the game stated them — not checked against what the upscaler did. Most games
> set their DLSS options through a call that cannot be intercepted and show none; the FSR values need FSR 3.1 or
> later through AMD's own library. None of it has been read from a real game yet.
> later through AMD's own library. Since beta.43 also what a game tells NVIDIA Streamline about each frame (jitter,
> motion-vector scale, depth range, field-of-view range, how often it reset the upscaler's history — for the first
> viewport that called, where a game has several) and how it configures FSR frame generation (the settings it asked
> for, not whether frames were generated). Since beta.44 also what Streamline answers when a game asks about a
> feature — its version, and what it requires (graphics APIs, V-Sync, GPU scheduling, Windows and driver versions):
> Streamline's answer as the game received it, not a check of the PC. A game that asks only while it starts has
> none and the session says so; the Unreal Engine games run so far ask again later, and were read. Since beta.45
> also whether Streamline says each feature is supported and whether it is loaded, and what the game did with it
> after FrameLedger attached — switched it on or off, allocated and freed its resources (counted to fifteen), shut
> Streamline down: calls the game made, not a statement that a feature ran or produced anything. FSR's upscaling
> values, Streamline's constants (seven games), its answers about a feature (seven games), the
> frame-generation configuration (one game) and five of beta.45's six calls (five games) have been read from
> real games; no game run so far allocated a feature's resources after FrameLedger attached, and the DLSS
> options have not been confirmed on one yet. A game may give a value in a unit of its own: one gives
> Streamline its field of view in degrees, and it is shown as given.
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
+3 -3
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.16 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.20 · **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 — never where the game's camera is, which way it looks, or its matrices. 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, 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.
- 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.
@@ -43,7 +43,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
## 4. What the app can technically observe
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation) — and, only while Advanced metrics is on, more of the parameters of the upscaling calls, which are then stored with the session (sizes, presets, exposure, sharpening, the jitter's size, the depth range, the range of the field of view, flags, the reported frame time, the upscaler's own memory), never the camera's position, direction or matrices; the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphics card and of each connected display, what it reports about the display a tracked game's window is on, its settings for a tracked game and its global ones (read only), and, when the capture agent runs as administrator with PawnIO installed, the sensors and model names of the processor, the memory and the motherboard (never a drive's), all of which are also read with no game running while the Advanced page is open, to show them there, and are not stored then; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation) — and, only while Advanced metrics is on, more of the parameters of the upscaling calls, and the parameters of ten further calls it begins to intercept in a game only once a session with that option on has started there (the constants the game gives NVIDIA Streamline for each frame, the game's configuration of FSR frame generation, Streamline's answers to the game's four questions about a feature — which version it is, what it requires, whether it is supported and whether it is loaded — and the game switching a feature on or off, allocating and freeing its resources, and shutting Streamline down), which are then stored with the session (sizes, presets, exposure, sharpening, the jitter's size, the motion-vector scale, the depth range, the range of the field of view, flags, the reported frame time, the upscaler's own memory, how frame generation is configured, the versions and requirements of Streamline's features, whether each is supported and loaded, and how often the game switched it, allocated and freed its resources and shut Streamline down), never the camera's position, direction or matrices, and never what identifies the graphics card; and — only while Advanced metrics is on, only in a Direct3D 12 game that had itself loaded NVIDIA's driver library — the graphics driver's own report of the game's last frames and its low-latency state, which the component asks that driver for itself about once a second (it makes that call; the game does not), keeping only how long each stage took; the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphLine truncated
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
+99
View File
@@ -235,7 +235,9 @@ public static class Strings
nameof(Adv_sl_dlssg_options),
nameof(Adv_sl_dlssg_state),
nameof(Adv_sl_dlssg_vram_estimate),
nameof(Adv_sl_feature_lifecycle),
nameof(Adv_sl_feature_requirements),
nameof(Adv_sl_feature_support),
nameof(Adv_sl_feature_versions),
nameof(Adv_sl_init_preferences),
nameof(Adv_sl_nis_options),
@@ -260,7 +262,11 @@ public static class Strings
nameof(Advanced_Elevation_Hint),
nameof(Advanced_Facts_Header),
nameof(Advanced_Header),
nameof(Advanced_InGameCallsLine),
nameof(Advanced_InGameDriverLine),
nameof(Advanced_InGameFeatureCallsLine),
nameof(Advanced_InGameLine),
nameof(Advanced_InGameMoreCallsLine),
nameof(Advanced_Machine_Intro),
nameof(Advanced_Max),
nameof(Advanced_Mean),
@@ -281,12 +287,24 @@ public static class Strings
nameof(Advanced_State_Viewer),
nameof(Advanced_State_Waiting),
nameof(Advanced_Status_InGame),
nameof(Advanced_Status_InGameDriver),
nameof(Advanced_Status_Read),
nameof(Advanced_Status_Readable),
nameof(Advanced_Status_SourceSilent),
nameof(Advanced_Tab_Machine),
nameof(Advanced_Tab_Session),
nameof(Advanced_Tab_Sources),
nameof(AdvDriverRead_Error),
nameof(AdvDriverRead_Faulted),
nameof(AdvDriverRead_NoDirect3D12),
nameof(AdvDriverRead_NoGetter),
nameof(AdvDriverRead_NoModule),
nameof(AdvDriverRead_NothingReported),
nameof(AdvDriverRead_Read),
nameof(AdvDriverRead_Refused),
nameof(AdvDriverRead_Slow),
nameof(AdvDriverRead_Stalled),
nameof(AdvDriverRead_Unknown),
nameof(AdvGroup_Board),
nameof(AdvGroup_Cpu),
nameof(AdvGroup_Display),
@@ -302,6 +320,12 @@ public static class Strings
nameof(AdvInGame_NotHooked),
nameof(AdvInGame_Reading),
nameof(AdvInGame_Unknown),
nameof(AdvInGameCall_NeverCalled),
nameof(AdvInGameCall_NotAskedAgain),
nameof(AdvInGameCall_NotHooked),
nameof(AdvInGameCall_Read),
nameof(AdvInGameCall_Unknown),
nameof(AdvReach_BeforeAttach),
nameof(AdvReach_Deferred),
nameof(AdvReach_Game),
nameof(AdvReach_HookedCall),
@@ -311,6 +335,7 @@ public static class Strings
nameof(AdvReach_NotInHeaders),
nameof(AdvReach_PlayerState),
nameof(AdvReach_Refused),
nameof(AdvReach_RefusedRoute),
nameof(AdvReach_Spike),
nameof(AdvScope_MachineFact),
nameof(AdvScope_Series),
@@ -329,10 +354,12 @@ public static class Strings
nameof(AdvToken_discrete),
nameof(AdvToken_dolby_vision),
nameof(AdvToken_draw_debug_view),
nameof(AdvToken_driver),
nameof(AdvToken_driver_default),
nameof(AdvToken_edr),
nameof(AdvToken_fpci),
nameof(AdvToken_game_ready),
nameof(AdvToken_gpu_render),
nameof(AdvToken_gsync_module),
nameof(AdvToken_hdr10),
nameof(AdvToken_hdr10_plus),
@@ -344,17 +371,23 @@ public static class Strings
nameof(AdvToken_non_linear_color_srgb),
nameof(AdvToken_none),
nameof(AdvToken_not_a_number),
nameof(AdvToken_not_radians),
nameof(AdvToken_not_supported),
nameof(AdvToken_off),
nameof(AdvToken_on),
nameof(AdvToken_on_and_off),
nameof(AdvToken_os_queue),
nameof(AdvToken_pci),
nameof(AdvToken_pci_express),
nameof(AdvToken_present),
nameof(AdvToken_render_submit),
nameof(AdvToken_rtx_new_feature),
nameof(AdvToken_rtx_production),
nameof(AdvToken_scrgb_linear),
nameof(AdvToken_simulation),
nameof(AdvToken_srgb),
nameof(AdvToken_studio),
nameof(AdvToken_total),
nameof(AdvToken_ulmb),
nameof(AdvToken_usable_now),
nameof(AdvToken_user_set),
@@ -1938,8 +1971,12 @@ public static class Strings
public static string Adv_sl_dlssg_vram_estimate => ResourceManager.GetString(nameof(Adv_sl_dlssg_vram_estimate), Culture) ?? nameof(Adv_sl_dlssg_vram_estimate);
public static string Adv_sl_feature_lifecycle => ResourceManager.GetString(nameof(Adv_sl_feature_lifecycle), Culture) ?? nameof(Adv_sl_feature_lifecycle);
public static string Adv_sl_feature_requirements => ResourceManager.GetString(nameof(Adv_sl_feature_requirements), Culture) ?? nameof(Adv_sl_feature_requirements);
public static string Adv_sl_feature_support => ResourceManager.GetString(nameof(Adv_sl_feature_support), Culture) ?? nameof(Adv_sl_feature_support);
public static string Adv_sl_feature_versions => ResourceManager.GetString(nameof(Adv_sl_feature_versions), Culture) ?? nameof(Adv_sl_feature_versions);
public static string Adv_sl_init_preferences => ResourceManager.GetString(nameof(Adv_sl_init_preferences), Culture) ?? nameof(Adv_sl_init_preferences);
@@ -1988,8 +2025,16 @@ public static class Strings
public static string Advanced_Header => ResourceManager.GetString(nameof(Advanced_Header), Culture) ?? nameof(Advanced_Header);
public static string Advanced_InGameCallsLine => ResourceManager.GetString(nameof(Advanced_InGameCallsLine), Culture) ?? nameof(Advanced_InGameCallsLine);
public static string Advanced_InGameDriverLine => ResourceManager.GetString(nameof(Advanced_InGameDriverLine), Culture) ?? nameof(Advanced_InGameDriverLine);
public static string Advanced_InGameFeatureCallsLine => ResourceManager.GetString(nameof(Advanced_InGameFeatureCallsLine), Culture) ?? nameof(Advanced_InGameFeatureCallsLine);
public static string Advanced_InGameLine => ResourceManager.GetString(nameof(Advanced_InGameLine), Culture) ?? nameof(Advanced_InGameLine);
public static string Advanced_InGameMoreCallsLine => ResourceManager.GetString(nameof(Advanced_InGameMoreCallsLine), Culture) ?? nameof(Advanced_InGameMoreCallsLine);
public static string Advanced_Machine_Intro => ResourceManager.GetString(nameof(Advanced_Machine_Intro), Culture) ?? nameof(Advanced_Machine_Intro);
public static string Advanced_Max => ResourceManager.GetString(nameof(Advanced_Max), Culture) ?? nameof(Advanced_Max);
@@ -2030,6 +2075,8 @@ public static class Strings
public static string Advanced_Status_InGame => ResourceManager.GetString(nameof(Advanced_Status_InGame), Culture) ?? nameof(Advanced_Status_InGame);
public static string Advanced_Status_InGameDriver => ResourceManager.GetString(nameof(Advanced_Status_InGameDriver), Culture) ?? nameof(Advanced_Status_InGameDriver);
public static string Advanced_Status_Read => ResourceManager.GetString(nameof(Advanced_Status_Read), Culture) ?? nameof(Advanced_Status_Read);
public static string Advanced_Status_Readable => ResourceManager.GetString(nameof(Advanced_Status_Readable), Culture) ?? nameof(Advanced_Status_Readable);
@@ -2042,6 +2089,28 @@ public static class Strings
public static string Advanced_Tab_Sources => ResourceManager.GetString(nameof(Advanced_Tab_Sources), Culture) ?? nameof(Advanced_Tab_Sources);
public static string AdvDriverRead_Error => ResourceManager.GetString(nameof(AdvDriverRead_Error), Culture) ?? nameof(AdvDriverRead_Error);
public static string AdvDriverRead_Faulted => ResourceManager.GetString(nameof(AdvDriverRead_Faulted), Culture) ?? nameof(AdvDriverRead_Faulted);
public static string AdvDriverRead_NoDirect3D12 => ResourceManager.GetString(nameof(AdvDriverRead_NoDirect3D12), Culture) ?? nameof(AdvDriverRead_NoDirect3D12);
public static string AdvDriverRead_NoGetter => ResourceManager.GetString(nameof(AdvDriverRead_NoGetter), Culture) ?? nameof(AdvDriverRead_NoGetter);
public static string AdvDriverRead_NoModule => ResourceManager.GetString(nameof(AdvDriverRead_NoModule), Culture) ?? nameof(AdvDriverRead_NoModule);
public static string AdvDriverRead_NothingReported => ResourceManager.GetString(nameof(AdvDriverRead_NothingReported), Culture) ?? nameof(AdvDriverRead_NothingReported);
public static string AdvDriverRead_Read => ResourceManager.GetString(nameof(AdvDriverRead_Read), Culture) ?? nameof(AdvDriverRead_Read);
public static string AdvDriverRead_Refused => ResourceManager.GetString(nameof(AdvDriverRead_Refused), Culture) ?? nameof(AdvDriverRead_Refused);
public static string AdvDriverRead_Slow => ResourceManager.GetString(nameof(AdvDriverRead_Slow), Culture) ?? nameof(AdvDriverRead_Slow);
public static string AdvDriverRead_Stalled => ResourceManager.GetString(nameof(AdvDriverRead_Stalled), Culture) ?? nameof(AdvDriverRead_Stalled);
public static string AdvDriverRead_Unknown => ResourceManager.GetString(nameof(AdvDriverRead_Unknown), Culture) ?? nameof(AdvDriverRead_Unknown);
public static string AdvGroup_Board => ResourceManager.GetString(nameof(AdvGroup_Board), Culture) ?? nameof(AdvGroup_Board);
public static string AdvGroup_Cpu => ResourceManager.GetString(nameof(AdvGroup_Cpu), Culture) ?? nameof(AdvGroup_Cpu);
@@ -2072,6 +2141,18 @@ public static class Strings
public static string AdvInGame_Unknown => ResourceManager.GetString(nameof(AdvInGame_Unknown), Culture) ?? nameof(AdvInGame_Unknown);
public static string AdvInGameCall_NeverCalled => ResourceManager.GetString(nameof(AdvInGameCall_NeverCalled), Culture) ?? nameof(AdvInGameCall_NeverCalled);
public static string AdvInGameCall_NotAskedAgain => ResourceManager.GetString(nameof(AdvInGameCall_NotAskedAgain), Culture) ?? nameof(AdvInGameCall_NotAskedAgain);
public static string AdvInGameCall_NotHooked => ResourceManager.GetString(nameof(AdvInGameCall_NotHooked), Culture) ?? nameof(AdvInGameCall_NotHooked);
public static string AdvInGameCall_Read => ResourceManager.GetString(nameof(AdvInGameCall_Read), Culture) ?? nameof(AdvInGameCall_Read);
public static string AdvInGameCall_Unknown => ResourceManager.GetString(nameof(AdvInGameCall_Unknown), Culture) ?? nameof(AdvInGameCall_Unknown);
public static string AdvReach_BeforeAttach => ResourceManager.GetString(nameof(AdvReach_BeforeAttach), Culture) ?? nameof(AdvReach_BeforeAttach);
public static string AdvReach_Deferred => ResourceManager.GetString(nameof(AdvReach_Deferred), Culture) ?? nameof(AdvReach_Deferred);
public static string AdvReach_Game => ResourceManager.GetString(nameof(AdvReach_Game), Culture) ?? nameof(AdvReach_Game);
@@ -2090,6 +2171,8 @@ public static class Strings
public static string AdvReach_Refused => ResourceManager.GetString(nameof(AdvReach_Refused), Culture) ?? nameof(AdvReach_Refused);
public static string AdvReach_RefusedRoute => ResourceManager.GetString(nameof(AdvReach_RefusedRoute), Culture) ?? nameof(AdvReach_RefusedRoute);
public static string AdvReach_Spike => ResourceManager.GetString(nameof(AdvReach_Spike), Culture) ?? nameof(AdvReach_Spike);
public static string AdvScope_MachineFact => ResourceManager.GetString(nameof(AdvScope_MachineFact), Culture) ?? nameof(AdvScope_MachineFact);
@@ -2126,6 +2209,8 @@ public static class Strings
public static string AdvToken_draw_debug_view => ResourceManager.GetString(nameof(AdvToken_draw_debug_view), Culture) ?? nameof(AdvToken_draw_debug_view);
public static string AdvToken_driver => ResourceManager.GetString(nameof(AdvToken_driver), Culture) ?? nameof(AdvToken_driver);
public static string AdvToken_driver_default => ResourceManager.GetString(nameof(AdvToken_driver_default), Culture) ?? nameof(AdvToken_driver_default);
public static string AdvToken_edr => ResourceManager.GetString(nameof(AdvToken_edr), Culture) ?? nameof(AdvToken_edr);
@@ -2134,6 +2219,8 @@ public static class Strings
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);
public static string AdvToken_gsync_module => ResourceManager.GetString(nameof(AdvToken_gsync_module), Culture) ?? nameof(AdvToken_gsync_module);
public static string AdvToken_hdr10 => ResourceManager.GetString(nameof(AdvToken_hdr10), Culture) ?? nameof(AdvToken_hdr10);
@@ -2156,6 +2243,8 @@ public static class Strings
public static string AdvToken_not_a_number => ResourceManager.GetString(nameof(AdvToken_not_a_number), Culture) ?? nameof(AdvToken_not_a_number);
public static string AdvToken_not_radians => ResourceManager.GetString(nameof(AdvToken_not_radians), Culture) ?? nameof(AdvToken_not_radians);
public static string AdvToken_not_supported => ResourceManager.GetString(nameof(AdvToken_not_supported), Culture) ?? nameof(AdvToken_not_supported);
public static string AdvToken_off => ResourceManager.GetString(nameof(AdvToken_off), Culture) ?? nameof(AdvToken_off);
@@ -2164,20 +2253,30 @@ public static class Strings
public static string AdvToken_on_and_off => ResourceManager.GetString(nameof(AdvToken_on_and_off), Culture) ?? nameof(AdvToken_on_and_off);
public static string AdvToken_os_queue => ResourceManager.GetString(nameof(AdvToken_os_queue), Culture) ?? nameof(AdvToken_os_queue);
public static string AdvToken_pci => ResourceManager.GetString(nameof(AdvToken_pci), Culture) ?? nameof(AdvToken_pci);
public static string AdvToken_pci_express => ResourceManager.GetString(nameof(AdvToken_pci_express), Culture) ?? nameof(AdvToken_pci_express);
public static string AdvToken_present => ResourceManager.GetString(nameof(AdvToken_present), Culture) ?? nameof(AdvToken_present);
public static string AdvToken_render_submit => ResourceManager.GetString(nameof(AdvToken_render_submit), Culture) ?? nameof(AdvToken_render_submit);
public static string AdvToken_rtx_new_feature => ResourceManager.GetString(nameof(AdvToken_rtx_new_feature), Culture) ?? nameof(AdvToken_rtx_new_feature);
public static string AdvToken_rtx_production => ResourceManager.GetString(nameof(AdvToken_rtx_production), Culture) ?? nameof(AdvToken_rtx_production);
public static string AdvToken_scrgb_linear => ResourceManager.GetString(nameof(AdvToken_scrgb_linear), Culture) ?? nameof(AdvToken_scrgb_linear);
public static string AdvToken_simulation => ResourceManager.GetString(nameof(AdvToken_simulation), Culture) ?? nameof(AdvToken_simulation);
public static string AdvToken_srgb => ResourceManager.GetString(nameof(AdvToken_srgb), Culture) ?? nameof(AdvToken_srgb);
public static string AdvToken_studio => ResourceManager.GetString(nameof(AdvToken_studio), Culture) ?? nameof(AdvToken_studio);
public static string AdvToken_total => ResourceManager.GetString(nameof(AdvToken_total), Culture) ?? nameof(AdvToken_total);
public static string AdvToken_ulmb => ResourceManager.GetString(nameof(AdvToken_ulmb), Culture) ?? nameof(AdvToken_ulmb);
public static string AdvToken_usable_now => ResourceManager.GetString(nameof(AdvToken_usable_now), Culture) ?? nameof(AdvToken_usable_now);
+133 -1
View File
@@ -557,6 +557,14 @@
<value>各 Streamline 機能の要件: OS、ドライバー、バッファー</value>
<comment>review</comment>
</data>
<data name="Adv_sl_feature_lifecycle" xml:space="preserve">
<value>各機能のオン/オフ、リソースの割り当てと解放、Streamline のシャットダウン</value>
<comment>review</comment>
</data>
<data name="Adv_sl_feature_support" xml:space="preserve">
<value>Streamline が各機能をサポートしているか、読み込み済みか</value>
<comment>review</comment>
</data>
<data name="Adv_sl_feature_versions" xml:space="preserve">
<value>各 Streamline 機能のバージョンとその NGX モデル バージョン</value>
<comment>review</comment>
@@ -653,6 +661,22 @@
<value>詳細メトリクス</value>
<comment>review</comment>
</data>
<data name="Advanced_InGameCallsLine" xml:space="preserve">
<value>ゲームが毎フレーム Streamline に伝える内容: {0}。FSR フレーム生成の設定方法: {1}。</value>
<comment>review</comment>
</data>
<data name="Advanced_InGameDriverLine" xml:space="preserve">
<value>NVIDIA の遅延レポート (FrameLedger がゲーム内でグラフィックス ドライバーに問い合わせます): {0}。</value>
<comment>review</comment>
</data>
<data name="Advanced_InGameFeatureCallsLine" xml:space="preserve">
<value>各 Streamline 機能のバージョン: {0}。各機能の要件: {1}。</value>
<comment>review</comment>
</data>
<data name="Advanced_InGameMoreCallsLine" xml:space="preserve">
<value>Streamline のその他の呼び出し - 読み取り済み: {0}。フック済みでゲームが呼び出さなかったもの: {1}。未フック: {2}。</value>
<comment>review</comment>
</data>
<data name="Advanced_InGameLine" xml:space="preserve">
<value>ゲーム内: {0}。</value>
<comment>review</comment>
@@ -737,6 +761,10 @@
<value>FrameLedger が計測するゲーム内で、ゲームがその呼び出しを行ったときに読み取り</value>
<comment>review</comment>
</data>
<data name="Advanced_Status_InGameDriver" xml:space="preserve">
<value>FrameLedger が計測するゲーム内で、グラフィックス ドライバーから読み取り: FrameLedger が約 1 秒に 1 回問い合わせます</value>
<comment>review</comment>
</data>
<data name="Advanced_Status_Read" xml:space="preserve">
<value>読み取り中</value>
<comment>review</comment>
@@ -761,6 +789,50 @@
<value>ソース</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Error" xml:space="preserve">
<value>ドライバーがエラーを返しました</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Faulted" xml:space="preserve">
<value>ゲーム終了まで停止 - ドライバーへの呼び出しでフォールトが発生しました</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_NoDirect3D12" xml:space="preserve">
<value>読み取っていません - このゲームは Direct3D 12 で表示していません</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_NoGetter" xml:space="preserve">
<value>読み取っていません - ライブラリが 2 つの関数を返しませんでした</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_NoModule" xml:space="preserve">
<value>読み取っていません - ゲームが NVIDIA の nvapi64.dll を読み込んでおらず、FrameLedger がそれを読み込むことはありません</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_NothingReported" xml:space="preserve">
<value>問い合わせましたが、ドライバーはフレームを報告しませんでした - このゲームは NVIDIA Reflex を使用していません</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Read" xml:space="preserve">
<value>読み取りました</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Refused" xml:space="preserve">
<value>読み取っていません - ゲーム内の nvapi64.dll はゲーム自身のフォルダーにあり、ドライバーのものではありません</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Slow" xml:space="preserve">
<value>ゲーム終了まで停止 - ドライバーへの呼び出しに {0:N0} µs かかりました。2,000 µs 以上かかった呼び出しが最後になります</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Stalled" xml:space="preserve">
<value>停止 - ドライバーへの呼び出しが戻りませんでした</value>
<comment>review</comment>
</data>
<data name="AdvDriverRead_Unknown" xml:space="preserve">
<value>記録なし</value>
<comment>review</comment>
</data>
<data name="AdvGroup_Board" xml:space="preserve">
<value>マザーボード</value>
<comment>review</comment>
@@ -821,6 +893,26 @@
<value>不明</value>
<comment>review</comment>
</data>
<data name="AdvInGameCall_NeverCalled" xml:space="preserve">
<value>フック済み - ゲームはこの呼び出しを行いませんでした</value>
<comment>review</comment>
</data>
<data name="AdvInGameCall_NotAskedAgain" xml:space="preserve">
<value>フック済み - ゲームは起動時にこれを問い合わせ、FrameLedger の接続後は再度問い合わせませんでした</value>
<comment>review</comment>
</data>
<data name="AdvInGameCall_NotHooked" xml:space="preserve">
<value>未フック - この呼び出しを持つライブラリをゲームが読み込みませんでした</value>
<comment>review</comment>
</data>
<data name="AdvInGameCall_Read" xml:space="preserve">
<value>読み取りました</value>
<comment>review</comment>
</data>
<data name="AdvInGameCall_Unknown" xml:space="preserve">
<value>不明</value>
<comment>review</comment>
</data>
<data name="AdvReach_Deferred" xml:space="preserve">
<value>このリリースでは読み取らない</value>
<comment>review</comment>
@@ -845,6 +937,10 @@
<value>ゲーム内 (新しいフックが必要) - 今後のリリースで対応</value>
<comment>review</comment>
</data>
<data name="AdvReach_BeforeAttach" xml:space="preserve">
<value>読み取らない: ゲームはこの呼び出しを FrameLedger がゲーム内に入る前に一度だけ行います</value>
<comment>review</comment>
</data>
<data name="AdvReach_NotInHeaders" xml:space="preserve">
<value>このインターフェイスでは提供されない</value>
<comment>review</comment>
@@ -857,6 +953,10 @@
<value>読み取らない: センサー ライブラリがすべての USB デバイスを探索することになるため</value>
<comment>review</comment>
</data>
<data name="AdvReach_RefusedRoute" xml:space="preserve">
<value>読み取りません: ゲーム実行中にしか分からないアドレスへのパッチ、またはゲーム自身のスレッド以外からの呼び出しをベンダーが禁じている関数が必要になるためです - どちらも行いません</value>
<comment>review</comment>
</data>
<data name="AdvReach_Spike" xml:space="preserve">
<value>調査中 (未決定)</value>
<comment>review</comment>
@@ -925,6 +1025,10 @@
<value>Dolby Vision</value>
<comment>review</comment>
</data>
<data name="AdvToken_driver" xml:space="preserve">
<value>ドライバー</value>
<comment>review</comment>
</data>
<data name="AdvToken_driver_default" xml:space="preserve">
<value>ドライバーの既定値</value>
<comment>review</comment>
@@ -945,6 +1049,10 @@
<value>Game Ready</value>
<comment>review</comment>
</data>
<data name="AdvToken_gpu_render" xml:space="preserve">
<value>GPU 描画</value>
<comment>review</comment>
</data>
<data name="AdvToken_gsync_module" xml:space="preserve">
<value>G-SYNC モジュール</value>
<comment>review</comment>
@@ -989,6 +1097,10 @@
<value>数値ではない</value>
<comment>review</comment>
</data>
<data name="AdvToken_not_radians" xml:space="preserve">
<value>ラジアンではありません: 値が π より大きいためです。ゲームはおそらく度で渡しています。</value>
<comment>review</comment>
</data>
<data name="AdvToken_not_supported" xml:space="preserve">
<value>非対応</value>
<comment>review</comment>
@@ -1005,6 +1117,10 @@
<value>オンのときとオフのときがあります</value>
<comment>review</comment>
</data>
<data name="AdvToken_os_queue" xml:space="preserve">
<value>OS の描画キュー</value>
<comment>review</comment>
</data>
<data name="AdvToken_pci" xml:space="preserve">
<value>PCI</value>
<comment>review</comment>
@@ -1013,6 +1129,14 @@
<value>PCI Express</value>
<comment>review</comment>
</data>
<data name="AdvToken_present" xml:space="preserve">
<value>プレゼント</value>
<comment>review</comment>
</data>
<data name="AdvToken_render_submit" xml:space="preserve">
<value>描画コマンドの送信</value>
<comment>review</comment>
</data>
<data name="AdvToken_rtx_new_feature" xml:space="preserve">
<value>RTX 新機能ブランチ</value>
<comment>review</comment>
@@ -1025,6 +1149,10 @@
<value>scRGB (リニア)</value>
<comment>review</comment>
</data>
<data name="AdvToken_simulation" xml:space="preserve">
<value>シミュレーション</value>
<comment>review</comment>
</data>
<data name="AdvToken_srgb" xml:space="preserve">
<value>sRGB</value>
<comment>review</comment>
@@ -1033,6 +1161,10 @@
<value>Studio</value>
<comment>review</comment>
</data>
<data name="AdvToken_total" xml:space="preserve">
<value>合計 (シミュレーション開始から GPU 描画終了まで)</value>
<comment>review</comment>
</data>
<data name="AdvToken_ulmb" xml:space="preserve">
<value>ULMB</value>
<comment>review</comment>
@@ -1438,7 +1570,7 @@
<comment>review</comment>
</data>
<data name="Settings_Advanced_Body" xml:space="preserve">
<value>セッション中にグラフィックス ドライバーとハードウェア センサーからさらに多くを読み取り、セッションと一緒に保存します - グラフィックス カードのメモリと負荷の詳細、各ファンと電圧、ディスプレイの対応機能、ゲームに対するドライバーの設定など。FrameLedger が内部から計測するゲームでは、ゲームが DLSS と FSR に渡す内容 (サイズ、プリセット、シャープニング、露出) も読み取ります - カメラの位置は決して読み取りません。オフ: ゲーム内も含め、追加の読み取りも保存も行いません。次のセッションから適用され、オフの間に記録したセッションが後から補われることはありません。</value>
<value>セッション中にグラフィックス ドライバーとハードウェア センサーからさらに多くを読み取り、セッションと一緒に保存します - グラフィックス カードのメモリと負荷の詳細、各ファンと電圧、ディスプレイの対応機能、ゲームに対するドライバーの設定など。FrameLedger が内部から計測するゲームでは、ゲームが DLSS、Streamline、FSR に渡す内容 (サイズ、プリセット、シャープニング、露出、深度範囲、フレーム生成の設定) も読み取ります - カメラの位置は決して読み取りません。NVIDIA のカードで、NVIDIA のライブラリを使用する Direct3D 12 のゲームでは、フレームの各段階にかかった時間を、FrameLedger がゲーム内から約 1 秒に 1 回グラフィックス ドライバーに問い合わせます - これは、ゲームのフレームを表示するスレッド上で FrameLedger 自身が行う呼び出しです。オフ: ゲーム内も含め、追加の読み取りも保存も行いません。次のセッションから適用され、オフの間に記録したセッションが後から補われることはありません。</value>
<comment>review</comment>
</data>
<data name="Settings_Advanced_Label" xml:space="preserve">
+100 -1
View File
@@ -423,6 +423,12 @@
<data name="Adv_sl_feature_requirements" xml:space="preserve">
<value>What each Streamline feature requires: operating system, driver, buffers</value>
</data>
<data name="Adv_sl_feature_lifecycle" xml:space="preserve">
<value>Each feature switched on or off, its resources allocated and freed, Streamline shut down</value>
</data>
<data name="Adv_sl_feature_support" xml:space="preserve">
<value>Whether Streamline says each feature is supported, and loaded</value>
</data>
<data name="Adv_sl_feature_versions" xml:space="preserve">
<value>Each Streamline feature's version and its NGX model version</value>
</data>
@@ -495,6 +501,18 @@
<data name="Advanced_Header" xml:space="preserve">
<value>Advanced metrics</value>
</data>
<data name="Advanced_InGameCallsLine" xml:space="preserve">
<value>What the game tells Streamline each frame: {0}. How it configures FSR frame generation: {1}.</value>
</data>
<data name="Advanced_InGameDriverLine" xml:space="preserve">
<value>NVIDIA's latency report, which FrameLedger asks the graphics driver for inside the game: {0}.</value>
</data>
<data name="Advanced_InGameFeatureCallsLine" xml:space="preserve">
<value>Which version each Streamline feature is: {0}. What each requires: {1}.</value>
</data>
<data name="Advanced_InGameMoreCallsLine" xml:space="preserve">
<value>Streamline's other calls - read: {0}; hooked, the game did not make the call: {1}; not hooked: {2}.</value>
</data>
<data name="Advanced_InGameLine" xml:space="preserve">
<value>Inside the game: {0}.</value>
</data>
@@ -558,6 +576,9 @@
<data name="Advanced_Status_InGame" xml:space="preserve">
<value>Read inside a game FrameLedger measures, when the game makes the call</value>
</data>
<data name="Advanced_Status_InGameDriver" xml:space="preserve">
<value>Read inside a game FrameLedger measures, from the graphics driver: FrameLedger asks for it about once a second</value>
</data>
<data name="Advanced_Status_Read" xml:space="preserve">
<value>Read</value>
</data>
@@ -576,6 +597,39 @@
<data name="Advanced_Tab_Sources" xml:space="preserve">
<value>Sources</value>
</data>
<data name="AdvDriverRead_Error" xml:space="preserve">
<value>the driver answered with an error</value>
</data>
<data name="AdvDriverRead_Faulted" xml:space="preserve">
<value>stopped until the game closed - a call into the driver faulted</value>
</data>
<data name="AdvDriverRead_NoDirect3D12" xml:space="preserve">
<value>not read - the game does not present through Direct3D 12</value>
</data>
<data name="AdvDriverRead_NoGetter" xml:space="preserve">
<value>not read - the library did not answer for the two functions</value>
</data>
<data name="AdvDriverRead_NoModule" xml:space="preserve">
<value>not read - the game has not loaded NVIDIA's nvapi64.dll, and FrameLedger never loads it</value>
</data>
<data name="AdvDriverRead_NothingReported" xml:space="preserve">
<value>asked, and the driver reported no frame - the game does not use NVIDIA Reflex</value>
</data>
<data name="AdvDriverRead_Read" xml:space="preserve">
<value>read</value>
</data>
<data name="AdvDriverRead_Refused" xml:space="preserve">
<value>not read - the nvapi64.dll in the game is in the game's own folder, not the driver's</value>
</data>
<data name="AdvDriverRead_Slow" xml:space="preserve">
<value>stopped until the game closed - a call into the driver took {0:N0} µs, and one of 2,000 µs or more is the last</value>
</data>
<data name="AdvDriverRead_Stalled" xml:space="preserve">
<value>stopped - a call into the driver did not return</value>
</data>
<data name="AdvDriverRead_Unknown" xml:space="preserve">
<value>not stated</value>
</data>
<data name="AdvGroup_Board" xml:space="preserve">
<value>Motherboard</value>
</data>
@@ -621,6 +675,21 @@
<data name="AdvInGame_Unknown" xml:space="preserve">
<value>not known</value>
</data>
<data name="AdvInGameCall_NeverCalled" xml:space="preserve">
<value>hooked - the game did not make the call</value>
</data>
<data name="AdvInGameCall_NotAskedAgain" xml:space="preserve">
<value>hooked - the game asks this while it starts, and did not ask again after FrameLedger attached</value>
</data>
<data name="AdvInGameCall_NotHooked" xml:space="preserve">
<value>not hooked - the game did not load the library that has the call</value>
</data>
<data name="AdvInGameCall_Read" xml:space="preserve">
<value>read</value>
</data>
<data name="AdvInGameCall_Unknown" xml:space="preserve">
<value>not known</value>
</data>
<data name="AdvReach_Deferred" xml:space="preserve">
<value>Not read in this release</value>
</data>
@@ -639,6 +708,9 @@
<data name="AdvReach_NewHook" xml:space="preserve">
<value>Inside the game, with a new hook - comes with a later release</value>
</data>
<data name="AdvReach_BeforeAttach" xml:space="preserve">
<value>Not read: the game makes this call once, before FrameLedger is inside it</value>
</data>
<data name="AdvReach_NotInHeaders" xml:space="preserve">
<value>Not offered by this interface</value>
</data>
@@ -648,6 +720,9 @@
<data name="AdvReach_Refused" xml:space="preserve">
<value>Not read: it would make the sensor library search every USB device</value>
</data>
<data name="AdvReach_RefusedRoute" xml:space="preserve">
<value>Not read: it would take a patch at an address found while the game runs, or a call the vendor forbids from outside the game's own threads - both refused</value>
</data>
<data name="AdvReach_Spike" xml:space="preserve">
<value>Being studied; not decided</value>
</data>
@@ -699,6 +774,9 @@
<data name="AdvToken_dolby_vision" xml:space="preserve">
<value>Dolby Vision</value>
</data>
<data name="AdvToken_driver" xml:space="preserve">
<value>driver</value>
</data>
<data name="AdvToken_driver_default" xml:space="preserve">
<value>Driver default</value>
</data>
@@ -714,6 +792,9 @@
<data name="AdvToken_game_ready" xml:space="preserve">
<value>Game Ready</value>
</data>
<data name="AdvToken_gpu_render" xml:space="preserve">
<value>GPU render</value>
</data>
<data name="AdvToken_gsync_module" xml:space="preserve">
<value>G-SYNC module</value>
</data>
@@ -747,6 +828,9 @@
<data name="AdvToken_not_a_number" xml:space="preserve">
<value>Not a number</value>
</data>
<data name="AdvToken_not_radians" xml:space="preserve">
<value>Not radians: the value is larger than π. The game probably gives degrees.</value>
</data>
<data name="AdvToken_not_supported" xml:space="preserve">
<value>Not supported</value>
</data>
@@ -759,12 +843,21 @@
<data name="AdvToken_on_and_off" xml:space="preserve">
<value>On at times, off at others</value>
</data>
<data name="AdvToken_os_queue" xml:space="preserve">
<value>operating system's render queue</value>
</data>
<data name="AdvToken_pci" xml:space="preserve">
<value>PCI</value>
</data>
<data name="AdvToken_pci_express" xml:space="preserve">
<value>PCI Express</value>
</data>
<data name="AdvToken_present" xml:space="preserve">
<value>present</value>
</data>
<data name="AdvToken_render_submit" xml:space="preserve">
<value>render submit</value>
</data>
<data name="AdvToken_rtx_new_feature" xml:space="preserve">
<value>RTX new-feature branch</value>
</data>
@@ -774,12 +867,18 @@
<data name="AdvToken_scrgb_linear" xml:space="preserve">
<value>scRGB (linear)</value>
</data>
<data name="AdvToken_simulation" xml:space="preserve">
<value>simulation</value>
</data>
<data name="AdvToken_srgb" xml:space="preserve">
<value>sRGB</value>
</data>
<data name="AdvToken_studio" xml:space="preserve">
<value>Studio</value>
</data>
<data name="AdvToken_total" xml:space="preserve">
<value>total, simulation start to GPU render end</value>
</data>
<data name="AdvToken_ulmb" xml:space="preserve">
<value>ULMB</value>
</data>
@@ -1084,7 +1183,7 @@
<value>The agent did not answer the rules update.</value>
</data>
<data name="Settings_Advanced_Body" xml:space="preserve">
<value>Read 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, in a game FrameLedger measures from inside, what the game tells DLSS and FSR (sizes, presets, sharpening, exposure - never where the camera is). All of it is stored with the session. Off: nothing more is read or stored, inside a game either. It applies from the next session, and a session recorded while it was off is not filled in later.</value>
<value>Read 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, in a game FrameLedger measures from inside, what the game tells DLSS, Streamline and FSR (sizes, presets, sharpening, exposure, the depth range, how frame generation is configured - never where the camera is). On an NVIDIA card, in a Direct3D 12 game that uses NVIDIA's own library, FrameLedger also asks the graphics driver about once a second, from inside the game, how long each stage of a frame took - a call it makes itself on the thread that shows the game's frames. All of it is stored with the session. Off: nothing more is read or stored, inside a game either. It applies from the next session, and a session recorded while it was off is not filled in later.</value>
</data>
<data name="Settings_Advanced_Label" xml:space="preserve">
<value>Advanced metrics</value>
+100 -1
View File
@@ -418,6 +418,12 @@
<data name="Adv_sl_feature_requirements" xml:space="preserve">
<value>Yêu cầu của từng tính năng Streamline: hệ điều hành, driver, bộ đệm</value>
</data>
<data name="Adv_sl_feature_lifecycle" xml:space="preserve">
<value>Từng tính năng được bật hay tắt, tài nguyên được cấp và giải phóng, Streamline bị đóng</value>
</data>
<data name="Adv_sl_feature_support" xml:space="preserve">
<value>Streamline nói từng tính năng có được hỗ trợ không, và có đang nạp không</value>
</data>
<data name="Adv_sl_feature_versions" xml:space="preserve">
<value>Phiên bản từng tính năng Streamline và phiên bản mô hình NGX của nó</value>
</data>
@@ -490,6 +496,18 @@
<data name="Advanced_Header" xml:space="preserve">
<value>Thông số nâng cao</value>
</data>
<data name="Advanced_InGameCallsLine" xml:space="preserve">
<value>Những gì game báo cho Streamline mỗi khung hình: {0}. Cách game cấu hình frame generation của FSR: {1}.</value>
</data>
<data name="Advanced_InGameDriverLine" xml:space="preserve">
<value>Báo cáo độ trễ của NVIDIA, do FrameLedger hỏi driver đồ họa ngay bên trong game: {0}.</value>
</data>
<data name="Advanced_InGameFeatureCallsLine" xml:space="preserve">
<value>Mỗi tính năng Streamline là phiên bản nào: {0}. Mỗi tính năng cần gì: {1}.</value>
</data>
<data name="Advanced_InGameMoreCallsLine" xml:space="preserve">
<value>Các lời gọi khác của Streamline - đã đọc: {0}; đã hook, game không gọi: {1}; chưa hook: {2}.</value>
</data>
<data name="Advanced_InGameLine" xml:space="preserve">
<value>Bên trong game: {0}.</value>
</data>
@@ -553,6 +571,9 @@
<data name="Advanced_Status_InGame" xml:space="preserve">
<value>Được đọc bên trong game mà FrameLedger đo, khi game thực hiện lời gọi đó</value>
</data>
<data name="Advanced_Status_InGameDriver" xml:space="preserve">
<value>Được đọc bên trong game mà FrameLedger đo, từ driver đồ họa: FrameLedger hỏi khoảng mỗi giây một lần</value>
</data>
<data name="Advanced_Status_Read" xml:space="preserve">
<value>Đang đọc</value>
</data>
@@ -571,6 +592,39 @@
<data name="Advanced_Tab_Sources" xml:space="preserve">
<value>Nguồn</value>
</data>
<data name="AdvDriverRead_Error" xml:space="preserve">
<value>driver trả về lỗi</value>
</data>
<data name="AdvDriverRead_Faulted" xml:space="preserve">
<value>đã dừng cho tới khi đóng game - một lời gọi vào driver gặp lỗi (fault)</value>
</data>
<data name="AdvDriverRead_NoDirect3D12" xml:space="preserve">
<value>không đọc - game không hiển thị qua Direct3D 12</value>
</data>
<data name="AdvDriverRead_NoGetter" xml:space="preserve">
<value>không đọc - thư viện không trả về hai hàm cần gọi</value>
</data>
<data name="AdvDriverRead_NoModule" xml:space="preserve">
<value>không đọc - game chưa nạp nvapi64.dll của NVIDIA, và FrameLedger không bao giờ nạp nó</value>
</data>
<data name="AdvDriverRead_NothingReported" xml:space="preserve">
<value>đã hỏi, driver không báo khung hình nào - game không dùng NVIDIA Reflex</value>
</data>
<data name="AdvDriverRead_Read" xml:space="preserve">
<value>đã đọc</value>
</data>
<data name="AdvDriverRead_Refused" xml:space="preserve">
<value>không đọc - nvapi64.dll trong game nằm ở chính thư mục của game, không phải của driver</value>
</data>
<data name="AdvDriverRead_Slow" xml:space="preserve">
<value>đã dừng cho tới khi đóng game - một lời gọi vào driver mất {0:N0} µs, và lời gọi từ 2.000 µs trở lên là lời gọi cuối</value>
</data>
<data name="AdvDriverRead_Stalled" xml:space="preserve">
<value>đã dừng - một lời gọi vào driver không trả về</value>
</data>
<data name="AdvDriverRead_Unknown" xml:space="preserve">
<value>không được ghi</value>
</data>
<data name="AdvGroup_Board" xml:space="preserve">
<value>Bo mạch chủ</value>
</data>
@@ -616,6 +670,21 @@
<data name="AdvInGame_Unknown" xml:space="preserve">
<value>không rõ</value>
</data>
<data name="AdvInGameCall_NeverCalled" xml:space="preserve">
<value>đã hook - game không thực hiện lời gọi</value>
</data>
<data name="AdvInGameCall_NotAskedAgain" xml:space="preserve">
<value>đã hook - game hỏi điều này lúc khởi động và không hỏi lại sau khi FrameLedger gắn vào</value>
</data>
<data name="AdvInGameCall_NotHooked" xml:space="preserve">
<value>chưa hook - game không nạp thư viện chứa lời gọi này</value>
</data>
<data name="AdvInGameCall_Read" xml:space="preserve">
<value>đã đọc</value>
</data>
<data name="AdvInGameCall_Unknown" xml:space="preserve">
<value>không rõ</value>
</data>
<data name="AdvReach_Deferred" xml:space="preserve">
<value>Không đọc trong bản phát hành này</value>
</data>
@@ -634,6 +703,9 @@
<data name="AdvReach_NewHook" xml:space="preserve">
<value>Bên trong game, cần hook mới - sẽ có ở bản phát hành sau</value>
</data>
<data name="AdvReach_BeforeAttach" xml:space="preserve">
<value>Không đọc: game gọi lời gọi này một lần, trước khi FrameLedger vào trong game</value>
</data>
<data name="AdvReach_NotInHeaders" xml:space="preserve">
<value>Giao diện này không cung cấp</value>
</data>
@@ -643,6 +715,9 @@
<data name="AdvReach_Refused" xml:space="preserve">
<value>Không đọc: việc này khiến thư viện cảm biến dò mọi thiết bị USB</value>
</data>
<data name="AdvReach_RefusedRoute" xml:space="preserve">
<value>Không đọc: việc đó cần vá mã tại một địa chỉ chỉ tìm được khi game đang chạy, hoặc một lời gọi mà nhà cung cấp cấm thực hiện từ ngoài luồng của game - cả hai đều bị từ chối</value>
</data>
<data name="AdvReach_Spike" xml:space="preserve">
<value>Đang nghiên cứu; chưa quyết định</value>
</data>
@@ -694,6 +769,9 @@
<data name="AdvToken_dolby_vision" xml:space="preserve">
<value>Dolby Vision</value>
</data>
<data name="AdvToken_driver" xml:space="preserve">
<value>driver</value>
</data>
<data name="AdvToken_driver_default" xml:space="preserve">
<value>Mặc định của driver</value>
</data>
@@ -709,6 +787,9 @@
<data name="AdvToken_game_ready" xml:space="preserve">
<value>Game Ready</value>
</data>
<data name="AdvToken_gpu_render" xml:space="preserve">
<value>GPU vẽ</value>
</data>
<data name="AdvToken_gsync_module" xml:space="preserve">
<value>Mô-đun G-SYNC</value>
</data>
@@ -742,6 +823,9 @@
<data name="AdvToken_not_a_number" xml:space="preserve">
<value>Không phải số</value>
</data>
<data name="AdvToken_not_radians" xml:space="preserve">
<value>Không phải radian: giá trị lớn hơn π. Có lẽ game đưa giá trị bằng độ.</value>
</data>
<data name="AdvToken_not_supported" xml:space="preserve">
<value>Không hỗ trợ</value>
</data>
@@ -754,12 +838,21 @@
<data name="AdvToken_on_and_off" xml:space="preserve">
<value>Lúc bật, lúc tắt</value>
</data>
<data name="AdvToken_os_queue" xml:space="preserve">
<value>hàng đợi vẽ của hệ điều hành</value>
</data>
<data name="AdvToken_pci" xml:space="preserve">
<value>PCI</value>
</data>
<data name="AdvToken_pci_express" xml:space="preserve">
<value>PCI Express</value>
</data>
<data name="AdvToken_present" xml:space="preserve">
<value>present</value>
</data>
<data name="AdvToken_render_submit" xml:space="preserve">
<value>gửi lệnh vẽ</value>
</data>
<data name="AdvToken_rtx_new_feature" xml:space="preserve">
<value>Nhánh RTX tính năng mới</value>
</data>
@@ -769,12 +862,18 @@
<data name="AdvToken_scrgb_linear" xml:space="preserve">
<value>scRGB (tuyến tính)</value>
</data>
<data name="AdvToken_simulation" xml:space="preserve">
<value>mô phỏng</value>
</data>
<data name="AdvToken_srgb" xml:space="preserve">
<value>sRGB</value>
</data>
<data name="AdvToken_studio" xml:space="preserve">
<value>Studio</value>
</data>
<data name="AdvToken_total" xml:space="preserve">
<value>tổng, từ đầu mô phỏng tới khi GPU vẽ xong</value>
</data>
<data name="AdvToken_ulmb" xml:space="preserve">
<value>ULMB</value>
</data>
@@ -1079,7 +1178,7 @@
<value>Agent không phản hồi yêu cầu cập nhật quy tắc.</value>
</data>
<data name="Settings_Advanced_Body" xml:space="preserve">
<value>Đọc thêm từ driver đồ hoạ và các cảm biến phần cứng trong lúc ghi phiên - bộ nhớ và tải của card đồ hoạ ở mức chi tiết, từng quạt và điện áp, khả năng của màn hình, thiết lập của driver cho game - và, với game mà FrameLedger đo từ bên trong, những gì game đưa cho DLSS và FSR (kích thước, preset, làm nét, phơi sáng - không bao giờ là vị trí camera). Tất cả được lưu cùng phiên. Tắt: không đọc và không lưu thêm gì, kể cả bên trong game. Áp dụng từ phiên kế tiếp; phiên đã ghi lúc tắt sẽ không được bổ sung về sau.</value>
<value>Đọc thêm từ driver đồ hoạ và các cảm biến phần cứng trong lúc ghi phiên - bộ nhớ và tải của card đồ hoạ ở mức chi tiết, từng quạt và điện áp, khả năng của màn hình, thiết lập của driver cho game - và, với game mà FrameLedger đo từ bên trong, những gì game đưa cho DLSS, Streamline và FSR (kích thước, preset, làm nét, phơi sáng, khoảng độ sâu, cách cấu hình frame generation - không bao giờ là vị trí camera). Với card NVIDIA, trong game Direct3D 12 có dùng thư viện của NVIDIA, FrameLedger còn hỏi driver đồ hoạ khoảng mỗi giây một lần, ngay bên trong game, xem từng chặng của một khung hình mất bao lâu - đây là lời gọi do chính FrameLedger thực hiện trên luồng hiển thị khung hình của game. Tất cả được lưu cùng phiên. Tắt: không đọc và không lưu thêm gì, kể cả bên trong game. Áp dụng từ phiên kế tiếp; phiên đã ghi lúc tắt sẽ không được bổ sung về sau.</value>
</data>
<data name="Settings_Advanced_Label" xml:space="preserve">
<value>Thông số nâng cao</value>
@@ -50,9 +50,29 @@ public static class AdvancedLabels
/// <summary>What became, in one session, of the entries read inside the game (0.1.0-beta.40).</summary>
public static string InGame(AdvancedInGameStatus status) => Lookup("AdvInGame_" + status) ?? status.ToString();
/// <summary>What became of one call hooked only for Advanced metrics, in a session (0.1.0-beta.43).</summary>
public static string InGameCall(AdvancedInGameCall call) => Lookup("AdvInGameCall_" + call) ?? call.ToString();
/// <summary>
/// The same for a call a game makes while it starts (0.1.0-beta.44): hooked and not seen is then "the game did not
/// ask again after FrameLedger attached" - the usual case, and not a finding about the game.
/// </summary>
public static string InGameStartupCall(AdvancedInGameCall call) =>
call == AdvancedInGameCall.NeverCalled ? Strings.AdvInGameCall_NotAskedAgain : InGameCall(call);
/// <summary>A token the driver's answer was mapped to; the token itself where this build has no word for it.</summary>
public static string Token(string token) => Lookup("AdvToken_" + token) ?? token;
/// <summary>
/// What became of the driver's latency report in a session, in words. A read stopped for being slow says how
/// slow: <paramref name="slowestUs"/> is the session's slowest call into the driver, in microseconds.
/// </summary>
public static string DriverRead(AdvancedDriverRead read, int? slowestUs)
{
string text = Lookup("AdvDriverRead_" + read) ?? read.ToString();
return read == AdvancedDriverRead.Slow ? string.Format(CultureInfo.CurrentCulture, text, slowestUs ?? 0) : text;
}
/// <summary>A number in its unit. A flag is yes or no; a count has no unit.</summary>
public static string Number(double value, AdvancedUnit unit)
{
@@ -90,7 +90,9 @@ public static class AdvancedPresenter
}
}
return owner is null ? (null, series) : (owner, AdvancedLabels.Member(AdvancedLabels.Of(owner), id[(owner.Id.Length + 1)..]));
// The member's own name, translated where it is one of ours (the spans of the driver's latency report) and
// shown as it is where it is the hardware's.
return owner is null ? (null, series) : (owner, AdvancedLabels.Member(AdvancedLabels.Of(owner), AdvancedLabels.Token(id[(owner.Id.Length + 1)..])));
}
/// <summary>Every series as it reads now, in the catalog's order: its value in its unit and the time it was read at.</summary>
@@ -188,9 +190,83 @@ public static class AdvancedPresenter
// A session's row also says what became of the entries read inside the game; the machine's live state and a
// row stored before 0.1.0-beta.40 do not, and then the sentence is not there.
return sources.InGame is { } inGame
? line + " " + string.Format(CultureInfo.CurrentCulture, Strings.Advanced_InGameLine, AdvancedLabels.InGame(inGame))
: line;
if (sources.InGame is { } inGame)
{
line += " " + string.Format(CultureInfo.CurrentCulture, Strings.Advanced_InGameLine, AdvancedLabels.InGame(inGame));
}
// The two calls hooked only for Advanced metrics (0.1.0-beta.43): for each, whether it was read, hooked and
// never made, or not hooked - so that "nothing here" says which of the two it is. A row stored before, and a
// session not measured inside the game, carry neither.
if (sources.StreamlineConstants is { } streamline && sources.FsrFrameGeneration is { } frameGeneration)
{
line += " " + string.Format(
CultureInfo.CurrentCulture,
Strings.Advanced_InGameCallsLine,
AdvancedLabels.InGameCall(streamline),
AdvancedLabels.InGameCall(frameGeneration));
}
// The two questions about a feature (0.1.0-beta.44), worded for calls a game makes while it starts. A row
// stored before carries neither.
if (sources.StreamlineFeatureVersion is { } version && sources.StreamlineFeatureRequirements is { } requirements)
{
line += " " + string.Format(
CultureInfo.CurrentCulture,
Strings.Advanced_InGameFeatureCallsLine,
AdvancedLabels.InGameStartupCall(version),
AdvancedLabels.InGameStartupCall(requirements));
}
// The six calls of 0.1.0-beta.45, in one sentence: each by its own name, under which of the three things
// happened to it. A row stored before carries none of the six.
if (MoreCalls(sources) is { } more)
{
line += " " + more;
}
// The driver's latency report (train C): not one of the game's calls, so a sentence of its own - what became
// of the read FrameLedger makes itself, with the microseconds when it was stopped for being slow. A row
// stored before, and a session that says nothing about it, do not carry it.
if (sources.DriverLatency is { } driver && driver != AdvancedDriverRead.Unknown)
{
line += " " + string.Format(
CultureInfo.CurrentCulture,
Strings.Advanced_InGameDriverLine,
AdvancedLabels.DriverRead(driver, sources.DriverLatencySlowestUs));
}
return line;
}
private static string? MoreCalls(AdvancedSources sources)
{
(string Name, AdvancedInGameCall? State)[] calls =
[
("slIsFeatureSupported", sources.StreamlineFeatureSupported),
("slIsFeatureLoaded", sources.StreamlineFeatureLoaded),
("slSetFeatureLoaded", sources.StreamlineSetFeatureLoaded),
("slAllocateResources", sources.StreamlineAllocateResources),
("slFreeResources", sources.StreamlineFreeResources),
("slShutdown", sources.StreamlineShutdown),
];
if (calls.Any(static c => c.State is null))
{
return null;
}
string Names(AdvancedInGameCall state)
{
string[] names = [.. calls.Where(c => c.State == state).Select(static c => c.Name)];
return names.Length == 0 ? AdvancedLabels.Token("none") : string.Join(", ", names);
}
return string.Format(
CultureInfo.CurrentCulture,
Strings.Advanced_InGameMoreCallsLine,
Names(AdvancedInGameCall.Read),
Names(AdvancedInGameCall.NeverCalled),
Names(AdvancedInGameCall.NotHooked));
}
private static string StatusOf(AdvancedMetric metric, AdvancedSources? now)
@@ -206,6 +282,12 @@ public static class AdvancedPresenter
return Strings.Advanced_Status_InGame;
}
if (metric.Reach == AdvancedReach.GameDriver)
{
// Nor this: read inside a game being measured, by a call FrameLedger makes into the driver itself.
return Strings.Advanced_Status_InGameDriver;
}
AdvancedSourceStatus? state = now is null ? null : (metric.Source, metric.Reach) switch
{
(AdvancedSource.Nvapi, _) => now.Nvapi,
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Advanced;
/// <summary>
/// What became, in one session, of the one thing FrameLedger reads inside a game that is not an argument of a call
/// it hooks: the graphics driver's latency report, which the part inside the game asks NVIDIA's driver for itself,
/// about once a second (Advanced metrics train C; owner decisions D132, D136, D138-D141; the entries of reach
/// <see cref="AdvancedReach.GameDriver"/>). Beside <see cref="AdvancedInGameCall"/> because the reasons a value is
/// absent are different ones: there is no hook to be in or out, and there is a driver that can refuse.
/// </summary>
public enum AdvancedDriverRead
{
/// <summary>Not stated: a row stored before this existed, or a session the part inside the game said nothing about.</summary>
Unknown = 0,
/// <summary>The driver was asked and reported frames.</summary>
Read = 1,
/// <summary>The driver was asked and reported no frame: the game does not use NVIDIA Reflex.</summary>
NothingReported = 2,
/// <summary>The game does not present through Direct3D 12, the one interface this is read on.</summary>
NoDirect3D12 = 3,
/// <summary>The game has not loaded NVIDIA's <c>nvapi64.dll</c>, and FrameLedger never loads it.</summary>
NoModule = 4,
/// <summary>The <c>nvapi64.dll</c> in the game sits in the game's own folder: a replacement, not the driver's (D140).</summary>
Refused = 5,
/// <summary>The module did not answer for the two functions.</summary>
NoGetter = 6,
/// <summary>The driver answered every read with an error.</summary>
Error = 7,
/// <summary>One call took two milliseconds or more: the read was switched off until the game exited (D141).</summary>
Slow = 8,
/// <summary>A call into the driver faulted: the read was switched off until the game exited.</summary>
Faulted = 9,
/// <summary>A call into the driver did not return.</summary>
Stalled = 10,
}
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Advanced;
/// <summary>
/// What became, in one session, of the entries read from ONE call that FrameLedger hooks only for Advanced metrics
/// (0.1.0-beta.43: <c>slSetConstants</c>, <c>ffxConfigure</c>). Beside <see cref="AdvancedInGameStatus"/>, which
/// speaks for the session as a whole, this tells "the hook was in and the game never made the call" from "the hook
/// was not in" - two different reasons a value is absent, and only the first says something about the game.
/// </summary>
public enum AdvancedInGameCall
{
/// <summary>Not stated: a row stored before 0.1.0-beta.43.</summary>
Unknown = 0,
/// <summary>The game made the call and what it passed was read.</summary>
Read = 1,
/// <summary>The hook was in for the session and the game did not make the call where it could be seen.</summary>
NeverCalled = 2,
/// <summary>
/// The hook was not in: the game did not load the library that exports the call (it does not use Streamline, or
/// FSR through AMD's libraries), or the library is of a generation FrameLedger does not read.
/// </summary>
NotHooked = 3,
}
@@ -37,7 +37,7 @@ public sealed record AdvancedMetric(
public bool IsFamily { get; init; }
/// <summary>True when a build with the option on reads it: every other reach is a reason it reads N/A.</summary>
public bool IsRead => Reach is AdvancedReach.Agent or AdvancedReach.AgentElevated or AdvancedReach.Game;
public bool IsRead => Reach is AdvancedReach.Agent or AdvancedReach.AgentElevated or AdvancedReach.Game or AdvancedReach.GameDriver;
/// <summary>The name of its series in <c>sensor_blobs</c> — for a family, the stem of its instances' names; null when it is not a series.</summary>
public string? SeriesName => Scope == AdvancedScope.Series ? SeriesPrefix + Id : null;
@@ -162,22 +162,35 @@ public static class AdvancedMetricCatalog
Sampled("ffx.upscale.frame_time_delta", FidelityFx, Game, Milliseconds, Upscaling, "The frame time the game reported to FSR"),
Sampled("ffx.memory_usage", FidelityFx, Game, Mebibytes, Upscaling, "FSR's own video memory, when the game asks it"),
// ---- Inside the game: hooks that are not built ----------------------------------------------------------
Session("sl.constants.jitter", Streamline, NewHook, Text, Upscaling, "The jitter offsets the game gave Streamline"),
Session("sl.constants.motion_vectors", Streamline, NewHook, Text, Upscaling, "Motion-vector scale, and whether they are 3D, dilated, jittered"),
Session("sl.constants.depth", Streamline, NewHook, Text, Upscaling, "Near and far planes, and whether depth is inverted"),
Session("sl.constants.projection", Streamline, NewHook, Text, Upscaling, "Field of view, aspect ratio, orthographic or not"),
Session("sl.constants.resets", Streamline, NewHook, Count, Upscaling, "How often the game reset the upscaler's history"),
Session("sl.feature.versions", Streamline, NewHook, Table, Upscaling, "Each Streamline feature's version and its NGX model version"),
Session("sl.feature.requirements", Streamline, NewHook, Table, Upscaling, "What each Streamline feature requires: operating system, driver, buffers"),
Session("sl.init.preferences", Streamline, NewHook, Text, Upscaling, "The preferences the game started Streamline with"),
Session("ffx.framegen.config", FidelityFx, NewHook, Text, FrameGeneration, "The game's FSR frame-generation configuration"),
// ---- Inside the game: two hooks of their own (0.1.0-beta.43), installed only where Advanced metrics was asked for
Session("sl.constants.jitter", Streamline, Game, Table, Upscaling, "The jitter offsets the game gave Streamline"),
Session("sl.constants.motion_vectors", Streamline, Game, Table, Upscaling, "Motion-vector scale, and whether they are 3D, dilated, jittered"),
Session("sl.constants.depth", Streamline, Game, Table, Upscaling, "Near and far planes, and whether depth is inverted"),
Session("sl.constants.projection", Streamline, Game, Table, Upscaling, "Field of view, aspect ratio, orthographic or not"),
Session("sl.constants.resets", Streamline, Game, Count, Upscaling, "How often the game reset the upscaler's history"),
Session("ffx.framegen.config", FidelityFx, Game, Table, FrameGeneration, "The game's FSR frame-generation configuration"),
// ---- Inside the game: two more hooks of their own (0.1.0-beta.44) - what Streamline answers about a feature
Session("sl.feature.versions", Streamline, Game, Table, Upscaling, "Each Streamline feature's version and its NGX model version"),
Session("sl.feature.requirements", Streamline, Game, Table, Upscaling, "What each Streamline feature requires: operating system, driver, buffers"),
// ---- Inside the game: six more hooks of their own (0.1.0-beta.45) - a feature's support, and what the game does with it
Session("sl.feature.support", Streamline, Game, Table, Upscaling, "Whether Streamline says each feature is supported, and loaded"),
Session("sl.feature.lifecycle", Streamline, Game, Table, Upscaling, "Each feature switched on or off, its resources allocated and freed, Streamline shut down"),
// ---- Inside the game: a call no hook can see (owner decision D129) ------------------------------------------
Session("sl.init.preferences", Streamline, BeforeAttach, Text, Upscaling, "The preferences the game started Streamline with"),
Session("sl.constants.camera", Streamline, PlayerState, Text, Upscaling, "Camera position, axes and matrices"),
// ---- Inside the game: what the driver reports, asked for by the part inside the game itself (train C) ------
// Not an argument of a hooked call: two read-only getters of the driver, about once a second (D132, D136).
// What the GAME asked of Reflex - the mode, boost, the limit - is an argument of a function that is not an
// export: reading it needs a patch at an address learned at run time, the class refused on 2026-08-09.
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"),
// ---- Inside the game: routes a spike decides ------------------------------------------------------------
Session("nvapi.reflex.mode", Nvapi, Spike, Text, Latency, "Reflex: low-latency mode, boost, the frame-rate limit"),
Session("nvapi.reflex.sleep_status", Nvapi, Spike, Text, Latency, "What the driver's low-latency state is"),
SampledFamily("nvapi.reflex.frame_report", Nvapi, Spike, Microseconds, Latency, "Latency per frame: simulation, render submit, present, driver, OS queue, GPU render"),
Session("sl.dlss.optimal_settings", Streamline, Spike, Text, Upscaling, "The render size and sharpness DLSS recommends"),
Sampled("sl.dlss.vram_estimate", Streamline, Spike, Mebibytes, Upscaling, "DLSS's own estimate of its video memory"),
Session("sl.dlssg.options", Streamline, Spike, Text, FrameGeneration, "DLSS frame generation: mode, frames to generate"),
@@ -187,7 +200,9 @@ public static class AdvancedMetricCatalog
Session("sl.dlssd.options", Streamline, Spike, Text, Upscaling, "Ray reconstruction's options"),
Session("sl.nis.options", Streamline, Spike, Text, Upscaling, "NVIDIA Image Scaling's options"),
Session("sl.deepdvc.options", Streamline, Spike, Text, Upscaling, "RTX Dynamic Vibrance's options"),
Session("sl.reflex.state", Streamline, Spike, Table, Latency, "Reflex through Streamline: availability and its frame reports"),
// A refused route (owner decision D133): the Overlay calling slReflexGetState itself breaks the thread
// contract the vendor's header states.
Session("sl.reflex.state", Streamline, RefusedRoute, Table, Latency, "Reflex through Streamline: availability and its frame reports"),
Sampled("sl.pcl.markers", Streamline, Spike, Count, Latency, "PC-latency markers the game sets"),
// ---- Closed by a licence --------------------------------------------------------------------------------
@@ -22,7 +22,7 @@ public enum AdvancedReach
/// <summary>An argument of a call the Overlay already hooks; not read yet.</summary>
HookedCall = 3,
/// <summary>Needs a hook on a function its module exports; the hook is not built.</summary>
/// <summary>Needs a hook on a function its module exports; the hook is not built. No entry carries it since 0.1.0-beta.45.</summary>
NewHook = 4,
/// <summary>A route nobody has proven safe: a spike decides, and the owner says go or no.</summary>
@@ -51,4 +51,26 @@ public enum AdvancedReach
/// records Advanced metrics (train B, owner decision D111) — and only when the game makes that call.
/// </summary>
Game = 12,
/// <summary>
/// The game makes the call once, before FrameLedger is inside it: no shipped mode injects before a game's first
/// instruction, and no hook is ever installed on a game's thread. Never read (owner decision D129).
/// </summary>
BeforeAttach = 13,
/// <summary>
/// Read inside a game FrameLedger measures, while the session records Advanced metrics — but not from a call the
/// game makes: the part inside the game asks the graphics driver itself, about once a second, for what the driver
/// reports (Advanced metrics train C; owner decisions D132, D136, D138). Only where the game presents through
/// Direct3D 12 and had already loaded the driver's library; <see cref="AdvancedDriverRead"/> says what became of
/// it in a session.
/// </summary>
GameDriver = 14,
/// <summary>
/// Reading it needs a route the project refused, whatever the source: a patch at an address learned at run time
/// (what a game asks of Reflex is an argument of a function no module exports), or a call the vendor's own header
/// forbids from a thread that is not the game's (owner decision D133). Never read.
/// </summary>
RefusedRoute = 15,
}
@@ -22,6 +22,58 @@ public sealed record AdvancedSources(
/// </summary>
public AdvancedInGameStatus? InGame { get; init; }
/// <summary>
/// What became of what the game tells Streamline about each frame (<c>slSetConstants</c>, the
/// <c>sl.constants.</c> entries) in the session this describes (0.1.0-beta.43); null where that is not a
/// question - the machine's live state, a session not measured inside the game - and in every row stored before.
/// </summary>
public AdvancedInGameCall? StreamlineConstants { get; init; }
/// <summary>The same for how the game configures FSR frame generation (<c>ffxConfigure</c>, <c>ffx.framegen.config</c>).</summary>
public AdvancedInGameCall? FsrFrameGeneration { get; init; }
/// <summary>
/// The same for which version each Streamline feature is (<c>slGetFeatureVersion</c>, <c>sl.feature.versions</c>;
/// 0.1.0-beta.44). A game asks while it starts: <see cref="AdvancedInGameCall.NeverCalled"/> is what a session
/// attached after that says, and it means "not asked again", not "never asked".
/// </summary>
public AdvancedInGameCall? StreamlineFeatureVersion { get; init; }
/// <summary>The same for what each feature requires (<c>slGetFeatureRequirements</c>, <c>sl.feature.requirements</c>).</summary>
public AdvancedInGameCall? StreamlineFeatureRequirements { get; init; }
/// <summary>
/// The same for the six calls of 0.1.0-beta.45, one member a call: <c>slIsFeatureSupported</c> and
/// <c>slIsFeatureLoaded</c> (<c>sl.feature.support</c>), <c>slSetFeatureLoaded</c>, <c>slAllocateResources</c>,
/// <c>slFreeResources</c> and <c>slShutdown</c> (<c>sl.feature.lifecycle</c>). Null in every row stored before.
/// </summary>
public AdvancedInGameCall? StreamlineFeatureSupported { get; init; }
public AdvancedInGameCall? StreamlineFeatureLoaded { get; init; }
public AdvancedInGameCall? StreamlineSetFeatureLoaded { get; init; }
public AdvancedInGameCall? StreamlineAllocateResources { get; init; }
public AdvancedInGameCall? StreamlineFreeResources { get; init; }
public AdvancedInGameCall? StreamlineShutdown { get; init; }
/// <summary>
/// What became of the graphics driver's latency report (the <c>nvapi.reflex.</c> entries of reach
/// <see cref="AdvancedReach.GameDriver"/>) in the session this describes (train C). Null where that is not a
/// question - the machine's live state, a session not measured inside the game, a game the part inside it
/// publishes nothing for - and in every row stored before.
/// </summary>
public AdvancedDriverRead? DriverLatency { get; init; }
/// <summary>
/// The slowest call into the driver the session saw, in microseconds; null with <see cref="DriverLatency"/> and
/// where no call was made. It is what tells a driver that held a call from a pause of the game's thread when
/// <see cref="DriverLatency"/> is <see cref="AdvancedDriverRead.Slow"/>.
/// </summary>
public int? DriverLatencySlowestUs { get; init; }
/// <summary>Nothing asked yet.</summary>
public static AdvancedSources Unknown { get; } = new(AdvancedSourceStatus.Unknown, NvapiCode: null, AdvancedSourceStatus.Unknown, AdvancedSourceStatus.Unknown);
}
@@ -38,23 +38,73 @@ public sealed class InGameAdvancedSampler
/// <summary>FSR's own video memory as it answered the game, in mebibytes — a point for each second the game asked.</summary>
public const string MemorySeries = AdvancedMetric.SeriesPrefix + "ffx.memory_usage";
/// <summary>
/// The stem of the seven series of the driver's latency report (train C): <c>adv.nvapi.reflex.frame_report.</c>
/// and one of <see cref="LatencySpans"/>. Each point is the mean, in microseconds, of the frames one read summed.
/// </summary>
public const string LatencySeriesStem = AdvancedMetric.SeriesPrefix + "nvapi.reflex.frame_report.";
private const double _mebibyte = 1024.0 * 1024.0;
// 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"];
// 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"];
// What the second row of a field of view over pi says (owner decision D128).
private const string _notRadians = "not_radians";
private static readonly string[] _presetModes = ["DLAA", "Quality", "Balanced", "Performance", "Ultra Performance", "Ultra Quality"];
// FfxApiDispatchUpscaleFlags (ffx_upscale.h), by bit.
private static readonly string[] _flagTokens = ["draw_debug_view", "non_linear_color_srgb", "non_linear_color_pq"];
// sl::Result (sl_result.h), by value.
private static readonly string[] _results =
[
"eOk", "eErrorIO", "eErrorDriverOutOfDate", "eErrorOSOutOfDate", "eErrorOSDisabledHWS", "eErrorDeviceNotCreated",
"eErrorNoSupportedAdapterFound", "eErrorAdapterNotSupported", "eErrorNoPlugins", "eErrorVulkanAPI", "eErrorDXGIAPI",
"eErrorD3DAPI", "eErrorNRDAPI", "eErrorNVAPI", "eErrorReflexAPI", "eErrorNGXFailed", "eErrorJSONParsing",
"eErrorMissingProxy", "eErrorMissingResourceState", "eErrorInvalidIntegration", "eErrorMissingInputParameter",
"eErrorNotInitialized", "eErrorComputeFailed", "eErrorInitNotCalled", "eErrorExceptionHandler", "eErrorInvalidParameter",
"eErrorMissingConstants", "eErrorDuplicatedConstants", "eErrorMissingOrInvalidAPI", "eErrorCommonConstantsMissing",
"eErrorUnsupportedInterface", "eErrorFeatureMissing", "eErrorFeatureNotSupported", "eErrorFeatureMissingHooks",
"eErrorFeatureFailedToLoad", "eErrorFeatureWrongPriority", "eErrorFeatureMissingDependency",
"eErrorFeatureManagerInvalidState", "eErrorInvalidState", "eWarnOutOfVRAM",
];
// sl::FeatureRequirementFlags (sl_core_types.h), by bit: the vendor's own names, shown as they are.
private static readonly string[] _requirementFlags =
[
"eD3D11Supported", "eD3D12Supported", "eVulkanSupported", "eVSyncOffRequired", "eHardwareSchedulingRequired",
];
// FfxApiDispatchFramegenerationFlags (ffx_framegeneration.h), by bit: the vendor's own names, shown as they are.
private static readonly string[] _frameGenerationFlags =
[
"DRAW_DEBUG_TEAR_LINES", "DRAW_DEBUG_RESET_INDICATORS", "DRAW_DEBUG_VIEW", "NO_SWAPCHAIN_CONTEXT_NOTIFY", "DRAW_DEBUG_PACING_LINES",
];
/// <summary>
/// Every word a fact made here may carry for the App to translate (<c>AdvToken_*</c>): the three states of a
/// switch seen over a session, the flags of the dispatch that have a name, and "none". A flag bit nobody named
/// is <c>bit_N</c> and is shown as it is.
/// 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", .. _flagTokens];
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", _notRadians, .. _flagTokens, .. _latencySpans];
/// <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;
private InGameAdvanced? _last;
private FlLatencyState _latencyState;
private bool _latencyFrames;
private uint _latencySlowestUs;
private uint _memoryQueries;
private FactKey _key;
private uint _builtResets;
private FlAdvancedValid _everValid;
private uint _featureAnswers;
/// <summary>The session facts as of the last publication taken; empty until the game made a call they are read from.</summary>
public IReadOnlyList<AdvancedFact> Facts { get; private set; } = [];
@@ -66,6 +116,81 @@ public sealed class InGameAdvancedSampler
public AdvancedInGameStatus Status(bool hooked) =>
!hooked ? AdvancedInGameStatus.NotHooked : SawAnything ? AdvancedInGameStatus.Reading : AdvancedInGameStatus.NothingSeen;
/// <summary>
/// What became of the driver's latency report (train C), for a session measured inside the game: null when it
/// was not, and when the capture side said nothing about it - a game it publishes no Advanced metrics for.
/// "Reported frames" wins over an error or a stop that came later: the series are there up to it, and the
/// stops say themselves.
/// </summary>
public AdvancedDriverRead? DriverRead(bool hooked)
{
if (!hooked)
{
return null;
}
return _latencyState switch
{
FlLatencyState.NoDevice => AdvancedDriverRead.NoDirect3D12,
FlLatencyState.NoModule => AdvancedDriverRead.NoModule,
FlLatencyState.Refused => AdvancedDriverRead.Refused,
FlLatencyState.NoGetter => AdvancedDriverRead.NoGetter,
FlLatencyState.Reading => _latencyFrames ? AdvancedDriverRead.Read : AdvancedDriverRead.NothingReported,
FlLatencyState.Error => _latencyFrames ? AdvancedDriverRead.Read : AdvancedDriverRead.Error,
FlLatencyState.Slow => AdvancedDriverRead.Slow,
FlLatencyState.Faulted => AdvancedDriverRead.Faulted,
FlLatencyState.Stalled => AdvancedDriverRead.Stalled,
_ => null,
};
}
/// <summary>The slowest call into the driver the publications carried, in microseconds; null while none was made.</summary>
public int? DriverSlowestUs => _latencySlowestUs == 0 ? null : (int)_latencySlowestUs;
/// <summary>
/// What became of the entries read from one call hooked only for Advanced metrics (0.1.0-beta.43):
/// <paramref name="group"/> is the bit a publication carries once the call was read, <paramref name="hookedIn"/>
/// whether the capture side said its hook was in. Read wins over the hook's bit: a publication is the proof.
/// </summary>
public AdvancedInGameCall Call(FlAdvancedValid group, bool hookedIn) =>
(_everValid & group) != FlAdvancedValid.None ? AdvancedInGameCall.Read : hookedIn ? AdvancedInGameCall.NeverCalled : AdvancedInGameCall.NotHooked;
/// <summary>
/// The same for one of the two questions a game asks Streamline about a feature (0.1.0-beta.44; one bit of the
/// mask covers both, so the question is told by what the slots carry): <paramref name="question"/> is
/// <see cref="FlAdvancedState.FeatureVersionAnswered"/> or <see cref="FlAdvancedState.FeatureRequirementsAnswered"/>.
/// A game asks while it starts, so <see cref="AdvancedInGameCall.NeverCalled"/> here is the usual answer of a
/// session attached later, and the App words it that way. Since 0.1.0-beta.45 <paramref name="question"/> may be
/// any bits of a slot's word 1 that one call writes: the answer bit of <c>slIsFeatureSupported</c> or
/// <c>slIsFeatureLoaded</c>, the two switch bits of <c>slSetFeatureLoaded</c>, a count's four bits.
/// </summary>
public AdvancedInGameCall FeatureCall(uint question, bool hookedIn) =>
(_featureAnswers & question) != 0 ? AdvancedInGameCall.Read : hookedIn ? AdvancedInGameCall.NeverCalled : AdvancedInGameCall.NotHooked;
/// <summary>What a word 1 carries when the game switched a feature through <c>slSetFeatureLoaded</c>, either way.</summary>
public const uint FeatureSwitched = FlAdvancedState.FeatureSwitchedOff | FlAdvancedState.FeatureSwitchedOn;
/// <summary>The four bits of a word 1 that count <c>slAllocateResources</c> calls.</summary>
public const uint FeatureAllocated = FlAdvancedState.FeatureCountMask << FlAdvancedState.FeatureAllocShift;
/// <summary>The four bits of a word 1 that count <c>slFreeResources</c> calls.</summary>
public const uint FeatureFreed = FlAdvancedState.FeatureCountMask << FlAdvancedState.FeatureFreeShift;
/// <summary>
/// The session is ending: the facts are brought up to the last publication where they carry a COUNT. A count
/// is not part of what decides a rebuild while the session runs - it would rewrite the session's context every
/// second for a number that only matters at the end - so the one fact that is a count
/// (<c>sl.constants.resets</c>) is as of the last rebuild until this is called.
/// </summary>
public void Conclude()
{
if (_last is not null && Facts.Count != 0 && _last.State.SlResets != _builtResets)
{
Facts = Build(_last);
_builtResets = _last.State.SlResets;
}
}
/// <summary>
/// Takes a publication. Returns the readings it carries when it is one not taken before and it carries any;
/// null otherwise — nothing published, the same publication as last time, or a second in which the game neither
@@ -80,20 +205,35 @@ public sealed class InGameAdvancedSampler
_last = published;
ref readonly FlAdvancedState s = ref published.State;
// The driver's latency report first, and whatever the mask says: where that read stands is published even
// when nothing was read, and it is not one of "the game's calls".
List<AdvancedReading>? readings = TakeLatency(published);
if (s.ValidMask == FlAdvancedValid.None)
{
return null;
return readings;
}
// "The game's calls were read" is about the game's calls: the driver's report is not one of them.
SawAnything |= (s.ValidMask & ~FlAdvancedValid.Latency) != FlAdvancedValid.None;
_everValid |= s.ValidMask;
if (s.ValidMask.HasFlag(FlAdvancedValid.SlFeatures))
{
for (int slot = 0; slot < FlAdvancedState.FeatureSlots && s.FeatureWordAt(slot, 0) != 0; slot++)
{
_featureAnswers |= s.FeatureWordAt(slot, 1);
}
}
SawAnything = true;
FactKey key = FactKey.Of(published);
if (key != _key || Facts.Count == 0)
{
_key = key;
Facts = Build(published);
_builtResets = s.SlResets;
}
var readings = new List<AdvancedReading>(2);
readings ??= new List<AdvancedReading>(2);
// The pair is drained by each publication: the dispatches of the second before it. A sum that saturated its
// word is not a mean of anything.
if (s.ValidMask.HasFlag(FlAdvancedValid.FfxUpscale) && s.FfxFrameTimeCount != 0 && s.FfxFrameTimeSumUs != uint.MaxValue)
@@ -111,6 +251,39 @@ public sealed class InGameAdvancedSampler
return readings.Count == 0 ? null : readings;
}
// The ten latency words of a publication (07_IPC, region 5): the state and the slowest call are kept; the frames
// and the sums are of ONE read and become one point a span - the mean over the frames that read summed. A span
// some summed frame did not report has no point: without a sleep mode the driver reports no driver span at all.
private List<AdvancedReading>? TakeLatency(InGameAdvanced published)
{
ref readonly FlAdvancedState s = ref published.State;
var state = (FlLatencyState)(s.LatState & FlAdvancedState.LatStateMask);
if (state != FlLatencyState.None)
{
_latencyState = state;
}
_latencySlowestUs = Math.Max(_latencySlowestUs, s.LatReads >> 16);
uint frames = s.LatFrames & 0xFFFFu;
if (!s.ValidMask.HasFlag(FlAdvancedValid.Latency) || frames == 0)
{
return null;
}
_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);
for (int span = 0; span < sums.Length; span++)
{
if (sums[span] != FlAdvancedState.LatSumNone)
{
readings.Add(new AdvancedReading(LatencySeriesStem + _latencySpans[span], sums[span] / (double)frames));
}
}
return readings;
}
private static List<AdvancedFact> Build(InGameAdvanced published)
{
var facts = new List<AdvancedFact>(11);
@@ -124,9 +297,327 @@ public sealed class InGameAdvancedSampler
AddFfx(published, facts);
}
if (published.State.ValidMask.HasFlag(FlAdvancedValid.FfxFgConfig))
{
AddFrameGeneration(published, facts);
}
if (published.State.ValidMask.HasFlag(FlAdvancedValid.SlConstants))
{
AddStreamlineConstants(published, facts);
}
if (published.State.ValidMask.HasFlag(FlAdvancedValid.SlFeatures))
{
AddStreamlineFeatures(published, facts);
}
if ((published.State.ValidMask & (FlAdvancedValid.SlFeatures | FlAdvancedValid.SlShutdown)) != FlAdvancedValid.None)
{
AddStreamlineFeatureState(published, facts);
}
if (published.State.ValidMask.HasFlag(FlAdvancedValid.Latency))
{
AddDriverSleepStatus(published, facts);
}
return facts;
}
// 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,
// 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)
{
ref readonly FlAdvancedState s = ref published.State;
uint on = (s.LatState >> FlAdvancedState.LatSleepSeenOnShift) & FlAdvancedState.LatSleepBits;
uint off = (s.LatState >> FlAdvancedState.LatSleepSeenOffShift) & FlAdvancedState.LatSleepBits;
if ((on | off) == 0)
{
return; // the report was read and the status never was
}
var rows = new List<AdvancedRow>(_sleepSwitches.Length + 1);
for (int bit = 0; bit < _sleepSwitches.Length; bit++)
{
// Bit 0 seen off, bit 1 seen on: the two bits AddSwitch reads.
AddSwitch(rows, _sleepSwitches[bit], ((off >> bit) & 1u) | (((on >> bit) & 1u) << 1));
}
uint multiplier = s.LatState >> FlAdvancedState.LatFgMultiplierShift;
if (multiplier != 0)
{
rows.Add(new AdvancedRow("fgMultiplier", multiplier.ToString(CultureInfo.InvariantCulture)));
}
facts.Add(Fact("nvapi.reflex.sleep_status", AdvancedValue.OfRows(rows)));
}
// 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.
private static void AddStreamlineFeatureState(InGameAdvanced published, List<AdvancedFact> facts)
{
ref readonly FlAdvancedState s = ref published.State;
var support = new List<AdvancedRow>(8);
var lifecycle = new List<AdvancedRow>(8);
for (int slot = 0; slot < FlAdvancedState.FeatureSlots && s.ValidMask.HasFlag(FlAdvancedValid.SlFeatures); slot++)
{
uint id = s.FeatureWordAt(slot, 0);
if (id == 0)
{
break;
}
string feature = FeatureName(id - 1);
uint word = s.FeatureWordAt(slot, 1);
if ((word & FlAdvancedState.FeatureSupportAnswered) != 0)
{
support.Add(new AdvancedRow(feature + " · slIsFeatureSupported", ResultName((word >> FlAdvancedState.FeatureSupportResultShift) & 0xFFu)));
}
if ((word & FlAdvancedState.FeatureLoadedAnswered) != 0)
{
string loaded = (word & FlAdvancedState.FeatureLoadedValue) != 0 ? "on" : "off";
support.Add(new AdvancedRow(feature + " · slIsFeatureLoaded", loaded, loaded));
}
// Bit 0 seen off, bit 1 seen on: the two bits AddSwitch reads.
uint switched = ((word & FlAdvancedState.FeatureSwitchedOff) != 0 ? 1u : 0u) | ((word & FlAdvancedState.FeatureSwitchedOn) != 0 ? 2u : 0u);
AddSwitch(lifecycle, feature + " · slSetFeatureLoaded", switched);
AddCount(lifecycle, feature + " · slAllocateResources", (word >> FlAdvancedState.FeatureAllocShift) & FlAdvancedState.FeatureCountMask);
AddCount(lifecycle, feature + " · slFreeResources", (word >> FlAdvancedState.FeatureFreeShift) & FlAdvancedState.FeatureCountMask);
}
if (s.ValidMask.HasFlag(FlAdvancedValid.SlShutdown))
{
lifecycle.Add(new AdvancedRow("slShutdown", s.SlShutdowns.ToString(CultureInfo.InvariantCulture)));
}
if (support.Count > 0)
{
facts.Add(Fact("sl.feature.support", AdvancedValue.OfRows(support)));
}
if (lifecycle.Count > 0)
{
facts.Add(Fact("sl.feature.lifecycle", AdvancedValue.OfRows(lifecycle)));
}
}
// A four-bit count of calls: nothing where the game made none, the number, or "15 or more" in signs no language
// needs translated - the count stops at 15.
private static void AddCount(List<AdvancedRow> rows, string name, uint count)
{
if (count != 0)
{
rows.Add(new AdvancedRow(name, count >= FlAdvancedState.FeatureCountMask ? "≥ 15" : count.ToString(CultureInfo.InvariantCulture)));
}
}
// sl::Result by the vendor's own name (sl_result.h): forty codes, the same ones in the same order at every
// Streamline tag from v2.0.0 to v2.14.16 (17_HOOK_ENGINE, the row of slIsFeatureSupported). A number past the list
// is said as a number; 0xFF is what the capture side writes for a code a byte could not carry.
private static string ResultName(uint code) =>
code < (uint)_results.Length ? _results[code] : string.Create(CultureInfo.InvariantCulture, $"result {code}");
// What Streamline answered when the game asked about a feature (slGetFeatureVersion, slGetFeatureRequirements;
// 0.1.0-beta.44): a slot per feature in the order the game first asked, the vendor's own names throughout. A
// version of all zeros is the vendor's "none" - a feature that uses no NGX model has no versionNGX, a requirement
// nobody stated has no row - except versionSL, which an answer always carries. The counts are said as they are:
// 0 threads is "it creates none".
private static void AddStreamlineFeatures(InGameAdvanced published, List<AdvancedFact> facts)
{
ref readonly FlAdvancedState s = ref published.State;
var versions = new List<AdvancedRow>(8);
var requirements = new List<AdvancedRow>(16);
for (int slot = 0; slot < FlAdvancedState.FeatureSlots; slot++)
{
uint id = s.FeatureWordAt(slot, 0);
if (id == 0)
{
break;
}
string feature = FeatureName(id - 1);
uint answered = s.FeatureWordAt(slot, 1);
if ((answered & FlAdvancedState.FeatureVersionAnswered) != 0)
{
versions.Add(new AdvancedRow(feature + " · versionSL", VersionText(published, slot, 2)));
AddVersion(versions, feature, "versionNGX", published, slot, 5);
}
if ((answered & FlAdvancedState.FeatureRequirementsAnswered) != 0)
{
uint flags = s.FeatureWordAt(slot, 8);
var names = new List<string>(5);
for (int bit = 0; bit < 32; bit++)
{
if ((flags & (1u << bit)) != 0)
{
names.Add(bit < _requirementFlags.Length ? _requirementFlags[bit] : string.Create(CultureInfo.InvariantCulture, $"bit {bit}"));
}
}
requirements.Add(names.Count == 0 ? new AdvancedRow(feature + " · flags", "none", "none") : new AdvancedRow(feature + " · flags", string.Join(", ", names)));
requirements.Add(new AdvancedRow(feature + " · maxNumCPUThreads", s.FeatureWordAt(slot, 9).ToString(CultureInfo.InvariantCulture)));
requirements.Add(new AdvancedRow(feature + " · maxNumViewports", s.FeatureWordAt(slot, 10).ToString(CultureInfo.InvariantCulture)));
requirements.Add(new AdvancedRow(feature + " · numRequiredTags", s.FeatureWordAt(slot, 11).ToString(CultureInfo.InvariantCulture)));
AddVersion(requirements, feature, "osVersionDetected", published, slot, 12);
AddVersion(requirements, feature, "osVersionRequired", published, slot, 15);
AddVersion(requirements, feature, "driverVersionDetected", published, slot, 18);
AddVersion(requirements, feature, "driverVersionRequired", published, slot, 21);
}
}
if (versions.Count > 0)
{
facts.Add(Fact("sl.feature.versions", AdvancedValue.OfRows(versions)));
}
if (requirements.Count > 0)
{
facts.Add(Fact("sl.feature.requirements", AdvancedValue.OfRows(requirements)));
}
}
private static string VersionText(InGameAdvanced published, int slot, int word)
{
ref readonly FlAdvancedState s = ref published.State;
return string.Create(CultureInfo.InvariantCulture, $"{s.FeatureWordAt(slot, word)}.{s.FeatureWordAt(slot, word + 1)}.{s.FeatureWordAt(slot, word + 2)}");
}
private static void AddVersion(List<AdvancedRow> rows, string feature, string member, InGameAdvanced published, int slot, int word)
{
ref readonly FlAdvancedState s = ref published.State;
if ((s.FeatureWordAt(slot, word) | s.FeatureWordAt(slot, word + 1) | s.FeatureWordAt(slot, word + 2)) != 0)
{
rows.Add(new AdvancedRow(feature + " · " + member, VersionText(published, slot, word)));
}
}
// sl::Feature by the vendor's own constant (sl_core_types.h); an id this build has no name for is its number.
private static string FeatureName(uint feature) => feature switch
{
0 => "kFeatureDLSS",
1 => "kFeatureNRD_INVALID",
2 => "kFeatureNIS",
3 => "kFeatureReflex",
4 => "kFeaturePCL",
5 => "kFeatureDeepDVC",
6 => "kFeatureLatewarp",
1000 => "kFeatureDLSS_G",
1001 => "kFeatureDLSS_RR",
1002 => "kFeatureNvPerf",
1003 => "kFeatureDirectSR",
1004 => "kFeatureDLSS_NR",
9999 => "kFeatureImGUI",
_ => string.Create(CultureInfo.InvariantCulture, $"feature {feature}"),
};
// How the game configures FSR frame generation (ffxConfigure, 0.1.0-beta.43): three switches as seen over the
// session, the flags any configure carried, and the last rectangle it generates in.
private static void AddFrameGeneration(InGameAdvanced published, List<AdvancedFact> facts)
{
ref readonly FlAdvancedState s = ref published.State;
var rows = new List<AdvancedRow>(5);
AddSwitch(rows, "frameGenerationEnabled", s.FfxFgEnabledSeen);
AddSwitch(rows, "allowAsyncWorkloads", s.FfxFgAsyncSeen);
AddSwitch(rows, "onlyPresentGenerated", s.FfxFgOnlyGeneratedSeen);
var names = new List<string>(4);
for (int bit = 0; bit < 32; bit++)
{
if ((s.FfxFgFlagsSeen & (1u << bit)) != 0)
{
names.Add(bit < _frameGenerationFlags.Length ? _frameGenerationFlags[bit] : string.Create(CultureInfo.InvariantCulture, $"bit {bit}"));
}
}
// This is reached only once a configure was read, so no flag seen is "the game set none" - said, as an
// upscale that set none says it (0.1.0-beta.44: Lies of P's session of 2026-11-12 had no row at all).
rows.Add(names.Count == 0 ? new AdvancedRow("flags", "none", "none") : new AdvancedRow("flags", string.Join(", ", names)));
// left, top, width, height. A rectangle with no area is one the game did not give; four -1 is one the capture
// side could not state (a side that is negative or past 32,767).
int left = s.FfxFgRectAt(0);
int top = s.FfxFgRectAt(1);
int width = s.FfxFgRectAt(2);
int height = s.FfxFgRectAt(3);
if (width > 0 && height > 0 && left >= 0 && top >= 0)
{
rows.Add(new AdvancedRow("generationRect", string.Create(CultureInfo.InvariantCulture, $"{width} × {height} at {left}, {top}")));
}
if (rows.Count > 0)
{
facts.Add(Fact("ffx.framegen.config", AdvancedValue.OfRows(rows)));
}
}
// What the game told Streamline about each frame (slSetConstants, 0.1.0-beta.43), for the first viewport that
// called. FLT_MAX is Streamline's "not set" and never reaches here; a plane at infinity is FSR's convention (D119).
private static void AddStreamlineConstants(InGameAdvanced published, List<AdvancedFact> facts)
{
ref readonly FlAdvancedState s = ref published.State;
var jitter = new List<AdvancedRow>(2);
AddUpTo(jitter, "jitterOffset.x", s.SlJitterMaxXBits);
AddUpTo(jitter, "jitterOffset.y", s.SlJitterMaxYBits);
if (jitter.Count > 0)
{
facts.Add(Fact("sl.constants.jitter", AdvancedValue.OfRows(jitter)));
}
// Bits in the vendor header's order: depthInverted 0, cameraMotionIncluded 1, motionVectors3D 2, reset 3,
// orthographicProjection 4, motionVectorsDilated 5, motionVectorsJittered 6.
var motion = new List<AdvancedRow>(6);
AddNumber(motion, "mvecScale.x", s.SlMvecScaleXBits);
AddNumber(motion, "mvecScale.y", s.SlMvecScaleYBits);
AddSwitch(motion, "cameraMotionIncluded", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 1));
AddSwitch(motion, "motionVectors3D", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 2));
AddSwitch(motion, "motionVectorsDilated", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 5));
AddSwitch(motion, "motionVectorsJittered", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 6));
if (motion.Count > 0)
{
facts.Add(Fact("sl.constants.motion_vectors", AdvancedValue.OfRows(motion)));
}
var depth = new List<AdvancedRow>(3);
AddNumber(depth, "cameraNear", s.SlNearBits);
AddNumber(depth, "cameraFar", s.SlFarBits);
AddSwitch(depth, "depthInverted", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 0));
if (depth.Count > 0)
{
facts.Add(Fact("sl.constants.depth", AdvancedValue.OfRows(depth)));
}
var projection = new List<AdvancedRow>(4);
AddFieldOfView(projection, "cameraFOV", s.SlFovMinBits, s.SlFovMaxBits);
AddNumber(projection, "cameraAspectRatio", s.SlAspectBits);
AddSwitch(projection, "orthographicProjection", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 4));
if (projection.Count > 0)
{
facts.Add(Fact("sl.constants.projection", AdvancedValue.OfRows(projection)));
}
// A count, of the first viewport's calls: 0 is "the game never reset the history", which is a fact.
facts.Add(Fact("sl.constants.resets", AdvancedValue.Of(s.SlResets)));
}
// The two bits a switch seen over a session leaves: bit 0 seen off, bit 1 seen on.
private static uint SwitchOf(uint seenTrue, uint seenFalse, int bit) =>
((seenFalse >> bit) & 1u) | (((seenTrue >> bit) & 1u) << 1);
private static void AddSwitch(List<AdvancedRow> rows, string member, uint seen)
{
string? state = (seen & 3u) switch { 1u => "off", 2u => "on", 3u => "on_and_off", _ => null };
if (state is not null)
{
rows.Add(new AdvancedRow(member, state, state));
}
}
private static void AddDlss(InGameAdvanced published, List<AdvancedFact> facts)
{
ref readonly FlAdvancedState s = ref published.State;
@@ -193,17 +684,9 @@ public sealed class InGameAdvancedSampler
}
var depth = new List<AdvancedRow>(3);
AddNumber(depth, "cameraNear", s.FfxNearBits);
AddNumber(depth, "cameraFar", s.FfxFarBits);
// A range, lowest to highest - never a series, which would say when the player aimed (D114).
if (Number(s.FfxFovMinBits) is double low && Number(s.FfxFovMaxBits) is double high)
{
// One value or two: told by the bits, which is what "the same float" means (and what csharpsquid:S1244 asks).
depth.Add(new AdvancedRow("cameraFovAngleVertical", s.FfxFovMinBits == s.FfxFovMaxBits
? string.Create(CultureInfo.InvariantCulture, $"{low:0.####} rad ({Degrees(low):0.#}°)")
: string.Create(CultureInfo.InvariantCulture, $"{low:0.####} – {high:0.####} rad ({Degrees(low):0.#}° – {Degrees(high):0.#}°)")));
}
AddDepthPlane(depth, "cameraNear", s.FfxNearBits);
AddDepthPlane(depth, "cameraFar", s.FfxFarBits);
AddFieldOfView(depth, "cameraFovAngleVertical", s.FfxFovMinBits, s.FfxFovMaxBits);
if (depth.Count > 0)
{
facts.Add(Fact("ffx.upscale.depth", AdvancedValue.OfRows(depth)));
@@ -232,6 +715,19 @@ public sealed class InGameAdvancedSampler
}
}
// A depth plane of FSR's: a number, or the plane at infinity (owner decision D119) - which Number, rightly for every
// other field, takes for no value at all.
private static void AddDepthPlane(List<AdvancedRow> rows, string member, uint bits)
{
if (bits == FlAdvancedState.FloatInfinite)
{
rows.Add(new AdvancedRow(member, "∞"));
return;
}
AddNumber(rows, member, bits);
}
private static void AddNumber(List<AdvancedRow> rows, string member, uint bits)
{
if (Number(bits) is double value)
@@ -256,6 +752,32 @@ public sealed class InGameAdvancedSampler
}
}
// A field of view as the game gave it: a range, lowest to highest - never a series, which would say when the
// player aimed (D114). Both vendors' headers say radians, and a value over pi cannot be one: Cyberpunk 2077 gives
// Streamline 51 to 90 (the owner's sessions of 2026-11-12, where this printed "51.0055 - 90 rad (2922.4 deg ...)").
// Such a value is said as it was given, and a second row says what it is not. It is never converted: which unit
// the game meant is this project's guess, and the row would then carry the guess as the game's word (D128).
private static void AddFieldOfView(List<AdvancedRow> rows, string member, uint minBits, uint maxBits)
{
if (Number(minBits) is not double low || Number(maxBits) is not double high)
{
return;
}
// One value or two: told by the bits, which is what "the same float" means (and what csharpsquid:S1244 asks).
bool one = minBits == maxBits;
if (high > Math.PI)
{
rows.Add(new AdvancedRow(member, one ? Text(low) : Text(low) + " – " + Text(high)));
rows.Add(new AdvancedRow(member + " unit", _notRadians, _notRadians));
return;
}
rows.Add(new AdvancedRow(member, one
? string.Create(CultureInfo.InvariantCulture, $"{low:0.####} rad ({Degrees(low):0.#}°)")
: string.Create(CultureInfo.InvariantCulture, $"{low:0.####} – {high:0.####} rad ({Degrees(low):0.#}° – {Degrees(high):0.#}°)")));
}
private static string? Range(uint minBits, uint maxBits) =>
Number(minBits) is double low && Number(maxBits) is double high
? minBits == maxBits ? Text(low) : Text(low) + " – " + Text(high)
@@ -285,7 +807,14 @@ public sealed class InGameAdvancedSampler
_ => preset.ToString(CultureInfo.InvariantCulture),
};
/// <summary>The fields the facts are made of, and nothing that moves every second: no count, no frame time, no clock.</summary>
private static ulong Pair(uint low, uint high) => low | ((ulong)high << 32);
private static ulong Pair(int low, int high) => Pair(unchecked((uint)low), unchecked((uint)high));
/// <summary>
/// The fields the facts are made of, and nothing that moves every second: no count, no frame time, no clock. The
/// one fact that IS a count - the resets told to Streamline - is brought up to date by <see cref="Conclude"/>.
/// </summary>
[StructLayout(LayoutKind.Auto)]
private readonly record struct FactKey(
FlAdvancedValid Valid,
@@ -306,7 +835,19 @@ public sealed class InGameAdvancedSampler
uint Far,
uint FovMin,
uint FovMax,
uint Flags)
uint Flags,
ulong FrameGenerationSwitches,
uint FrameGenerationFlags,
ulong FrameGenerationRectLow,
ulong FrameGenerationRectHigh,
ulong SlJitter,
ulong SlMvecScale,
ulong SlDepth,
ulong SlFov,
uint SlAspect,
ulong SlFlags,
ulong SlFeatures,
uint DriverSleep)
{
public static FactKey Of(InGameAdvanced published)
{
@@ -318,7 +859,7 @@ public sealed class InGameAdvancedSampler
}
return new FactKey(
s.ValidMask & (FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale),
s.ValidMask & (FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale | FlAdvancedValid.FfxFgConfig | FlAdvancedValid.SlConstants | FlAdvancedValid.SlFeatures | FlAdvancedValid.SlShutdown),
s.DlssOutputWidth,
s.DlssOutputHeight,
s.DlssPreExposureBits,
@@ -336,7 +877,43 @@ public sealed class InGameAdvancedSampler
s.FfxFarBits,
s.FfxFovMinBits,
s.FfxFovMaxBits,
s.FfxFlagsSeen);
s.FfxFlagsSeen,
s.FfxFgEnabledSeen | ((ulong)s.FfxFgAsyncSeen << 8) | ((ulong)s.FfxFgOnlyGeneratedSeen << 16),
s.FfxFgFlagsSeen,
Pair(s.FfxFgRectAt(0), s.FfxFgRectAt(1)),
Pair(s.FfxFgRectAt(2), s.FfxFgRectAt(3)),
Pair(s.SlJitterMaxXBits, s.SlJitterMaxYBits),
Pair(s.SlMvecScaleXBits, s.SlMvecScaleYBits),
Pair(s.SlNearBits, s.SlFarBits),
Pair(s.SlFovMinBits, s.SlFovMaxBits),
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 feature slots as one number (FNV-1a over the words of the slots in use): an answer that arrives, or one
// that changes, makes the facts new; 0 where the group was not published.
private static ulong FeaturesHash(InGameAdvanced published)
{
ref readonly FlAdvancedState s = ref published.State;
if ((s.ValidMask & (FlAdvancedValid.SlFeatures | FlAdvancedValid.SlShutdown)) == FlAdvancedValid.None)
{
return 0;
}
// The shutdowns first (0.1.0-beta.45): a count, but one that moves a handful of times in a session at most.
ulong hash = (14695981039346656037UL ^ s.SlShutdowns) * 1099511628211UL;
for (int slot = 0; slot < FlAdvancedState.FeatureSlots && s.ValidMask.HasFlag(FlAdvancedValid.SlFeatures) && s.FeatureWordAt(slot, 0) != 0; slot++)
{
for (int word = 0; word < FlAdvancedState.FeatureWords; word++)
{
hash = (hash ^ s.FeatureWordAt(slot, word)) * 1099511628211UL;
}
}
return hash;
}
}
}
@@ -22,6 +22,11 @@ namespace FrameLedger.Application.Recording;
/// (<c>19_SAFETY</c>: re-enabling silently would mean a rules feed or a policy can switch injection on
/// for a game without anyone looking).
/// </para>
/// <para>
/// <b>The count starts again when the user switches hooking on</b> (owner decision D126, 0.1.0-beta.44): the consent
/// grant sets <c>hook_crash_count</c> to 0. Until then the count only ever grew, so once a game had been switched off,
/// every single early abnormal end after its user switched it on again switched it off - the reason still saying "twice".
/// </para>
/// </remarks>
public sealed class CrashAutoDisablePolicy
{
@@ -179,14 +179,22 @@ public static class SessionAggregator
private static SessionRow ApplyUpscaler(SessionRow row, Context c)
{
UpscaleExtent? extent = UpscaleExtent.From(c.Dominant);
FlUpscaler? identity = FgLadder.UpscalerIdentity(c.Input.Records);
// ONE TECHNOLOGY'S NAME, QUALITY AND SIZE (D120, 2026-11-12): the technology named on the most samples of
// the dominant stream, and - when the session names more than one - only the samples that name it. The name
// used to be the first one any record carried, beside a quality byte and a render size taken from whichever
// records had them: a session that saw DLSS briefly and then ran FSR was "DLSS" with FSR's byte and size.
UpscalerChoice choice = UpscalerChoice.From(c.Dominant);
UpscaleExtent? extent = UpscaleExtent.From(choice.Samples);
// A dominant stream that names nothing leaves the name to any other stream that does, as before.
string? named = choice.Kind is { } kind
? Vocabulary.Upscaler(kind)
: FgLadder.UpscalerIdentity(c.Input.Records) is { } elsewhere ? Vocabulary.Upscaler(elsewhere) : null;
bool hookRan = FgLadder.UpscalerHookRan(c.Input.Records);
IReadOnlyList<FrameSample> withParams = [.. c.Dominant.Where(static s => s.Claims(MeasuredFields.UpscalerParams))];
IReadOnlyList<FrameSample> withParams = [.. choice.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams))];
return row with
{
Upscaler = identity is { } u ? Vocabulary.Upscaler(u) : hookRan ? "unknown" : null,
UpscalerQuality = QualityByte.Of(withParams)?.ToString(CultureInfo.InvariantCulture),
Upscaler = named ?? (hookRan ? "unknown" : null),
UpscalerQuality = choice.QualityFor(QualityByte.Of(withParams))?.ToString(CultureInfo.InvariantCulture),
UpscalerSharpness = Modal(withParams, static s => s.UpscalerSharpness),
UpscalerDriverReported = c.Input.Ngx.SrCreatedAndEvaluated ? "dlss" : null,
RenderW = extent?.RenderW,
@@ -194,7 +202,9 @@ public static class SessionAggregator
OutputW = extent?.OutputW,
OutputH = extent?.OutputH,
UpscaleRatio = extent?.Ratio,
SettingsChangedMidSession = c.Segments.Count(s => s.Samples.Count > 0) > c.All.Select(static s => s.SwapchainId).Distinct().Count(),
// A second technology named in one session is a setting changed mid-session, as a changed output size is.
SettingsChangedMidSession = choice.Named > 1
|| c.Segments.Count(s => s.Samples.Count > 0) > c.All.Select(static s => s.SwapchainId).Distinct().Count(),
HdrFlag = Vocabulary.Tri(c.Hdr),
HdrSource = c.Hdr == Tri.NotApplicable ? null : Vocabulary.Measured,
};
@@ -408,10 +418,9 @@ public static class SessionAggregator
FrameStatistics stats = c.Generating
? FrameStatistics.From(FrameTimeSeries.ApplicationFrames(seg.Samples, null, c.Input.QpcFrequency).FrameTimesMs, presented: false)
: FrameStatistics.From(series.FrameTimesMs, presented: true);
UpscaleExtent? extent = UpscaleExtent.From(seg.Samples);
UpscalerKind? upscaler = seg.Samples.Where(static s => s.Claims(MeasuredFields.Upscaler))
.Select(static s => s.Upscaler)
.FirstOrDefault(static u => u is not UpscalerKind.NotReported and not UpscalerKind.Unknown and not UpscalerKind.RetiredRayReconstruction, UpscalerKind.NotReported);
// The segment's upscaler is chosen as the session's is (D120): one technology's name, quality and size.
UpscalerChoice choice = UpscalerChoice.From(seg.Samples);
UpscaleExtent? extent = UpscaleExtent.From(choice.Samples);
rows.Add(new SegmentRow
{
SwapchainId = seg.SwapchainId,
@@ -421,8 +430,8 @@ public static class SessionAggregator
RenderH = extent?.RenderH,
OutputW = seg.OutputW == 0 ? null : seg.OutputW,
OutputH = seg.OutputH == 0 ? null : seg.OutputH,
Upscaler = upscaler is { } u && u != UpscalerKind.NotReported ? Vocabulary.Upscaler(u) : null,
UpscalerQuality = QualityByte.Of([.. seg.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams))])?.ToString(CultureInfo.InvariantCulture),
Upscaler = choice.Kind is { } u ? Vocabulary.Upscaler(u) : null,
UpscalerQuality = choice.QualityFor(QualityByte.Of([.. choice.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams))]))?.ToString(CultureInfo.InvariantCulture),
FgMode = null,
NativeFps = null,
DisplayedFps = series.AverageFps,
@@ -2,6 +2,7 @@
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Runtime.InteropServices;
using FrameLedger.Application.Advanced;
using FrameLedger.Application.Capture;
using FrameLedger.Application.Persistence;
@@ -191,8 +192,8 @@ public sealed class SessionRecorder : ISessionRecorder
return DriverProfileRecord.Serialize(await read.WaitAsync(DriverProfileBudget).ConfigureAwait(false));
}
catch (Exception ex) when (ex is TimeoutException or InvalidOperationException or ArgumentException
or System.Runtime.InteropServices.ExternalException or DllNotFoundException or EntryPointNotFoundException
or BadImageFormatException or System.Runtime.InteropServices.MarshalDirectiveException)
or ExternalException or DllNotFoundException or EntryPointNotFoundException
or BadImageFormatException or MarshalDirectiveException)
{
return null;
}
@@ -374,7 +375,8 @@ public sealed class SessionRecorder : ISessionRecorder
// records Advanced metrics - the same condition the shared reader is held under.
private readonly InGameAdvancedSampler? _inGame = advanced is null ? null : new InGameAdvancedSampler();
private IReadOnlyList<AdvancedReading>? _inGamePending;
private (IReadOnlyList<AdvancedFact> Facts, AdvancedInGameStatus Status) _inGameContext = ([], AdvancedInGameStatus.Unknown);
private (IReadOnlyList<AdvancedFact> Facts, AdvancedInGameStatus Status, InGameCallStates Calls) _inGameContext =
([], AdvancedInGameStatus.Unknown, default);
private IReadOnlyList<AdvancedFact> _sessionWithGame = [];
/// <summary>A session that records Advanced metrics asks the Overlay for what the game tells its upscaler (D111).</summary>
@@ -475,12 +477,19 @@ public sealed class SessionRecorder : ISessionRecorder
_sessionFactsRead = Task.Run(() => _sessionFacts = ReadSessionFacts(advanced, target));
}
if (atEnd)
{
// The one fact that is a count is brought up to the last publication (InGameAdvancedSampler.Conclude).
_inGame?.Conclude();
}
AdvancedSnapshot? snapshot = advanced.Latest;
IReadOnlyList<AdvancedFact>? session = _sessionFacts;
IReadOnlyList<AdvancedFact> game = _inGame?.Facts ?? [];
AdvancedInGameStatus status = InGameStatus();
InGameCallStates calls = InGameCalls();
(IReadOnlyList<AdvancedFact>?, IReadOnlyList<AdvancedSeriesInfo>?, AdvancedSources?, IReadOnlyList<AdvancedFact>?) now = (snapshot?.MachineFacts, snapshot?.Series, snapshot?.Sources, session);
bool sameGame = ReferenceEquals(game, _inGameContext.Facts) && status == _inGameContext.Status;
bool sameGame = ReferenceEquals(game, _inGameContext.Facts) && status == _inGameContext.Status && calls == _inGameContext.Calls;
if ((snapshot is null && session is null && game.Count == 0)
|| (sameGame && ReferenceEquals(now.Item1, _context.Machine) && ReferenceEquals(now.Item2, _context.Series) && Equals(now.Item3, _context.Sources) && ReferenceEquals(now.Item4, _context.Session)))
{
@@ -494,14 +503,74 @@ public sealed class SessionRecorder : ISessionRecorder
}
_context = now;
_inGameContext = (game, status);
_inGameContext = (game, status, calls);
writer.SetAdvancedContext(new AdvancedSessionData(
snapshot?.MachineFacts ?? [],
_sessionWithGame,
snapshot?.Series ?? [],
(snapshot?.Sources ?? AdvancedSources.Unknown) with { InGame = status }));
(snapshot?.Sources ?? AdvancedSources.Unknown) with
{
InGame = status,
StreamlineConstants = calls.Streamline,
FsrFrameGeneration = calls.FrameGeneration,
StreamlineFeatureVersion = calls.FeatureVersion,
StreamlineFeatureRequirements = calls.FeatureRequirements,
StreamlineFeatureSupported = calls.FeatureSupported,
StreamlineFeatureLoaded = calls.FeatureLoaded,
StreamlineSetFeatureLoaded = calls.SetFeatureLoaded,
StreamlineAllocateResources = calls.AllocateResources,
StreamlineFreeResources = calls.FreeResources,
StreamlineShutdown = calls.Shutdown,
DriverLatency = calls.Driver,
DriverLatencySlowestUs = calls.DriverSlowestUs,
}));
}
/// <summary>
/// What became of the calls hooked only for Advanced metrics (two since 0.1.0-beta.43, four since
/// 0.1.0-beta.44, ten since 0.1.0-beta.45), for a session measured inside the game: read, hooked and never called, or not hooked - from
/// the hook families the capture side last published and from what its publications carried. All null for a
/// session not measured inside the game: <see cref="AdvancedInGameStatus.NotHooked"/> already says so.
/// </summary>
private InGameCallStates InGameCalls()
{
if (_inGame is null || AttachedAt is null)
{
return default;
}
var hooks = (FlHookFamily)(_last?.WriterState.HooksInstalledMask ?? 0u);
return new InGameCallStates(
_inGame.Call(FlAdvancedValid.SlConstants, hooks.HasFlag(FlHookFamily.SlConstants)),
_inGame.Call(FlAdvancedValid.FfxFgConfig, hooks.HasFlag(FlHookFamily.FfxConfigure)),
_inGame.FeatureCall(FlAdvancedState.FeatureVersionAnswered, hooks.HasFlag(FlHookFamily.SlFeatureVersion)),
_inGame.FeatureCall(FlAdvancedState.FeatureRequirementsAnswered, hooks.HasFlag(FlHookFamily.SlFeatureRequirements)),
_inGame.FeatureCall(FlAdvancedState.FeatureSupportAnswered, hooks.HasFlag(FlHookFamily.SlFeatureSupported)),
_inGame.FeatureCall(FlAdvancedState.FeatureLoadedAnswered, hooks.HasFlag(FlHookFamily.SlFeatureLoaded)),
_inGame.FeatureCall(InGameAdvancedSampler.FeatureSwitched, hooks.HasFlag(FlHookFamily.SlSetFeatureLoaded)),
_inGame.FeatureCall(InGameAdvancedSampler.FeatureAllocated, hooks.HasFlag(FlHookFamily.SlAllocateResources)),
_inGame.FeatureCall(InGameAdvancedSampler.FeatureFreed, hooks.HasFlag(FlHookFamily.SlFreeResources)),
_inGame.Call(FlAdvancedValid.SlShutdown, hooks.HasFlag(FlHookFamily.SlShutdown)),
_inGame.DriverRead(hooked: true),
_inGame.DriverSlowestUs);
}
/// <summary>The ten calls' states, compared as one value when deciding whether the session's context moved.</summary>
[StructLayout(LayoutKind.Auto)]
private readonly record struct InGameCallStates(
AdvancedInGameCall? Streamline,
AdvancedInGameCall? FrameGeneration,
AdvancedInGameCall? FeatureVersion,
AdvancedInGameCall? FeatureRequirements,
AdvancedInGameCall? FeatureSupported,
AdvancedInGameCall? FeatureLoaded,
AdvancedInGameCall? SetFeatureLoaded,
AdvancedInGameCall? AllocateResources,
AdvancedInGameCall? FreeResources,
AdvancedInGameCall? Shutdown,
AdvancedDriverRead? Driver,
int? DriverSlowestUs);
/// <summary>
/// What the row says of the entries read inside the game: read, measured inside the game with none of their
/// calls seen, or not measured inside the game at all.
@@ -75,12 +75,16 @@ internal static class OverlayLog
}
}
/// <summary>Faults, the stop, unhook decisions, a missing symbol, supervision loss — never the routine installs.</summary>
/// <summary>
/// Faults, the stop, unhook decisions, a missing symbol, a patch that did not go in, supervision loss — never the
/// routine installs.
/// </summary>
private static bool IsWorthPrinting(string line) =>
line.StartsWith('+', StringComparison.Ordinal)
&& (line.Contains(" FAULT ", StringComparison.Ordinal)
|| line.Contains(" STOP ", StringComparison.Ordinal)
|| line.Contains(" UNHOOK_", StringComparison.Ordinal)
|| line.Contains(" SYMBOL_MISSING ", StringComparison.Ordinal)
|| line.Contains(" PATCH_FAILED ", StringComparison.Ordinal)
|| line.Contains(" SUPERVISION_LOST ", StringComparison.Ordinal));
}
@@ -29,4 +29,34 @@ public enum HookFamilies
/// <summary>The Streamline detour decodes DLSS 5's neural rendering (beta.34, D84).</summary>
SlNeuralRendering = 1 << 12,
/// <summary><c>slSetConstants</c> is hooked (0.1.0-beta.43) - only where Advanced metrics was ever asked for.</summary>
SlConstants = 1 << 13,
/// <summary><c>ffxConfigure</c> is hooked (0.1.0-beta.43) - only where Advanced metrics was ever asked for.</summary>
FfxConfigure = 1 << 14,
/// <summary><c>slGetFeatureVersion</c> is hooked (0.1.0-beta.44) - only where Advanced metrics was ever asked for.</summary>
SlFeatureVersion = 1 << 15,
/// <summary><c>slGetFeatureRequirements</c> is hooked (0.1.0-beta.44) - only where Advanced metrics was ever asked for.</summary>
SlFeatureRequirements = 1 << 16,
/// <summary><c>slIsFeatureSupported</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
SlFeatureSupported = 1 << 17,
/// <summary><c>slIsFeatureLoaded</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
SlFeatureLoaded = 1 << 18,
/// <summary><c>slSetFeatureLoaded</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
SlSetFeatureLoaded = 1 << 19,
/// <summary><c>slAllocateResources</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
SlAllocateResources = 1 << 20,
/// <summary><c>slFreeResources</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
SlFreeResources = 1 << 21,
/// <summary><c>slShutdown</c> is hooked (0.1.0-beta.45) - only where Advanced metrics was ever asked for.</summary>
SlShutdown = 1 << 22,
}
@@ -0,0 +1,82 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Domain.Metrics;
/// <summary>
/// Which upscaler a stream of samples names, and the samples its quality and render size are to be read from - so
/// that the name, the quality and the size a session shows are those of ONE technology (owner decision D120,
/// 2026-11-12; <c>03_METRICS</c> §Upscaling).
/// </summary>
/// <remarks>
/// <para>
/// <b>WHY.</b> The session's name used to be the FIRST technology any record named, while its quality byte and its
/// render size came from whichever records carried them. A real session of 81 seconds (Dying Light: The Beast, an FSR
/// dispatch and a DLSS evaluation both seen) was stored as "DLSS" with FSR's quality byte and FSR's render size: three
/// true readings, of two technologies, under one name.
/// </para>
/// <para>
/// <b>THE RULE.</b> The technology named on the most samples; a tie goes to the lower value, as
/// <see cref="QualityByte.Of"/> breaks its own. While only one technology is named the samples are the whole stream,
/// exactly as before - under frame generation a name sits on one present in N, and the render size of the presents
/// between must still count. When more than one is named, the samples are those that name the chosen one, and
/// nothing of the other is carried under its name.
/// </para>
/// </remarks>
public sealed record UpscalerChoice
{
private UpscalerChoice(UpscalerKind? kind, int named, IReadOnlyList<FrameSample> samples)
{
Kind = kind;
Named = named;
Samples = samples;
}
/// <summary>The technology named on the most samples; null when no sample names one.</summary>
public UpscalerKind? Kind { get; }
/// <summary>How many different technologies the stream names. More than one is a setting changed mid-session.</summary>
public int Named { get; }
/// <summary>The samples the quality and the render size are read from.</summary>
public IReadOnlyList<FrameSample> Samples { get; }
/// <summary>True for a value that names a technology: not "not reported", not "unknown", not the retired value.</summary>
public static bool IsNamed(UpscalerKind kind) =>
kind is not (UpscalerKind.NotReported or UpscalerKind.Unknown or UpscalerKind.RetiredRayReconstruction);
/// <summary>True for FSR in any of its versions, the family <see cref="QualityByte.IsFsr"/>'s bytes belong to.</summary>
public static bool IsFsr(UpscalerKind kind) =>
kind is UpscalerKind.Fsr2 or UpscalerKind.Fsr3 or UpscalerKind.Fsr4 or UpscalerKind.FsrUnversioned;
/// <summary>
/// A quality byte that belongs to the named technology's family, or null: FSR's bytes under an FSR name, any
/// other byte under any other name. A byte of the other family is withheld rather than shown under a name it
/// was not measured for.
/// </summary>
public byte? QualityFor(byte? quality) =>
quality is byte value && Kind is { } kind && QualityByte.IsFsr(value) != IsFsr(kind) ? null : quality;
public static UpscalerChoice From(IReadOnlyList<FrameSample> stream)
{
ArgumentNullException.ThrowIfNull(stream);
(UpscalerKind Kind, int Count)[] named =
[
.. stream
.Where(static s => s.Claims(MeasuredFields.Upscaler) && IsNamed(s.Upscaler))
.GroupBy(static s => s.Upscaler)
.Select(static g => (g.Key, g.Count()))
.OrderByDescending(static g => g.Item2)
.ThenBy(static g => g.Key),
];
if (named.Length == 0)
{
return new UpscalerChoice(kind: null, named: 0, stream);
}
UpscalerKind chosen = named[0].Kind;
return named.Length == 1
? new UpscalerChoice(chosen, named: 1, stream)
: new UpscalerChoice(chosen, named.Length, [.. stream.Where(s => s.Claims(MeasuredFields.Upscaler) && s.Upscaler == chosen)]);
}
}
@@ -51,9 +51,14 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
+ "VALUES (@name, @path, @size, @mtime, 1, @at, @provenance, @disclosure, @at, @at)";
// The block columns are NOT in the SET list: that is the merge-forward, expressed as an omission.
// hook_crash_count = 0 IS (owner decision D126, 0.1.0-beta.44): the count of early abnormal ends was never set back,
// so a game switched off after two, and switched on again by its user, was switched off by the next single one -
// under a reason that says "twice" (Lies of P, 2026-11-12: two ends in October, one more today). A grant is the only
// statement that turns hooking on, and it is the user's act; the count starts again there. What the row says of the
// last time (hook_autodisabled_reason, hook_autodisabled_at) stays - the App shows it only while hooking is off.
private const string _updateGrant =
"UPDATE games SET exe_size_bytes = @size, exe_mtime_ms = @mtime, hook_enabled = 1, hook_consent_at = @at, "
+ "hook_consent_provenance = @provenance, hook_consent_disclosure_version = @disclosure, updated_at = @at "
+ "hook_consent_provenance = @provenance, hook_consent_disclosure_version = @disclosure, hook_crash_count = 0, updated_at = @at "
+ "WHERE exe_path = @path";
private const string _revoke =
+235 -9
View File
@@ -280,6 +280,49 @@ public enum FlHookFamily : uint
/// writer that looked for neural rendering is told from one built before it could (<see cref="FlFeatureFlags.SlNeuralRendering"/>).
/// </summary>
SlNeuralRendering = 1u << 12,
/// <summary>
/// <c>slSetConstants</c> is hooked (0.1.0-beta.43, Advanced metrics train B). Only in a process that was asked for
/// Advanced metrics at least once; it tells "hooked, never called" from "not hooked", and entitles no frame field.
/// </summary>
SlConstants = 1u << 13,
/// <summary>
/// <c>ffxConfigure</c> is hooked on every ffx-api module the process loaded (0.1.0-beta.43). Only in a process that
/// was asked for Advanced metrics at least once; it entitles no frame field.
/// </summary>
FfxConfigure = 1u << 14,
/// <summary>
/// <c>slGetFeatureVersion</c> is hooked (0.1.0-beta.44, Advanced metrics train B). Only in a process that was asked
/// for Advanced metrics at least once. A game asks while it starts, so the bit beside a feature with no version means
/// "hooked, and the game did not ask again"; it entitles no frame field.
/// </summary>
SlFeatureVersion = 1u << 15,
/// <summary><c>slGetFeatureRequirements</c> is hooked (0.1.0-beta.44), under the same conditions.</summary>
SlFeatureRequirements = 1u << 16,
/// <summary>
/// <c>slIsFeatureSupported</c> is hooked (0.1.0-beta.45, owner decisions D129-D131). Only in a process that was asked
/// for Advanced metrics at least once; it entitles no frame field. The adapter the game asks about is never read.
/// </summary>
SlFeatureSupported = 1u << 17,
/// <summary><c>slIsFeatureLoaded</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
SlFeatureLoaded = 1u << 18,
/// <summary><c>slSetFeatureLoaded</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
SlSetFeatureLoaded = 1u << 19,
/// <summary><c>slAllocateResources</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
SlAllocateResources = 1u << 20,
/// <summary><c>slFreeResources</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
SlFreeResources = 1u << 21,
/// <summary><c>slShutdown</c> is hooked (0.1.0-beta.45), under the same conditions.</summary>
SlShutdown = 1u << 22,
}
/// <summary>
@@ -755,14 +798,62 @@ public enum FlAdvancedValid : uint
/// <summary>The game asked <c>ffxQuery</c> for the upscaler's memory, and it answered.</summary>
FfxMemory = 1u << 2,
/// <summary>0.1.0-beta.41: <c>ffxConfigure</c> with a frame-generation descriptor was seen.</summary>
/// <summary>0.1.0-beta.43 (D118, D122): <c>ffxConfigure</c> with a frame-generation descriptor was seen.</summary>
FfxFgConfig = 1u << 3,
/// <summary>0.1.0-beta.41: <c>slSetConstants</c> was seen.</summary>
/// <summary>0.1.0-beta.43 (D118, D122): <c>slSetConstants</c> was seen.</summary>
SlConstants = 1u << 4,
/// <summary>0.1.0-beta.42: at least one feature slot is filled.</summary>
/// <summary>0.1.0-beta.44 (D118, D122): at least one feature slot is filled.</summary>
SlFeatures = 1u << 5,
/// <summary>0.1.0-beta.45: <c>slShutdown</c> was seen; <see cref="FlAdvancedState.SlShutdowns"/> counts.</summary>
SlShutdown = 1u << 6,
/// <summary>
/// Train C (0.1.0-beta.47): a read of the driver's latency report returned OK for
/// this request. Not one of the game's calls: the Overlay makes this read itself, and
/// <see cref="FlAdvancedState.LatState"/> says where it stands even while this bit is clear.
/// </summary>
Latency = 1u << 7,
}
/// <summary>
/// The low byte of <see cref="FlAdvancedState.LatState"/> (<c>fl_shm.h</c>'s <c>FlLatencyState</c>).
/// <see cref="Refused"/>, <see cref="NoGetter"/>, <see cref="Slow"/>, <see cref="Faulted"/> and <see cref="Stalled"/>
/// are final for the process: nothing is retried, and a later session of the same process reads the same word.
/// </summary>
public enum FlLatencyState : uint
{
/// <summary>Not asked, or nothing looked at yet.</summary>
None = 0,
/// <summary>Asked; no Direct3D 12 device has been seen behind a hooked swap chain.</summary>
NoDevice = 1,
/// <summary>The game has not loaded <c>nvapi64.dll</c>.</summary>
NoModule = 2,
/// <summary>The <c>nvapi64.dll</c> in the process sits in the executable's own folder: not the driver's (D140).</summary>
Refused = 3,
/// <summary>The module does not answer for both getters, or answered with an address outside itself.</summary>
NoGetter = 4,
/// <summary>Resolved; a read is made about once a second.</summary>
Reading = 5,
/// <summary>The last read returned an NVAPI status that is not OK; reading goes on.</summary>
Error = 6,
/// <summary>One call took 2 ms or more: off until the game exits (D141).</summary>
Slow = 7,
/// <summary>A getter faulted: off until the game exits.</summary>
Faulted = 8,
/// <summary>A call had not returned after a second: nothing can stop it.</summary>
Stalled = 9,
}
/// <summary>
@@ -788,6 +879,32 @@ public unsafe struct FlAdvancedState
/// <summary>A float nobody saw: the bits no detour stores.</summary>
public const uint FloatNone = 0xFFFFFFFFu;
/// <summary>
/// The plane at infinity (0.1.0-beta.42, owner decision D119): +infinity's own bits, in <see cref="FfxNearBits"/>
/// or <see cref="FfxFarBits"/> and in no other field. An engine with an infinite depth hands FSR
/// <c>FLT_MAX</c> or +infinity for one plane; the Overlay stores either as this. Never from Streamline, whose
/// <c>FLT_MAX</c> is "not set".
/// </summary>
public const uint FloatInfinite = 0x7F800000u;
/// <summary>The bits of <see cref="LatState"/> that hold the <see cref="FlLatencyState"/>.</summary>
public const uint LatStateMask = 0x000000FFu;
/// <summary>Bits 8..12 of <see cref="LatState"/>: sleep-status switches seen on, in the vendor struct's order.</summary>
public const int LatSleepSeenOnShift = 8;
/// <summary>Bits 16..20 of <see cref="LatState"/>: the same switches seen off.</summary>
public const int LatSleepSeenOffShift = 16;
/// <summary>The five switches of one group.</summary>
public const uint LatSleepBits = 0x1Fu;
/// <summary>Bits 24..31 of <see cref="LatState"/>: the last frame-generation multiplier the status gave, stopping at 255.</summary>
public const int LatFgMultiplierShift = 24;
/// <summary>A span sum: a summed frame did not report the span.</summary>
public const uint LatSumNone = 0xFFFFFFFFu;
/// <summary>How many feature slots <see cref="Features"/> holds.</summary>
public const int FeatureSlots = 12;
@@ -811,8 +928,42 @@ public unsafe struct FlAdvancedState
/// <summary>QueryPerformanceCounter at the last publication.</summary>
public ulong SampleQpc;
/// <summary>Must be zero.</summary>
public fixed uint ReservedHeader[10];
/// <summary>
/// Reflex latency (train C, 0.1.0-beta.47; the ten words that were <c>ReservedHeader</c>). The low byte is a
/// <see cref="FlLatencyState"/>; above it the driver's sleep status as seen (<see cref="LatSleepSeenOnShift"/>,
/// <see cref="LatSleepSeenOffShift"/>, <see cref="LatFgMultiplierShift"/>). Zero in a process nobody asked.
/// </summary>
public uint LatState;
/// <summary>Bits 0..15: reads made since the request. Bits 16..31: the slowest call, microseconds. Each stops at 65535.</summary>
public uint LatReads;
/// <summary>
/// Of the newest read not yet published: bits 0..15 frames summed, bits 16..31 frames refused. Zero when no read
/// was made since the publication before.
/// </summary>
public uint LatFrames;
/// <summary>Sum over the frames summed, microseconds, simulation start to end; <see cref="LatSumNone"/> = not reported.</summary>
public uint LatSimulationSumUs;
/// <summary>Render submit start to end.</summary>
public uint LatSubmitSumUs;
/// <summary>Present start to end.</summary>
public uint LatPresentSumUs;
/// <summary>Driver start to end.</summary>
public uint LatDriverSumUs;
/// <summary>OS render queue start to end.</summary>
public uint LatOsQueueSumUs;
/// <summary>GPU render start to end.</summary>
public uint LatGpuSumUs;
/// <summary>Simulation start to GPU render end.</summary>
public uint LatTotalSumUs;
/// <summary>The <c>structVersion</c> the game's <c>sl::DLSSOptions</c> declared; 0 = none seen.</summary>
public uint DlssStructVersion;
@@ -849,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;
@@ -909,6 +1078,14 @@ public unsafe struct FlAdvancedState
/// <summary>left, top, width, height.</summary>
public fixed int FfxFgRect[4];
/// <summary>One side of <see cref="FfxFgRect"/>: 0 left, 1 top, 2 width, 3 height. Four -1 is a rectangle the capture side could not state.</summary>
public readonly int FfxFgRectAt(int side)
{
ArgumentOutOfRangeException.ThrowIfNegative(side);
ArgumentOutOfRangeException.ThrowIfGreaterThan(side, 3);
return FfxFgRect[side];
}
/// <summary>Must be zero.</summary>
public fixed uint ReservedFfx[2];
@@ -939,11 +1116,60 @@ public unsafe struct FlAdvancedState
public uint SlFlagsSeenFalse;
/// <summary>Must be zero.</summary>
public fixed uint ReservedSl[3];
/// <summary><c>slShutdown</c> calls since the request (0.1.0-beta.45; the word was the first of three reserved).</summary>
public uint SlShutdowns;
/// <summary><see cref="FeatureSlots"/> slots of <see cref="FeatureWords"/> words each (0.1.0-beta.42).</summary>
/// <summary>Must be zero.</summary>
public fixed uint ReservedSl[2];
/// <summary><see cref="FeatureSlots"/> slots of <see cref="FeatureWords"/> words each (0.1.0-beta.44).</summary>
public fixed uint Features[FeatureSlots * FeatureWords];
/// <summary>Word 1 of a slot: <c>slGetFeatureVersion</c> answered for this feature.</summary>
public const uint FeatureVersionAnswered = 1u << 0;
/// <summary>Word 1 of a slot: <c>slGetFeatureRequirements</c> answered for this feature.</summary>
public const uint FeatureRequirementsAnswered = 1u << 1;
/// <summary>Word 1 (0.1.0-beta.45): <c>slIsFeatureSupported</c> answered; its <c>sl::Result</c> is in bits 8..15.</summary>
public const uint FeatureSupportAnswered = 1u << 2;
/// <summary>Word 1: <c>slIsFeatureLoaded</c> answered, and <see cref="FeatureLoadedValue"/> is what it said.</summary>
public const uint FeatureLoadedAnswered = 1u << 3;
public const uint FeatureLoadedValue = 1u << 4;
/// <summary>Word 1: the game was seen to switch the feature off through <c>slSetFeatureLoaded</c>. A session's.</summary>
public const uint FeatureSwitchedOff = 1u << 5;
/// <summary>Word 1: the game was seen to switch it on. A session's.</summary>
public const uint FeatureSwitchedOn = 1u << 6;
/// <summary>Word 1: where the result of <c>slIsFeatureSupported</c> starts; eight bits, 0xFF a code a byte cannot carry.</summary>
public const int FeatureSupportResultShift = 8;
/// <summary>Word 1: where the count of <c>slAllocateResources</c> calls starts; four bits, stopping at 15. A session's.</summary>
public const int FeatureAllocShift = 16;
/// <summary>Word 1: the same for <c>slFreeResources</c>.</summary>
public const int FeatureFreeShift = 20;
/// <summary>A four-bit count's mask, and the value at which it stopped counting.</summary>
public const uint FeatureCountMask = 0xFu;
/// <summary>
/// One word of one feature slot, as <c>fl_shm.h</c> lays them out: 0 the <c>sl::Feature</c> id plus one (0 = an
/// empty slot; slots fill from 0), 1 which question was answered, 2..7 the two versions, 8 the flags, 9..11 three
/// counts, 12..23 four versions.
/// </summary>
public readonly uint FeatureWordAt(int slot, int word)
{
ArgumentOutOfRangeException.ThrowIfNegative(slot);
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(slot, FeatureSlots);
ArgumentOutOfRangeException.ThrowIfNegative(word);
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(word, FeatureWords);
return Features[(slot * FeatureWords) + word];
}
}
/// <summary>Region 6 — the ring. Exactly 64 bytes, no implicit padding.</summary>
+83
View File
@@ -210,6 +210,79 @@ add_subdirectory(FrameLedger.VkLayer)
# -DFL_BUILD_TOOLS=ON -DFL_BUILD_TESTS=OFF a configuration error.
enable_testing()
# A TEST THAT WAS CUT SHORT IS NOT A PASS (2026-11-13).
#
# ctest calls a test passed when its process exits with 0. On 2026-11-13 the development PC's security software
# removed a freshly linked fl_guard_test.exe while the gate ran: the process ended early, with 0, and ctest printed
# "fl_guard ... Passed 0.66 sec" for a suite that takes three minutes. The gate went red only because the next test,
# fl_prescan, runs the same executable and could not find it -- by luck, not by design. An exit code cannot tell
# "finished and passed" from "stopped, and nobody complained".
#
# So every test in this tree must PRINT THE LINE IT ENDS ON, and ctest is told to look for it
# (PASS_REGULAR_EXPRESSION): the last thing the program writes when it has run to its end and passed. A run that
# stops before that line is red, whatever it returned.
#
# TWO THINGS ABOUT PASS_REGULAR_EXPRESSION, both learnt here before (tests/CMakeLists.txt, fl_nvapi_bridge): with it
# set ctest IGNORES THE EXIT CODE, so the line must be one the program prints only when it passed -- and where a
# program's summary can read "passed" beside a failure, FAIL_REGULAR_EXPRESSION names the failure. A SKIP_RETURN_CODE
# still wins: a test that says "cannot run here" is skipped, not failed for the line it never reached.
#
# fl_test_completes(<test> <regex>...) -- the test passes only if its output matches one of the expressions.
# fl_catch2_test_completes(<test>...) -- the same for a Catch2 executable: its own last line, or its summary row
# when a case was skipped, and never a row that names a failure.
# EVERY TEST MUST GO THROUGH ONE OF THE TWO: fl_require_every_test_completes(), at the end of this file, fails the
# CONFIGURE when a test in tests/ or tools/ has not -- a new test cannot be added without its last line.
function(fl_test_completes test)
if(ARGC LESS 2)
message(FATAL_ERROR "fl_test_completes(${test}): give the line the test ends on")
endif()
set_tests_properties(${test} PROPERTIES PASS_REGULAR_EXPRESSION "${ARGN}")
set_property(GLOBAL APPEND PROPERTY FL_TESTS_THAT_COMPLETE "${test}")
endfunction()
# Catch2's console reporter ends a run with "All tests passed (N assertions in M test cases)" when every case
# passed, and with a row "test cases: T | P passed | S skipped" when one was skipped (catch_reporter_helpers.cpp,
# printTestRunTotals: a count of zero has no column). A row with a failure has " | F failed" in it.
set(FL_CATCH2_COMPLETE "All tests passed \\(" "test cases: +[0-9]+ \\| +[0-9]+ passed \\| +[0-9]+ skipped")
set(FL_CATCH2_FAILED "\\| +[0-9]+ failed")
function(fl_catch2_test_completes)
foreach(test IN LISTS ARGN)
fl_test_completes(${test} ${FL_CATCH2_COMPLETE})
set_tests_properties(${test} PROPERTIES FAIL_REGULAR_EXPRESSION "${FL_CATCH2_FAILED}")
endforeach()
endfunction()
function(fl_collect_tests directory out)
get_property(found DIRECTORY "${directory}" PROPERTY TESTS)
get_property(subdirectories DIRECTORY "${directory}" PROPERTY SUBDIRECTORIES)
foreach(subdirectory IN LISTS subdirectories)
fl_collect_tests("${subdirectory}" nested)
list(APPEND found ${nested})
endforeach()
set(${out} "${found}" PARENT_SCOPE)
endfunction()
function(fl_require_every_test_completes)
get_property(complete GLOBAL PROPERTY FL_TESTS_THAT_COMPLETE)
set(missing "")
foreach(directory IN LISTS ARGN)
if(IS_DIRECTORY "${directory}")
fl_collect_tests("${directory}" tests)
foreach(test IN LISTS tests)
if(NOT test IN_LIST complete)
list(APPEND missing "${test}")
endif()
endforeach()
endif()
endforeach()
if(missing)
list(JOIN missing ", " names)
message(FATAL_ERROR
"These tests can be cut short and still pass: ${names}. Each needs the line it ends on -- "
"fl_test_completes() or fl_catch2_test_completes(), see the note above enable_testing().")
endif()
endfunction()
if(FL_BUILD_TESTS)
add_subdirectory(tests)
endif()
@@ -217,3 +290,13 @@ endif()
if(FL_BUILD_TOOLS)
add_subdirectory(tools)
endif()
# Last, when every test is registered: none may be left that passes on its exit code alone.
set(fl_test_directories "")
if(FL_BUILD_TESTS)
list(APPEND fl_test_directories "${CMAKE_CURRENT_SOURCE_DIR}/tests")
endif()
if(FL_BUILD_TOOLS)
list(APPEND fl_test_directories "${CMAKE_CURRENT_SOURCE_DIR}/tools")
endif()
fl_require_every_test_completes(${fl_test_directories})
@@ -277,12 +277,26 @@ enum class Collected : std::uint8_t {
// kProcessUnreadable -- so it is never a pass. ACCESS_DENIED (a protected process) is kFailed and is never retried.
// Every other consumer of Collected treats anything but kOk as a failure.
kRetry,
// EnumerateModules ONLY (owner decision D123, 2026-11-12): the module list CHANGED WHILE IT WAS READ -- a module
// that was in the list could not be named a moment later, because the process unloaded it, or was still loading
// it, between the two calls. Not a finding and not a protected process: a game at its launch loads and unloads
// modules for seconds. Until D123 this was kIncomplete and refused at once, which ended real sessions as a safety
// unhook with no frame recorded (five in the Agent's logs of one PC in a week: Phantom Blade Zero, Crown & Coin,
// Cyberpunk 2077). The module check reads the whole scan set again, up to kMaxUnsettledRereads times, each
// after kScanRetryPauseMs; a list that is still unsettled on the last read refuses as kModuleScanFailed -- so it
// is never a pass, and nothing that was not read whole is ever allowed. A list too long for the buffer stays
// kIncomplete and is not read again: a second read would be as long.
kUnsettled,
};
// How long the module check waits before its one re-read (D48). A process that was still loading has its modules
// How long the module check waits before a re-read (D48, D123). A process that was still loading has its modules
// well within it; one that has exited is out of the fresh snapshot.
inline constexpr std::uint32_t kScanRetryPauseMs = 250;
// How many times the module check reads the scan set again for a list that changed under the read (D123): three, so
// four reads in all and at most 750 ms of pauses. D48's re-read for a process still being created stays ONE.
inline constexpr std::uint32_t kMaxUnsettledRereads = 3;
// Callbacks receive (context, name) for each item found. Returning false stops
// enumeration early — used when a match has already been found.
using NameSink = bool (*)(void* ctx, const char* name);
@@ -391,9 +391,12 @@ Verdict LoadRules(const Sources& s, Rules& rules) noexcept {
// One pass of check 1 over a fresh scan set. `allowRetry` (D48): on the first pass a member that is still being
// created or already gone (Collected::kRetry) is noted in `retryWanted` and the pass goes on -- a finding in any other
// member still refuses at once; on the second pass the same answer refuses as kProcessUnreadable, exactly as an
// unreadable member always has. Anything but the four answers refuses too: no answer is a pass by omission.
// unreadable member always has. `allowUnsettled` (D123): the same for a member whose module list changed while it
// was read (Collected::kUnsettled), noted in `unsettledWanted`; when it is not allowed -- the last read -- the same
// answer refuses as kModuleScanFailed. Anything but the answers named refuses too: no answer is a pass by omission.
Verdict ScanModulesOnce(const Sources& s, const Rules& rules, std::uint32_t targetPid, const Tolerance* tolerance,
ToleratedFinding& finding, bool allowRetry, bool& retryWanted) noexcept {
ToleratedFinding& finding, bool allowRetry, bool& retryWanted, bool allowUnsettled,
bool& unsettledWanted) noexcept {
ScanSet set;
if (s.EnumerateScanSet(targetPid, &ScanSetSink, &set) != Collected::kOk || set.overflowed || set.count == 0) {
// An empty scan set is not "nothing to scan" — it is "we do not know
@@ -427,6 +430,16 @@ Verdict ScanModulesOnce(const Sources& s, const Rules& rules, std::uint32_t targ
if (c == Collected::kFailed || c == Collected::kRetry) {
return Refuse(Reason::kProcessUnreadable, nullptr, "a process in the scan set could not be read");
}
// D123: a list that changed under the read is read again from a fresh scan set -- AFTER the finding check
// above, so a blocklisted module among those that were read still refuses at once. The members read whole
// in this pass are read again too: the pass that allows is one in which every member was read whole.
if (c == Collected::kUnsettled) {
if (allowUnsettled) {
unsettledWanted = true;
continue;
}
return Refuse(Reason::kModuleScanFailed, nullptr, "a module list kept changing while it was read");
}
if (c != Collected::kOk) {
return Refuse(Reason::kModuleScanFailed, nullptr, "a module list came back incomplete");
}
@@ -464,24 +477,40 @@ Verdict ScanModulesOnce(const Sources& s, const Rules& rules, std::uint32_t targ
// whole. A member still unreadable then refuses as before; one that is gone is not in the new set; a target that is
// gone makes the new set unavailable, which refuses. The re-read can only turn a refusal of "could not read" into a
// full read -- never into a pass that skipped anything.
//
// D123 (owner decision, 2026-11-12): a member whose module list CHANGED WHILE IT WAS READ -- a game at its launch,
// loading and unloading -- refused the session the same way, and five real sessions on one PC ended as a safety
// unhook with no frame recorded. Such a list is read again the same way, up to kMaxUnsettledRereads times; one that
// has not settled by the last read refuses as kModuleScanFailed. D48's re-read stays ONE for the whole check: a
// member still being created on a second read refuses, whichever read first saw it. Every read is of the whole
// scan set, and the read that allows is one in which every member was read whole and none held a finding.
Verdict CheckModules(const Sources& s, const Rules& rules, std::uint32_t targetPid, const Tolerance* tolerance,
ToleratedFinding& finding) noexcept {
if (s.EnumerateScanSet == nullptr || s.EnumerateModules == nullptr) {
return Refuse(Reason::kProcessTreeUnavailable, nullptr, "no process source");
}
bool retryWanted = false;
const Verdict first = ScanModulesOnce(s, rules, targetPid, tolerance, finding, true, retryWanted);
if (!first.Allowed() || !retryWanted) {
return first;
bool retryUsed = false; // D48's one re-read, for the whole check
std::uint32_t unsettledRereads = 0; // D123's, up to kMaxUnsettledRereads
for (;;) {
bool retryWanted = false;
bool unsettledWanted = false;
const Verdict pass = ScanModulesOnce(s, rules, targetPid, tolerance, finding, !retryUsed, retryWanted,
unsettledRereads < kMaxUnsettledRereads, unsettledWanted);
// A refusal is final, and so is a pass in which every member was read whole. A `wanted` flag is only ever
// set where the pass was allowed to ask, so this cannot loop past either bound.
if (!pass.Allowed() || (!retryWanted && !unsettledWanted)) {
return pass;
}
retryUsed = retryUsed || retryWanted;
if (unsettledWanted) {
++unsettledRereads;
}
if (s.Pause != nullptr) {
s.Pause(kScanRetryPauseMs);
}
finding = ToleratedFinding{}; // collected again from the pass that decides
}
if (s.Pause != nullptr) {
s.Pause(kScanRetryPauseMs);
}
finding = ToleratedFinding{}; // collected again from the pass that decides
bool again = false;
return ScanModulesOnce(s, rules, targetPid, tolerance, finding, false, again);
}
// Check 2 — machine-wide drivers. Independent of process identity, which is
@@ -893,8 +922,10 @@ PresentationRuntime FindPresentationRuntime(const Sources& s, std::uint32_t pid)
}
RuntimeProbe p;
const Collected c = s.EnumerateModules(pid, &RuntimeSinkFn, &p);
if (c == Collected::kFailed || c == Collected::kRetry) {
return PresentationRuntime::kNone; // still in its loader, or unreadable -- the full scan refuses the latter
if (c == Collected::kFailed || c == Collected::kRetry || c == Collected::kUnsettled) {
// Still in its loader, a list that moved under the read (D123: half a list could miss vulkan-1.dll and send
// the Overlay into a Vulkan title), or unreadable -- the full scan refuses the last. The poll asks again.
return PresentationRuntime::kNone;
}
if (p.vk) {
return PresentationRuntime::kVulkan;
@@ -119,7 +119,11 @@ Collected EnumerateModulesImpl(std::uint32_t pid, ModuleSink sink, void* ctx) no
char name[MAX_PATH]{};
if (GetModuleBaseNameA(h, mods[i], name, MAX_PATH) == 0) {
CloseHandle(h);
return Collected::kIncomplete; // a module we could not name is one we could not check
// A module we could not name is one we could not check -- and it WAS in the list a moment ago, so the
// list moved under the read (unloaded, or its loader entry not yet whole). The module check reads the
// scan set again a bounded number of times and refuses if it never settles (D123); until then this was
// kIncomplete, an immediate refusal.
return Collected::kUnsettled;
}
// The load path, for §S22(b)'s ownership question. Failing to get it is
@@ -34,6 +34,8 @@ add_dependencies(FrameLedger.Overlay fl_ac_floor_gen)
target_link_libraries(FrameLedger.Overlay PRIVATE fl_ac_floor)
target_link_libraries(FrameLedger.Overlay PRIVATE FrameLedger.Shm fl_dxgi_vtable fl_native_flags fl_hostile_env_flags minhook
fl_streamline_headers fl_fidelityfx_headers fl_fsr3_host_headers
# NVAPI's headers and NOT its library (third_party/CMakeLists.txt says why): fl_reflex.h's structs and ids.
fl_nvapi_headers
# Advapi32: the ring's DACL. User32: WindowFromDC / GetClientRect for the OpenGL
# output size. Shell32 + Ole32: SHGetKnownFolderPath for the native log's
# directory (§S21's resolution, not the environment), init/watchdog thread only.
@@ -15,6 +15,9 @@
// m const FfxApiEffectMemoryUsage& what ffxQuery wrote, after it answered OK
// q the memory query's descriptor (its out-pointer), and `desc`, its header (its type)
//
// (and since train C three more, for what the driver wrote into the Overlay's own buffers: `lr`, `lf` and `ls` --
// the section "REFLEX LATENCY" below says what they are and why they are here.)
//
// RULE 4. Each is an argument of a call the Overlay hooks, or what that call wrote
// through an out-pointer the game gave it. Nothing else is dereferenced: no
// resource, no command list, no callback, and never a camera's position, axes or
@@ -41,10 +44,12 @@
#include <atomic>
#include <bit>
#include <cstdint>
#include <fl_reflex.h>
#include <fl_shm.h>
#include <sl.h>
// After sl.h, as fl_sl_inputs.h explains: sl_dlss.h has no includes of its own.
#include <ffx_api.h>
#include <ffx_framegeneration.h>
#include <ffx_upscale.h>
#include <sl_dlss.h>
@@ -57,6 +62,18 @@ inline bool Usable(float v) noexcept {
return (std::bit_cast<uint32_t>(v) & 0x7FFFFFFFu) < 0x7F7FFFFFu;
}
// A depth plane as FSR is handed one (owner decision D119): an ordinary value as its bits; FLT_MAX or +infinity --
// how an engine with an infinite depth says "this plane is at infinity" -- as FL_ADV_FLOAT_INFINITE; anything else
// (a NaN, a negative infinity, -FLT_MAX) as "no value". FOR THE ffx ROUTE ONLY: Streamline's INVALID_FLOAT is
// FLT_MAX and means nobody set it, which is why Usable refuses it everywhere else.
inline uint32_t FfxDepthPlaneBits(float v) noexcept {
const uint32_t bits = std::bit_cast<uint32_t>(v);
if (Usable(v)) {
return bits;
}
return bits == 0x7F7FFFFFu || bits == FL_ADV_FLOAT_INFINITE ? FL_ADV_FLOAT_INFINITE : FL_ADV_FLOAT_NONE;
}
inline float Magnitude(float v) noexcept {
return std::bit_cast<float>(std::bit_cast<uint32_t>(v) & 0x7FFFFFFFu);
}
@@ -150,8 +167,62 @@ struct Accumulators {
std::atomic<uint64_t> ffxMemoryAliasableBytes{0u};
std::atomic<uint32_t> ffxMemoryQueries{0u};
std::atomic<uint32_t> ffxMemoryOwner{0u}; // leaf + 1 of the module whose answered queries are counted
// ffxConfigure with a frame-generation descriptor (0.1.0-beta.43)
std::atomic<uint32_t> ffxFgOwner{0u}; // leaf + 1 of the module whose configures are counted
std::atomic<uint32_t> ffxFgConfigures{0u};
std::atomic<uint32_t> ffxFgEnabledSeen{0u}; // bit 0: seen off; bit 1: seen on
std::atomic<uint32_t> ffxFgAsyncSeen{0u}; // the same two bits
std::atomic<uint32_t> ffxFgOnlyGeneratedSeen{0u}; // the same two bits
std::atomic<uint32_t> ffxFgFlagsSeen{0u};
std::atomic<uint64_t> ffxFgRect{0u}; // PackRect: the last rectangle, in ONE word so it is never half of two
// sl::Constants (0.1.0-beta.43), summarised - from the first viewport seen; the calls count every viewport
std::atomic<uint64_t> slViewport{0u}; // that viewport's id + 1; 0 = none yet
std::atomic<uint32_t> slConstantsCalls{0u};
std::atomic<uint32_t> slResets{0u};
std::atomic<uint32_t> slJitterMaxXBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slJitterMaxYBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slMvecScaleXBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slMvecScaleYBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slNearBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slFarBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slFovMinBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slFovMaxBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slAspectBits{FL_ADV_FLOAT_NONE};
std::atomic<uint32_t> slFlagsSeenTrue{0u};
std::atomic<uint32_t> slFlagsSeenFalse{0u};
// What Streamline answered about each feature the game asked about (0.1.0-beta.44): FL_ADV_FEATURE_SLOTS slots
// of FL_ADV_FEATURE_WORDS words, laid out as the region's `features` (fl_shm.h). Kept across a new request.
std::atomic<uint32_t> features[FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS]{};
// slShutdown calls since the request (0.1.0-beta.45)
std::atomic<uint32_t> slShutdowns{0u};
};
// Word 1 of a feature slot: which of the two questions has an answer in it.
inline constexpr uint32_t kFeatureVersionAnswered = 1u << 0;
inline constexpr uint32_t kFeatureRequirementsAnswered = 1u << 1;
// 0.1.0-beta.45: whether it is supported (and the sl::Result that said so, in bits 8..15), whether it is loaded (and
// what the answer was), and whether the game was seen to switch it off or on.
inline constexpr uint32_t kFeatureSupportAnswered = 1u << 2;
inline constexpr uint32_t kFeatureLoadedAnswered = 1u << 3;
inline constexpr uint32_t kFeatureLoadedValue = 1u << 4;
inline constexpr uint32_t kFeatureSwitchedOff = 1u << 5;
inline constexpr uint32_t kFeatureSwitchedOn = 1u << 6;
inline constexpr uint32_t kFeatureSupportResultShift = 8u;
inline constexpr uint32_t kFeatureSupportResultMask = 0xFFu << kFeatureSupportResultShift;
// What of word 1 is a SESSION's -- what the game did while it was watched -- and is cleared by a new request. The
// rest is a fact about the process (which version, what it requires, whether it is supported and loaded) and stays.
// How many times the game allocated and freed the feature's resources: four bits each, stopping at 15.
inline constexpr uint32_t kFeatureAllocShift = 16u;
inline constexpr uint32_t kFeatureFreeShift = 20u;
inline constexpr uint32_t kFeatureCountMask = 0xFu;
inline constexpr uint32_t kFeatureSessionBits = kFeatureSwitchedOff | kFeatureSwitchedOn |
(kFeatureCountMask << kFeatureAllocShift) |
(kFeatureCountMask << kFeatureFreeShift);
// Whether `leaf` is the module whose calls a summary counts: the first one seen, and
// from then on only it. A title that goes through the loader has the same call
// arrive at two hooked modules; a count is a count of calls and not of hooks.
@@ -237,11 +308,12 @@ inline void ObserveFfxUpscale(uint32_t leaf, const ffxDispatchDescUpscale& d, Ac
KeepMax(a.ffxPreExposureMaxBits, d.preExposure);
}
if (Usable(d.cameraNear)) {
a.ffxNearBits.store(std::bit_cast<uint32_t>(d.cameraNear), std::memory_order_relaxed);
// The two depth planes, the last of each; one of them may be at infinity (D119).
if (const uint32_t nearBits = FfxDepthPlaneBits(d.cameraNear); nearBits != FL_ADV_FLOAT_NONE) {
a.ffxNearBits.store(nearBits, std::memory_order_relaxed);
}
if (Usable(d.cameraFar)) {
a.ffxFarBits.store(std::bit_cast<uint32_t>(d.cameraFar), std::memory_order_relaxed);
if (const uint32_t farBits = FfxDepthPlaneBits(d.cameraFar); farBits != FL_ADV_FLOAT_NONE) {
a.ffxFarBits.store(farBits, std::memory_order_relaxed);
}
// The field of view as a range (owner decision D114): the lowest and the highest, never a series.
if (Usable(d.cameraFovAngleVertical) && d.cameraFovAngleVertical > 0.0f) {
@@ -294,15 +366,502 @@ inline void ObserveFfxMemoryQuery(uint32_t leaf, const ffxQueryDescHeader* desc,
}
}
// A rectangle in one 64-bit word, sixteen bits a side: left, top, width, height from the lowest. The detour stores
// it with one store and the watchdog reads it with one load, so a publication never carries the left edge of one
// rectangle beside the width of the next. A side that is negative or does not fit in fifteen bits makes the whole
// word kRectUnfit, which Publish writes as four -1: a rectangle nobody can state rather than a clipped one.
inline constexpr uint64_t kRectUnfit = 0xFFFFFFFFFFFFFFFFull;
inline uint64_t PackRect(int32_t left, int32_t top, int32_t width, int32_t height) noexcept {
const auto fits = [](int32_t v) noexcept { return v >= 0 && v <= 0x7FFF; };
if (!fits(left) || !fits(top) || !fits(width) || !fits(height)) {
return kRectUnfit;
}
return static_cast<uint64_t>(left) | (static_cast<uint64_t>(top) << 16) | (static_cast<uint64_t>(width) << 32) |
(static_cast<uint64_t>(height) << 48);
}
// How the game configures FSR frame generation (ffxConfigure, 0.1.0-beta.43). Read only when the header's type is
// the frame-generation configuration -- a key-value pair, a distortion field or the camera info arriving through the
// same call is passed over with nothing but its type looked at.
//
// WHAT IS READ: whether generation is on, whether it may run asynchronously, the flags, whether only generated
// frames are presented, and the rectangle generated in. WHAT IS NOT, EVER: the swapchain, the two callbacks and
// their contexts, the HUD-less resource and the frame id that sit in the same descriptor.
//
// ONE MODULE'S CONFIGURES ARE COUNTED (Owns), with a slot of its own: behind a loader the same call reaches the
// loader and the leaf, and a title's upscale may be owned by another module than its frame generation.
inline void ObserveFfxConfigure(uint32_t leaf, const ffxConfigureDescHeader* desc, Accumulators& a) noexcept {
if (desc == nullptr || desc->type != FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION) {
return;
}
if (!Owns(a.ffxFgOwner, leaf)) {
return;
}
const auto& g = *reinterpret_cast<const ffxConfigureDescFrameGeneration*>(desc);
a.ffxFgConfigures.fetch_add(1u, std::memory_order_relaxed);
NoteBits(a.ffxFgEnabledSeen, ByteIsSet(g.frameGenerationEnabled) ? 2u : 1u);
NoteBits(a.ffxFgAsyncSeen, ByteIsSet(g.allowAsyncWorkloads) ? 2u : 1u);
NoteBits(a.ffxFgOnlyGeneratedSeen, ByteIsSet(g.onlyPresentGenerated) ? 2u : 1u);
if (g.flags != 0u) {
NoteBits(a.ffxFgFlagsSeen, g.flags);
}
a.ffxFgRect.store(
PackRect(g.generationRect.left, g.generationRect.top, g.generationRect.width, g.generationRect.height),
std::memory_order_relaxed);
NoteBits(a.validMask, FL_ADV_VALID_FFX_FG_CONFIG);
}
// One sl::Boolean of sl::Constants into the two "seen" words: true sets its bit in `seenTrue`, false in `seenFalse`,
// the third state ("invalid": the game set nothing) in neither.
inline void NoteSlBoolean(sl::Boolean value, uint32_t bit, uint32_t& seenTrue, uint32_t& seenFalse) noexcept {
if (value == sl::Boolean::eTrue) {
seenTrue |= bit;
} else if (value == sl::Boolean::eFalse) {
seenFalse |= bit;
}
}
// What the game told Streamline about a frame (slSetConstants, 0.1.0-beta.43). The caller has matched the struct's
// GUID and found its version at least 1, on THIS call (fl_sl_inputs.h IsReadable): every member read below is one
// version 1 carries (17_HOOK_ENGINE "Which struct version carries which field").
//
// WHAT IS READ: the jitter, the motion-vector scale, the two depth planes, the field of view, the aspect ratio and
// the seven Booleans. WHAT IS NOT, EVER: the five matrices that precede them and the pinhole offset, the camera's
// position and its three axes that sit between the scale and the planes (rule 4). Nothing here names them, and
// tools/overlay-fields-check.ps1 fails the build if anything in the code loaded into a game does.
//
// THE SUMMARIES ARE THE FIRST VIEWPORT'S. A title with two viewports -- a scene and a picture-in-picture, a
// split screen -- sets constants for each every frame; "the last value seen" across them would flip twice a frame
// and a range would span two cameras. The first viewport that calls is the one summarised, for the life of the
// process. The call count is of every viewport: it says how often the game called.
//
// FLT_MAX IS "NOT SET" HERE (Streamline's INVALID_FLOAT) and is kept nowhere: the plane at infinity of D119 is
// FidelityFX's convention and stays on that route.
inline void ObserveSlConstants(const sl::Constants& k, uint32_t viewport, Accumulators& a) noexcept {
a.slConstantsCalls.fetch_add(1u, std::memory_order_relaxed);
const uint64_t me = static_cast<uint64_t>(viewport) + 1u;
uint64_t owner = a.slViewport.load(std::memory_order_relaxed);
if (owner == 0u && a.slViewport.compare_exchange_strong(owner, me, std::memory_order_relaxed)) {
owner = me;
}
if (owner != me) {
return;
}
if (Usable(k.jitterOffset.x) && Usable(k.jitterOffset.y)) {
KeepMax(a.slJitterMaxXBits, Magnitude(k.jitterOffset.x));
KeepMax(a.slJitterMaxYBits, Magnitude(k.jitterOffset.y));
}
if (Usable(k.mvecScale.x) && Usable(k.mvecScale.y)) {
a.slMvecScaleXBits.store(std::bit_cast<uint32_t>(k.mvecScale.x), std::memory_order_relaxed);
a.slMvecScaleYBits.store(std::bit_cast<uint32_t>(k.mvecScale.y), std::memory_order_relaxed);
}
if (Usable(k.cameraNear)) {
a.slNearBits.store(std::bit_cast<uint32_t>(k.cameraNear), std::memory_order_relaxed);
}
if (Usable(k.cameraFar)) {
a.slFarBits.store(std::bit_cast<uint32_t>(k.cameraFar), std::memory_order_relaxed);
}
// A range, lowest to highest, never a series (D114).
if (Usable(k.cameraFOV) && k.cameraFOV > 0.0f) {
KeepMin(a.slFovMinBits, k.cameraFOV);
KeepMax(a.slFovMaxBits, k.cameraFOV);
}
if (Usable(k.cameraAspectRatio) && k.cameraAspectRatio > 0.0f) {
a.slAspectBits.store(std::bit_cast<uint32_t>(k.cameraAspectRatio), std::memory_order_relaxed);
}
// One bit per Boolean, in the header's order (FlAdvancedState::slFlagsSeenTrue).
uint32_t seenTrue = 0u;
uint32_t seenFalse = 0u;
NoteSlBoolean(k.depthInverted, 1u << 0, seenTrue, seenFalse);
NoteSlBoolean(k.cameraMotionIncluded, 1u << 1, seenTrue, seenFalse);
NoteSlBoolean(k.motionVectors3D, 1u << 2, seenTrue, seenFalse);
NoteSlBoolean(k.reset, 1u << 3, seenTrue, seenFalse);
NoteSlBoolean(k.orthographicProjection, 1u << 4, seenTrue, seenFalse);
NoteSlBoolean(k.motionVectorsDilated, 1u << 5, seenTrue, seenFalse);
NoteSlBoolean(k.motionVectorsJittered, 1u << 6, seenTrue, seenFalse);
NoteBits(a.slFlagsSeenTrue, seenTrue);
NoteBits(a.slFlagsSeenFalse, seenFalse);
if ((seenTrue & (1u << 3)) != 0u) {
a.slResets.fetch_add(1u, std::memory_order_relaxed);
}
NoteBits(a.validMask, FL_ADV_VALID_SL_CONSTANTS);
}
// The slot of `feature`: the one that holds it already, else the first empty one, claimed here. nullptr when every
// slot holds another feature -- a thirteenth is not kept -- and for the one id that cannot be stored plus one.
// Slots fill from 0 and are never emptied, so the first empty slot ends the search.
inline std::atomic<uint32_t>* FeatureSlot(uint32_t feature, Accumulators& a) noexcept {
const uint32_t id = feature + 1u;
if (id == 0u) {
return nullptr;
}
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS; ++i) {
std::atomic<uint32_t>* slot = &a.features[i * FL_ADV_FEATURE_WORDS];
uint32_t held = slot[0].load(std::memory_order_relaxed);
if (held == 0u && slot[0].compare_exchange_strong(held, id, std::memory_order_relaxed)) {
return slot;
}
if (held == id) { // it was there, or another thread asking about the same feature claimed it just now
return slot;
}
}
return nullptr;
}
// Three words of a slot from one sl::Version: major, minor, build.
inline void PutVersion(std::atomic<uint32_t>* words, const sl::Version& number) noexcept {
words[0].store(number.major, std::memory_order_relaxed);
words[1].store(number.minor, std::memory_order_relaxed);
words[2].store(number.build, std::memory_order_relaxed);
}
// What slGetFeatureVersion ANSWERED (0.1.0-beta.44): the caller is the detour, after the original returned OK and
// the struct's GUID and version were checked. Both members are version 1's (17_HOOK_ENGINE "Which struct version
// carries which field"). A feature asked about again overwrites its own slot: the last answer is the one kept.
inline void ObserveSlFeatureVersion(uint32_t feature, const sl::FeatureVersion& fv, Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
PutVersion(slot + 2, fv.versionSL);
PutVersion(slot + 5, fv.versionNGX);
NoteBits(slot[1], kFeatureVersionAnswered);
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
// What slGetFeatureRequirements ANSWERED (0.1.0-beta.44), under the same conditions. WHAT IS READ: the flags, three
// counts, the number of required buffer tags, and four versions -- every one a member of struct version 1, the last
// of them `driverVersionRequired`. WHAT IS NOT, EVER: `requiredTags`, the pointer the count belongs to, and every
// member after the versions -- the Vulkan queue counts and the pointers to the names of extensions and features.
// Nothing here follows a pointer of the game's.
inline void ObserveSlFeatureRequirements(uint32_t feature, const sl::FeatureRequirements& fr,
Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
slot[8].store(static_cast<uint32_t>(fr.flags), std::memory_order_relaxed);
slot[9].store(fr.maxNumCPUThreads, std::memory_order_relaxed);
slot[10].store(fr.maxNumViewports, std::memory_order_relaxed);
slot[11].store(fr.numRequiredTags, std::memory_order_relaxed);
PutVersion(slot + 12, fr.osVersionDetected);
PutVersion(slot + 15, fr.osVersionRequired);
PutVersion(slot + 18, fr.driverVersionDetected);
PutVersion(slot + 21, fr.driverVersionRequired);
NoteBits(slot[1], kFeatureRequirementsAnswered);
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
// Some bits of a word replaced by others, the rest left as they are: two detours may be writing different fields of
// the same slot's word 1.
inline void PutBits(std::atomic<uint32_t>& word, uint32_t mask, uint32_t bits) noexcept {
uint32_t seen = word.load(std::memory_order_relaxed);
while ((seen & mask) != bits) {
if (word.compare_exchange_weak(seen, (seen & ~mask) | bits, std::memory_order_relaxed)) {
break;
}
}
}
// What slIsFeatureSupported ANSWERED about a feature (0.1.0-beta.45): the sl::Result itself, whatever it is -- a
// refusal is the answer to this question, where for a version or a requirement it is the absence of one. The last
// answer is the one kept. The adapter the game asked about is not an argument of this function: the detour never
// hands it over, and nothing here could read it (owner decision D131).
inline void ObserveSlFeatureSupported(uint32_t feature, uint32_t result, Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
const uint32_t code = result > 0xFEu ? 0xFFu : result;
PutBits(slot[1], kFeatureSupportResultMask | kFeatureSupportAnswered,
(code << kFeatureSupportResultShift) | kFeatureSupportAnswered);
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
// What slIsFeatureLoaded ANSWERED (0.1.0-beta.45): the caller is the detour, after the original said OK and wrote
// the bool. The last answer is the one kept.
inline void ObserveSlFeatureLoaded(uint32_t feature, bool loaded, Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
PutBits(slot[1], kFeatureLoadedAnswered | kFeatureLoadedValue,
kFeatureLoadedAnswered | (loaded ? kFeatureLoadedValue : 0u));
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
// What the game told slSetFeatureLoaded (0.1.0-beta.45): off, on, or over a session both. What the game ASKED --
// whether Streamline did it is slIsFeatureLoaded's to say.
inline void ObserveSlSetFeatureLoaded(uint32_t feature, bool loaded, Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
NoteBits(slot[1], loaded ? kFeatureSwitchedOn : kFeatureSwitchedOff);
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
// One more in a four-bit count of a slot's word 1, which stops at 15 and never carries into its neighbour.
inline void BumpCount(std::atomic<uint32_t>& word, uint32_t shift) noexcept {
uint32_t seen = word.load(std::memory_order_relaxed);
while (((seen >> shift) & kFeatureCountMask) != kFeatureCountMask) {
if (word.compare_exchange_weak(seen, seen + (1u << shift), std::memory_order_relaxed)) {
break;
}
}
}
// The game allocating, and freeing, a feature's resources (0.1.0-beta.45): counted for the feature and nothing else
// -- the command buffer and the viewport of the same calls are not arguments of these functions.
inline void ObserveSlAllocateResources(uint32_t feature, Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
BumpCount(slot[1], kFeatureAllocShift);
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
inline void ObserveSlFreeResources(uint32_t feature, Accumulators& a) noexcept {
std::atomic<uint32_t>* slot = FeatureSlot(feature, a);
if (slot == nullptr) {
return;
}
BumpCount(slot[1], kFeatureFreeShift);
NoteBits(a.validMask, FL_ADV_VALID_SL_FEATURES);
}
// The game shutting Streamline down (0.1.0-beta.45): a count.
inline void ObserveSlShutdown(Accumulators& a) noexcept {
a.slShutdowns.fetch_add(1u, std::memory_order_relaxed);
NoteBits(a.validMask, FL_ADV_VALID_SL_SHUTDOWN);
}
// ---------------------------------------------------------------------------------------------------------------------
// REFLEX LATENCY (train C; owner decisions D132, D136, D138-D141; fl_reflex.h; fl_shm.h's latency words).
//
// THE ONE GROUP HERE THAT IS NOT AN ARGUMENT OF A HOOKED CALL. The two structs below are what the driver wrote into
// buffers the OVERLAY handed to its two read-only getters (fl_reflex.h makes the calls). The members read are on
// the same list as every other, through three more parameters with fixed names:
//
// lr const NV_LATENCY_RESULT_PARAMS& the report: sixty-four frames
// lf const NV_LATENCY_RESULT_PARAMS::FrameReport& one frame of it, handed on by index and never aliased
// 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 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
// reported, which is not a fault of the frame: without a sleep mode the driver leaves driverStartTime zero in every
// frame. A span that runs backwards or lasts more than a second is one no frame can have, and that frame is
// refused whole; so is a frame with no total. Frame ids that go backwards are a game that started counting again.
//
// The caller owns the tally and the cursor (dllmain.cpp's gate says who that is at any moment): nothing here is
// atomic, and nothing here calls out.
// ---------------------------------------------------------------------------------------------------------------------
inline constexpr uint32_t kLatSpans =
7u; // simulation, submit, present, driver, OS queue, GPU, total: the region's order
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);
// 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;
};
// Where the reader is in the game's frame ids: the newest one already summed or refused. 0 = none yet.
struct LatencyCursor {
uint64_t lastFrameId = 0;
};
inline constexpr uint32_t kLatSpanReported = 0u;
inline constexpr uint32_t kLatSpanAbsent = 1u;
inline constexpr uint32_t kLatSpanImpossible = 2u;
inline uint32_t LatencySpan(uint64_t start, uint64_t end, uint32_t& us) noexcept {
us = 0u;
if (start == 0u || end == 0u) {
return kLatSpanAbsent;
}
if (end < start || end - start > kLatSpanLimitUs) {
return kLatSpanImpossible;
}
us = static_cast<uint32_t>(end - start);
return kLatSpanReported;
}
// A slot of the report the driver put nothing in.
inline bool LatencyFrameIsEmpty(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf) noexcept {
return lf.frameID == 0u && lf.simStartTime == 0u && lf.gpuRenderEndTime == 0u;
}
inline uint64_t LatencyFrameId(const NV_LATENCY_RESULT_PARAMS::FrameReport& lf) noexcept {
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] = {
LatencySpan(lf.simStartTime, lf.simEndTime, us[0]),
LatencySpan(lf.renderSubmitStartTime, lf.renderSubmitEndTime, us[1]),
LatencySpan(lf.presentStartTime, lf.presentEndTime, us[2]),
LatencySpan(lf.driverStartTime, lf.driverEndTime, us[3]),
LatencySpan(lf.osRenderQueueStartTime, lf.osRenderQueueEndTime, us[4]),
LatencySpan(lf.gpuRenderStartTime, lf.gpuRenderEndTime, us[5]),
LatencySpan(lf.simStartTime, lf.gpuRenderEndTime, us[kLatTotal]),
};
bool refuse = kind[kLatTotal] != kLatSpanReported; // no total, or one no frame can have
for (uint32_t i = 0; i < kLatTotal; ++i) {
refuse = refuse || kind[i] == kLatSpanImpossible;
}
if (refuse) {
++tally.refused;
return;
}
++tally.frames;
for (uint32_t i = 0; i < kLatSpans; ++i) {
if (kind[i] == kLatSpanAbsent) {
tally.lacking |= 1u << i;
} else {
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.
inline void ObserveLatencyReport(const NV_LATENCY_RESULT_PARAMS& lr, LatencyCursor& cursor,
LatencyTally& tally) noexcept {
tally = LatencyTally{};
uint64_t newest = 0u;
uint64_t second = 0u;
for (uint32_t i = 0; i < kLatReportFrames; ++i) {
if (LatencyFrameIsEmpty(lr.frameReport[i])) {
continue;
}
const uint64_t id = LatencyFrameId(lr.frameReport[i]);
if (id > newest) {
second = newest;
newest = id;
} else if (id > second && id != newest) {
second = id;
}
}
if (newest == 0u) {
return; // a report of nothing
}
if (newest < cursor.lastFrameId) {
cursor.lastFrameId = 0u; // the game's frame ids started again
}
uint64_t last = cursor.lastFrameId;
for (uint32_t i = 0; i < kLatReportFrames; ++i) {
if (LatencyFrameIsEmpty(lr.frameReport[i])) {
continue;
}
const uint64_t id = LatencyFrameId(lr.frameReport[i]);
if (id <= cursor.lastFrameId || id >= second) {
continue; // summed already, or one of the two newest
}
ObserveLatencyFrame(lr.frameReport[i], tally);
last = id > last ? id : last;
}
cursor.lastFrameId = last;
}
// The driver's sleep status: which of its five switches are on (bit n, in the struct's order -- fl_shm.h) and its
// frame-generation multiplier. The driver's words, not the game's: see FlLatencyState.
struct LatencySleep {
uint32_t on = 0;
uint32_t multiplier = 0; // its frame-generation multiplier
};
inline LatencySleep ObserveSleepStatus(const NV_GET_SLEEP_STATUS_PARAMS& ls) noexcept {
LatencySleep seen{};
seen.on = (ls.bLowLatencyMode != 0u ? 1u : 0u) | (ls.bFsVrr != 0u ? 2u : 0u) | (ls.bCplVsyncOn != 0u ? 4u : 0u) |
(ls.bUseGameSleep != 0u ? 8u : 0u) | (ls.bFullscreenIFlip != 0u ? 16u : 0u);
seen.multiplier = static_cast<uint32_t>(ls.fgMultiplier);
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
};
inline uint32_t LatencySum(const LatencyTally& tally, uint32_t span) noexcept {
if (tally.frames == 0u) {
return 0u;
}
return (tally.lacking & (1u << span)) != 0u ? FL_LAT_SUM_NONE : tally.sumUs[span];
}
inline uint32_t Stop16(uint32_t value) noexcept {
return value > 0xFFFFu ? 0xFFFFu : value;
}
// A NEW REQUEST: the summaries start afresh, so a session's ranges, masks and
// counts are its own and not those of the session before it in the same game.
// THE WATCHDOG'S. A detour running beside it loses nothing that matters: what it
// stores is of the call it is in, which belongs to the request that is starting.
// The two owners stay - which module's calls are counted is a fact about the
// process, not about a session.
// process, not about a session. SO DO THE FEATURE SLOTS (0.1.0-beta.44): what
// version a feature is and what it requires do not change while the game runs,
// and a game asks once, while it starts -- a second session of the same process
// would otherwise have nothing where the first had the answer. Their bit of the
// mask is therefore kept with them.
inline void Reset(Accumulators& a) noexcept {
const auto relaxed = std::memory_order_relaxed;
a.validMask.store(0u, relaxed);
a.validMask.store(a.features[0].load(relaxed) != 0u ? static_cast<uint32_t>(FL_ADV_VALID_SL_FEATURES) : 0u,
relaxed);
a.dlssStructVersion.store(0u, relaxed);
a.dlssOptionsSeen.store(0u, relaxed);
a.dlssOutputWidth.store(0u, relaxed);
@@ -330,13 +889,48 @@ inline void Reset(Accumulators& a) noexcept {
a.ffxMemoryTotalBytes.store(0u, relaxed);
a.ffxMemoryAliasableBytes.store(0u, relaxed);
a.ffxMemoryQueries.store(0u, relaxed);
a.ffxFgConfigures.store(0u, relaxed);
a.ffxFgEnabledSeen.store(0u, relaxed);
a.ffxFgAsyncSeen.store(0u, relaxed);
a.ffxFgOnlyGeneratedSeen.store(0u, relaxed);
a.ffxFgFlagsSeen.store(0u, relaxed);
a.ffxFgRect.store(0u, relaxed);
// Which viewport is summarised stays, as the owners do: a fact about the process.
a.slConstantsCalls.store(0u, relaxed);
a.slResets.store(0u, relaxed);
a.slJitterMaxXBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slJitterMaxYBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slMvecScaleXBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slMvecScaleYBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slNearBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slFarBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slFovMinBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slFovMaxBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slAspectBits.store(FL_ADV_FLOAT_NONE, relaxed);
a.slFlagsSeenTrue.store(0u, relaxed);
a.slFlagsSeenFalse.store(0u, relaxed);
a.slShutdowns.store(0u, relaxed);
// The feature slots stay; what of their word 1 is a session's does not (0.1.0-beta.45).
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS; ++i) {
std::atomic<uint32_t>* slot = &a.features[static_cast<size_t>(i) * FL_ADV_FEATURE_WORDS];
if (slot[0].load(relaxed) == 0u) {
break;
}
if ((slot[1].load(relaxed) & kFeatureSessionBits) != 0u) {
slot[1].fetch_and(~kFeatureSessionBits, relaxed);
}
}
}
// Copies the accumulators into region 5, under the request they answer. THE
// WATCHDOG'S, and only the watchdog's: one writer, so the seqlock is odd -> stores
// -> even with no compare-exchange. The frame-time pair is drained, so each
// publication carries the dispatches since the last one.
inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request, uint64_t qpc) noexcept {
//
// `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) {
return;
}
@@ -360,6 +954,28 @@ inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request,
put32(region->request, request);
put64(region->sampleQpc, qpc);
if (latency != nullptr) {
LatencyOut& out = *latency;
put32(region->latState, (out.state & FL_LAT_STATE_MASK) |
((out.sleepSeenOn & FL_LAT_SLEEP_BITS) << FL_LAT_SLEEP_SEEN_ON_SHIFT) |
((out.sleepSeenOff & FL_LAT_SLEEP_BITS) << FL_LAT_SLEEP_SEEN_OFF_SHIFT) |
((out.multiplier > 255u ? 255u : out.multiplier) << FL_LAT_FG_MULTIPLIER_SHIFT));
put32(region->latReads, Stop16(out.reads) | (Stop16(out.worstUs) << 16));
put32(region->latFrames, Stop16(out.tally.frames) | (Stop16(out.tally.refused) << 16));
put32(region->latSimulationSumUs, LatencySum(out.tally, 0u));
put32(region->latSubmitSumUs, LatencySum(out.tally, 1u));
put32(region->latPresentSumUs, LatencySum(out.tally, 2u));
put32(region->latDriverSumUs, LatencySum(out.tally, 3u));
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
}
put32(region->dlssStructVersion, a.dlssStructVersion.load(relaxed));
put32(region->dlssOptionsSeen, a.dlssOptionsSeen.load(relaxed));
put32(region->dlssOutputWidth, a.dlssOutputWidth.load(relaxed));
@@ -397,6 +1013,36 @@ inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request,
put64(region->ffxMemoryAliasableBytes, a.ffxMemoryAliasableBytes.load(relaxed));
put32(region->ffxMemoryQueries, a.ffxMemoryQueries.load(relaxed));
put32(region->ffxFgConfigures, a.ffxFgConfigures.load(relaxed));
put32(region->ffxFgEnabledSeen, a.ffxFgEnabledSeen.load(relaxed));
put32(region->ffxFgAsyncSeen, a.ffxFgAsyncSeen.load(relaxed));
put32(region->ffxFgOnlyGeneratedSeen, a.ffxFgOnlyGeneratedSeen.load(relaxed));
put32(region->ffxFgFlagsSeen, a.ffxFgFlagsSeen.load(relaxed));
const uint64_t rect = a.ffxFgRect.load(relaxed);
for (uint32_t i = 0; i < 4u; ++i) {
const auto side = rect == kRectUnfit ? int32_t{-1} : static_cast<int32_t>((rect >> (16u * i)) & 0xFFFFu);
std::atomic_ref<int32_t>{region->ffxFgRect[i]}.store(side, relaxed);
}
put32(region->slConstantsCalls, a.slConstantsCalls.load(relaxed));
put32(region->slResets, a.slResets.load(relaxed));
put32(region->slJitterMaxXBits, a.slJitterMaxXBits.load(relaxed));
put32(region->slJitterMaxYBits, a.slJitterMaxYBits.load(relaxed));
put32(region->slMvecScaleXBits, a.slMvecScaleXBits.load(relaxed));
put32(region->slMvecScaleYBits, a.slMvecScaleYBits.load(relaxed));
put32(region->slNearBits, a.slNearBits.load(relaxed));
put32(region->slFarBits, a.slFarBits.load(relaxed));
put32(region->slFovMinBits, a.slFovMinBits.load(relaxed));
put32(region->slFovMaxBits, a.slFovMaxBits.load(relaxed));
put32(region->slAspectBits, a.slAspectBits.load(relaxed));
put32(region->slFlagsSeenTrue, a.slFlagsSeenTrue.load(relaxed));
put32(region->slFlagsSeenFalse, a.slFlagsSeenFalse.load(relaxed));
put32(region->slShutdowns, a.slShutdowns.load(relaxed));
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS; ++i) {
put32(region->features[i], a.features[i].load(relaxed));
}
std::atomic_ref<uint32_t> samples{region->samples};
samples.store(samples.load(relaxed) + 1u, relaxed);
seq.store(odd + 1u, std::memory_order_release);
@@ -0,0 +1,119 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// Which descriptor types an ffx-api module was handed, for the native log
// (17_HOOK_ENGINE §Native logging; 0.1.0-beta.42, owner decision D121).
//
// WHY. Cyberpunk 2077, set to FSR upscaling with FSR frame generation, was
// recorded with frame generation measured and the upscaler "unknown": the
// PREPARE and FRAMEGENERATION dispatches arrived and no UPSCALE dispatch ever
// did. Nothing in the field could say where the upscale went -- the record
// carries what was decoded, never what was not. This keeps, per hooked module
// and per entry point, the distinct values of the one member every ffx-api
// descriptor starts with -- its `type`, which the detours read already to choose
// an arm -- and the watchdog writes each to the log the first time it is seen.
// One session's log then says which module was called with what.
//
// NOT A MEASUREMENT AND NOT GATED BY ADVANCED METRICS: it is a diagnostic, like
// HOOK_INSTALLED. It reaches the log file and nothing else -- no record, no
// region of the shared memory, no session.
//
// THE HOOK'S SHARE IS A FEW LOADS. A type already kept costs one relaxed load
// per slot up to its own and no write; a title sends two to four distinct types
// per module, so that is two to four loads a call. A NEW type costs one
// compare-exchange, once. Slots fill in order and are never cleared, so the
// watchdog's "how many have I logged" is a prefix length. No allocation, no
// lock, no logging here (rule 5); nothing is read but the value passed in
// (rule 4).
//
// Header-only so the cost is measured on this code itself and ctest fl_ffx_types
// drives it without the Overlay.
#ifndef FRAMELEDGER_FL_FFX_TYPES_H
#define FRAMELEDGER_FL_FFX_TYPES_H
#include <atomic>
#include <cstdint>
namespace fl::ffxtypes {
inline constexpr std::uint32_t kSlots = 8;
// What did not fit, OR'd into Seen::more.
enum More : std::uint32_t {
kMoreTypes = 1u << 0, // a ninth distinct type arrived: the eight kept are not all there were
kMoreZero = 1u << 1, // a descriptor whose type was 0 arrived (0 is the empty slot, so it has no slot)
};
struct alignas(64) Seen {
std::atomic<std::uint64_t> types[kSlots]{};
std::atomic<std::uint32_t> more{0};
// Filled out to two cache lines by hand, so that the words another module's detour reads are never on a line
// this one writes -- and so that the padding is stated rather than left to the compiler (C4324).
std::uint8_t reserved[60]{};
};
static_assert(sizeof(Seen) == 128, "two cache lines: eight types, the More word, and the stated padding");
namespace detail {
inline void NoteMore(Seen& seen, std::uint32_t bit) noexcept {
// Read first: once the bit is set, a title that sends such a descriptor every frame writes nothing.
if ((seen.more.load(std::memory_order_relaxed) & bit) == 0u) {
seen.more.fetch_or(bit, std::memory_order_relaxed);
}
}
} // namespace detail
// Hook path. Keep `type` if it is new.
inline void Note(Seen& seen, std::uint64_t type) noexcept {
if (type == 0u) {
detail::NoteMore(seen, kMoreZero);
return;
}
for (std::atomic<std::uint64_t>& slot : seen.types) {
std::uint64_t kept = slot.load(std::memory_order_relaxed);
if (kept == type) {
return;
}
if (kept == 0u) {
if (slot.compare_exchange_strong(kept, type, std::memory_order_relaxed)) {
return;
}
if (kept == type) {
return; // another thread kept the same type in this slot first
}
// ...or a different one: this slot is taken, the next is tried.
}
}
detail::NoteMore(seen, kMoreTypes);
}
// Watchdog side: how far one Seen has been written to the log.
struct Reported {
std::uint32_t types = 0; // slots [0, types) are in the log
std::uint32_t more = 0; // More bits already in the log
};
// Calls onType(type) for every kept type not reported yet, in the order they were kept, and onMore(bits) for More
// bits not reported yet. One thread per Reported.
template <class OnType, class OnMore>
void ReportNew(const Seen& seen, Reported& reported, OnType&& onType, OnMore&& onMore) noexcept {
while (reported.types < kSlots) {
const std::uint64_t type = seen.types[reported.types].load(std::memory_order_relaxed);
if (type == 0u) {
break;
}
onType(type);
++reported.types;
}
const std::uint32_t more = seen.more.load(std::memory_order_relaxed);
if (const std::uint32_t fresh = more & ~reported.more; fresh != 0u) {
onMore(fresh);
reported.more |= fresh;
}
}
} // namespace fl::ffxtypes
#endif // FRAMELEDGER_FL_FFX_TYPES_H
@@ -124,7 +124,13 @@ inline constexpr uint32_t kFamiliesEvaluateFeatureDoesNotImplement =
static_cast<uint32_t>(fl::FL_HOOK_RT_AS_BUILD) | static_cast<uint32_t>(fl::FL_HOOK_RT_PSO) |
static_cast<uint32_t>(fl::FL_HOOK_PSO) | static_cast<uint32_t>(fl::FL_HOOK_COLOR_SPACE) |
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM) |
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY);
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY) | static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS) |
static_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) |
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS) |
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED) |
static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED) |
static_cast<uint32_t>(fl::FL_HOOK_SL_ALLOCATE_RESOURCES) | static_cast<uint32_t>(fl::FL_HOOK_SL_FREE_RESOURCES) |
static_cast<uint32_t>(fl::FL_HOOK_SL_SHUTDOWN);
static_assert((kFamilyEvaluateFeature & kFamiliesEvaluateFeatureDoesNotImplement) == 0u,
"the slEvaluateFeature row claims a family its detour does not implement -- hookinventory-check "
@@ -183,6 +189,13 @@ static_assert((kFamilyEvaluateFeature & static_cast<uint32_t>(fl::FL_HOOK_FG_EVA
// prints against each other (frames/upscale-drained) and the K = 1 control in the
// fixtures are what would show a loader that re-entered a leaf's export: 2x on both.
//
// AND MEASURED A THIRD TIME, 2026-11-12, WITH A THIRD ANSWER: Cyberpunk 2077's loader 2.3.0 DOES hand a dispatch
// on to the leaf's export -- its frame-generation dispatch types are logged on the loader and on the
// frame-generation leaf. So "the leaves stay silent behind the loader" is a fact about the loader of September's
// three titles (1.0.2), not about loaders. The rows stand as they are -- whatever module the game calls -- and
// what a dispatch seen twice may count is decided where it is counted: PREPARE by its frame number, an UPSCALE at
// the first source that saw one (dllmain.cpp g_ffxUpscaleOwner, owner decision D125).
//
// The effect-DLL split is NOT a guess about the vendor's internals: the FidelityFX
// SDK's own getting-started text says the loader "only manages the loading of
// effect type DLLs" and is "interface- and behavior-compatible with
@@ -200,7 +213,13 @@ inline constexpr uint32_t kFamiliesFfxDispatchDoesNotImplement =
static_cast<uint32_t>(fl::FL_HOOK_RT_AS_BUILD) | static_cast<uint32_t>(fl::FL_HOOK_RT_PSO) |
static_cast<uint32_t>(fl::FL_HOOK_PSO) | static_cast<uint32_t>(fl::FL_HOOK_COLOR_SPACE) |
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM) |
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY) | static_cast<uint32_t>(fl::FL_HOOK_SL_NEURAL_RENDERING);
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY) | static_cast<uint32_t>(fl::FL_HOOK_SL_NEURAL_RENDERING) |
static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS) | static_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE) |
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS) |
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED) | static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED) |
static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED) |
static_cast<uint32_t>(fl::FL_HOOK_SL_ALLOCATE_RESOURCES) | static_cast<uint32_t>(fl::FL_HOOK_SL_FREE_RESOURCES) |
static_cast<uint32_t>(fl::FL_HOOK_SL_SHUTDOWN);
static_assert((kFamilyFfxDispatch & kFamiliesFfxDispatchDoesNotImplement) == 0u,
"the ffxDispatch rows claim a family their detour does not implement -- hookinventory-check reads "
@@ -271,6 +290,130 @@ static_assert(kFamilyFfxQuery != kFamilyFfxDispatch && kFamilyFfxQuery != kFamil
static_assert((kFamilyFfxDispatch & kFamilyFfxQuery) == 0u,
"the dispatch rows must not claim the query's bit: they do not hook ffxQuery");
// --- Streamline: slSetConstants (0.1.0-beta.43, Advanced metrics train B, owner decisions D111-D116) ---
//
// WHAT THE GAME TELLS STREAMLINE ABOUT A FRAME, once per frame and viewport: the jitter, the motion-vector scale,
// the depth range, the field of view, the aspect ratio and seven Booleans -- beside five matrices and the camera's
// position and axes, WHICH ARE NEVER READ (rule 4; tools/overlay-fields-check.ps1 refuses their names anywhere in
// the code loaded into a game). One exporter, sl.interposer.dll, like the other Streamline rows.
//
// THE ONE ROW THAT IS NOT INSTALLED UNLESS ASKED FOR. Every other row is patched when its module appears; this one
// only in a process the Agent has asked for Advanced metrics at least once (D111: with the option off, nothing more
// is read -- and nothing more is patched). dllmain's installer checks that BEFORE it resolves the symbol, because
// resolving takes a reference on the module. Once in, the patch stays for the life of the process and the detour
// forwards without looking while the request is off.
//
// ITS OWN BIT. It entitles no measured field of a frame record; the bit says the hook is in, so that a session can
// tell "hooked, and the game never called it" from "not hooked".
inline constexpr uint32_t kFamilySlConstants = static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS);
static_assert(kFamilySlConstants != kFamilyEvaluateFeature && kFamilySlConstants != kFamilyFfxDispatch &&
kFamilySlConstants != kFamilyFfxQuery &&
kFamilySlConstants != static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) &&
kFamilySlConstants != static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS),
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand slSetConstants' "
"detour to another export, or another's to it");
// --- Streamline: slGetFeatureVersion and slGetFeatureRequirements (0.1.0-beta.44, train B's third step) ---
//
// THE TWO QUESTIONS A GAME ASKS STREAMLINE ABOUT A FEATURE: which version it is (Streamline's own, and the NGX
// model's), and what it requires -- the graphics APIs, V-Sync off, hardware-accelerated GPU scheduling, how many
// threads and viewports, how many buffers, and the versions of Windows and of the driver it found beside the ones it
// needs. THE ANSWER IS WHAT IS READ: the detour calls the original first and reads the struct the game passed only
// when the original said OK. The pointers the same answer carries -- the list of required buffer tags, the names of
// Vulkan extensions and features -- are never followed (fl_adv_fields.h; tools/overlay-fields-check.ps1).
//
// INSTALLED ONLY WHERE ASKED FOR, as slSetConstants is (D111), a row and a bit each. THEY ARE THE FIRST ROWS OF THE
// TABLE because a game asks while it starts: until 0.1.0-beta.46 the watchdog patched the rows one by one in the
// table's order, each patch stopped the game's threads for a moment, and in a process that was asked these two were
// the ones that could not wait. The rows a tick finds now go in together, under one stop of the threads (D134), and
// the table's order is the order of their log lines. In a process never asked they are passed over before anything
// is resolved.
inline constexpr uint32_t kFamilySlFeatureVersion = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION);
inline constexpr uint32_t kFamilySlFeatureRequirements = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS);
static_assert(kFamilySlFeatureVersion != kFamilySlFeatureRequirements &&
kFamilySlFeatureVersion != kFamilyEvaluateFeature && kFamilySlFeatureVersion != kFamilyFfxDispatch &&
kFamilySlFeatureVersion != kFamilyFfxQuery && kFamilySlFeatureVersion != kFamilySlConstants &&
kFamilySlFeatureVersion != static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) &&
kFamilySlFeatureVersion != static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS),
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand slGetFeatureVersion's "
"detour to another export, or another's to it");
static_assert(kFamilySlFeatureRequirements != kFamilyEvaluateFeature &&
kFamilySlFeatureRequirements != kFamilyFfxDispatch &&
kFamilySlFeatureRequirements != kFamilyFfxQuery &&
kFamilySlFeatureRequirements != kFamilySlConstants &&
kFamilySlFeatureRequirements != static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) &&
kFamilySlFeatureRequirements != static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS),
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand "
"slGetFeatureRequirements' detour to another export, or another's to it");
// --- Streamline: slIsFeatureSupported, slIsFeatureLoaded, slSetFeatureLoaded (0.1.0-beta.45, D129-D131) ---
//
// WHETHER A FEATURE IS SUPPORTED, WHETHER IT IS LOADED, AND THE GAME SWITCHING IT ON AND OFF. Bare arguments and
// results, no vendor struct: the feature's id, the sl::Result the question was answered with (a refusal IS the
// answer to "is it supported"), the bool slIsFeatureLoaded wrote when it said OK, the bool the game passed to
// slSetFeatureLoaded. THE ADAPTER slIsFeatureSupported IS ASKED ABOUT IS NEVER READ (D131): sl::AdapterInfo holds
// the adapter's LUID or a Vulkan physical device, and the detour forwards the reference without looking at it --
// tools/overlay-fields-check.ps1 refuses the names of its members anywhere in the code loaded into a game.
//
// INSTALLED ONLY WHERE ASKED FOR (D111), a row and a bit each, like every row that exists only for Advanced metrics.
// slInit IS NOT A ROW AND WILL NOT BE (D129): a game calls it once, before this DLL is in the process or before a
// patch can land -- nothing is ever patched on a game's thread (17_HOOK_ENGINE, the loader lock) -- so a hook on it
// would be a patch that reads nothing.
inline constexpr uint32_t kFamilySlFeatureSupported = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED);
inline constexpr uint32_t kFamilySlFeatureLoaded = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED);
inline constexpr uint32_t kFamilySlSetFeatureLoaded = static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED);
// One bit each, and no earlier family holds any of them: InstallByFamily binds a row by EQUALITY on its family, so
// a value shared with another row would hand one export's detour to another.
//
// slAllocateResources, slFreeResources, slShutdown (the same release): COUNTED, AND NOTHING ELSE. The feature's id
// is the only argument looked at -- never the command buffer, never the viewport. slFreeResources and slShutdown
// are on a game's way out: their detours note the call and then call the original, exactly once, and touch nothing
// after it returns.
inline constexpr uint32_t kFamilySlAllocateResources = static_cast<uint32_t>(fl::FL_HOOK_SL_ALLOCATE_RESOURCES);
inline constexpr uint32_t kFamilySlFreeResources = static_cast<uint32_t>(fl::FL_HOOK_SL_FREE_RESOURCES);
inline constexpr uint32_t kFamilySlShutdown = static_cast<uint32_t>(fl::FL_HOOK_SL_SHUTDOWN);
inline constexpr uint32_t kFamiliesOfBeta45FeatureState = kFamilySlFeatureSupported | kFamilySlFeatureLoaded |
kFamilySlSetFeatureLoaded | kFamilySlAllocateResources |
kFamilySlFreeResources | kFamilySlShutdown;
static_assert(kFamilySlFeatureSupported != kFamilySlFeatureLoaded &&
kFamilySlFeatureSupported != kFamilySlSetFeatureLoaded &&
kFamilySlFeatureLoaded != kFamilySlSetFeatureLoaded &&
kFamilySlAllocateResources != kFamilySlFreeResources &&
kFamilySlAllocateResources != kFamilySlShutdown && kFamilySlFreeResources != kFamilySlShutdown &&
((kFamilySlFeatureSupported | kFamilySlFeatureLoaded | kFamilySlSetFeatureLoaded) &
(kFamilySlAllocateResources | kFamilySlFreeResources | kFamilySlShutdown)) == 0u,
"six rows, six detours, six different families");
static_assert(((kFamilyEvaluateFeature | kFamilyFfxDispatch | kFamilyFfxQuery | kFamilySlConstants |
kFamilySlFeatureVersion | kFamilySlFeatureRequirements |
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) |
static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS)) &
kFamiliesOfBeta45FeatureState) == 0u,
"an earlier family claims a bit of one of the six rows of 0.1.0-beta.45");
// --- AMD FidelityFX: ffxConfigure on the same four modules (0.1.0-beta.43, Advanced metrics train B) ---
//
// HOW THE GAME CONFIGURES FRAME GENERATION: a title calls ffxConfigure with a frame-generation descriptor, usually
// every frame, saying whether generation is on, whether it may run asynchronously, its flags, whether only generated
// frames are presented, and the rectangle it generates in. Those five are read; the swapchain, the two callbacks
// and their contexts, the HUD-less resource and the frame id in the same descriptor never are. Every other
// configure type -- key-value pairs, the distortion field, the camera info -- is passed over with only its header's
// type read. The rows are the four modules ffxDispatch is hooked on, for the reason those rows give.
//
// INSTALLED ONLY WHERE ASKED FOR, like slSetConstants above (D111), and published when whole, like the other two
// ffx families. One call reaches two hooked modules behind a loader that forwards to the leaf's export (Cyberpunk
// 2077's 2.3.0) and behind the fixture's loader, which has always forwarded ffxConfigure that way: the reads are
// counted at the first module that saw a frame-generation configure (fl_adv_fields.h).
inline constexpr uint32_t kFamilyFfxConfigure = static_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE);
static_assert(kFamilyFfxConfigure != kFamilyEvaluateFeature && kFamilyFfxConfigure != kFamilyFfxDispatch &&
kFamilyFfxConfigure != kFamilyFfxQuery && kFamilyFfxConfigure != kFamilySlConstants &&
kFamilyFfxConfigure != kFamilySlFeatureVersion &&
kFamilyFfxConfigure != kFamilySlFeatureRequirements &&
(kFamilyFfxConfigure & kFamiliesOfBeta45FeatureState) == 0u &&
kFamilyFfxConfigure != static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) &&
kFamilyFfxConfigure != static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS),
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand ffxConfigure's detour "
"to a dispatch or a query export, whose descriptors it does not share");
// The leaves, in the order dllmain's per-leaf trampoline and latch arrays are indexed.
enum FfxLeaf : uint32_t {
kFfxLeafMonolith = 0, // amd_fidelityfx_dx12.dll -- SDK 1.1.x, FSR 3.1 only
@@ -362,10 +505,19 @@ inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
// first, it entitled records the second row was not yet producing (measured 38 of
// 41 on the frame-based fixture), which is the ffx leaves' defect from #110 again.
#define FL_HOOK_INVENTORY(X) \
X(L"sl.interposer.dll", "slGetFeatureVersion", fl::inventory::kFamilySlFeatureVersion) \
X(L"sl.interposer.dll", "slGetFeatureRequirements", fl::inventory::kFamilySlFeatureRequirements) \
X(L"sl.interposer.dll", "slIsFeatureSupported", fl::inventory::kFamilySlFeatureSupported) \
X(L"sl.interposer.dll", "slIsFeatureLoaded", fl::inventory::kFamilySlFeatureLoaded) \
X(L"sl.interposer.dll", "slEvaluateFeature", fl::inventory::kFamilyEvaluateFeature) \
X(L"sl.interposer.dll", "slSetTag", fl::FL_HOOK_UPSCALER_PARAMS) \
X(L"sl.interposer.dll", "slSetTagForFrame", fl::FL_HOOK_UPSCALER_PARAMS) \
X(L"sl.interposer.dll", "slGetNewFrameToken", fl::FL_HOOK_FG_EVALUATIONS) \
X(L"sl.interposer.dll", "slSetConstants", fl::inventory::kFamilySlConstants) \
X(L"sl.interposer.dll", "slSetFeatureLoaded", fl::inventory::kFamilySlSetFeatureLoaded) \
X(L"sl.interposer.dll", "slAllocateResources", fl::inventory::kFamilySlAllocateResources) \
X(L"sl.interposer.dll", "slFreeResources", fl::inventory::kFamilySlFreeResources) \
X(L"sl.interposer.dll", "slShutdown", fl::inventory::kFamilySlShutdown) \
X(L"amd_fidelityfx_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
X(L"amd_fidelityfx_upscaler_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
@@ -374,8 +526,65 @@ inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
X(L"amd_fidelityfx_upscaler_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
X(L"amd_fidelityfx_loader_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
X(L"amd_fidelityfx_dx12.dll", "ffxConfigure", fl::inventory::kFamilyFfxConfigure) \
X(L"amd_fidelityfx_upscaler_dx12.dll", "ffxConfigure", fl::inventory::kFamilyFfxConfigure) \
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxConfigure", fl::inventory::kFamilyFfxConfigure) \
X(L"amd_fidelityfx_loader_dx12.dll", "ffxConfigure", fl::inventory::kFamilyFfxConfigure) \
X(L"ffx_fsr3_x64.dll", "ffxFsr3ContextDispatchUpscale", fl::inventory::kFamilyFsr3Host)
// How many rows the table has: one inline patch each at most. dllmain's patch registry is sized against it, so a
// row added here cannot outgrow the registry without a compile error (0.1.0-beta.42).
#define FL_COUNT_ROW(mod, sym, family) +1u
inline constexpr uint32_t kRowCount = 0u FL_HOOK_INVENTORY(FL_COUNT_ROW);
#undef FL_COUNT_ROW
static_assert(kRowCount == 26u, "a row was added or removed: say so here, and in 17_HOOK_ENGINE §Hook inventory");
// A row's "module!symbol", for the native log, built at compile time from the row's own two spellings -- so an
// install line names the module it patched, and no second list of names exists to drift from the table
// (0.1.0-beta.42). The module names are ASCII by the table's own spelling; the assert below keeps every row inside
// the text, so no two rows can log the same truncated name.
struct RowName {
char text[72]{};
};
constexpr RowName NameOfRow(const wchar_t* moduleName, const char* symbol) noexcept {
RowName name{};
size_t i = 0;
for (; *moduleName != L'\0' && i + 1 < sizeof(name.text); ++moduleName) {
name.text[i++] = static_cast<char>(*moduleName);
}
if (i + 1 < sizeof(name.text)) {
name.text[i++] = '!';
}
for (; *symbol != '\0' && i + 1 < sizeof(name.text); ++symbol) {
name.text[i++] = *symbol;
}
return name;
}
constexpr size_t LengthW(const wchar_t* text) noexcept {
size_t n = 0;
while (text[n] != L'\0') {
++n;
}
return n;
}
constexpr size_t LengthA(const char* text) noexcept {
size_t n = 0;
while (text[n] != '\0') {
++n;
}
return n;
}
constexpr bool EveryRowNameFits() noexcept {
#define FL_ROW_NAME_FITS(mod, sym, family) \
if (LengthW(mod) + 1 + LengthA(sym) + 1 > sizeof(RowName::text)) { \
return false; \
}
FL_HOOK_INVENTORY(FL_ROW_NAME_FITS)
#undef FL_ROW_NAME_FITS
return true;
}
static_assert(EveryRowNameFits(), "a row's module!symbol does not fit RowName::text -- widen it, and the log event's");
// The FSR 3.0 host module and the one symbol dllmain's ffx arm keys on for it. Named
// constants HERE, for the reason kModuleSlInterposer gives below, and bound to the
// table so the row and the arm cannot drift apart.
@@ -496,6 +705,38 @@ static_assert(EveryFfxQueryRowIsALeaf(),
static_assert(!FfxQueryRowExistsFor(kModuleFfxFsr3Host),
"the FSR 3.0 host has its own query API, not ffxQuery; a row claiming one would resolve nothing");
// The ffxConfigure rows, bound to the leaf table the same way (0.1.0-beta.43).
inline constexpr const char* kSymbolFfxConfigure = "ffxConfigure";
constexpr bool FfxConfigureRowExistsFor(const wchar_t* moduleName) noexcept {
#define FL_FFX_CONFIGURE_ROW_FOR(mod, sym, family) \
if (SameW(mod, moduleName) && SameA(sym, kSymbolFfxConfigure)) { \
return true; \
}
FL_HOOK_INVENTORY(FL_FFX_CONFIGURE_ROW_FOR)
#undef FL_FFX_CONFIGURE_ROW_FOR
return false;
}
constexpr bool EveryFfxConfigureRowIsALeaf() noexcept {
#define FL_FFX_CONFIGURE_ROW_IS_LEAF(mod, sym, family) \
if (SameA(sym, kSymbolFfxConfigure) && FfxLeafOfExact(mod) < 0) { \
return false; \
}
FL_HOOK_INVENTORY(FL_FFX_CONFIGURE_ROW_IS_LEAF)
#undef FL_FFX_CONFIGURE_ROW_IS_LEAF
return true;
}
static_assert(FfxConfigureRowExistsFor(kFfxLeafModules[kFfxLeafMonolith]) &&
FfxConfigureRowExistsFor(kFfxLeafModules[kFfxLeafUpscaler]) &&
FfxConfigureRowExistsFor(kFfxLeafModules[kFfxLeafFrameGeneration]) &&
FfxConfigureRowExistsFor(kFfxLeafModules[kFfxLeafLoader]),
"every ffx leaf needs its ffxConfigure row, spelled identically -- the configure reaches whatever module "
"the game calls, as the dispatch does");
static_assert(EveryFfxConfigureRowIsALeaf(),
"an ffxConfigure row names a module the leaf table does not know -- InstallByFamily would find no slot");
static_assert(!FfxConfigureRowExistsFor(kModuleFfxFsr3Host),
"the FSR 3.0 host has its own configure API, not ffxConfigure; a row claiming one would resolve nothing");
// Does this module speak the Streamline 2 ABI the vendored headers describe?
//
// MEASURED 2026-08-14, and it cost an access violation to find. The Witcher 3
@@ -0,0 +1,417 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// The patch registry (17_HOOK_ENGINE §Unhooking): every inline patch the Overlay
// makes, so that the stop can take each one out again -- and the ONE sequence a
// patch goes in by, so that a patch the stop cannot see is never made.
//
// WHAT THIS REPLACES, AND WHY (0.1.0-beta.42, found by reviewing the plan for the
// next two hooks against the code). The registry was an array and a counter:
//
// 1. FULL MEANT SILENT. RegisterPatch advanced the counter and wrote the entry
// only while it fitted; PatchTarget had already created and enabled the
// hook. A 49th patch would have been live and unknown to the stop -- "the
// part inside the game stops" (legal/DISCLAIMER.md §2) with one patch left
// in, and no line anywhere saying so. Unreachable with the 20 patch sites
// of today; the rule now does not depend on counting them right.
// 2. ENABLED BEFORE REGISTERED. PatchTarget enabled the hook, re-read
// g_observing, and registered last. A stop that ran between the re-read and
// the registration walked a table that did not hold the patch yet.
//
// THE SEQUENCE NOW (Install below): take a slot -- no slot, no patch -- create,
// enable, COMMIT the slot, and only then re-read the flag. The stop clears the
// flag and only then walks the committed slots. Both are a write followed by a
// read of what the other wrote, in the one total order sequentially consistent
// operations have, so at least one of the two sees the other: either the walk
// finds the committed slot and restores it, or the installer finds the flag
// clear and takes its own patch out. There is no interleaving in which neither
// does. (On x86-64 the only instruction this costs is the commit's XCHG, on an
// install path that runs a handful of times per process.)
//
// A SLOT IS Free -> Claimed -> Live, and from Live only to Retired. A claimed slot
// whose patch failed goes back to Free -- the walk never saw it. A slot that was
// ever Live is never handed out again: the walk reads a Live slot's three fields
// without a lock, and a slot refilled under it would be a target paired with
// another patch's detour. Retiring costs a slot only for a patch that raced the
// stop, and after the stop nothing is installed at all.
//
// Header-only, MinHook-free and allocation-free: the Overlay passes MinHook in as
// the `hooker`, and ctest fl_unhook_inline drives this same sequence against real
// MinHook patches -- the shipped sequence, not a copy of it.
#ifndef FRAMELEDGER_FL_PATCH_REGISTRY_H
#define FRAMELEDGER_FL_PATCH_REGISTRY_H
#include <atomic>
#include <cstdint>
namespace fl::patch {
// Why Install did or did not patch. The values are written to the native log (PATCH_FAILED a=<value>), so they
// are fixed: append, never renumber.
enum class InstallResult : std::uint32_t {
Installed = 0,
NoTarget = 1, // nothing to patch
Stopped = 2, // observing was already off: nothing was created
Full = 3, // every slot is taken: nothing was created
CreateFailed =
4, // the hooker could not create the hook (MinHook: already created, unsupported prologue, memory)
EnableFailed = 5, // created, not enabled: no patch at the target
StoppedDuring = 6, // the stop ran while this patch went in; the installer took it out again, or never put it in
Pending = 7, // in a Batch, created and waiting for its Commit; never logged
};
template <std::uint32_t Capacity>
class Registry {
public:
// A free slot for a patch that does not exist yet, or -1: the caller must not patch.
int Claim(void* target, void* detour, const char* name) noexcept {
for (std::uint32_t i = 0; i < Capacity; ++i) {
std::uint32_t expected = kFree;
if (slots_[i].state.compare_exchange_strong(expected, kClaimed, std::memory_order_acq_rel,
std::memory_order_relaxed)) {
slots_[i].target = target;
slots_[i].detour = detour;
slots_[i].name = name;
return static_cast<int>(i);
}
}
return -1;
}
// The patch is enabled; the stop's walk restores it from here on. Sequentially consistent ON PURPOSE: it is the
// write of the write-then-read pair described at the top of this file.
void Commit(int slot) noexcept {
if (Valid(slot)) {
slots_[static_cast<std::uint32_t>(slot)].state.store(kLive, std::memory_order_seq_cst);
}
}
// The patch was never made. Only for a slot that was claimed and not committed.
void Release(int slot) noexcept {
if (Valid(slot)) {
std::uint32_t expected = kClaimed;
slots_[static_cast<std::uint32_t>(slot)].state.compare_exchange_strong(
expected, kFree, std::memory_order_acq_rel, std::memory_order_relaxed);
}
}
// The installer took a committed patch out itself. The slot is never handed out again.
void Retire(int slot) noexcept {
if (Valid(slot)) {
slots_[static_cast<std::uint32_t>(slot)].state.store(kRetired, std::memory_order_seq_cst);
}
}
// Every committed patch: visit(target, detour, name). The read of the write-then-read pair, on the stop's side.
template <class Visit>
void ForEachLive(Visit&& visit) const noexcept {
for (std::uint32_t i = 0; i < Capacity; ++i) {
if (slots_[i].state.load(std::memory_order_seq_cst) == kLive) {
visit(slots_[i].target, slots_[i].detour, slots_[i].name);
}
}
}
std::uint32_t LiveCount() const noexcept {
std::uint32_t n = 0;
ForEachLive([&n](void*, void*, const char*) noexcept { ++n; });
return n;
}
static constexpr std::uint32_t kCapacity = Capacity;
private:
static constexpr std::uint32_t kFree = 0;
static constexpr std::uint32_t kClaimed = 1;
static constexpr std::uint32_t kLive = 2;
static constexpr std::uint32_t kRetired = 3;
static bool Valid(int slot) noexcept { return slot >= 0 && static_cast<std::uint32_t>(slot) < Capacity; }
struct Slot {
std::atomic<std::uint32_t> state{kFree};
void* target = nullptr;
void* detour = nullptr;
const char* name = nullptr;
};
Slot slots_[Capacity]{};
};
// Patch ONE address, registered before it can run and never left in after a stop.
//
// `hooker` is the inline-hook engine: Create(target, detour, original) -> bool, Enable(target) -> bool,
// Disable(target). The Overlay passes MinHook; so does the test.
//
// A hook that was created and could not be enabled stays created in the engine, as it always has: a later attempt
// then fails at Create, and nothing is at the target either way.
template <std::uint32_t Capacity, class Hooker>
InstallResult Install(Registry<Capacity>& registry, const std::atomic<std::uint32_t>& observing, Hooker&& hooker,
void* target, void* detour, void** original, const char* name) noexcept {
if (target == nullptr) {
return InstallResult::NoTarget;
}
if (observing.load(std::memory_order_seq_cst) == 0u) {
return InstallResult::Stopped;
}
const int slot = registry.Claim(target, detour, name);
if (slot < 0) {
return InstallResult::Full;
}
if (!hooker.Create(target, detour, original)) {
registry.Release(slot);
return InstallResult::CreateFailed;
}
if (!hooker.Enable(target)) {
registry.Release(slot);
return InstallResult::EnableFailed;
}
registry.Commit(slot);
if (observing.load(std::memory_order_seq_cst) == 0u) {
// The stop ran while the patch went in. Its walk either saw the committed slot and restored the patch -- then
// this disable finds it disabled already -- or it had passed the slot, and this is what takes the patch out.
hooker.Disable(target);
registry.Retire(slot);
return InstallResult::StoppedDuring;
}
return InstallResult::Installed;
}
// ---------------------------------------------------------------------------------------------------------------------
// BATCHES (0.1.0-beta.46, owner decision D134): several patches in, or every patch out, for ONE stop of the process's
// threads instead of one a patch.
//
// WHY. MinHook stops every thread of the process to write a jump: a snapshot of the system's threads, then a suspend,
// a context read and a resume for each of this process's. Enabling or disabling ONE hook does all of that for one
// jump. In the owner's games of 2026-11-13 the thirteen Streamline patches took 0.7 s to 2.8 s of a game's start that
// way, 57 to 215 ms each, and a stop restored its patches at about 160 ms each. MinHook can queue: mark hooks to be
// enabled or disabled, then apply every mark under one stop of the threads.
//
// WHAT THE QUEUE IS, AND THE TWO THINGS IT MAKES DANGEROUS (hook.c, MH_ApplyQueued). The queue is ONE table for the
// process: applying it applies every hook whose mark differs from its state -- not the caller's marks, everybody's.
// So:
// 1. A mark may never be left standing. A hook marked "enable" that failed, left marked, would be enabled by the
// next apply -- the stop's own, if that came next. And a hook marked "disable" for a target that a foreign overlay
// has patched over would have OUR saved bytes written over THEIR jump by whoever applied next (§H7).
// 2. Two threads may not interleave their marks and applies: the installer's apply would execute the stop's marks
// and the other way round.
// Hence the GATE (`BeginQueue` / `EndQueue` on the engine): mark, apply and commit happen inside it, and when it is
// free no hook has a mark that differs from its state. The gate is held for one apply and never across anything that
// can take the loader's lock (resolving a symbol is done before, by the caller).
//
// A draft of this marked EVERYTHING for disabling and then un-marked the targets it must not restore. It was refused
// on review against hook.c: un-marking a hook that is already disabled marks it for ENABLING, and the stop's own apply
// would have put a patch back in after the stop. Nothing here marks "all", and nothing un-marks by marking the
// opposite except where the hook's state is known.
//
// THE ENGINE, beside Create: QueueEnable(target) / QueueDisable(target) -> bool (mark only); Apply() -> bool (every
// mark, one stop of the threads; false when any failed -- it stops at the first failure and does not say which);
// EnsureEnabled(target) / EnsureDisabled(target) -> bool (one hook, true when it is in that state afterwards);
// BeginQueue() / EndQueue().
// ---------------------------------------------------------------------------------------------------------------------
// HOW A BATCH'S ONE APPLY ENDED (owner decision D137). Two install batches in real games took 0.61 s and 1.26 s on
// 0.1.0-beta.46 where sixteen others took 0.08-0.26 s, and the log could not say whether either was one long stop of
// the threads or an apply that failed part-way and was finished one patch at a time: the fallback wrote a line only
// for a patch that failed for good. The caller logs this. `singly` counts the patches handed to the engine one at a
// time after the apply said it had failed -- attempts, not stops: the engine makes no stop for one the apply had
// already done.
struct BatchOutcome {
bool applied = true; // the one apply did all it was asked, or there was nothing to apply
std::uint32_t singly = 0; // patches then enabled -- or, in the stop, restored -- one at a time
};
// The stop's walk: every committed patch that is still OURS is restored, under one apply; a patch a foreign overlay
// has patched over is left exactly as it is (17_HOOK_ENGINE §Unhooking, §H7). The caller has already cleared the
// observing flag -- this is the read half of the pair described at the top of this file.
//
// `ours(target, detour)` -> bool: the bytes at the target are still the jump made for us (fl_patch_check.h).
// `report(name, target, wasOurs, restored)` is called once per committed patch, after the gate is released.
template <std::uint32_t Capacity, class Hooker, class Ours, class Report>
BatchOutcome RestoreAll(const Registry<Capacity>& registry, Hooker&& hooker, Ours&& ours, Report&& report) noexcept {
struct Entry {
void* target;
const char* name;
bool wasOurs;
bool marked;
bool restored;
};
Entry entries[Capacity];
std::uint32_t count = 0;
bool anyMarked = false;
hooker.BeginQueue();
registry.ForEachLive(
[&entries, &count, &anyMarked, &hooker, &ours](void* target, void* detour, const char* name) noexcept {
if (count >= Capacity) {
return;
}
// Only a patch that is still ours is ever marked. One that is not is not touched -- not marked, and not
// un-marked either: it has no mark to remove.
const bool mine = ours(target, detour);
const bool marked = mine && hooker.QueueDisable(target);
anyMarked = anyMarked || marked;
entries[count++] = Entry{target, name, mine, marked, false};
});
const bool applied = !anyMarked || hooker.Apply();
BatchOutcome outcome{applied, 0u};
for (std::uint32_t i = 0; i < count; ++i) {
Entry& e = entries[i];
if (!e.marked) {
continue;
}
outcome.singly += applied ? 0u : 1u;
// The apply stops at the first hook it cannot restore: the ones after it are taken out one at a time, as
// every patch was until 0.1.0-beta.46. One that will not come out at all has its mark removed -- it is
// enabled, so marking it "enable" leaves nothing to apply.
e.restored = applied || hooker.EnsureDisabled(e.target);
if (!e.restored) {
hooker.QueueEnable(e.target);
}
}
hooker.EndQueue();
for (std::uint32_t i = 0; i < count; ++i) {
report(entries[i].name, entries[i].target, entries[i].wasOurs, entries[i].restored);
}
return outcome;
}
// Several patches, registered before any can run, enabled under ONE stop of the threads, and none left in after a
// stop -- the sequence of Install, for a group. One thread fills and commits a batch (the Overlay's watchdog).
//
// Add: claim a slot and create the hook; nothing is at the target yet and nothing is marked. Commit: enable them all.
// After Commit every item carries its InstallResult, and the caller does what follows a patch (its log line, its
// family bit) for the ones that read Installed, in the order they were added.
template <std::uint32_t Capacity>
class Batch {
public:
struct Item {
void* target = nullptr;
void* detour = nullptr;
const char* name = nullptr;
void* context = nullptr; // the caller's: what to do once the patch is in
std::uint32_t word = 0; // the caller's
int slot = -1;
InstallResult result = InstallResult::NoTarget;
};
// Pending: the hook is created and waits for Commit. Anything else is final and nothing was added.
template <class Hooker>
InstallResult Add(Registry<Capacity>& registry, const std::atomic<std::uint32_t>& observing, Hooker&& hooker,
void* target, void* detour, void** original, const char* name, void* context,
std::uint32_t word) noexcept {
if (target == nullptr) {
return InstallResult::NoTarget;
}
if (observing.load(std::memory_order_seq_cst) == 0u) {
return InstallResult::Stopped;
}
if (count_ >= Capacity) {
return InstallResult::Full; // not reachable before the registry itself is full: one slot an item
}
const int slot = registry.Claim(target, detour, name);
if (slot < 0) {
return InstallResult::Full;
}
if (!hooker.Create(target, detour, original)) {
registry.Release(slot);
return InstallResult::CreateFailed;
}
items_[count_++] = Item{target, detour, name, context, word, slot, InstallResult::Pending};
return InstallResult::Pending;
}
// Returns how the apply that put the patches IN ended; the apply that takes them out again after a stop that
// landed meanwhile is not reported -- every item then reads StoppedDuring.
template <class Hooker, class Ours>
BatchOutcome Commit(Registry<Capacity>& registry, const std::atomic<std::uint32_t>& observing, Hooker&& hooker,
Ours&& ours) noexcept {
if (count_ == 0u) {
return BatchOutcome{};
}
hooker.BeginQueue();
if (observing.load(std::memory_order_seq_cst) == 0u) {
// The stop ran between Add and here. Nothing was marked and nothing is at any target: the slots go back,
// and the hooks stay created and disabled in the engine, as a hook that failed to enable always has.
for (std::uint32_t i = 0; i < count_; ++i) {
registry.Release(items_[i].slot);
items_[i].result = InstallResult::StoppedDuring;
}
hooker.EndQueue();
return BatchOutcome{};
}
for (std::uint32_t i = 0; i < count_; ++i) {
if (!hooker.QueueEnable(items_[i].target)) {
registry.Release(items_[i].slot);
items_[i].result = InstallResult::EnableFailed;
}
}
const bool applied = hooker.Apply();
BatchOutcome outcome{applied, 0u};
for (std::uint32_t i = 0; i < count_; ++i) {
Item& item = items_[i];
if (item.result != InstallResult::Pending) {
continue;
}
outcome.singly += applied ? 0u : 1u;
// The ENGINE says whether the hook is enabled, not the bytes at the target: a foreign overlay that
// patched over us a moment after the apply would read as "not in", and taking that for a failure would
// mark a restore nobody had compared (§H7). The apply stops at the first hook that fails, so the ones
// after it are enabled one at a time -- one bad patch costs one patch, as it always has.
if (applied || hooker.EnsureEnabled(item.target)) {
registry.Commit(item.slot);
item.result = InstallResult::Installed;
} else {
hooker.QueueDisable(item.target); // it is disabled: this removes the mark, and marks nothing
registry.Release(item.slot);
item.result = InstallResult::EnableFailed;
}
}
hooker.EndQueue();
if (observing.load(std::memory_order_seq_cst) != 0u) {
return outcome;
}
// The stop ran while the batch went in -- the re-read of Install, for the group. Its walk either saw the
// committed slots and restored the patches, and then they are no longer ours and nothing is marked, or it had
// passed them, and this takes them out. Compared first, as the stop compares: a patch something else has
// patched over in the meantime is left to it.
bool takeOut[Capacity]{};
bool anyMarked = false;
hooker.BeginQueue();
for (std::uint32_t i = 0; i < count_; ++i) {
const Item& item = items_[i];
if (item.result == InstallResult::Installed) {
takeOut[i] = ours(item.target, item.detour) && hooker.QueueDisable(item.target);
anyMarked = anyMarked || takeOut[i];
}
}
const bool out = !anyMarked || hooker.Apply();
for (std::uint32_t i = 0; i < count_; ++i) {
Item& item = items_[i];
if (item.result != InstallResult::Installed) {
continue;
}
if (takeOut[i] && !out && !hooker.EnsureDisabled(item.target)) {
hooker.QueueEnable(item.target); // enabled and staying so: no mark may be left standing
}
registry.Retire(item.slot);
item.result = InstallResult::StoppedDuring;
}
hooker.EndQueue();
return outcome;
}
std::uint32_t Count() const noexcept { return count_; }
const Item& At(std::uint32_t i) const noexcept { return items_[i]; }
void Clear() noexcept { count_ = 0u; }
private:
Item items_[Capacity]{};
std::uint32_t count_ = 0u;
};
} // namespace fl::patch
#endif // FRAMELEDGER_FL_PATCH_REGISTRY_H
@@ -0,0 +1,244 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// The two calls the Overlay makes into NVIDIA's driver, and how it finds them (Advanced metrics train C; owner
// decisions D132, D136, D138-D141; docs/spike-notes §30, §31; 17_HOOK_ENGINE §Memory / latency).
//
// NOT A HOOK. Every other thing the Overlay learns in a game is an argument of a call it hooks. These are calls the
// Overlay MAKES: NvAPI_D3D_GetLatency and NvAPI_D3D_GetSleepStatus, the driver's two read-only latency getters, with
// the Direct3D 12 device behind the swap chain it hooks (rule 4's note of 2026-11-13). Getters only: no marker, no
// sleep mode, no sleep, nothing that changes what the driver does.
//
// THE GAME BROUGHT THE MODULE. nvapi64.dll is looked for by name among the modules the process ALREADY holds and is
// never loaded. This file is not linked against nvapi64.lib -- that static library loads the DLL itself -- and takes
// only the vendored MIT headers' ids (nvapi_interface.h) and structs (nvapi.h). tools/nvapi-readonly-check.ps1 holds
// that the two ids below are the only NVAPI ids in code loaded into a game.
//
// A MODULE IN THE EXECUTABLE'S OWN FOLDER IS REFUSED (D140). The driver's nvapi64.dll lives in Windows' own
// directories; one beside the game is a replacement somebody put there, and FrameLedger neither calls into it on a
// presenting thread nor records its numbers as NVIDIA's.
//
// WHERE THE TWO ADDRESSES ARE (measured by the probe, driver 32.0.16.2114). System32's nvapi64.dll is a shim: it
// answers the two ids with addresses inside ANOTHER image, nvapi64_impl.dll in the driver's own store. So an address
// is accepted when it is executable code of an image the process has loaded -- never the heap, never nowhere -- and
// a reference is kept on THAT image as well, because the addresses are only code for as long as it stays loaded and
// the game may unload NVAPI while a presenting thread is about to call.
//
// SHARED WITH THE PROBE (tools/fl-probe-reflex), which is built with the Overlay's flags and enforces Control Flow
// Guard: its ctest runs THIS sequence. hook-harness does not enforce it, so the injected tests say nothing about CFG.
// nvapi64_impl.dll IS a CFG image; its getters are valid call targets, which the probe's real runs show by having
// made the calls from an enforcing process. A target that were not would be a fast-fail no guard catches: in a game
// that enforces CFG, on a driver nobody has run the probe against, that is not excluded.
#ifndef FRAMELEDGER_FL_REFLEX_H
#define FRAMELEDGER_FL_REFLEX_H
#include <windows.h>
// nvapi.h declares its Direct3D structs only after a Direct3D header, and names DXGI's swap chain in passing.
#include <d3d12.h>
#include <dxgi.h>
#include <cstdint>
#include <cstring>
#include <nvapi.h>
namespace fl::reflex {
inline constexpr unsigned int kIdGetSleepStatus = 0xaef96ca1u; // nvapi_interface.h: NvAPI_D3D_GetSleepStatus
inline constexpr unsigned int kIdGetLatency = 0x1a587f9cu; // nvapi_interface.h: NvAPI_D3D_GetLatency
inline constexpr DWORD kPathCapacity = 520;
using QueryInterfaceFn = void*(__cdecl*)(unsigned int);
// The status type under a name of its own: tools/nvapi-readonly-check.ps1 takes an `NvAPI_` name followed by a
// parenthesis for a call by name, and code loaded into a game makes none.
using Status = NvAPI_Status;
using GetLatencyFn = Status(__cdecl*)(IUnknown*, NV_LATENCY_RESULT_PARAMS*);
using GetSleepStatusFn = Status(__cdecl*)(IUnknown*, NV_GET_SLEEP_STATUS_PARAMS*);
struct Api {
GetLatencyFn getLatency = nullptr;
GetSleepStatusFn getSleepStatus = nullptr;
HMODULE nvapi = nullptr; // the nvapi64.dll that was asked; one reference is held
HMODULE owner = nullptr; // the image GetLatency's address is in; references are held
wchar_t modulePath[kPathCapacity]{}; // where nvapi64.dll was loaded from, for the log
wchar_t ownerPath[kPathCapacity]{}; // ... and the image the getters are in
};
enum class Resolved : std::uint32_t {
Ok = 0,
NoModule = 1, // the process has not loaded nvapi64.dll: nothing was called and nothing was loaded
NoQueryInterface = 2, // a module of that name without the export
NoGetter = 3, // it does not answer for both getters, or answered with an address in no loaded image
Refused = 4, // it sits in the executable's own folder, or its path could not be read (D140)
Faulted = 5, // asking it for the getters faulted
};
// The Overlay's own filter (dllmain.cpp's FlFilter): a debugger's exceptions are not ours to swallow.
inline LONG Filter(DWORD code) noexcept {
if (code == EXCEPTION_BREAKPOINT || code == EXCEPTION_SINGLE_STEP) {
return EXCEPTION_CONTINUE_SEARCH;
}
return EXCEPTION_EXECUTE_HANDLER;
}
// The length of the directory part of a path, its last separator included; 0 when there is none.
inline DWORD DirectoryLength(const wchar_t* path, DWORD length) noexcept {
for (DWORD i = length; i > 0; --i) {
if (path[i - 1] == L'\\' || path[i - 1] == L'/') {
return i;
}
}
return 0;
}
// True when `nvapi` was loaded from the folder the process's executable is in -- or when either path cannot be read
// whole, which is refused the same way: what cannot be placed is not taken for the driver's.
inline bool InExecutableFolder(HMODULE nvapi, wchar_t* modulePath) noexcept {
wchar_t exePath[kPathCapacity]{};
const DWORD moduleLength = GetModuleFileNameW(nvapi, modulePath, kPathCapacity);
const DWORD exeLength = GetModuleFileNameW(nullptr, exePath, kPathCapacity);
if (moduleLength == 0 || moduleLength >= kPathCapacity || exeLength == 0 || exeLength >= kPathCapacity) {
return true;
}
const DWORD moduleDir = DirectoryLength(modulePath, moduleLength);
const DWORD exeDir = DirectoryLength(exePath, exeLength);
if (moduleDir == 0 || exeDir == 0) {
return true;
}
return CompareStringOrdinal(modulePath, static_cast<int>(moduleDir), exePath, static_cast<int>(exeDir), TRUE) ==
CSTR_EQUAL;
}
// The loaded image `address` is executable code of, with a reference taken on it -- or null. A getter's address
// comes from the module's own answer; this refuses one that is not code of an image before it is ever called, and
// keeps the image that holds it from being unloaded under a later call.
inline HMODULE OwnerImage(const void* address) noexcept {
MEMORY_BASIC_INFORMATION info{};
if (address == nullptr || VirtualQuery(address, &info, sizeof(info)) == 0) {
return nullptr;
}
const DWORD executable = PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY;
if (info.Type != MEM_IMAGE || info.State != MEM_COMMIT || (info.Protect & executable) == 0u) {
return nullptr;
}
HMODULE owner = nullptr;
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, static_cast<LPCWSTR>(address), &owner)) {
return nullptr;
}
return owner;
}
// The module's answers for the two ids, asked under a guard: the lookup runs the module's code.
inline bool AskForGetters(QueryInterfaceFn query, void*& latency, void*& sleepStatus, DWORD& faultCode) noexcept {
__try {
latency = query(kIdGetLatency);
sleepStatus = query(kIdGetSleepStatus);
return true;
} __except (Filter(GetExceptionCode())) {
faultCode = GetExceptionCode();
return false;
}
}
// Finds the two getters in a module the process ALREADY holds; never loads one.
//
// A REFERENCE IS TAKEN WHEN THE MODULE IS FOUND, and kept whatever is returned after that -- as the Overlay's
// ResolveScoped keeps the one on a module it patches -- so the caller must not call again once this has returned
// anything but NoModule: every other answer is final for the process. One more is taken on the image each getter is
// in. None is ever released: a presenting thread may be inside one of the calls.
inline Resolved Resolve(Api& api, DWORD& faultCode) noexcept {
api.getLatency = nullptr;
api.getSleepStatus = nullptr;
api.nvapi = nullptr;
api.owner = nullptr;
api.modulePath[0] = L'\0';
api.ownerPath[0] = L'\0';
faultCode = 0;
HMODULE nvapi = nullptr;
if (!GetModuleHandleExW(0, L"nvapi64.dll", &nvapi) || nvapi == nullptr) {
return Resolved::NoModule;
}
api.nvapi = nvapi;
if (InExecutableFolder(nvapi, api.modulePath)) {
return Resolved::Refused;
}
const auto query = reinterpret_cast<QueryInterfaceFn>(GetProcAddress(nvapi, "nvapi_QueryInterface"));
if (query == nullptr) {
return Resolved::NoQueryInterface;
}
void* latency = nullptr;
void* sleepStatus = nullptr;
if (!AskForGetters(query, latency, sleepStatus, faultCode)) {
return Resolved::Faulted;
}
const HMODULE latencyOwner = OwnerImage(latency);
const HMODULE statusOwner = OwnerImage(sleepStatus);
if (latencyOwner == nullptr || statusOwner == nullptr) {
return Resolved::NoGetter;
}
api.owner = latencyOwner;
if (const DWORD length = GetModuleFileNameW(latencyOwner, api.ownerPath, kPathCapacity);
length == 0 || length >= kPathCapacity) {
api.ownerPath[0] = L'\0';
}
api.getLatency = reinterpret_cast<GetLatencyFn>(latency);
api.getSleepStatus = reinterpret_cast<GetSleepStatusFn>(sleepStatus);
return Resolved::Ok;
}
inline Resolved Resolve(Api& api) noexcept {
DWORD faultCode = 0;
return Resolve(api, faultCode);
}
// What a read returns when the driver's code faulted under it: not one of NVAPI's own codes.
inline constexpr NvAPI_Status kFaulted = static_cast<NvAPI_Status>(-9999);
// One read of the driver's report. Guarded -- the first guard the Overlay puts around code that is not its own
// (17_HOOK_ENGINE §Fault policy says why this one is). A guard does not bound a call that never returns, and a
// caught fault does not give back a lock the driver held: the caller makes no second call after either.
inline NvAPI_Status ReadLatency(const Api& api, IUnknown* device, NV_LATENCY_RESULT_PARAMS& out,
DWORD& faultCode) noexcept {
std::memset(&out, 0, sizeof(out));
out.version = NV_LATENCY_RESULT_PARAMS_VER1;
if (api.getLatency == nullptr || device == nullptr) {
return NVAPI_INVALID_ARGUMENT;
}
__try {
return api.getLatency(device, &out);
} __except (Filter(GetExceptionCode())) {
faultCode = GetExceptionCode();
return kFaulted;
}
}
inline NvAPI_Status ReadSleepStatus(const Api& api, IUnknown* device, NV_GET_SLEEP_STATUS_PARAMS& out,
DWORD& faultCode) noexcept {
std::memset(&out, 0, sizeof(out));
out.version = NV_GET_SLEEP_STATUS_PARAMS_VER1;
if (api.getSleepStatus == nullptr || device == nullptr) {
return NVAPI_INVALID_ARGUMENT;
}
__try {
return api.getSleepStatus(device, &out);
} __except (Filter(GetExceptionCode())) {
faultCode = GetExceptionCode();
return kFaulted;
}
}
inline NvAPI_Status ReadLatency(const Api& api, IUnknown* device, NV_LATENCY_RESULT_PARAMS& out) noexcept {
DWORD faultCode = 0;
return ReadLatency(api, device, out, faultCode);
}
inline NvAPI_Status ReadSleepStatus(const Api& api, IUnknown* device, NV_GET_SLEEP_STATUS_PARAMS& out) noexcept {
DWORD faultCode = 0;
return ReadSleepStatus(api, device, out, faultCode);
}
} // namespace fl::reflex
#endif // FRAMELEDGER_FL_REFLEX_H
File diff suppressed because it is too large. Load diff
+166 -33
View File
@@ -69,6 +69,16 @@
// moved from 0x100 to 0x6C0 to make room for it. What a hooked game told its upscaler is neither a frame fact nor a
// display fact, and no region had room. The region is sized ONCE for the three releases of train B (beta.40, .41,
// .42): a member a later release fills is declared here and stays zero until then, so those releases bump nothing.
//
// STILL 5 (2026-11-13, Advanced metrics train C, owner decisions D136 and D138): the ten reserved words that ended
// region 5's first line became the Reflex latency words (latState .. latTotalSumUs). No offset and no size moved, a
// 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
@@ -405,6 +415,33 @@ enum FlHookFamily : uint32_t {
// FL_FEAT_RAY_RECONSTRUCTION_OBSERVED and never bit 7, and without this family its silence would read as a
// measured "not running" -- a fabricated negative of the kind 03_METRICS §RT/PT/RR forbids for ray reconstruction.
FL_HOOK_SL_NEURAL_RENDERING = 1u << 12,
// Advanced metrics, train B's second step (0.1.0-beta.43): slSetConstants is hooked. Published only in a process
// that was asked for Advanced metrics at least once -- the patch is not made otherwise (owner decision D111) --
// so its absence beside FL_ADV_VALID_* bits says "the hook was not installed", and its presence beside a zero
// slConstantsCalls says "hooked, and the game never called it". It entitles no measured field of a frame record.
FL_HOOK_SL_CONSTANTS = 1u << 13,
// The same for ffxConfigure on the ffx-api modules (0.1.0-beta.43): hooked, in a process that was asked for
// Advanced metrics at least once. Published when every ffx-api module the process has loaded is patched, as the
// dispatch and query families are. Beside a zero ffxFgConfigures it says "hooked, and the game never configured
// frame generation"; it entitles no measured field of a frame record.
FL_HOOK_FFX_CONFIGURE = 1u << 14,
// Advanced metrics, train B's third step (0.1.0-beta.44): slGetFeatureVersion and slGetFeatureRequirements are
// hooked -- a bit each, because a patch each. Published only in a process that was asked for Advanced metrics at
// least once, as the two above. A GAME ASKS THESE WHILE IT STARTS, so the usual reading of a bit beside a slot
// that has no answer of that kind is "hooked, and the game did not ask again"; neither entitles a measured field
// of a frame record.
FL_HOOK_SL_FEATURE_VERSION = 1u << 15,
FL_HOOK_SL_FEATURE_REQUIREMENTS = 1u << 16,
// Three more of Streamline's questions and switches about a feature (0.1.0-beta.45, owner decisions D129-D131):
// slIsFeatureSupported, slIsFeatureLoaded, slSetFeatureLoaded -- a bit each, because a patch each, published only
// in a process that was asked for Advanced metrics at least once. None entitles a measured field of a frame record.
FL_HOOK_SL_FEATURE_SUPPORTED = 1u << 17,
FL_HOOK_SL_FEATURE_LOADED = 1u << 18,
FL_HOOK_SL_SET_FEATURE_LOADED = 1u << 19,
// And the last three of 0.1.0-beta.45: slAllocateResources, slFreeResources, slShutdown -- counted, nothing more.
FL_HOOK_SL_ALLOCATE_RESOURCES = 1u << 20,
FL_HOOK_SL_FREE_RESOURCES = 1u << 21,
FL_HOOK_SL_SHUTDOWN = 1u << 22,
};
// FlWriterState::runtimeCensus -- which vendor RUNTIME MODULES the loader reported
@@ -932,20 +969,82 @@ struct alignas(64) FlDisplayState {
// FlAdvancedState.validMask: which groups below were ever read. Additive: a reader ignores a bit it does not know.
enum FlAdvancedValid : uint32_t {
FL_ADV_VALID_DLSS_OPTIONS = 1u << 0, // sl::DLSSOptions seen chained into slEvaluateFeature's inputs
FL_ADV_VALID_FFX_UPSCALE = 1u << 1, // an ffx upscale dispatch's extra fields were read
FL_ADV_VALID_FFX_MEMORY = 1u << 2, // the game asked ffxQuery for the upscaler's memory, and it answered
FL_ADV_VALID_FFX_FG_CONFIG = 1u << 3, // (0.1.0-beta.41) ffxConfigure with a frame-generation descriptor seen
FL_ADV_VALID_SL_CONSTANTS = 1u << 4, // (0.1.0-beta.41) slSetConstants seen
FL_ADV_VALID_SL_FEATURES = 1u << 5, // (0.1.0-beta.42) at least one feature slot filled
FL_ADV_VALID_DLSS_OPTIONS = 1u << 0, // sl::DLSSOptions seen chained into slEvaluateFeature's inputs
FL_ADV_VALID_FFX_UPSCALE = 1u << 1, // an ffx upscale dispatch's extra fields were read
FL_ADV_VALID_FFX_MEMORY = 1u << 2, // the game asked ffxQuery for the upscaler's memory, and it answered
// The release numbers on the three groups below moved twice (owner decisions D118 and D122, 2026-11-12): beta.41
// was a fix release and the second step became two. They are declared here and written by nothing until then.
FL_ADV_VALID_FFX_FG_CONFIG = 1u << 3, // (0.1.0-beta.43) ffxConfigure with a frame-generation descriptor seen
FL_ADV_VALID_SL_CONSTANTS = 1u << 4, // (0.1.0-beta.43) slSetConstants seen
FL_ADV_VALID_SL_FEATURES = 1u << 5, // (0.1.0-beta.44) at least one feature slot filled
FL_ADV_VALID_SL_SHUTDOWN = 1u << 6, // (0.1.0-beta.45) slShutdown seen; slShutdowns counts
// (train C, declared 2026-11-13 and written by nothing until the Overlay reads the driver's latency report) a
// read of the driver's latency report returned OK for this request. NOT "the game's calls were read": this group
// comes from a call the Overlay makes itself, and latState says where that stands even while the bit is clear.
FL_ADV_VALID_LATENCY = 1u << 7,
};
// A float nobody saw. An all-ones pattern is a NaN no detour stores: every value is checked finite first.
// REFLEX LATENCY (train C; owner decisions D132, D136, D138-D141; spike-notes §31; 17_HOOK_ENGINE §Memory / latency).
// Not a hook and not an argument of one: while a session asks for Advanced metrics, the Overlay CALLS the NVIDIA
// driver's two read-only getters about once a second on the presenting thread, with the Direct3D 12 device behind
// the swap chain it hooks, and only through an nvapi64.dll the game had already loaded. These words are what it
// publishes -- by the watchdog, in the same seqlock as the rest of the region.
//
// FlAdvancedState.latState, bits 0..7. REFUSED, NO_GETTER, SLOW, FAULTED and STALLED are final for the process:
// nothing is retried, and a later session of the same process reads the same word.
enum FlLatencyState : uint32_t {
FL_LAT_NONE = 0, // not asked, or nothing looked at yet
FL_LAT_NO_DEVICE = 1, // asked; no Direct3D 12 device has been seen behind a hooked swap chain
FL_LAT_NO_MODULE = 2, // the game has not loaded nvapi64.dll (asked again each second: a game may load it late)
FL_LAT_REFUSED =
3, // the nvapi64.dll in the process sits in the executable's own folder: not the driver's (D140)
FL_LAT_NO_GETTER = 4, // the module does not answer for both getters, or answered with an address outside itself
FL_LAT_READING = 5, // resolved; a read is made about once a second
FL_LAT_ERROR = 6, // the last read returned an NVAPI status that is not OK; reading goes on
FL_LAT_SLOW = 7, // one call took 2 ms or more: off until the game exits (D141)
FL_LAT_FAULTED = 8, // a getter faulted: off until the game exits, and counted once in faultCount
FL_LAT_STALLED = 9, // a call had not returned after a second: nothing can stop it; reported and left
};
// latState, above the state: the driver's sleep status as SEEN -- a switch can be in both groups in one session.
// Bit n of each group, in the order of NV_GET_SLEEP_STATUS_PARAMS: low-latency mode, fullscreen VRR, the control
// panel's vsync, the game's own sleep, fullscreen independent flip. They are the DRIVER'S words: on the driver the
// spike ran against, low-latency mode read 0 for a device whose game had just switched it on.
#define FL_LAT_STATE_MASK 0x000000FFu
#define FL_LAT_SLEEP_SEEN_ON_SHIFT 8u // bits 8..12
#define FL_LAT_SLEEP_SEEN_OFF_SHIFT 16u // bits 16..20
#define FL_LAT_SLEEP_BITS 0x1Fu
#define FL_LAT_FG_MULTIPLIER_SHIFT 24u // bits 24..31: the last fgMultiplier the status gave, stopping at 255
// A span the driver did not report for a frame that was summed (an end point of zero): the whole sum reads this.
// Without a sleep mode the driver leaves driverStartTime zero in every frame; with one it fills it in.
#define FL_LAT_SUM_NONE 0xFFFFFFFFu
// A float nobody saw. An all-ones pattern is a NaN no detour stores: every value is checked finite first -- with the
// one exception below.
#define FL_ADV_FLOAT_NONE 0xFFFFFFFFu
// Feature slots (0.1.0-beta.42): FL_ADV_FEATURE_SLOTS slots of FL_ADV_FEATURE_WORDS uint32 each, in `features`.
// THE PLANE AT INFINITY (0.1.0-beta.42, owner decision D119): +infinity's own bits, in ffxNearBits or ffxFarBits and
// in no other field. An engine with an inverted, infinite depth hands FSR one finite plane and FLT_MAX -- or
// +infinity -- for the other; three of the first four FSR titles read gave `cameraFar` alone (10, 1, 0.1), the other
// plane having been refused as "nobody set this". For FSR that reading is wrong: its FLT_MAX is a plane, not a
// sentinel. For Streamline it is right -- INVALID_FLOAT is FLT_MAX -- so this is the ffx route's alone. Stored as
// the real +infinity rather than as a second all-ones-like pattern, so that a reader which knows nothing of this
// constant still decodes a float that means what it says.
#define FL_ADV_FLOAT_INFINITE 0x7F800000u
// Feature slots (0.1.0-beta.44): FL_ADV_FEATURE_SLOTS slots of FL_ADV_FEATURE_WORDS uint32 each, in `features`.
// Filled in the order the game first asked about each feature, from slot 0, and NOT emptied by a new request: what
// version a feature is and what it requires are facts about the process, and a game asks once, while it starts. A
// thirteenth feature is not kept.
// [0] sl::Feature id PLUS ONE; 0 = an empty slot
// [1] bit 0: slGetFeatureVersion answered; bit 1: slGetFeatureRequirements answered
// (0.1.0-beta.45) bit 2: slIsFeatureSupported answered, and bits 8..15 the sl::Result it gave (0 = eOk;
// 0xFF = a code a byte cannot carry); bit 3: slIsFeatureLoaded answered, bit 4 what it said;
// bit 5: the game was seen to switch the feature OFF (slSetFeatureLoaded), bit 6: ON -- these two are a
// session's and are cleared by a new request; the rest are the process's and stay.
// bits 16..19: slAllocateResources calls for the feature, bits 20..23: slFreeResources calls -- each
// stops at 15, and both are a session's
// [2..4] versionSL major, minor, build [5..7] versionNGX
// [8] FeatureRequirementFlags [9] maxNumCPUThreads
// [10] maxNumViewports [11] numRequiredTags
@@ -956,12 +1055,28 @@ enum FlAdvancedValid : uint32_t {
struct alignas(64) FlAdvancedState {
// ---- line 0: the header ------------------------------------------------------------------------------------
uint32_t seq; // @0 seqlock: odd while the watchdog is inside, +2 per publication
uint32_t validMask; // @4 FlAdvancedValid
uint32_t samples; // @8 publications (wraps)
uint32_t request; // @12 the FlControlBlock::advancedRequested this publication answers
uint64_t sampleQpc; // @16 QueryPerformanceCounter at the last publication
uint32_t reservedHeader[10]; // @24..63 must be zero
uint32_t seq; // @0 seqlock: odd while the watchdog is inside, +2 per publication
uint32_t validMask; // @4 FlAdvancedValid
uint32_t samples; // @8 publications (wraps)
uint32_t request; // @12 the FlControlBlock::advancedRequested this publication answers
uint64_t sampleQpc; // @16 QueryPerformanceCounter at the last publication
// Reflex latency (train C) -- the ten words that were reservedHeader. Written by nothing until the Overlay makes
// the read; all zero in a process nobody asked.
uint32_t latState; // @24 FlLatencyState, and the sleep status as seen (the masks above)
uint32_t latReads; // @28 bits 0..15 reads made since the request; bits 16..31 the slowest call
// in microseconds -- each stops at 65535
uint32_t latFrames; // @32 of the newest read not yet published: bits 0..15 frames summed,
// bits 16..31 frames refused (a span that runs backwards or lasts over a
// second, or no total). Zero when no read was made since the publication
// before.
// Sums over the frames summed, microseconds; FL_LAT_SUM_NONE = a summed frame did not report the span.
uint32_t latSimulationSumUs; // @36 simStartTime .. simEndTime
uint32_t latSubmitSumUs; // @40 renderSubmitStartTime .. renderSubmitEndTime
uint32_t latPresentSumUs; // @44 presentStartTime .. presentEndTime
uint32_t latDriverSumUs; // @48 driverStartTime .. driverEndTime
uint32_t latOsQueueSumUs; // @52 osRenderQueueStartTime .. osRenderQueueEndTime
uint32_t latGpuSumUs; // @56 gpuRenderStartTime .. gpuRenderEndTime
uint32_t latTotalSumUs; // @60 simStartTime .. gpuRenderEndTime
// ---- line 1: sl::DLSSOptions as last seen in slEvaluateFeature's inputs -----------------------------------
uint32_t dlssStructVersion; // @64 the structVersion the game's struct declared; 0 = none seen
@@ -972,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)
@@ -988,7 +1113,7 @@ struct alignas(64) FlAdvancedState {
uint32_t ffxJitterMaxYBits; // @148
uint32_t ffxPreExposureMinBits; // @152
uint32_t ffxPreExposureMaxBits; // @156
uint32_t ffxNearBits; // @160 cameraNear, the last one seen
uint32_t ffxNearBits; // @160 cameraNear, the last one seen; FL_ADV_FLOAT_INFINITE = at infinity
uint32_t ffxFarBits; // @164
uint32_t ffxFovMinBits; // @168 cameraFovAngleVertical, radians: the lowest and the highest (D114)
uint32_t ffxFovMaxBits; // @172
@@ -1001,15 +1126,15 @@ struct alignas(64) FlAdvancedState {
uint64_t ffxMemoryTotalBytes; // @192 FfxApiEffectMemoryUsage, as the last answered query gave it
uint64_t ffxMemoryAliasableBytes; // @200
uint32_t ffxMemoryQueries; // @208 answered memory queries (wraps)
uint32_t ffxFgConfigures; // @212 (beta.41) ffxConfigure calls with a frame-generation descriptor
uint32_t ffxFgEnabledSeen; // @216 (beta.41) bit 0: seen off; bit 1: seen on
uint32_t ffxFgAsyncSeen; // @220 (beta.41) allowAsyncWorkloads, the same two bits
uint32_t ffxFgOnlyGeneratedSeen; // @224 (beta.41) onlyPresentGenerated, the same two bits
uint32_t ffxFgFlagsSeen; // @228 (beta.41) every dispatch flag any configure carried
int32_t ffxFgRect[4]; // @232..247 (beta.41) generationRect: left, top, width, height - the last
uint32_t ffxFgConfigures; // @212 (beta.43) ffxConfigure calls with a frame-generation descriptor
uint32_t ffxFgEnabledSeen; // @216 (beta.43) bit 0: seen off; bit 1: seen on
uint32_t ffxFgAsyncSeen; // @220 (beta.43) allowAsyncWorkloads, the same two bits
uint32_t ffxFgOnlyGeneratedSeen; // @224 (beta.43) onlyPresentGenerated, the same two bits
uint32_t ffxFgFlagsSeen; // @228 (beta.43) every dispatch flag any configure carried
int32_t ffxFgRect[4]; // @232..247 (beta.43) generationRect: left, top, width, height - the last
uint32_t reservedFfx[2]; // @248..255 must be zero
// ---- line 4: sl::Constants, summarised (beta.41) - never the camera's position, axes or matrices -----------
// ---- line 4: sl::Constants, summarised (beta.43) - never the camera's position, axes or matrices -----------
uint32_t slConstantsCalls; // @256 slSetConstants calls, every viewport together (wraps)
uint32_t slResets; // @260 calls with `reset` true
uint32_t slJitterMaxXBits; // @264
@@ -1025,9 +1150,10 @@ struct alignas(64) FlAdvancedState {
// reset, orthographicProjection, motionVectorsDilated, motionVectorsJittered.
uint32_t slFlagsSeenTrue; // @300
uint32_t slFlagsSeenFalse; // @304
uint32_t reservedSl[3]; // @308..319 must be zero
uint32_t slShutdowns; // @308 (beta.45) slShutdown calls since the request (wraps)
uint32_t reservedSl[2]; // @312..319 must be zero
// ---- lines 5..22: Streamline's features (beta.42) --------------------------------------------------------------
// ---- lines 5..22: Streamline's features (beta.44) --------------------------------------------------------------
uint32_t features[FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS]; // @320..1471
};
@@ -1285,13 +1411,19 @@ static_assert(offsetof(FlAdvancedState, seq) == 0);
static_assert(offsetof(FlAdvancedState, validMask) == 4);
static_assert(offsetof(FlAdvancedState, samples) == 8);
static_assert(offsetof(FlAdvancedState, sampleQpc) == 16);
static_assert(offsetof(FlAdvancedState, reservedHeader) == 24);
static_assert(offsetof(FlAdvancedState, latState) == 24);
static_assert(offsetof(FlAdvancedState, latFrames) == 32);
static_assert(offsetof(FlAdvancedState, latSimulationSumUs) == 36);
static_assert(offsetof(FlAdvancedState, latTotalSumUs) == 60);
static_assert(offsetof(FlAdvancedState, dlssStructVersion) == 64);
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);
@@ -1300,7 +1432,8 @@ static_assert(offsetof(FlAdvancedState, ffxFgRect) == 232);
static_assert(offsetof(FlAdvancedState, reservedFfx) == 248);
static_assert(offsetof(FlAdvancedState, slConstantsCalls) == 256);
static_assert(offsetof(FlAdvancedState, slFlagsSeenFalse) == 304);
static_assert(offsetof(FlAdvancedState, reservedSl) == 308);
static_assert(offsetof(FlAdvancedState, slShutdowns) == 308);
static_assert(offsetof(FlAdvancedState, reservedSl) == 312);
static_assert(offsetof(FlAdvancedState, features) == 320);
static_assert(offsetof(FlAdvancedState, sampleQpc) % 8 == 0 && offsetof(FlAdvancedState, ffxMemoryTotalBytes) % 8 == 0);
static_assert(FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS * sizeof(uint32_t) == 1152);
+70 -7
View File
@@ -8,6 +8,9 @@
add_executable(fl_shm_layout_test layout_test.cpp)
target_link_libraries(fl_shm_layout_test PRIVATE FrameLedger.Shm fl_native_flags)
add_test(NAME fl_shm_layout COMMAND fl_shm_layout_test)
# Not a Catch2 executable: its last line is its own (the note above enable_testing() in the top-level file -- a run
# cut short is not a pass).
fl_test_completes(fl_shm_layout "layout ok")
# The NVAPI bridge's C ABI (P2 PR-E2). Links the SHIPPED DLL rather than compiling its source in,
# because what the managed side loads is that DLL's export table; the DLL is copied beside the test
@@ -23,9 +26,14 @@ add_test(NAME fl_nvapi_bridge COMMAND fl_nvapi_bridge_test)
# The branch line is required AND a failed assertion fails the test (2026-09-25). PASS_REGULAR_EXPRESSION alone makes
# ctest ignore the exit code, and for as long as it stood alone the AVAILABLE branch's reference-counting check failed
# on every machine with an NVIDIA GPU while ctest reported Passed; CI, which has no driver, never takes that branch.
set_tests_properties(fl_nvapi_bridge PROPERTIES
PASS_REGULAR_EXPRESSION "BRANCH: (AVAILABLE|DEGRADED)"
FAIL_REGULAR_EXPRESSION "FAILED:;[0-9]+ failed")
#
# AND THE RUN MUST REACH ITS END (2026-11-13; the note above enable_testing() in the top-level file): the branch line is
# printed in the middle of the run, so by itself it passed a run that stopped right after it. The expression now
# needs the branch line AND, after it, Catch2's last line.
fl_test_completes(fl_nvapi_bridge
"BRANCH: (AVAILABLE|DEGRADED)(.|\n)*All tests passed \\("
"BRANCH: (AVAILABLE|DEGRADED)(.|\n)*test cases: +[0-9]+ \\| +[0-9]+ passed \\| +[0-9]+ skipped")
set_tests_properties(fl_nvapi_bridge PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED:;[0-9]+ failed")
# The process-memory reader's C ABI (beta.12, D43). Same shape as the bridge above: the SHIPPED DLL, copied beside
# the test, a branch line that says which machine this is (a CI runner has no hardware adapter, so the video half
@@ -38,9 +46,10 @@ add_custom_command(TARGET fl_process_stats_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:FrameLedger.ProcessStats> $<TARGET_FILE_DIR:fl_process_stats_test>)
add_test(NAME fl_process_stats COMMAND fl_process_stats_test)
set_tests_properties(fl_process_stats PROPERTIES
PASS_REGULAR_EXPRESSION "BRANCH: (GPU_INSTANCE|NO_GPU_INSTANCE)"
FAIL_REGULAR_EXPRESSION "FAILED:;[0-9]+ failed")
fl_test_completes(fl_process_stats
"BRANCH: (GPU_INSTANCE|NO_GPU_INSTANCE)(.|\n)*All tests passed \\("
"BRANCH: (GPU_INSTANCE|NO_GPU_INSTANCE)(.|\n)*test cases: +[0-9]+ \\| +[0-9]+ passed \\| +[0-9]+ skipped")
set_tests_properties(fl_process_stats PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED:;[0-9]+ failed")
# The safety-guard matrix. 20_OPEN_QUESTIONS §S13(a) put the guard in C++, which
# made Catch2 a PREREQUISITE of the guard rather than a later nicety: 14_TESTING
@@ -137,14 +146,21 @@ target_compile_definitions(fl_guard_test PRIVATE
# late arrival must be hooked within milliseconds rather than on the next tick.
FL_STUB_SL_COMMON=L"$<TARGET_FILE:fl_stub_sl_common>"
FL_STUB_SL_INTERPOSER=L"$<TARGET_FILE:fl_stub_sl_interposer>"
# The ffx-api loader stub, so a test can read one of its exports' first bytes out of a target (0.1.0-beta.43).
FL_STUB_FFX_LOADER=L"$<TARGET_FILE:fl_stub_ffx_loader>"
# The stand-in nvapi64.dll (train C): the target loads it, and the tests turn its knobs and read its call counts
# through the named section fl_stub_nvapi_shared.h describes.
FL_STUB_NVAPI64=L"$<TARGET_FILE:fl_stub_nvapi64>"
FL_OVERLAY_DLL=L"${FL_STAGED_OVERLAY}"
# The un-staged original, so a test can prove the check discriminates on
# DIRECTORY rather than on filename: same bytes, same name, wrong place.
FL_OVERLAY_DLL_ELSEWHERE=L"$<TARGET_FILE:FrameLedger.Overlay>"
)
add_dependencies(fl_guard_test hook-harness FrameLedger.Overlay fl_stage_overlay_payload)
add_dependencies(fl_guard_test hook-harness FrameLedger.Overlay fl_stage_overlay_payload fl_stub_nvapi64)
target_include_directories(fl_guard_test PRIVATE "${CMAKE_SOURCE_DIR}/tools/vendor-stubs")
add_test(NAME fl_guard COMMAND fl_guard_test)
fl_catch2_test_completes(fl_guard)
# The Vulkan layer's capture side (P1 item 3), driven by a FAKE loader chain --
# no registry, no loader, no GPU -- so it is merge-gated. Three ctests, three
@@ -177,6 +193,29 @@ target_link_libraries(fl_unhook_inline_test PRIVATE fl_native_flags minhook Catc
target_compile_options(fl_unhook_inline_test PRIVATE /EHsc)
target_compile_definitions(fl_unhook_inline_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
add_test(NAME fl_unhook_inline COMMAND fl_unhook_inline_test)
fl_catch2_test_completes(fl_unhook_inline)
# fl_adv_fields.h's reader of the driver's latency report (Advanced metrics train C): the header the Overlay
# compiles, on reports written by hand -- the two newest frames held back, 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.
add_executable(fl_reflex_summary_test reflex_summary_test.cpp)
target_include_directories(fl_reflex_summary_test PRIVATE "${CMAKE_SOURCE_DIR}/FrameLedger.Overlay/include")
target_link_libraries(fl_reflex_summary_test PRIVATE FrameLedger.Shm fl_native_flags fl_streamline_headers
fl_fidelityfx_headers fl_nvapi_headers Catch2::Catch2WithMain)
target_compile_options(fl_reflex_summary_test PRIVATE /EHsc)
target_compile_definitions(fl_reflex_summary_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
add_test(NAME fl_reflex_summary COMMAND fl_reflex_summary_test)
fl_catch2_test_completes(fl_reflex_summary)
# fl_ffx_types.h (0.1.0-beta.42, D121): the descriptor types an ffx-api module was handed, kept by the detours for
# the native log. The header the Overlay compiles, driven without the Overlay -- including from eight threads.
add_executable(fl_ffx_types_test ffx_types_test.cpp)
target_include_directories(fl_ffx_types_test PRIVATE "${CMAKE_SOURCE_DIR}/FrameLedger.Overlay/include")
target_link_libraries(fl_ffx_types_test PRIVATE fl_native_flags Catch2::Catch2WithMain)
target_compile_options(fl_ffx_types_test PRIVATE /EHsc)
target_compile_definitions(fl_ffx_types_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
add_test(NAME fl_ffx_types COMMAND fl_ffx_types_test)
fl_catch2_test_completes(fl_ffx_types)
add_test(NAME fl_vklayer COMMAND fl_vklayer_test "[vklayer]")
add_test(NAME fl_vklayer_supervision COMMAND fl_vklayer_test "[vklayer-deadline]")
@@ -184,12 +223,14 @@ add_test(NAME fl_vklayer_supervision COMMAND fl_vklayer_test "[vklayer-deadline]
# presentable device -- CI, per the §S29(d) census -- and runs on a dev box.
add_test(NAME fl_vklayer_real COMMAND fl_vklayer_test "[vklayer-real]")
set_tests_properties(fl_vklayer_real PROPERTIES SKIP_RETURN_CODE 4)
fl_catch2_test_completes(fl_vklayer fl_vklayer_supervision fl_vklayer_real)
# Check 4's fail-closed matrix, as its own ctest name so a regression in the
# static pre-scan is legible in the ctest summary rather than buried in
# fl_guard's total. Same binary, selected by tag — duplicating the evidence
# fakes into a second target would be a second set of seams to keep in step.
add_test(NAME fl_prescan COMMAND fl_guard_test "[prescan]")
fl_catch2_test_completes(fl_prescan)
# The rules file we actually SHIP, against the parser that has to read it.
#
@@ -219,6 +260,7 @@ target_compile_definitions(fl_rules_budget_test PRIVATE
)
add_test(NAME fl_rules_budget COMMAND fl_rules_budget_test)
fl_catch2_test_completes(fl_rules_budget)
# The SPSC ring (14_TESTING §Native unit tests). Half of the TODO that used to
# sit here; the fault-policy suite lands with the hook bodies it guards, since a
@@ -233,6 +275,27 @@ add_executable(fl_ring_test ring_test.cpp)
target_link_libraries(fl_ring_test PRIVATE FrameLedger.Shm fl_native_flags Catch2::Catch2WithMain)
target_compile_options(fl_ring_test PRIVATE /EHsc)
add_test(NAME fl_ring COMMAND fl_ring_test)
fl_catch2_test_completes(fl_ring)
# THE RULE ABOVE, MADE TO FAIL ON PURPOSE (2026-11-13). "A run that is cut short is red" is a property of two
# regular expressions, and a gate that has never been seen red is this project's own recurring defect
# (20_OPEN_QUESTIONS, gates that cannot fail). Four runs that print what a Catch2 executable would, through the very
# function the real tests use:
# - nothing at all, exit 0 -- the run of 2026-11-13 -- must be RED;
# - Catch2's last line must be green;
# - its summary row with a skipped case must be green (a test that skips one case and passes the rest);
# - a row that names a failure must be RED even beside a line that says passed.
# WILL_FAIL turns "red" into this test's pass, so the suite is green exactly while the rule holds.
add_test(NAME fl_canary_cut_short_is_red COMMAND "${CMAKE_COMMAND}" -E true)
add_test(NAME fl_canary_complete_is_green
COMMAND "${CMAKE_COMMAND}" -E echo "All tests passed (1 assertion in 1 test case)")
add_test(NAME fl_canary_skipped_case_is_green
COMMAND "${CMAKE_COMMAND}" -E echo "test cases: 3 | 2 passed | 1 skipped")
add_test(NAME fl_canary_failure_is_red
COMMAND "${CMAKE_COMMAND}" -E echo "All tests passed ( test cases: 3 | 2 passed | 1 failed")
fl_catch2_test_completes(fl_canary_cut_short_is_red fl_canary_complete_is_green fl_canary_skipped_case_is_green
fl_canary_failure_is_red)
set_tests_properties(fl_canary_cut_short_is_red fl_canary_failure_is_red PROPERTIES WILL_FAIL TRUE)
# STILL NO FAULT-POLICY SUITE, and the reason is worth more than the TODO it
# replaces. The three-fault self-disable is NFR-3's entire mechanism and the
+139
View File
@@ -0,0 +1,139 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// fl_ffx_types.h: the descriptor types an ffx-api module was handed, kept by the
// detours and written to the native log by the watchdog (0.1.0-beta.42, D121).
// The header is what the Overlay compiles, so these cases are about the shipped
// code: each type once, in the order it arrived, nothing lost when two threads
// meet a new type at the same moment, and what does not fit SAID rather than
// dropped.
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
#include <fl_ffx_types.h>
#include <thread>
#include <vector>
namespace {
std::vector<std::uint64_t> Kept(const fl::ffxtypes::Seen& seen) {
std::vector<std::uint64_t> out;
for (const auto& slot : seen.types) {
if (const std::uint64_t v = slot.load(); v != 0u) {
out.push_back(v);
}
}
return out;
}
} // namespace
TEST_CASE("a type is kept once, in the order it first arrived", "[ffxtypes]") {
fl::ffxtypes::Seen seen;
for (int frame = 0; frame < 1000; ++frame) {
fl::ffxtypes::Note(seen, 0x00020004u); // PREPARE
fl::ffxtypes::Note(seen, 0x00020003u); // FRAMEGENERATION
if (frame >= 10) {
fl::ffxtypes::Note(seen, 0x00010001u); // UPSCALE, from the eleventh frame on
}
}
const std::vector<std::uint64_t> expected{0x00020004u, 0x00020003u, 0x00010001u};
CHECK(Kept(seen) == expected);
CHECK(seen.more.load() == 0u);
}
TEST_CASE("what does not fit is said: a ninth type, and a type of zero", "[ffxtypes]") {
fl::ffxtypes::Seen seen;
for (std::uint64_t type = 1; type <= fl::ffxtypes::kSlots; ++type) {
fl::ffxtypes::Note(seen, type);
}
CHECK(Kept(seen).size() == fl::ffxtypes::kSlots);
CHECK(seen.more.load() == 0u);
fl::ffxtypes::Note(seen, 3u); // already kept: still nothing to say
CHECK(seen.more.load() == 0u);
fl::ffxtypes::Note(seen, 99u);
CHECK(seen.more.load() == fl::ffxtypes::kMoreTypes);
CHECK(Kept(seen).size() == fl::ffxtypes::kSlots); // and none of the eight was displaced
fl::ffxtypes::Note(seen, 0u);
const std::uint32_t both = fl::ffxtypes::kMoreTypes | fl::ffxtypes::kMoreZero;
CHECK(seen.more.load() == both);
fl::ffxtypes::Seen zeroOnly;
fl::ffxtypes::Note(zeroOnly, 0u);
CHECK(Kept(zeroOnly).empty()); // zero is the empty slot: it takes none
CHECK(zeroOnly.more.load() == fl::ffxtypes::kMoreZero);
}
TEST_CASE("the watchdog's report: each kept type once, new ones on a later pass, the rest untouched", "[ffxtypes]") {
fl::ffxtypes::Seen seen;
fl::ffxtypes::Reported reported;
std::vector<std::uint64_t> types;
std::vector<std::uint32_t> more;
const auto report = [&] {
fl::ffxtypes::ReportNew(
seen, reported, [&types](std::uint64_t t) noexcept { types.push_back(t); },
[&more](std::uint32_t m) noexcept { more.push_back(m); });
};
report();
CHECK(types.empty());
CHECK(more.empty());
fl::ffxtypes::Note(seen, 0x20004u);
fl::ffxtypes::Note(seen, 0x20003u);
report();
report(); // nothing new: nothing said again
const std::vector<std::uint64_t> firstTwo{0x20004u, 0x20003u};
CHECK(types == firstTwo);
fl::ffxtypes::Note(seen, 0x10001u);
fl::ffxtypes::Note(seen, 0u);
report();
const std::vector<std::uint64_t> allThree{0x20004u, 0x20003u, 0x10001u};
CHECK(types == allThree);
const std::vector<std::uint32_t> zeroSaid{fl::ffxtypes::kMoreZero};
CHECK(more == zeroSaid);
for (std::uint64_t t = 100; t < 110; ++t) {
fl::ffxtypes::Note(seen, t);
}
report();
report();
CHECK(types.size() == fl::ffxtypes::kSlots);
const std::vector<std::uint32_t> bothSaid{fl::ffxtypes::kMoreZero, fl::ffxtypes::kMoreTypes};
CHECK(more == bothSaid);
}
TEST_CASE("threads that meet the same new types at once keep each exactly once", "[ffxtypes]") {
// The detours run on whatever threads the game dispatches from. Six types, eight threads, each noting all six in
// its own order, many times over: six slots filled, no type twice, none lost, nothing said to be missing.
for (int round = 0; round < 200; ++round) {
fl::ffxtypes::Seen seen;
std::vector<std::thread> threads;
threads.reserve(8);
for (int t = 0; t < 8; ++t) {
threads.emplace_back([&seen, t] {
for (int i = 0; i < 6; ++i) {
fl::ffxtypes::Note(seen, 0x10000u + static_cast<std::uint64_t>((i + t) % 6) + 1u);
}
});
}
for (std::thread& th : threads) {
th.join();
}
std::vector<std::uint64_t> kept = Kept(seen);
REQUIRE(kept.size() == 6u);
std::uint64_t sum = 0;
for (std::size_t i = 0; i < kept.size(); ++i) {
sum += kept[i] - 0x10000u;
for (std::size_t j = i + 1; j < kept.size(); ++j) {
REQUIRE(kept[i] != kept[j]);
}
}
REQUIRE(sum == 21u); // 1 + 2 + ... + 6: every one of the six, once
REQUIRE(seen.more.load() == 0u);
}
}
File diff suppressed because it is too large. Load diff
+312
View File
@@ -0,0 +1,312 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// fl_adv_fields.h's reader of the driver's latency report (Advanced metrics train C; spike-notes §31), driven
// without the Overlay and without a driver: the header the Overlay compiles, on reports written here by hand.
//
// What it holds is what a real report made necessary. The newest frames of a report are not final -- one run of the
// probe read a span of half an hour in the newest -- so the two newest are never summed. An end point of zero is a
// span the driver did not report, not a fault of the frame: without a sleep mode it leaves driverStartTime zero in
// every frame, and a reader that refused those frames would refuse every frame of such a game. A span that runs
// backwards or lasts over a second is refused with its frame. And a game whose frame ids start again must not be
// read as a game that has stopped.
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
#include <fl_adv_fields.h>
#include <memory>
namespace {
using Frame = NV_LATENCY_RESULT_PARAMS::FrameReport;
// A frame as the stand-in module writes one: every span reported, 7500 us from simulation start to the GPU's end.
Frame Whole(std::uint64_t id) {
Frame f{};
const std::uint64_t t = 1'000'000ull + id * 4200ull;
f.frameID = id;
f.simStartTime = t + 100u;
f.simEndTime = t + 900u; // 800
f.renderSubmitStartTime = t + 950u;
f.renderSubmitEndTime = t + 2100u; // 1150
f.presentStartTime = t + 2150u;
f.presentEndTime = t + 2300u; // 150
f.driverStartTime = t + 2300u;
f.driverEndTime = t + 2700u; // 400
f.osRenderQueueStartTime = t + 2700u;
f.osRenderQueueEndTime = t + 3900u; // 1200
f.gpuRenderStartTime = t + 3900u;
f.gpuRenderEndTime = t + 7600u; // 3700; total 7500
return f;
}
// The report is 15 KB: on the heap here, as it is in static storage in the Overlay.
std::unique_ptr<NV_LATENCY_RESULT_PARAMS> Report(std::uint64_t firstId, std::uint32_t frames = 64u) {
auto report = std::make_unique<NV_LATENCY_RESULT_PARAMS>();
for (std::uint32_t i = 0; i < frames; ++i) {
report->frameReport[64u - frames + i] = Whole(firstId + i); // the newest last, as the driver writes it
}
return report;
}
} // namespace
TEST_CASE("a report's two newest frames are left for the next read, and a frame is summed once", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto first = Report(5000u);
fl::adv::ObserveLatencyReport(*first, cursor, tally);
CHECK(tally.frames == 62u); // 5000..5061; 5062 and 5063 are not final yet
CHECK(tally.refused == 0u);
CHECK(tally.lacking == 0u);
CHECK(tally.sumUs[0] == 62u * 800u);
CHECK(tally.sumUs[1] == 62u * 1150u);
CHECK(tally.sumUs[2] == 62u * 150u);
CHECK(tally.sumUs[3] == 62u * 400u);
CHECK(tally.sumUs[4] == 62u * 1200u);
CHECK(tally.sumUs[5] == 62u * 3700u);
CHECK(tally.sumUs[fl::adv::kLatTotal] == 62u * 7500u);
CHECK(cursor.lastFrameId == 5061u);
// The same report again: nothing is new.
fl::adv::ObserveLatencyReport(*first, cursor, tally);
CHECK(tally.frames == 0u);
CHECK(tally.refused == 0u);
CHECK(cursor.lastFrameId == 5061u);
// Ten frames further on: the two that were held back and eight more, and again not the two newest.
auto second = Report(5010u);
fl::adv::ObserveLatencyReport(*second, cursor, tally);
CHECK(tally.frames == 10u); // 5062..5071
CHECK(tally.sumUs[fl::adv::kLatTotal] == 10u * 7500u);
CHECK(cursor.lastFrameId == 5071u);
}
TEST_CASE("a report of nothing, of one frame and of two sums nothing", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
tally.frames = 9u; // whatever was there is replaced, not added to
auto empty = Report(0u, 0u);
fl::adv::ObserveLatencyReport(*empty, cursor, tally);
CHECK(tally.frames == 0u);
CHECK(cursor.lastFrameId == 0u);
auto one = Report(700u, 1u);
fl::adv::ObserveLatencyReport(*one, cursor, tally);
CHECK(tally.frames == 0u);
auto two = Report(700u, 2u);
fl::adv::ObserveLatencyReport(*two, cursor, tally);
CHECK(tally.frames == 0u);
CHECK(tally.refused == 0u);
auto three = Report(700u, 3u);
fl::adv::ObserveLatencyReport(*three, cursor, tally);
CHECK(tally.frames == 1u); // 700; 701 and 702 wait
CHECK(cursor.lastFrameId == 700u);
}
TEST_CASE("an end point of zero is a span the driver did not report: the frame is summed and the span reads none",
"[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto report = Report(100u);
for (auto& f : report->frameReport) {
f.driverStartTime = 0u; // what the driver gives a game that sets markers and no sleep mode
}
fl::adv::ObserveLatencyReport(*report, cursor, tally);
CHECK(tally.frames == 62u);
CHECK(tally.refused == 0u);
CHECK(tally.lacking == (1u << 3));
CHECK(tally.sumUs[3] == 0u);
CHECK(tally.sumUs[fl::adv::kLatTotal] == 62u * 7500u);
// What is published for it: the sum of a span some summed frame lacked is all ones, never a smaller number.
CHECK(fl::adv::LatencySum(tally, 3u) == FL_LAT_SUM_NONE);
CHECK(fl::adv::LatencySum(tally, 0u) == 62u * 800u);
CHECK(fl::adv::LatencySum(fl::adv::LatencyTally{}, 0u) == 0u); // no frame: zero, not "none"
}
TEST_CASE("a span no frame can have refuses the frame whole, and so does a frame with no total", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto report = Report(100u);
report->frameReport[0].presentEndTime = report->frameReport[0].presentStartTime - 50u; // backwards
report->frameReport[1].gpuRenderEndTime = report->frameReport[1].simStartTime + 1'844'674'519ull; // half an hour
report->frameReport[2].gpuRenderEndTime = 0u; // no total
report->frameReport[3].simStartTime = 0u; // no total
report->frameReport[4].osRenderQueueEndTime = report->frameReport[4].osRenderQueueStartTime + 1'000'001ull;
report->frameReport[5].osRenderQueueEndTime = report->frameReport[5].osRenderQueueStartTime + 1'000'000ull;
fl::adv::ObserveLatencyReport(*report, cursor, tally);
CHECK(tally.refused == 5u);
CHECK(tally.frames == 57u); // 62 that are not the two newest, less the five; frame 5's second is still a span
CHECK(tally.lacking == 0u);
CHECK(tally.sumUs[2] == 57u * 150u); // the backwards present added nothing
CHECK(tally.sumUs[4] == 56u * 1200u + 1'000'000u); // exactly a second is allowed; a microsecond more is not
CHECK(cursor.lastFrameId == 161u); // a refused frame is not looked at again either
}
TEST_CASE("frame ids that start again restart the reader instead of silencing it", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto late = Report(90'000u);
fl::adv::ObserveLatencyReport(*late, cursor, tally);
REQUIRE(cursor.lastFrameId == 90'061u);
auto again = Report(1u); // the game went back to its menu and counts from one
fl::adv::ObserveLatencyReport(*again, cursor, tally);
CHECK(tally.frames == 62u);
CHECK(cursor.lastFrameId == 62u);
}
TEST_CASE("the frames are found whatever order the driver left them in", "[latency]") {
fl::adv::LatencyCursor cursor;
fl::adv::LatencyTally tally;
auto report = Report(300u);
const Frame newest = report->frameReport[63];
report->frameReport[63] = report->frameReport[10];
report->frameReport[10] = newest; // the newest id is in the middle now
fl::adv::ObserveLatencyReport(*report, cursor, tally);
CHECK(tally.frames == 62u);
CHECK(cursor.lastFrameId == 361u); // 362 and 363 are the two newest wherever they sit
}
TEST_CASE("the sleep status is the driver's five switches and its multiplier, and nothing else of it", "[latency]") {
NV_GET_SLEEP_STATUS_PARAMS status{};
CHECK(fl::adv::ObserveSleepStatus(status).on == 0u);
status.bLowLatencyMode = 1;
status.bCplVsyncOn = 1;
status.bFullscreenIFlip = 1;
status.fgMultiplier = 3;
status.sleepIntervalUs = 4166u; // changes with every frame: not kept
const fl::adv::LatencySleep seen = fl::adv::ObserveSleepStatus(status);
CHECK(seen.on == (1u | 4u | 16u));
CHECK(seen.multiplier == 3u);
status = NV_GET_SLEEP_STATUS_PARAMS{};
status.bFsVrr = 1;
status.bUseGameSleep = 1;
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{};
fl::adv::LatencyOut out;
out.state = fl::FL_LAT_READING;
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;
out.tally.refused = 1u;
for (std::uint32_t i = 0; i < fl::adv::kLatSpans; ++i) {
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);
CHECK(((region.latState >> FL_LAT_SLEEP_SEEN_ON_SHIFT) & FL_LAT_SLEEP_BITS) == (1u | 8u));
CHECK(((region.latState >> FL_LAT_SLEEP_SEEN_OFF_SHIFT) & FL_LAT_SLEEP_BITS) == (2u | 4u | 16u));
CHECK((region.latState >> FL_LAT_FG_MULTIPLIER_SHIFT) == 2u);
CHECK((region.latReads & 0xFFFFu) == 0xFFFFu);
CHECK((region.latReads >> 16) == 66u);
CHECK((region.latFrames & 0xFFFFu) == 10u);
CHECK((region.latFrames >> 16) == 1u);
CHECK(region.latSimulationSumUs == 1000u);
CHECK(region.latSubmitSumUs == 2000u);
CHECK(region.latPresentSumUs == 3000u);
CHECK(region.latDriverSumUs == FL_LAT_SUM_NONE);
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.
fl::adv::Publish(a, &region, 7u, 1235u, &out);
CHECK((region.latState & FL_LAT_STATE_MASK) == fl::FL_LAT_READING);
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 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);
}
+670
View File
@@ -17,10 +17,12 @@
#include <windows.h>
#include <atomic>
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
#include <cstring>
#include <fl_patch_check.h>
#include <fl_patch_registry.h>
#include <MinHook.h>
namespace {
@@ -93,6 +95,92 @@ void RepointJump(void* target, const void* relay, std::int32_t* savedRel) {
FlushInstructionCache(GetCurrentProcess(), p, 5);
}
// --- the registry's cases (0.1.0-beta.42) ---------------------------------------------------------------------------
// Three more real functions, each with a body of its own so the linker cannot fold them into one address.
__declspec(noinline) int First(int x) {
volatile int acc = x;
for (int i = 0; i < 3; ++i) {
acc = acc * 5 + i;
}
return acc;
}
__declspec(noinline) int Second(int x) {
volatile int acc = x;
for (int i = 0; i < 4; ++i) {
acc = acc * 7 - i;
}
return acc;
}
__declspec(noinline) int Third(int x) {
volatile int acc = x;
for (int i = 0; i < 5; ++i) {
acc = acc * 11 + 2 * i;
}
return acc;
}
TargetFn g_origFirst = nullptr;
TargetFn g_origSecond = nullptr;
TargetFn g_origThird = nullptr;
int DetourFirst(int x) {
return g_origFirst(x) + 1000000;
}
int DetourSecond(int x) {
return g_origSecond(x) + 2000000;
}
int DetourThird(int x) {
return g_origThird(x) + 3000000;
}
// MinHook, exactly as the Overlay hands it to fl::patch::Install (dllmain.cpp's MinHookEngine).
struct RealMinHook {
static bool Create(void* target, void* detour, void** original) noexcept {
return MH_CreateHook(target, detour, original) == MH_OK;
}
static bool Enable(void* target) noexcept { return MH_EnableHook(target) == MH_OK; }
static void Disable(void* target) noexcept { MH_DisableHook(target); }
};
// The same engine with one thing arranged: a stop that arrives between the enable and the installer's re-read.
struct StopArrivesWhileEnabling {
std::atomic<std::uint32_t>* observing;
static bool Create(void* target, void* detour, void** original) noexcept {
return RealMinHook::Create(target, detour, original);
}
bool Enable(void* target) const noexcept {
const bool ok = RealMinHook::Enable(target);
observing->store(0u);
return ok;
}
static void Disable(void* target) noexcept { RealMinHook::Disable(target); }
};
// An engine that fails at a chosen step and counts what it was asked: nothing may be created once a patch is refused.
struct FailingEngine {
bool createOk;
bool enableOk;
int* created;
bool Create(void*, void*, void**) const noexcept {
++*created;
return createOk;
}
bool Enable(void*) const noexcept { return enableOk; }
static void Disable(void*) noexcept {}
};
// The stop's walk, as StopObserving writes it: restore each patch that is still ours.
template <std::uint32_t N>
int RestoreEveryLivePatch(const fl::patch::Registry<N>& registry) {
int restored = 0;
registry.ForEachLive([&restored](void* target, void* detour, const char*) noexcept {
if (fl::patch::StillOurs(target, detour) && MH_DisableHook(target) == MH_OK) {
++restored;
}
});
return restored;
}
void RestoreJump(void* target, std::int32_t savedRel) {
auto* p = static_cast<std::uint8_t*>(target);
DWORD old = 0;
@@ -160,3 +248,585 @@ TEST_CASE("garbage at the target is 'not ours', never a fault", "[unhook][inline
CHECK_FALSE(fl::patch::StillOurs(page, nullptr));
VirtualFree(page, 0, MEM_RELEASE);
}
TEST_CASE("a full registry refuses the patch: nothing is created and the target's bytes are untouched",
"[unhook][registry]") {
using fl::patch::InstallResult;
fl::patch::Registry<2> registry;
std::atomic<std::uint32_t> observing{1u};
void* first = reinterpret_cast<void*>(&First);
void* second = reinterpret_cast<void*>(&Second);
void* third = reinterpret_cast<void*>(&Third);
const int firstPlain = First(3);
const int secondPlain = Second(3);
const int thirdPlain = Third(3);
std::uint8_t before[16]{};
std::memcpy(before, third, sizeof(before));
REQUIRE(MH_Initialize() == MH_OK);
CHECK(fl::patch::Install(registry, observing, RealMinHook{}, first, reinterpret_cast<void*>(&DetourFirst),
reinterpret_cast<void**>(&g_origFirst), "first") == InstallResult::Installed);
CHECK(fl::patch::Install(registry, observing, RealMinHook{}, second, reinterpret_cast<void*>(&DetourSecond),
reinterpret_cast<void**>(&g_origSecond), "second") == InstallResult::Installed);
CHECK(First(3) == firstPlain + 1000000);
CHECK(Second(3) == secondPlain + 2000000);
CHECK(registry.LiveCount() == 2u);
// The third has no slot. The array and counter this replaced patched it anyway and forgot it.
g_origThird = nullptr;
CHECK(fl::patch::Install(registry, observing, RealMinHook{}, third, reinterpret_cast<void*>(&DetourThird),
reinterpret_cast<void**>(&g_origThird), "third") == InstallResult::Full);
CHECK(std::memcmp(before, third, sizeof(before)) == 0);
CHECK(Third(3) == thirdPlain);
CHECK(g_origThird == nullptr); // MinHook was never asked: no trampoline exists for it
CHECK(MH_EnableHook(third) == MH_ERROR_NOT_CREATED);
CHECK(registry.LiveCount() == 2u);
// And the stop takes out every patch that did go in -- which is now every patch there is.
observing.store(0u);
CHECK(RestoreEveryLivePatch(registry) == 2);
CHECK(First(3) == firstPlain);
CHECK(Second(3) == secondPlain);
// Stopping is one-way: after it, nothing is created at all.
CHECK(fl::patch::Install(registry, observing, RealMinHook{}, third, reinterpret_cast<void*>(&DetourThird),
reinterpret_cast<void**>(&g_origThird), "third") == InstallResult::Stopped);
CHECK(MH_EnableHook(third) == MH_ERROR_NOT_CREATED);
MH_Uninitialize();
}
TEST_CASE("a patch that goes in while the stop runs is taken out by its installer, and its slot is never reused",
"[unhook][registry]") {
using fl::patch::InstallResult;
fl::patch::Registry<1> registry;
std::atomic<std::uint32_t> observing{1u};
void* first = reinterpret_cast<void*>(&First);
const int firstPlain = First(4);
REQUIRE(MH_Initialize() == MH_OK);
// The window the old order left open: the flag read 1, the stop ran -- its walk found nothing, the patch was not
// registered yet -- and the patch was then enabled and registered, live after "stopped".
CHECK(fl::patch::Install(registry, observing, StopArrivesWhileEnabling{&observing}, first,
reinterpret_cast<void*>(&DetourFirst), reinterpret_cast<void**>(&g_origFirst),
"first") == InstallResult::StoppedDuring);
CHECK(First(4) == firstPlain); // not left in
CHECK_FALSE(fl::patch::StillOurs(first, reinterpret_cast<void*>(&DetourFirst)));
CHECK(registry.LiveCount() == 0u); // and not left for a walk to report as somebody else's
CHECK(registry.Claim(first, first, "again") == -1);
MH_Uninitialize();
}
TEST_CASE("a patch that failed gives its slot back, and a slot is not seen by the walk until it is committed",
"[unhook][registry]") {
using fl::patch::InstallResult;
fl::patch::Registry<1> registry;
std::atomic<std::uint32_t> observing{1u};
int target = 0;
int detour = 0;
void* original = nullptr;
int created = 0;
CHECK(fl::patch::Install(registry, observing, FailingEngine{false, true, &created}, &target, &detour, &original,
"x") == InstallResult::CreateFailed);
CHECK(fl::patch::Install(registry, observing, FailingEngine{true, false, &created}, &target, &detour, &original,
"x") == InstallResult::EnableFailed);
CHECK(created == 2);
CHECK(registry.LiveCount() == 0u);
CHECK(fl::patch::Install(registry, observing, FailingEngine{true, true, &created}, nullptr, &detour, &original,
"x") == InstallResult::NoTarget);
CHECK(created == 2);
// Both failures gave the one slot back, so it can still be claimed -- and a claimed slot is nobody's yet.
const int slot = registry.Claim(&target, &detour, "x");
REQUIRE(slot == 0);
CHECK(registry.LiveCount() == 0u);
CHECK(registry.Claim(&target, &detour, "y") == -1);
CHECK(fl::patch::Install(registry, observing, FailingEngine{true, true, &created}, &target, &detour, &original,
"x") == InstallResult::Full);
CHECK(created == 2); // refused before the engine was asked for anything
registry.Commit(slot);
const void* seenTarget = nullptr;
const char* seenName = nullptr;
registry.ForEachLive([&seenTarget, &seenName](void* t, void*, const char* name) noexcept {
seenTarget = t;
seenName = name;
});
CHECK(seenTarget == &target);
CHECK(seenName != nullptr);
CHECK(registry.LiveCount() == 1u);
// Release is for a slot that was never committed: on a live one it changes nothing.
registry.Release(slot);
CHECK(registry.LiveCount() == 1u);
registry.Retire(slot);
CHECK(registry.LiveCount() == 0u);
registry.Commit(-1);
registry.Release(7);
registry.Retire(-3);
CHECK(registry.LiveCount() == 0u);
}
// --- batches (0.1.0-beta.46, owner decision D134) --------------------------------------------------------------------
// Several patches for ONE stop of the process's threads, and every patch out the same way. Driven twice: against real
// MinHook, for what is at the target, and against a MODEL of MinHook's table (hook.c: each hook has a state and a
// mark, and an apply executes every hook whose two differ, stopping at the first that fails), for the things real
// MinHook cannot be made to do on demand -- an apply that fails halfway, a stop that lands inside one.
namespace {
// MinHook with its queue, as dllmain.cpp's MinHookEngine hands it to Batch and RestoreAll. The gate is the Overlay's;
// one thread patches here.
struct RealQueue {
static bool Create(void* target, void* detour, void** original) noexcept {
return MH_CreateHook(target, detour, original) == MH_OK;
}
static bool QueueEnable(void* target) noexcept { return MH_QueueEnableHook(target) == MH_OK; }
static bool QueueDisable(void* target) noexcept { return MH_QueueDisableHook(target) == MH_OK; }
static bool Apply() noexcept { return MH_ApplyQueued() == MH_OK; }
static bool EnsureEnabled(void* target) noexcept {
const MH_STATUS status = MH_EnableHook(target);
return status == MH_OK || status == MH_ERROR_ENABLED;
}
static bool EnsureDisabled(void* target) noexcept {
const MH_STATUS status = MH_DisableHook(target);
return status == MH_OK || status == MH_ERROR_DISABLED;
}
static void BeginQueue() noexcept {}
static void EndQueue() noexcept {}
};
bool RealOurs(const void* target, const void* detour) noexcept {
return fl::patch::StillOurs(target, detour);
}
struct Model {
static constexpr int kMax = 8;
void* target[kMax]{};
bool enabled[kMax]{};
bool marked[kMax]{}; // MinHook's queueEnable: the state the next apply gives the hook
bool foreign[kMax]{}; // somebody else patched over this one
int count = 0;
void* neverEnables = nullptr; // the hook at this target cannot be enabled
bool applyFails = false; // the apply does nothing and says so
std::atomic<std::uint32_t>* stopsDuringApply = nullptr;
int applies = 0;
int gate = 0;
bool touchedOutsideTheGate = false;
bool wroteOverAForeignPatch = false;
int Find(const void* t) const noexcept {
for (int i = 0; i < count; ++i) {
if (target[i] == t) {
return i;
}
}
return -1;
}
bool AMarkIsStanding() const noexcept {
for (int i = 0; i < count; ++i) {
if (enabled[i] != marked[i]) {
return true;
}
}
return false;
}
bool Enabled(const void* t) const noexcept {
const int i = Find(t);
return i >= 0 && enabled[i];
}
void Set(int i, bool on) noexcept {
if (i < 0 || i >= count) {
return;
}
if (!on && enabled[i] && foreign[i]) {
wroteOverAForeignPatch = true; // our saved bytes over their jump: what §H7 forbids
}
enabled[i] = on;
marked[i] = on;
}
// Somebody else patched over the hook at `t`.
void PatchOver(const void* t) noexcept {
const int i = Find(t);
if (i >= 0) {
foreign[i] = true;
}
}
};
struct ModelEngine {
Model* m;
bool Create(void* target, void*, void**) const noexcept {
if (m->Find(target) >= 0 || m->count == Model::kMax) {
return false;
}
m->target[m->count++] = target;
return true;
}
bool Mark(void* target, bool on) const noexcept {
const int i = m->Find(target);
if (i < 0) {
return false;
}
m->touchedOutsideTheGate = m->touchedOutsideTheGate || m->gate == 0;
m->marked[i] = on;
return true;
}
bool QueueEnable(void* target) const noexcept { return Mark(target, true); }
bool QueueDisable(void* target) const noexcept { return Mark(target, false); }
bool Apply() const noexcept {
++m->applies;
m->touchedOutsideTheGate = m->touchedOutsideTheGate || m->gate == 0;
if (m->stopsDuringApply != nullptr) {
m->stopsDuringApply->store(0u);
}
if (m->applyFails) {
return false;
}
for (int i = 0; i < m->count; ++i) {
if (m->enabled[i] == m->marked[i]) {
continue;
}
if (m->marked[i] && m->target[i] == m->neverEnables) {
return false; // hook.c: the first failure ends the apply, the rest keep their marks
}
m->Set(i, m->marked[i]);
}
return true;
}
bool EnsureEnabled(void* target) const noexcept {
const int i = m->Find(target);
if (i < 0 || target == m->neverEnables) {
return false;
}
m->Set(i, true);
return true;
}
bool EnsureDisabled(void* target) const noexcept {
const int i = m->Find(target);
if (i < 0) {
return false;
}
m->Set(i, false);
return true;
}
void BeginQueue() const noexcept { ++m->gate; }
void EndQueue() const noexcept { --m->gate; }
};
// "Still ours", for the model: in, and nobody patched over it.
struct ModelOurs {
const Model* m;
bool operator()(const void* target, const void*) const noexcept {
const int i = m->Find(target);
return i >= 0 && m->enabled[i] && !m->foreign[i];
}
};
int g_a = 0;
int g_b = 0;
int g_c = 0;
int g_detour = 0;
} // namespace
TEST_CASE("a batch puts three patches in under one apply, and the stop takes them out under one",
"[unhook][registry][batch]") {
using fl::patch::InstallResult;
fl::patch::Registry<3> registry;
fl::patch::Batch<3> batch;
std::atomic<std::uint32_t> observing{1u};
void* first = reinterpret_cast<void*>(&First);
void* second = reinterpret_cast<void*>(&Second);
void* third = reinterpret_cast<void*>(&Third);
const int firstPlain = First(3);
const int secondPlain = Second(3);
const int thirdPlain = Third(3);
REQUIRE(MH_Initialize() == MH_OK);
CHECK(batch.Add(registry, observing, RealQueue{}, first, reinterpret_cast<void*>(&DetourFirst),
reinterpret_cast<void**>(&g_origFirst), "first", nullptr, 0u) == InstallResult::Pending);
CHECK(batch.Add(registry, observing, RealQueue{}, second, reinterpret_cast<void*>(&DetourSecond),
reinterpret_cast<void**>(&g_origSecond), "second", nullptr, 0u) == InstallResult::Pending);
// The same target a second time: the engine refuses it, its slot goes back, and the others are not held up.
CHECK(batch.Add(registry, observing, RealQueue{}, second, reinterpret_cast<void*>(&DetourSecond),
reinterpret_cast<void**>(&g_origSecond), "second again", nullptr,
0u) == InstallResult::CreateFailed);
CHECK(batch.Add(registry, observing, RealQueue{}, third, reinterpret_cast<void*>(&DetourThird),
reinterpret_cast<void**>(&g_origThird), "third", nullptr, 7u) == InstallResult::Pending);
CHECK(batch.Add(registry, observing, RealQueue{}, nullptr, first, nullptr, "nothing", nullptr, 0u) ==
InstallResult::NoTarget);
REQUIRE(batch.Count() == 3u);
// Added is not patched: nothing is at any target, and the stop's walk has nothing to see.
CHECK(First(3) == firstPlain);
CHECK(Third(3) == thirdPlain);
CHECK(registry.LiveCount() == 0u);
const fl::patch::BatchOutcome in = batch.Commit(registry, observing, RealQueue{}, RealOurs);
CHECK(in.applied); // one apply did it (D137: the caller's log line says so)
CHECK(in.singly == 0u);
for (std::uint32_t i = 0; i < batch.Count(); ++i) {
CHECK(batch.At(i).result == InstallResult::Installed);
}
CHECK(batch.At(2).word == 7u); // what the caller attached comes back with the item
CHECK(First(3) == firstPlain + 1000000);
CHECK(Second(3) == secondPlain + 2000000);
CHECK(Third(3) == thirdPlain + 3000000);
CHECK(registry.LiveCount() == 3u);
batch.Clear();
CHECK(batch.Count() == 0u);
// The stop: one walk, one apply, every patch reported as ours and restored.
observing.store(0u);
int restored = 0;
int declined = 0;
const fl::patch::BatchOutcome out = fl::patch::RestoreAll(
registry, RealQueue{}, RealOurs, [&restored, &declined](const char*, void*, bool wasOurs, bool ok) noexcept {
restored += (wasOurs && ok) ? 1 : 0;
declined += wasOurs ? 0 : 1;
});
CHECK(out.applied);
CHECK(out.singly == 0u);
CHECK(restored == 3);
CHECK(declined == 0);
CHECK(First(3) == firstPlain);
CHECK(Second(3) == secondPlain);
CHECK(Third(3) == thirdPlain);
// Stopping is one-way for a batch as for a single patch: nothing is created after it.
CHECK(batch.Add(registry, observing, RealQueue{}, first, reinterpret_cast<void*>(&DetourFirst),
reinterpret_cast<void**>(&g_origFirst), "first", nullptr, 0u) == InstallResult::Stopped);
MH_Uninitialize();
}
TEST_CASE("the stop's batch leaves a patch a foreign overlay patched over exactly as it is, and restores the others",
"[unhook][registry][batch]") {
using fl::patch::InstallResult;
fl::patch::Registry<2> registry;
fl::patch::Batch<2> batch;
std::atomic<std::uint32_t> observing{1u};
void* first = reinterpret_cast<void*>(&First);
void* second = reinterpret_cast<void*>(&Second);
const int secondPlain = Second(3);
REQUIRE(MH_Initialize() == MH_OK);
REQUIRE(batch.Add(registry, observing, RealQueue{}, first, reinterpret_cast<void*>(&DetourFirst),
reinterpret_cast<void**>(&g_origFirst), "first", nullptr, 0u) == InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, RealQueue{}, second, reinterpret_cast<void*>(&DetourSecond),
reinterpret_cast<void**>(&g_origSecond), "second", nullptr, 0u) == InstallResult::Pending);
batch.Commit(registry, observing, RealQueue{}, RealOurs);
REQUIRE(registry.LiveCount() == 2u);
// A foreign overlay patches First after us.
std::uint8_t* foreignRelay = MakeRelay(reinterpret_cast<void*>(&ForeignDetour), first);
std::int32_t savedRel = 0;
RepointJump(first, foreignRelay, &savedRel);
std::uint8_t theirs[5]{};
std::memcpy(theirs, first, sizeof(theirs));
REQUIRE(First(5) == 4); // their hook is what runs
observing.store(0u);
int restored = 0;
int declined = 0;
fl::patch::RestoreAll(registry, RealQueue{}, RealOurs,
[&restored, &declined](const char*, void*, bool wasOurs, bool ok) noexcept {
restored += (wasOurs && ok) ? 1 : 0;
declined += wasOurs ? 0 : 1;
});
CHECK(restored == 1);
CHECK(declined == 1);
CHECK(std::memcmp(theirs, first, sizeof(theirs)) == 0); // not one byte of theirs was written
CHECK(First(5) == 4);
CHECK(Second(3) == secondPlain);
// ...and no mark was left on the declined one: an apply by anybody afterwards still does not touch it.
CHECK(MH_ApplyQueued() == MH_OK);
CHECK(std::memcmp(theirs, first, sizeof(theirs)) == 0);
RestoreJump(first, savedRel); // the foreign overlay goes away before MinHook is torn down
MH_Uninitialize();
VirtualFree(foreignRelay, 0, MEM_RELEASE);
}
TEST_CASE("an apply that fails halfway costs one patch, and leaves no mark for a later apply to act on",
"[unhook][registry][batch]") {
using fl::patch::InstallResult;
fl::patch::Registry<3> registry;
fl::patch::Batch<3> batch;
std::atomic<std::uint32_t> observing{1u};
Model model;
model.neverEnables = &g_b;
const ModelEngine engine{&model};
REQUIRE(batch.Add(registry, observing, engine, &g_a, &g_detour, nullptr, "a", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_b, &g_detour, nullptr, "b", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_c, &g_detour, nullptr, "c", nullptr, 0u) ==
InstallResult::Pending);
CHECK_FALSE(model.AMarkIsStanding()); // adding marks nothing
const fl::patch::BatchOutcome outcome = batch.Commit(registry, observing, engine, ModelOurs{&model});
// D137: the apply said it failed, so all three were handed to the engine one at a time -- a, which the apply had
// already put in, among them: the count is of attempts, and the engine makes no stop for a patch that is in.
CHECK_FALSE(outcome.applied);
CHECK(outcome.singly == 3u);
CHECK(batch.At(0).result == InstallResult::Installed);
CHECK(batch.At(1).result == InstallResult::EnableFailed);
CHECK(batch.At(2).result == InstallResult::Installed); // the apply stopped at b; c went in by itself
CHECK(model.Enabled(&g_a));
CHECK_FALSE(model.Enabled(&g_b));
CHECK(model.Enabled(&g_c));
CHECK(registry.LiveCount() == 2u);
CHECK(model.applies == 1);
CHECK_FALSE(model.AMarkIsStanding());
CHECK_FALSE(model.touchedOutsideTheGate);
CHECK(model.gate == 0);
// The stop's apply -- anybody's apply -- must not be what puts b in.
model.neverEnables = nullptr;
CHECK(engine.Apply());
CHECK_FALSE(model.Enabled(&g_b));
// b's slot went back: the third slot can be claimed again.
CHECK(registry.Claim(&g_b, &g_detour, "b again") >= 0);
}
TEST_CASE("an apply that does nothing at all still gets every patch in, one at a time", "[unhook][registry][batch]") {
using fl::patch::InstallResult;
fl::patch::Registry<2> registry;
fl::patch::Batch<2> batch;
std::atomic<std::uint32_t> observing{1u};
Model model;
model.applyFails = true; // MinHook could not stop the threads: nothing applied, one status for all
const ModelEngine engine{&model};
REQUIRE(batch.Add(registry, observing, engine, &g_a, &g_detour, nullptr, "a", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_b, &g_detour, nullptr, "b", nullptr, 0u) ==
InstallResult::Pending);
const fl::patch::BatchOutcome in = batch.Commit(registry, observing, engine, ModelOurs{&model});
CHECK_FALSE(in.applied); // what the Overlay logs as "install singly", with the two in the line's high half
CHECK(in.singly == 2u);
CHECK(batch.At(0).result == InstallResult::Installed);
CHECK(batch.At(1).result == InstallResult::Installed);
CHECK(registry.LiveCount() == 2u);
CHECK_FALSE(model.AMarkIsStanding());
// And the stop, with the same failing apply, still takes both out.
observing.store(0u);
int restored = 0;
const fl::patch::BatchOutcome out = fl::patch::RestoreAll(
registry, engine, ModelOurs{&model},
[&restored](const char*, void*, bool wasOurs, bool ok) noexcept { restored += (wasOurs && ok) ? 1 : 0; });
CHECK_FALSE(out.applied); // "restore singly"
CHECK(out.singly == 2u);
CHECK(restored == 2);
CHECK_FALSE(model.Enabled(&g_a));
CHECK_FALSE(model.Enabled(&g_b));
CHECK_FALSE(model.AMarkIsStanding());
CHECK_FALSE(model.touchedOutsideTheGate);
}
TEST_CASE("a stop before the batch commits enables nothing; a stop inside its apply is undone by the batch itself",
"[unhook][registry][batch]") {
using fl::patch::InstallResult;
Model model;
const ModelEngine engine{&model};
SECTION("the stop ran between the adds and the commit") {
fl::patch::Registry<2> registry;
fl::patch::Batch<2> batch;
std::atomic<std::uint32_t> observing{1u};
REQUIRE(batch.Add(registry, observing, engine, &g_a, &g_detour, nullptr, "a", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_b, &g_detour, nullptr, "b", nullptr, 0u) ==
InstallResult::Pending);
observing.store(0u);
const fl::patch::BatchOutcome outcome = batch.Commit(registry, observing, engine, ModelOurs{&model});
CHECK(outcome.applied); // nothing was asked of an apply, so nothing failed
CHECK(outcome.singly == 0u);
CHECK(batch.At(0).result == InstallResult::StoppedDuring);
CHECK(batch.At(1).result == InstallResult::StoppedDuring);
CHECK(model.applies == 0); // nothing was marked, nothing applied
CHECK_FALSE(model.Enabled(&g_a));
CHECK_FALSE(model.Enabled(&g_b));
CHECK(registry.LiveCount() == 0u);
CHECK(registry.Claim(&g_a, &g_detour, "free again") >= 0); // never live, so not retired
}
SECTION("the stop ran while the apply was putting them in") {
fl::patch::Registry<2> registry;
fl::patch::Batch<2> batch;
std::atomic<std::uint32_t> observing{1u};
model.stopsDuringApply = &observing;
REQUIRE(batch.Add(registry, observing, engine, &g_a, &g_detour, nullptr, "a", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_b, &g_detour, nullptr, "b", nullptr, 0u) ==
InstallResult::Pending);
batch.Commit(registry, observing, engine, ModelOurs{&model});
CHECK(batch.At(0).result == InstallResult::StoppedDuring);
CHECK(batch.At(1).result == InstallResult::StoppedDuring);
CHECK_FALSE(model.Enabled(&g_a)); // put in, and taken out again by the installer
CHECK_FALSE(model.Enabled(&g_b));
CHECK(model.applies == 2); // one in, one out
CHECK(registry.LiveCount() == 0u);
CHECK(registry.Claim(&g_a, &g_detour, "again") == -1); // they were live: the slots are never reused
CHECK_FALSE(model.AMarkIsStanding());
CHECK_FALSE(model.touchedOutsideTheGate);
CHECK(model.gate == 0);
}
}
TEST_CASE("the stop marks only what is still ours: a foreign patch is not written, a restored patch is not put back",
"[unhook][registry][batch]") {
using fl::patch::InstallResult;
fl::patch::Registry<3> registry;
fl::patch::Batch<3> batch;
std::atomic<std::uint32_t> observing{1u};
Model model;
const ModelEngine engine{&model};
REQUIRE(batch.Add(registry, observing, engine, &g_a, &g_detour, nullptr, "a", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_b, &g_detour, nullptr, "b", nullptr, 0u) ==
InstallResult::Pending);
REQUIRE(batch.Add(registry, observing, engine, &g_c, &g_detour, nullptr, "c", nullptr, 0u) ==
InstallResult::Pending);
batch.Commit(registry, observing, engine, ModelOurs{&model});
REQUIRE(registry.LiveCount() == 3u);
model.PatchOver(&g_a); // a: somebody patched over us
// c: committed, and already taken out -- an installer between its own disable and its Retire. The draft that
// marked everything and then un-marked what it must not restore marked THIS one for enabling, and the stop's own
// apply put the patch back in after the stop.
model.Set(model.Find(&g_c), false);
model.applies = 0;
observing.store(0u);
int ours = 0;
int notOurs = 0;
fl::patch::RestoreAll(registry, engine, ModelOurs{&model},
[&ours, &notOurs](const char*, void*, bool wasOurs, bool ok) noexcept {
ours += (wasOurs && ok) ? 1 : 0;
notOurs += wasOurs ? 0 : 1;
});
CHECK(ours == 1); // b
CHECK(notOurs == 2); // a and c
CHECK(model.applies == 1);
CHECK(model.Enabled(&g_a)); // theirs: still in
CHECK_FALSE(model.wroteOverAForeignPatch);
CHECK_FALSE(model.Enabled(&g_b));
CHECK_FALSE(model.Enabled(&g_c)); // stayed out
CHECK_FALSE(model.AMarkIsStanding());
CHECK_FALSE(model.touchedOutsideTheGate);
CHECK(model.gate == 0);
// Nothing of ours left: a second stop's walk marks nothing and applies nothing.
model.applies = 0;
fl::patch::RestoreAll(registry, engine, ModelOurs{&model}, [](const char*, void*, bool, bool) noexcept {});
CHECK(model.applies == 0);
}
+10
View File
@@ -156,6 +156,16 @@ add_library(fl_nvapi INTERFACE)
target_include_directories(fl_nvapi SYSTEM INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/nvapi"
)
# THE HEADERS ALONE, for code that is loaded into a game (Advanced metrics train C, owner decision D136). The Overlay
# calls two of the driver's getters through an nvapi64.dll the GAME had already loaded (fl_reflex.h); it takes the
# vendored MIT headers' structs and ids and must never link nvapi64.lib, whose first call loads the DLL. So this is
# the include directory and nothing else. tools/hookinventory-check.ps1 Pass C reads the built Overlay's import table
# for an nvapi module, and tools/nvapi-readonly-check.ps1 holds which ids the Overlay may name.
add_library(fl_nvapi_headers INTERFACE)
target_include_directories(fl_nvapi_headers SYSTEM INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/nvapi"
)
target_link_libraries(fl_nvapi INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/nvapi/amd64/nvapi64.lib"
)
+1
View File
@@ -8,4 +8,5 @@ add_subdirectory(fl-probe-processstats)
add_subdirectory(fl-probe-signer)
add_subdirectory(fl-probe-vklayer)
add_subdirectory(vendor-stubs)
add_subdirectory(fl-probe-reflex)
add_subdirectory(hook-harness)
@@ -30,3 +30,5 @@ add_dependencies(fl-baseline-probe FrameLedger.Guard)
# process reports nothing, a planted module IS detected, and the answer flips
# back after unload rather than latching.
add_test(NAME fl_baseline_probe COMMAND fl-baseline-probe --self-test)
# The self-test's last line (the note above enable_testing() in the top-level file: a run cut short is not a pass).
fl_test_completes(fl_baseline_probe "\\[PASS\\] after unload the scan reports no capability loaded again")
@@ -225,6 +225,8 @@ const char* CollectedName(fl::guard::Collected c) {
return "INCOMPLETE";
case fl::guard::Collected::kRetry:
return "RETRY (still loading, or gone)";
case fl::guard::Collected::kUnsettled:
return "UNSETTLED (the list changed while it was read)";
}
return "?";
}
+15 -1
View File
@@ -115,7 +115,16 @@ int main() {
FL_ADV_FIELD(samples);
FL_ADV_FIELD(request);
FL_ADV_FIELD(sampleQpc);
FL_ADV_FIELD(reservedHeader);
FL_ADV_FIELD(latState);
FL_ADV_FIELD(latReads);
FL_ADV_FIELD(latFrames);
FL_ADV_FIELD(latSimulationSumUs);
FL_ADV_FIELD(latSubmitSumUs);
FL_ADV_FIELD(latPresentSumUs);
FL_ADV_FIELD(latDriverSumUs);
FL_ADV_FIELD(latOsQueueSumUs);
FL_ADV_FIELD(latGpuSumUs);
FL_ADV_FIELD(latTotalSumUs);
FL_ADV_FIELD(dlssStructVersion);
FL_ADV_FIELD(dlssOptionsSeen);
FL_ADV_FIELD(dlssOutputWidth);
@@ -127,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);
@@ -167,6 +180,7 @@ int main() {
FL_ADV_FIELD(slAspectBits);
FL_ADV_FIELD(slFlagsSeenTrue);
FL_ADV_FIELD(slFlagsSeenFalse);
FL_ADV_FIELD(slShutdowns);
FL_ADV_FIELD(reservedSl);
Field("features", offsetof(FlAdvancedState, features), sizeof(FlAdvancedState::features), true);
#undef FL_ADV_FIELD
@@ -19,3 +19,5 @@ target_compile_definitions(fl-probe-guard PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
# is ACCESS_DENIED on a service, which the probe reports as NOT MEASURED
# rather than leaving to be assumed.
add_test(NAME fl_guard_apis COMMAND fl-probe-guard)
# Its last line when every probe passed (a run cut short is not a pass -- the top-level file, above enable_testing()).
fl_test_completes(fl_guard_apis "GUARD PROBE OK \\(")
@@ -15,3 +15,5 @@ target_link_libraries(fl-probe-hookprofile PRIVATE FrameLedger.Shm fl_native_fla
target_compile_definitions(fl-probe-hookprofile PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
add_test(NAME fl_hook_profile COMMAND fl-probe-hookprofile)
# Its last line when every probe passed (a run cut short is not a pass -- the top-level file, above enable_testing()).
fl_test_completes(fl_hook_profile "ALL PROBES PASSED \\(")
@@ -51,3 +51,6 @@ target_compile_definitions(fl-probe-interposer PRIVATE WIN32_LEAN_AND_MEAN NOMIN
# Run part 2 deliberately, like --probe-cost:
# fl-probe-interposer --interposer "D:\...\Cyberpunk 2077\bin\x64"
add_test(NAME fl_vtable_identity_control COMMAND fl-probe-interposer)
# Part 1's last line: printed only once the control passed, just before the probe returns (a run cut short is not a
# pass -- the top-level file, above enable_testing()).
fl_test_completes(fl_vtable_identity_control "control: [0-9]+/[0-9]+ checks passed")
@@ -40,6 +40,9 @@ add_test(NAME fl_nvapi_probe COMMAND fl-probe-nvapi)
# probe returns in ~0.01 s against ~1.4 s on the dev box — but inferable is not
# observed, and docs/18_GPU_VENDOR_APIS.md §L3 says so rather than claiming the
# stronger thing.
set_tests_properties(fl_nvapi_probe PROPERTIES
PASS_REGULAR_EXPRESSION "BRANCH: (AVAILABLE|DEGRADED)"
)
#
# THE BRANCH LINE AND, AFTER IT, THE PROBE'S LAST LINE (2026-11-13). The branch line alone passed a run that stopped
# right after printing it -- and, because a pass expression makes ctest ignore the exit code, a run that went on to
# print FAILED. "OK (available branch)" / "OK (degraded branch)" is what the probe ends on when nothing failed.
fl_test_completes(fl_nvapi_probe
"BRANCH: (AVAILABLE|DEGRADED)(.|\n)*OK \\((available|degraded) branch\\)")
@@ -0,0 +1,26 @@
# fl-probe-reflex -- the instrument of docs/spike-notes §31 (Reflex route D, owner decision D132). A tool, NOT
# SHIPPED, and it touches no game.
#
# BUILT WITH THE OVERLAY'S OWN FLAGS (fl_hostile_env_flags), as fl-probe-hookprofile is, AND FROM THE OVERLAY'S OWN
# HEADER: the call sequence is FrameLedger.Overlay/include/fl_reflex.h since the owner said go (D136), and this probe
# includes it. So its ctest runs what ships, with Control Flow Guard enforced -- which hook-harness, the target of
# the injected tests, does not enforce.
#
# THE NVAPI HEADERS, NOT THE NVAPI LIBRARY. The include directory of the vendored MIT headers is taken by itself;
# fl_nvapi -- which also links nvapi64.lib -- is deliberately not: the static library loads nvapi64.dll itself, from
# a trusted location, with a signature check, and route D's shape is that the process already has the module.
add_executable(fl-probe-reflex main.cpp)
target_link_libraries(fl-probe-reflex PRIVATE fl_native_flags fl_hostile_env_flags d3d11 d3d12 dxgi)
target_link_libraries(fl-probe-reflex PRIVATE fl_nvapi_headers)
target_include_directories(fl-probe-reflex PRIVATE "${CMAKE_SOURCE_DIR}/FrameLedger.Overlay/include")
target_compile_definitions(fl-probe-reflex PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX UNICODE _UNICODE)
add_dependencies(fl-probe-reflex fl_stub_nvapi64)
# The half a build machine can run: the candidate against the stand-in module -- absent, without its getters, a
# report of nothing, an error, sixty-four reports, both device kinds, a call that does not come back for a while.
# Software devices; exit 77 where there is no Direct3D 11 at all. `--real` (the installed driver, an NVIDIA adapter)
# is a measurement the note records, never a test.
add_test(NAME fl_reflex_probe_stub COMMAND fl-probe-reflex --stub "$<TARGET_FILE:fl_stub_nvapi64>")
set_tests_properties(fl_reflex_probe_stub PROPERTIES SKIP_RETURN_CODE 77)
# Its last line when nothing failed (a run cut short is not a pass -- the top-level file, above enable_testing()).
fl_test_completes(fl_reflex_probe_stub "STUB OK: 0 failure\\(s\\)")
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// What the probe adds to the call sequence it measures (docs/spike-notes §30, §31).
//
// THE SEQUENCE ITSELF MOVED. Until the owner said go (D136) the candidate lived here and nowhere that ships; it is now
// FrameLedger.Overlay/include/fl_reflex.h, the header the Overlay is built from, and this probe includes that one --
// so its ctest keeps running the shipped sequence, under the Overlay's flags and with Control Flow Guard enforced.
// What stays here is the probe's own way of printing a report, which the Overlay does not use: its reader is
// fl_adv_fields.h's, with the rules a game needs (the newest frames are not final, an impossible span is refused).
#ifndef FRAMELEDGER_FL_REFLEX_CANDIDATE_H
#define FRAMELEDGER_FL_REFLEX_CANDIDATE_H
#include <fl_reflex.h>
namespace fl::reflex {
// What a report holds, in numbers: how many of its sixty-four frames carry anything, and the newest one's id and
// two spans in the report's own unit -- simulation start to present end (the game's side) and to the end of GPU work.
struct Digest {
std::uint32_t valid = 0;
std::uint64_t newestFrameId = 0;
std::uint64_t newestSimToPresentEnd = 0;
std::uint64_t newestSimToGpuEnd = 0;
std::uint32_t newestGpuActiveUs = 0;
};
inline Digest Summarise(const NV_LATENCY_RESULT_PARAMS& report) noexcept {
Digest d{};
for (int i = 0; i < 64; ++i) {
const auto& r = report.frameReport[i];
if (r.frameID == 0u && r.simStartTime == 0u && r.gpuRenderEndTime == 0u) {
continue;
}
++d.valid;
d.newestFrameId = r.frameID;
d.newestSimToPresentEnd = r.presentEndTime >= r.simStartTime ? r.presentEndTime - r.simStartTime : 0u;
d.newestSimToGpuEnd = r.gpuRenderEndTime >= r.simStartTime ? r.gpuRenderEndTime - r.simStartTime : 0u;
d.newestGpuActiveUs = r.gpuActiveRenderTimeUs;
}
return d;
}
} // namespace fl::reflex
#endif // FRAMELEDGER_FL_REFLEX_CANDIDATE_H
+933
View File
@@ -0,0 +1,933 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// fl-probe-reflex -- the instrument of docs/spike-notes §31 (Reflex route D, owner decision D132). NOT SHIPPED, and it
// touches no game: it runs the call sequence of fl_reflex_candidate.h in its own process, against two things.
//
// --stub <path> a stand-in nvapi64.dll (tools/vendor-stubs/stub_nvapi64.cpp): the module absent, a getter absent,
// a report of nothing, an error, sixty-four reports, both device kinds, and a call that does not come
// back for seconds. ctest fl_reflex_probe_stub. Software devices are enough: the stub does not look.
// --real the installed driver, on this PC's NVIDIA adapter, with the probe playing the game's part: it
// loads nvapi64.dll itself, initialises it, and SETS LATENCY MARKERS ON ITS OWN DEVICE for a few
// hundred frames -- a write, made here because a getter has nothing to return without it, in a
// process that is nobody's game. Then it measures what route D would do: the two getters. A
// measurement, not a test: exit 77 where there is no NVIDIA adapter.
//
// Built with the Overlay's own flags, because the candidate is the Overlay's code-to-be.
#include <windows.h>
#include <d3d11.h>
#include <d3d12.h>
#include <dxgi1_4.h>
#include <atomic>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include "fl_reflex_candidate.h"
namespace {
int g_failures = 0;
void Check(bool ok, const char* what) noexcept {
std::printf("%s %s\n", ok ? "PASS" : "FAIL", what);
if (!ok) {
++g_failures;
}
}
template <class T>
void ReleaseIf(T*& p) noexcept {
if (p != nullptr) {
p->Release();
p = nullptr;
}
}
double QpcSeconds() noexcept {
// QuadPart named in the initialiser, so the member read back is the one the union holds (cpp:S6232).
LARGE_INTEGER f{.QuadPart = 0};
LARGE_INTEGER c{.QuadPart = 0};
QueryPerformanceFrequency(&f);
QueryPerformanceCounter(&c);
return static_cast<double>(c.QuadPart) / static_cast<double>(f.QuadPart);
}
// ---------------------------------------------------------------------------------------------------------------------
// Devices. `nvidia` picks this PC's NVIDIA adapter (vendor 0x10DE) or fails; otherwise the software adapter.
// ---------------------------------------------------------------------------------------------------------------------
IDXGIAdapter1* FindAdapter(IDXGIFactory4* factory, bool nvidia) noexcept {
if (!nvidia) {
IDXGIAdapter1* warp = nullptr;
factory->EnumWarpAdapter(__uuidof(IDXGIAdapter1), reinterpret_cast<void**>(&warp));
return warp;
}
for (UINT i = 0;; ++i) {
IDXGIAdapter1* adapter = nullptr;
if (factory->EnumAdapters1(i, &adapter) != S_OK) {
return nullptr;
}
DXGI_ADAPTER_DESC1 desc{};
if (SUCCEEDED(adapter->GetDesc1(&desc)) && desc.VendorId == 0x10DEu &&
(desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) == 0u) {
return adapter;
}
adapter->Release();
}
}
struct Dx11 {
ID3D11Device* device = nullptr;
ID3D11DeviceContext* context = nullptr;
IDXGISwapChain1* chain = nullptr;
ID3D11RenderTargetView* target = nullptr;
};
bool MakeDx11(IDXGIFactory4* factory, IDXGIAdapter1* adapter, Dx11& out) noexcept {
if (FAILED(D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_BGRA_SUPPORT, nullptr,
0, D3D11_SDK_VERSION, &out.device, nullptr, &out.context))) {
return false;
}
DXGI_SWAP_CHAIN_DESC1 desc{};
desc.Width = 256;
desc.Height = 256;
desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
desc.SampleDesc.Count = 1;
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
desc.BufferCount = 2;
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
desc.AlphaMode = DXGI_ALPHA_MODE_PREMULTIPLIED;
if (FAILED(factory->CreateSwapChainForComposition(out.device, &desc, nullptr, &out.chain))) {
return false;
}
ID3D11Texture2D* back = nullptr;
if (FAILED(out.chain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&back)))) {
return false;
}
const HRESULT hr = out.device->CreateRenderTargetView(back, nullptr, &out.target);
back->Release();
return SUCCEEDED(hr);
}
void FreeDx11(Dx11& d) noexcept {
ReleaseIf(d.target);
ReleaseIf(d.chain);
ReleaseIf(d.context);
ReleaseIf(d.device);
}
struct Dx12 {
ID3D12Device* device = nullptr;
ID3D12CommandQueue* queue = nullptr;
IDXGISwapChain1* chain = nullptr;
};
bool MakeDx12(IDXGIFactory4* factory, IDXGIAdapter1* adapter, Dx12& out) noexcept {
if (FAILED(D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0, __uuidof(ID3D12Device),
reinterpret_cast<void**>(&out.device)))) {
return false;
}
D3D12_COMMAND_QUEUE_DESC q{};
q.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
if (FAILED(
out.device->CreateCommandQueue(&q, __uuidof(ID3D12CommandQueue), reinterpret_cast<void**>(&out.queue)))) {
return false;
}
DXGI_SWAP_CHAIN_DESC1 desc{};
desc.Width = 256;
desc.Height = 256;
desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
desc.SampleDesc.Count = 1;
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
desc.BufferCount = 2;
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
desc.AlphaMode = DXGI_ALPHA_MODE_PREMULTIPLIED;
return SUCCEEDED(factory->CreateSwapChainForComposition(out.queue, &desc, nullptr, &out.chain));
}
void FreeDx12(Dx12& d) noexcept {
ReleaseIf(d.chain);
ReleaseIf(d.queue);
ReleaseIf(d.device);
}
// ---------------------------------------------------------------------------------------------------------------------
// --stub
// ---------------------------------------------------------------------------------------------------------------------
using SetU32Fn = void(__cdecl*)(std::uint32_t);
using GetU32Fn = std::uint32_t(__cdecl*)();
using GetPtrFn = void*(__cdecl*)();
struct BlockedCall {
fl::reflex::Api api;
IUnknown* device;
NvAPI_Status status;
};
DWORD WINAPI BlockedCallThread(LPVOID p) noexcept {
auto* call = static_cast<BlockedCall*>(p);
static NV_LATENCY_RESULT_PARAMS report; // 15 KB: not on a new thread's stack for no reason
call->status = fl::reflex::ReadLatency(call->api, call->device, report);
return 0;
}
// A stand-in for the Overlay's watchdog: a loop that ticks every 50 ms and, when told, makes the call ITSELF.
struct Ticker {
std::atomic<std::uint32_t> ticks{0};
std::atomic<std::uint32_t> callNow{0};
std::atomic<std::uint32_t> quit{0};
fl::reflex::Api api;
IUnknown* device = nullptr;
};
DWORD WINAPI TickerThread(LPVOID p) noexcept {
auto* t = static_cast<Ticker*>(p);
static NV_LATENCY_RESULT_PARAMS report;
while (t->quit.load(std::memory_order_acquire) == 0u) {
if (t->callNow.exchange(0u, std::memory_order_acq_rel) != 0u) {
fl::reflex::ReadLatency(t->api, t->device, report);
}
t->ticks.fetch_add(1u, std::memory_order_relaxed);
Sleep(50);
}
return 0;
}
int RunStub(const wchar_t* stubPath) noexcept {
using fl::reflex::Resolved;
fl::reflex::Api api{};
// 1. The module is not in the process: nothing is called, and nothing gets loaded by asking.
Check(GetModuleHandleW(L"nvapi64.dll") == nullptr, "before: no nvapi64.dll in this process");
Check(fl::reflex::Resolve(api) == Resolved::NoModule, "module absent -> NoModule");
Check(GetModuleHandleW(L"nvapi64.dll") == nullptr, "resolving loaded nothing");
Check(api.getLatency == nullptr && api.getSleepStatus == nullptr, "no address was kept");
HMODULE stub = LoadLibraryExW(stubPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
if (stub == nullptr) {
std::printf("FAIL the stub did not load (%lu)\n", GetLastError());
return 1;
}
const auto setMode = reinterpret_cast<SetU32Fn>(GetProcAddress(stub, "FlStubNvSetMode"));
const auto setBlock = reinterpret_cast<SetU32Fn>(GetProcAddress(stub, "FlStubNvSetBlockMs"));
const auto hide = reinterpret_cast<SetU32Fn>(GetProcAddress(stub, "FlStubNvHideGetters"));
const auto latencyCalls = reinterpret_cast<GetU32Fn>(GetProcAddress(stub, "FlStubNvLatencyCalls"));
const auto lastDevice = reinterpret_cast<GetPtrFn>(GetProcAddress(stub, "FlStubNvLastDevice"));
if (setMode == nullptr || setBlock == nullptr || hide == nullptr || latencyCalls == nullptr ||
lastDevice == nullptr) {
std::printf("FAIL the module at that path is not the stub\n");
return 1;
}
// 2. A module that does not have the getters.
hide(1u);
Check(fl::reflex::Resolve(api) == Resolved::NoGetter, "a getter the module does not have -> NoGetter");
Check(api.getLatency == nullptr, "and nothing half-resolved is kept");
hide(0u);
Check(fl::reflex::Resolve(api) == Resolved::Ok, "both getters resolved by interface id");
IDXGIFactory4* factory = nullptr;
if (FAILED(CreateDXGIFactory1(__uuidof(IDXGIFactory4), reinterpret_cast<void**>(&factory)))) {
std::printf("SKIP no DXGI factory\n");
return 77;
}
IDXGIAdapter1* adapter = FindAdapter(factory, false);
Dx11 dx11{};
Dx12 dx12{};
const bool have11 = MakeDx11(factory, adapter, dx11);
const bool have12 = MakeDx12(factory, adapter, dx12);
if (!have11) {
std::printf("SKIP no Direct3D 11 device here\n");
return 77;
}
static NV_LATENCY_RESULT_PARAMS report;
NV_GET_SLEEP_STATUS_PARAMS sleep{};
// 3. Sixty-four reports, read as the header lays them out, with the device handed through untouched.
setMode(0u);
Check(fl::reflex::ReadLatency(api, dx11.device, report) == NVAPI_OK, "D3D11: the report is read");
fl::reflex::Digest d = fl::reflex::Summarise(report);
Check(d.valid == 64u && d.newestFrameId == 5063u, "sixty-four frames, the newest last");
Check(d.newestSimToPresentEnd == 2200u && d.newestSimToGpuEnd == 7500u && d.newestGpuActiveUs == 3500u,
"the spans are the ones the stub wrote");
Check(lastDevice() == dx11.device, "the driver was handed the device, and only the device");
if (have12) {
Check(fl::reflex::ReadLatency(api, dx12.device, report) == NVAPI_OK && lastDevice() == dx12.device,
"D3D12: the same call with the ID3D12Device the Overlay already holds");
} else {
std::printf("NOTE no Direct3D 12 device here; that half is not run\n");
}
Check(fl::reflex::ReadSleepStatus(api, dx11.device, sleep) == NVAPI_OK && sleep.bLowLatencyMode != 0 &&
sleep.sleepIntervalUs == 4166u && sleep.fgMultiplier == 2,
"the sleep status is read");
// 4. A game that set no marker (nvapi.h: every frame comes back zero), and a driver that says no.
setMode(1u);
Check(fl::reflex::ReadLatency(api, dx11.device, report) == NVAPI_OK && fl::reflex::Summarise(report).valid == 0u,
"a report of nothing is zero frames, not sixty-four");
setMode(2u);
Check(fl::reflex::ReadLatency(api, dx11.device, report) == NVAPI_ERROR, "an error is returned as the error");
Check(fl::reflex::ReadSleepStatus(api, dx11.device, sleep) == NVAPI_ERROR, "for the sleep status as well");
Check(fl::reflex::ReadLatency(api, nullptr, report) == NVAPI_INVALID_ARGUMENT &&
latencyCalls() == (have12 ? 4u : 3u),
"no device, no call: the driver was not entered");
setMode(0u);
// 5. A call that does not come back for a while. On a thread of its own, nothing else waits for it...
setBlock(1500u);
Ticker ticker{};
ticker.api = api;
ticker.device = dx11.device;
HANDLE tick = CreateThread(nullptr, 0, &TickerThread, &ticker, 0, nullptr);
Sleep(300);
BlockedCall blocked{api, dx11.device, NVAPI_ERROR};
const std::uint32_t before = ticker.ticks.load();
const double began = QpcSeconds();
HANDLE caller = CreateThread(nullptr, 0, &BlockedCallThread, &blocked, 0, nullptr);
Sleep(1000);
const std::uint32_t during = ticker.ticks.load() - before;
Check(during >= 10u, "a call blocked on its own thread: the ticking thread went on (>= 10 ticks in the second)");
WaitForSingleObject(caller, 5000);
const double took = QpcSeconds() - began;
Check(blocked.status == NVAPI_OK && took >= 1.4, "and the blocked call came back with its report");
std::printf("NOTE the blocked call took %.2f s; the other thread ticked %u times in its first second\n", took,
during);
CloseHandle(caller);
// ...and made BY the ticking thread, that thread stands still for as long as the driver keeps it.
const std::uint32_t before2 = ticker.ticks.load();
ticker.callNow.store(1u);
Sleep(1000);
const std::uint32_t during2 = ticker.ticks.load() - before2;
Check(during2 <= 3u, "the same call made by the ticking thread: it stopped ticking while the driver held it");
std::printf("NOTE made by the ticking thread itself, it ticked %u times in that second\n", during2);
Sleep(1000);
ticker.quit.store(1u);
WaitForSingleObject(tick, 3000);
CloseHandle(tick);
setBlock(0u);
FreeDx12(dx12);
FreeDx11(dx11);
ReleaseIf(adapter);
ReleaseIf(factory);
std::printf("%s: %d failure(s)\n", g_failures == 0 ? "STUB OK" : "STUB FAILED", g_failures);
return g_failures == 0 ? 0 : 1;
}
// ---------------------------------------------------------------------------------------------------------------------
// --real: the installed driver. The probe is the "game" here: it loads NVAPI, initialises it and sets markers.
// ---------------------------------------------------------------------------------------------------------------------
constexpr unsigned int kIdInitialize = 0x0150e828u; // nvapi_interface.h: NvAPI_Initialize
constexpr unsigned int kIdUnload = 0xd22bdd7eu; // NvAPI_Unload
constexpr unsigned int kIdSetLatencyMarker = 0xd9984c05u; // NvAPI_D3D_SetLatencyMarker -- the game's call
using PlainFn = NvAPI_Status(__cdecl*)();
using SetMarkerFn = NvAPI_Status(__cdecl*)(IUnknown*, NV_LATENCY_MARKER_PARAMS*);
struct Game {
SetMarkerFn setMarker = nullptr;
IUnknown* markerDevice = nullptr;
std::uint64_t frame = 0;
std::uint32_t markerErrors = 0;
NvAPI_Status lastMarkerStatus = NVAPI_OK;
};
void Mark(Game& g, NV_LATENCY_MARKER_TYPE type) noexcept {
NV_LATENCY_MARKER_PARAMS p{};
p.version = NV_LATENCY_MARKER_PARAMS_VER1;
p.frameID = g.frame;
p.markerType = type;
const NvAPI_Status s = g.setMarker(g.markerDevice, &p);
if (s != NVAPI_OK) {
++g.markerErrors;
g.lastMarkerStatus = s;
}
}
void Frame11(Game& g, Dx11& dx, bool markers) noexcept {
++g.frame;
if (markers) {
Mark(g, SIMULATION_START);
Mark(g, SIMULATION_END);
Mark(g, RENDERSUBMIT_START);
}
const float colour[4] = {static_cast<float>(g.frame % 255u) / 255.0f, 0.2f, 0.4f, 1.0f};
dx.context->OMSetRenderTargets(1, &dx.target, nullptr);
dx.context->ClearRenderTargetView(dx.target, colour);
if (markers) {
Mark(g, RENDERSUBMIT_END);
Mark(g, PRESENT_START);
}
dx.chain->Present(0, 0);
if (markers) {
Mark(g, PRESENT_END);
}
}
void Frame12(Game& g, Dx12& dx) noexcept {
++g.frame;
Mark(g, SIMULATION_START);
Mark(g, SIMULATION_END);
Mark(g, RENDERSUBMIT_START);
Mark(g, RENDERSUBMIT_END);
Mark(g, PRESENT_START);
dx.chain->Present(0, 0);
Mark(g, PRESENT_END);
}
void PrintDigest(const char* label, NvAPI_Status status, const NV_LATENCY_RESULT_PARAMS& report) noexcept {
const fl::reflex::Digest d = fl::reflex::Summarise(report);
std::printf("%-46s status %d, frames with anything %u, newest id %llu, sim->presentEnd %llu, sim->gpuEnd %llu, "
"gpuActive %u us\n",
label, static_cast<int>(status), d.valid, static_cast<unsigned long long>(d.newestFrameId),
static_cast<unsigned long long>(d.newestSimToPresentEnd),
static_cast<unsigned long long>(d.newestSimToGpuEnd), d.newestGpuActiveUs);
}
struct Poller {
fl::reflex::Api api;
IUnknown* device = nullptr;
std::atomic<std::uint32_t> quit{0};
std::atomic<std::uint32_t> paused{0};
std::atomic<std::uint32_t> intervalMs{250}; // 0: one read after another, as fast as the driver answers
std::uint32_t calls = 0;
std::uint32_t notOk = 0;
std::uint32_t faults = 0;
double worstSeconds = 0.0;
std::uint32_t emptyReports = 0;
std::uint32_t atLeast1Ms = 0; // reads that took a millisecond or more, and two (R6)
std::uint32_t atLeast2Ms = 0;
};
DWORD WINAPI PollerThread(LPVOID p) noexcept {
auto* poll = static_cast<Poller*>(p);
static NV_LATENCY_RESULT_PARAMS report;
NV_GET_SLEEP_STATUS_PARAMS sleep{};
while (poll->quit.load(std::memory_order_acquire) == 0u) {
if (poll->paused.load(std::memory_order_acquire) != 0u) {
Sleep(50);
continue;
}
const double t0 = QpcSeconds();
const NvAPI_Status a = fl::reflex::ReadLatency(poll->api, poll->device, report);
const NvAPI_Status b = fl::reflex::ReadSleepStatus(poll->api, poll->device, sleep);
const double took = QpcSeconds() - t0;
++poll->calls;
poll->notOk += (a != NVAPI_OK || b != NVAPI_OK) ? 1u : 0u;
poll->faults += (a == fl::reflex::kFaulted || b == fl::reflex::kFaulted) ? 1u : 0u;
poll->emptyReports += (a == NVAPI_OK && fl::reflex::Summarise(report).valid == 0u) ? 1u : 0u;
if (took > poll->worstSeconds) {
poll->worstSeconds = took;
}
poll->atLeast1Ms += took >= 0.001 ? 1u : 0u;
poll->atLeast2Ms += took >= 0.002 ? 1u : 0u;
const std::uint32_t interval = poll->intervalMs.load(std::memory_order_relaxed);
if (interval != 0u) {
Sleep(interval);
}
}
return 0;
}
// Microseconds a call, over `n` calls: the mean, the median and the worst.
struct Cost {
double mean = 0.0;
double median = 0.0;
double worst = 0.0;
};
template <class Call>
Cost Measure(int n, const Call& call) noexcept {
static double samples[4096];
if (n <= 0) {
return Cost{};
}
if (n > 4096) {
n = 4096;
}
double sum = 0.0;
for (int i = 0; i < n; ++i) {
const double t0 = QpcSeconds();
call();
samples[i] = (QpcSeconds() - t0) * 1e6;
sum += samples[i];
}
for (int i = 1; i < n; ++i) { // insertion sort: a few thousand doubles, once
const double v = samples[i];
int j = i - 1;
while (j >= 0 && samples[j] > v) {
samples[j + 1] = samples[j];
--j;
}
samples[j + 1] = v;
}
return Cost{sum / n, samples[n / 2], samples[n - 1]};
}
double FramesPerSecond11(Game& g, Dx11& dx, double seconds) noexcept {
const double t0 = QpcSeconds();
std::uint32_t frames = 0;
while (QpcSeconds() - t0 < seconds) {
Frame11(g, dx, true);
++frames;
}
return static_cast<double>(frames) / (QpcSeconds() - t0);
}
// ---------------------------------------------------------------------------------------------------------------------
// R6 (owner decision D139; spike-notes §31, "The leg with a sleep"): THE GETTERS WHILE THE GAME SLEEPS.
// No run above set a sleep mode or called NvAPI_D3D_Sleep, and a game that uses Reflex does both every frame. If the
// driver makes a getter wait behind the game's sleep, a read on the presenting thread holds a present for as long as
// the sleep lasts. The probe is the game once more: BOTH CALLS BELOW ARE WRITES, made on the probe's own device in its
// own process; no shipped binary contains either, and the mode is switched back off before the device goes.
// ---------------------------------------------------------------------------------------------------------------------
constexpr unsigned int kIdSetSleepMode = 0xac1ca9e0u; // nvapi_interface.h: NvAPI_D3D_SetSleepMode -- the game's call
constexpr unsigned int kIdSleep = 0x852cd1d2u; // NvAPI_D3D_Sleep -- the game's call
constexpr unsigned int kSleepIntervalUs = 4166u; // a 240-a-second limit: every frame really sleeps
using SetSleepModeFn = NvAPI_Status(__cdecl*)(IUnknown*, NV_SET_SLEEP_MODE_PARAMS*);
using SleepFn = NvAPI_Status(__cdecl*)(IUnknown*);
struct Sleeper {
SleepFn sleep = nullptr;
IUnknown* device = nullptr;
bool on = false;
std::uint32_t errors = 0;
std::uint32_t calls = 0;
double seconds = 0.0; // spent inside NvAPI_D3D_Sleep
};
// One frame of a game that uses Reflex: the sleep first, then the markers and the present.
void SleepingFrame12(Game& g, Dx12& dx, Sleeper& s) noexcept {
if (s.on) {
const double t0 = QpcSeconds();
if (s.sleep(s.device) != NVAPI_OK) {
++s.errors;
}
s.seconds += QpcSeconds() - t0;
++s.calls;
}
Frame12(g, dx);
}
struct Beside {
std::uint32_t calls = 0;
std::uint32_t notOk = 0;
std::uint32_t faults = 0;
std::uint32_t atLeast1Ms = 0;
std::uint32_t atLeast2Ms = 0;
double worstUs = 0.0;
double framesPerSecond = 0.0;
};
// The getters on another thread every `intervalMs` (0: without a pause) for `seconds`, while this thread is the game.
Beside PollBeside(const fl::reflex::Api& api, Game& g, Dx12& dx, Sleeper& s, std::uint32_t intervalMs,
double seconds) noexcept {
Poller poll{};
poll.api = api;
poll.device = dx.device;
poll.intervalMs.store(intervalMs);
HANDLE thread = CreateThread(nullptr, 0, &PollerThread, &poll, 0, nullptr);
const double t0 = QpcSeconds();
std::uint32_t frames = 0;
while (QpcSeconds() - t0 < seconds) {
SleepingFrame12(g, dx, s);
++frames;
}
const double took = QpcSeconds() - t0;
poll.quit.store(1u);
if (thread != nullptr) {
WaitForSingleObject(thread, 5000);
CloseHandle(thread);
}
Beside out{};
out.calls = poll.calls;
out.notOk = poll.notOk;
out.faults = poll.faults;
out.atLeast1Ms = poll.atLeast1Ms;
out.atLeast2Ms = poll.atLeast2Ms;
out.worstUs = poll.worstSeconds * 1e6;
out.framesPerSecond = static_cast<double>(frames) / took;
return out;
}
void PrintBeside(const char* label, const Beside& b) noexcept {
std::printf(
"%-52s %u reads, %u not OK, %u faulted, worst %.1f us, >= 1 ms: %u, >= 2 ms: %u; %.0f frames a second\n", label,
b.calls, b.notOk, b.faults, b.worstUs, b.atLeast1Ms, b.atLeast2Ms, b.framesPerSecond);
}
void RunSleepLeg(IDXGIFactory4* factory, IDXGIAdapter1* adapter, const fl::reflex::Api& api,
fl::reflex::QueryInterfaceFn query, SetMarkerFn setMarker) noexcept {
const auto setMode = reinterpret_cast<SetSleepModeFn>(query(kIdSetSleepMode));
Sleeper sleeper{};
sleeper.sleep = reinterpret_cast<SleepFn>(query(kIdSleep));
Dx12 dx{};
if (setMode == nullptr || sleeper.sleep == nullptr || !MakeDx12(factory, adapter, dx)) {
std::printf("R6 SKIPPED: no sleep functions from this nvapi64.dll, or no Direct3D 12 device\n");
FreeDx12(dx);
return;
}
sleeper.device = dx.device;
Game game{};
game.setMarker = setMarker;
game.markerDevice = dx.device;
game.frame = 300000;
static NV_LATENCY_RESULT_PARAMS report;
NV_GET_SLEEP_STATUS_PARAMS status{};
// THE CONTROL: the same device, the same two pollers, before any sleep mode.
for (int i = 0; i < 300; ++i) {
SleepingFrame12(game, dx, sleeper);
}
const Beside controlSlow = PollBeside(api, game, dx, sleeper, 250u, 20.0);
const Beside controlFast = PollBeside(api, game, dx, sleeper, 0u, 10.0);
PrintBeside("R6 control, no sleep mode, 4 reads a second:", controlSlow);
PrintBeside("R6 control, no sleep mode, reads without a pause:", controlFast);
// S1. THE GAME SETS A SLEEP MODE AND SLEEPS EVERY FRAME.
NV_SET_SLEEP_MODE_PARAMS mode{};
mode.version = NV_SET_SLEEP_MODE_PARAMS_VER1;
mode.bLowLatencyMode = 1;
mode.minimumIntervalUs = kSleepIntervalUs;
mode.bUseMarkersToOptimize = 1;
const NvAPI_Status set = setMode(dx.device, &mode);
sleeper.on = set == NVAPI_OK;
const double began = QpcSeconds();
for (int i = 0; i < 600; ++i) {
SleepingFrame12(game, dx, sleeper);
}
const double frameUs = (QpcSeconds() - began) / 600.0 * 1e6;
const NvAPI_Status s1 = fl::reflex::ReadSleepStatus(api, dx.device, status);
std::printf("S1 SetSleepMode %d; 600 frames: %.1f us a frame, %.1f us of it inside Sleep, %u sleep error(s)\n",
static_cast<int>(set), frameUs,
sleeper.calls != 0u ? sleeper.seconds / static_cast<double>(sleeper.calls) * 1e6 : 0.0, sleeper.errors);
std::printf("S1 sleep status %d: lowLatency %u, fsVrr %u, cplVsync %u, interval %u us, gameSleep %u, iFlip %u, "
"fgMultiplier %u\n",
static_cast<int>(s1), static_cast<unsigned>(status.bLowLatencyMode),
static_cast<unsigned>(status.bFsVrr), static_cast<unsigned>(status.bCplVsyncOn),
static_cast<unsigned>(status.sleepIntervalUs), static_cast<unsigned>(status.bUseGameSleep),
static_cast<unsigned>(status.bFullscreenIFlip), static_cast<unsigned>(status.fgMultiplier));
// S4. What the report holds once the game sleeps.
PrintDigest("S4 D3D12, sleeping, 600 frames:", fl::reflex::ReadLatency(api, dx.device, report), report);
{
std::uint32_t input = 0;
std::uint32_t driverStart = 0;
std::uint32_t gpuEnd = 0;
for (const auto& r : report.frameReport) {
input += r.inputSampleTime != 0u ? 1u : 0u;
driverStart += r.driverStartTime != 0u ? 1u : 0u;
gpuEnd += r.gpuRenderEndTime != 0u ? 1u : 0u;
}
std::printf("S4 of 64 frames: inputSampleTime in %u, driverStartTime in %u, gpuRenderEndTime in %u\n", input,
driverStart, gpuEnd);
}
// S2. THE GETTERS ON THE THREAD THAT SLEEPS AND PRESENTS: one read after each frame's present -- where the Overlay
// would make it -- and then back to back.
{
static double samples[2000];
double sum = 0.0;
double worst = 0.0;
std::uint32_t slow = 0;
for (double& sample : samples) {
SleepingFrame12(game, dx, sleeper);
const double t0 = QpcSeconds();
fl::reflex::ReadLatency(api, dx.device, report);
sample = (QpcSeconds() - t0) * 1e6;
sum += sample;
worst = sample > worst ? sample : worst;
slow += sample >= 2000.0 ? 1u : 0u;
}
for (int i = 1; i < 2000; ++i) { // insertion sort, as Measure does
const double v = samples[i];
int j = i - 1;
while (j >= 0 && samples[j] > v) {
samples[j + 1] = samples[j];
--j;
}
samples[j + 1] = v;
}
std::printf("S2 GetLatency after each of 2000 sleeping frames, us: mean %.2f, median %.2f, worst %.2f, "
">= 2 ms: %u\n",
sum / 2000.0, samples[1000], worst, slow);
}
const Cost latency = Measure(2000, [&]() noexcept { fl::reflex::ReadLatency(api, dx.device, report); });
const Cost sleepStatus = Measure(2000, [&]() noexcept { fl::reflex::ReadSleepStatus(api, dx.device, status); });
std::printf("S2 GetLatency back to back, us: mean %.2f, median %.2f, worst %.2f (2000 calls)\n", latency.mean,
latency.median, latency.worst);
std::printf("S2 GetSleepStatus back to back, us: mean %.2f, median %.2f, worst %.2f (2000 calls)\n",
sleepStatus.mean, sleepStatus.median, sleepStatus.worst);
// S3. THE GETTERS ON ANOTHER THREAD WHILE THIS ONE SLEEPS AND PRESENTS -- a game's sleep is often on a thread that
// is not the one that presents.
const Beside sleepSlow = PollBeside(api, game, dx, sleeper, 250u, 20.0);
const Beside sleepFast = PollBeside(api, game, dx, sleeper, 0u, 10.0);
PrintBeside("S3 sleeping, 4 reads a second:", sleepSlow);
PrintBeside("S3 sleeping, reads without a pause:", sleepFast);
std::printf("S3 marker errors %u (last status %d), sleep errors %u\n", game.markerErrors,
static_cast<int>(game.lastMarkerStatus), sleeper.errors);
// The mode goes back off before the device does.
NV_SET_SLEEP_MODE_PARAMS off{};
off.version = NV_SET_SLEEP_MODE_PARAMS_VER1;
std::printf("R6 SetSleepMode back off: %d\n", static_cast<int>(setMode(dx.device, &off)));
FreeDx12(dx);
}
int RunReal(int pollSeconds) noexcept {
IDXGIFactory4* factory = nullptr;
if (FAILED(CreateDXGIFactory1(__uuidof(IDXGIFactory4), reinterpret_cast<void**>(&factory)))) {
std::printf("SKIP no DXGI factory\n");
return 77;
}
IDXGIAdapter1* adapter = FindAdapter(factory, true);
if (adapter == nullptr) {
std::printf("SKIP no NVIDIA adapter on this PC\n");
return 77;
}
DXGI_ADAPTER_DESC1 desc{};
adapter->GetDesc1(&desc);
std::printf("adapter: %ls\n", desc.Description);
// THE GAME'S PART: nvapi64.dll from the system directory, by full path, and NvAPI_Initialize.
wchar_t path[MAX_PATH]{};
const UINT n = GetSystemDirectoryW(path, MAX_PATH);
if (n == 0 || n + 16 > MAX_PATH) {
return 77;
}
wcscat_s(path, L"\\nvapi64.dll");
fl::reflex::Api api{};
std::printf("before the game loaded it: Resolve = %u (1 = NoModule)\n",
static_cast<unsigned>(fl::reflex::Resolve(api)));
HMODULE nvapi = LoadLibraryExW(path, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
if (nvapi == nullptr) {
std::printf("SKIP %ls did not load (%lu)\n", path, GetLastError());
return 77;
}
const auto query = reinterpret_cast<fl::reflex::QueryInterfaceFn>(GetProcAddress(nvapi, "nvapi_QueryInterface"));
const auto initialize = query != nullptr ? reinterpret_cast<PlainFn>(query(kIdInitialize)) : nullptr;
const auto unload = query != nullptr ? reinterpret_cast<PlainFn>(query(kIdUnload)) : nullptr;
Game game{};
game.setMarker = query != nullptr ? reinterpret_cast<SetMarkerFn>(query(kIdSetLatencyMarker)) : nullptr;
if (initialize == nullptr || game.setMarker == nullptr) {
std::printf("SKIP this nvapi64.dll does not answer the ids\n");
return 77;
}
Dx11 dx11{};
if (!MakeDx11(factory, adapter, dx11)) {
std::printf("SKIP no Direct3D 11 device on the NVIDIA adapter\n");
return 77;
}
static NV_LATENCY_RESULT_PARAMS report;
NV_GET_SLEEP_STATUS_PARAMS sleep{};
// WHERE THE TWO ADDRESSES ARE. The module answers with addresses that need not be its own: the image each one
// lies in is printed, because the Overlay refuses an address that is in no image at all (fl_reflex.h, InImage).
const unsigned int getterIds[2] = {fl::reflex::kIdGetLatency, fl::reflex::kIdGetSleepStatus};
for (const unsigned int id : getterIds) {
const void* address = query(id);
MEMORY_BASIC_INFORMATION info{};
wchar_t owner[MAX_PATH]{};
if (address != nullptr && VirtualQuery(address, &info, sizeof(info)) != 0) {
GetModuleFileNameW(static_cast<HMODULE>(info.AllocationBase), owner, MAX_PATH);
}
std::printf("id 0x%08x -> %p: type 0x%lx, protect 0x%lx, in %ls%s\n", id, address,
static_cast<unsigned long>(info.Type), static_cast<unsigned long>(info.Protect),
owner[0] != 0 ? owner : L"(no image)",
info.AllocationBase == static_cast<void*>(nvapi) ? " (nvapi64.dll itself)" : "");
}
// R0. THE GETTERS BEFORE NvAPI_Initialize -- a game that has the module but has not initialised it.
std::printf("Resolve with the module loaded: %u (0 = Ok)\n", static_cast<unsigned>(fl::reflex::Resolve(api)));
PrintDigest("R0 before NvAPI_Initialize:", fl::reflex::ReadLatency(api, dx11.device, report), report);
std::printf("NvAPI_Initialize: %d\n", static_cast<int>(initialize()));
// R1. Initialised, no marker ever set: what a game that does not use Reflex gives.
for (int i = 0; i < 120; ++i) {
Frame11(game, dx11, false);
}
PrintDigest("R1 D3D11, 120 frames, no marker:", fl::reflex::ReadLatency(api, dx11.device, report), report);
const NvAPI_Status s1 = fl::reflex::ReadSleepStatus(api, dx11.device, sleep);
std::printf(" sleep status %d: lowLatency %u, fsVrr %u, cplVsync %u, interval %u us, gameSleep %u, iFlip %u, "
"fgMultiplier %u\n",
static_cast<int>(s1), static_cast<unsigned>(sleep.bLowLatencyMode), static_cast<unsigned>(sleep.bFsVrr),
static_cast<unsigned>(sleep.bCplVsyncOn), static_cast<unsigned>(sleep.sleepIntervalUs),
static_cast<unsigned>(sleep.bUseGameSleep), static_cast<unsigned>(sleep.bFullscreenIFlip),
static_cast<unsigned>(sleep.fgMultiplier));
// R2. The game sets markers: 300 frames.
game.markerDevice = dx11.device;
const double began = QpcSeconds();
for (int i = 0; i < 300; ++i) {
Frame11(game, dx11, true);
}
const double frameSeconds = (QpcSeconds() - began) / 300.0;
std::printf("markers: %u error(s), last status %d; a frame took %.1f us by this probe's clock\n", game.markerErrors,
static_cast<int>(game.lastMarkerStatus), frameSeconds * 1e6);
PrintDigest("R2 D3D11, 300 frames with markers:", fl::reflex::ReadLatency(api, dx11.device, report), report);
{
// The unit of the report's times: the gap between two neighbouring frames' simStartTime against the probe's
// own measured frame time.
const auto& a = report.frameReport[62];
const auto& b = report.frameReport[63];
std::printf(" frames 62,63: id %llu,%llu simStart %llu,%llu (gap %llu) gpuFrameTimeUs %u\n",
static_cast<unsigned long long>(a.frameID), static_cast<unsigned long long>(b.frameID),
static_cast<unsigned long long>(a.simStartTime), static_cast<unsigned long long>(b.simStartTime),
static_cast<unsigned long long>(b.simStartTime - a.simStartTime),
static_cast<unsigned>(b.gpuFrameTimeUs));
// Every time of the last four frames, as its distance from that frame's simStartTime ("-" where the driver
// left the field zero): which fields a report fills in, and when a frame's report is complete.
for (int i = 60; i < 64; ++i) {
const auto& r = report.frameReport[i];
const std::uint64_t fields[] = {r.inputSampleTime, r.simEndTime, r.renderSubmitStartTime,
r.renderSubmitEndTime, r.presentStartTime, r.presentEndTime,
r.driverStartTime, r.driverEndTime, r.osRenderQueueStartTime,
r.osRenderQueueEndTime, r.gpuRenderStartTime, r.gpuRenderEndTime};
static const char* const names[] = {"input", "simEnd", "subStart", "subEnd", "presStart", "presEnd",
"drvStart", "drvEnd", "osqStart", "osqEnd", "gpuStart", "gpuEnd"};
std::printf(" frame %d id %llu:", i, static_cast<unsigned long long>(r.frameID));
for (int f = 0; f < 12; ++f) {
if (fields[f] == 0u) {
std::printf(" %s -", names[f]);
} else {
std::printf(" %s %lld", names[f],
static_cast<long long>(fields[f]) - static_cast<long long>(r.simStartTime));
}
}
std::printf(" | gpuActive %u gpuFrame %u\n", static_cast<unsigned>(r.gpuActiveRenderTimeUs),
static_cast<unsigned>(r.gpuFrameTimeUs));
}
}
// R3. What a call costs, on the thread that presents, between two frames.
const Cost latency = Measure(2000, [&]() noexcept { fl::reflex::ReadLatency(api, dx11.device, report); });
const Cost status = Measure(2000, [&]() noexcept { fl::reflex::ReadSleepStatus(api, dx11.device, sleep); });
std::printf("R3 GetLatency us a call: mean %.2f, median %.2f, worst %.2f (2000 calls)\n", latency.mean,
latency.median, latency.worst);
std::printf("R3 GetSleepStatus us a call: mean %.2f, median %.2f, worst %.2f (2000 calls)\n", status.mean,
status.median, status.worst);
// R4. The getters on ANOTHER thread, four times a second, while this one presents and sets markers.
// LEGS OF TEN SECONDS, ALTERNATING -- alone, beside the poller, alone, ... -- because one long leg against one
// short one measures the drift of an uncapped loop over a minute, not the poller (the first run of this probe
// compared 5 s alone with 60 s beside and read 1.3 % apart).
Poller poll{};
poll.api = api;
poll.device = dx11.device;
poll.paused.store(1u);
HANDLE thread = CreateThread(nullptr, 0, &PollerThread, &poll, 0, nullptr);
double aloneSum = 0.0;
double besideSum = 0.0;
const int legs = pollSeconds / 10 > 0 ? pollSeconds / 10 : 1;
for (int leg = 0; leg < legs; ++leg) {
poll.paused.store(1u);
const double alone = FramesPerSecond11(game, dx11, 10.0);
poll.paused.store(0u);
const double beside = FramesPerSecond11(game, dx11, 10.0);
aloneSum += alone;
besideSum += beside;
std::printf("R4 leg %d: frames a second %.0f alone, %.0f beside the poller (%+.2f %%)\n", leg + 1, alone,
beside, (beside - alone) * 100.0 / alone);
}
const std::uint32_t slowCalls = poll.calls;
const std::uint32_t slowNotOk = poll.notOk;
const double slowWorst = poll.worstSeconds;
// THE SAME WITH THE POLLER READING WITHOUT A PAUSE -- hundreds of thousands of reads a second where route D would
// make four. The legs above cannot tell half a percent from the loop's own drift; a dose this large can be seen,
// and what four reads a second cost is that, scaled down by the ratio of the two rates.
poll.intervalMs.store(0u);
double aloneFast = 0.0;
double besideFast = 0.0;
std::uint32_t fastCallsBefore = poll.calls;
for (int leg = 0; leg < 3; ++leg) {
poll.paused.store(1u);
const double alone = FramesPerSecond11(game, dx11, 10.0);
poll.paused.store(0u);
const double beside = FramesPerSecond11(game, dx11, 10.0);
aloneFast += alone;
besideFast += beside;
std::printf("R4b leg %d: frames a second %.0f alone, %.0f beside a poller that never pauses (%+.2f %%)\n",
leg + 1, alone, beside, (beside - alone) * 100.0 / alone);
}
poll.quit.store(1u);
WaitForSingleObject(thread, 5000);
CloseHandle(thread);
std::printf("R4b 30 s beside a poller that never pauses: %u reads (%.0f a second), %u not OK, %u faulted, worst "
"read %.1f us; frames a second %.0f alone, %.0f beside it (%+.2f %%); marker errors %u\n",
poll.calls - fastCallsBefore, static_cast<double>(poll.calls - fastCallsBefore) / 30.0,
poll.notOk - slowNotOk, poll.faults, poll.worstSeconds * 1e6, aloneFast / 3.0, besideFast / 3.0,
(besideFast - aloneFast) * 100.0 / aloneFast, game.markerErrors);
poll.calls = slowCalls;
poll.notOk = slowNotOk;
poll.worstSeconds = slowWorst;
std::printf("R4 %d s beside a poller in %d legs: %u reads, %u not OK, %u faulted, %u empty, worst read %.1f us; "
"frames a second %.0f alone, %.0f beside it (%+.2f %%); marker errors %u\n",
legs * 10, legs, poll.calls, poll.notOk, poll.faults, poll.emptyReports, poll.worstSeconds * 1e6,
aloneSum / legs, besideSum / legs, (besideSum - aloneSum) * 100.0 / aloneSum, game.markerErrors);
// R5. Direct3D 12: which object the driver wants -- the device (what the Overlay holds) or the queue.
Dx12 dx12{};
if (MakeDx12(factory, adapter, dx12)) {
Game game12{};
game12.setMarker = game.setMarker;
game12.markerDevice = dx12.device;
game12.frame = 100000;
for (int i = 0; i < 300; ++i) {
Frame12(game12, dx12);
}
std::printf("R5 D3D12, markers on the DEVICE: %u error(s), last status %d\n", game12.markerErrors,
static_cast<int>(game12.lastMarkerStatus));
PrintDigest("R5 D3D12, read with the device:", fl::reflex::ReadLatency(api, dx12.device, report), report);
PrintDigest("R5 D3D12, read with the queue:", fl::reflex::ReadLatency(api, dx12.queue, report), report);
const NvAPI_Status s12 = fl::reflex::ReadSleepStatus(api, dx12.device, sleep);
std::printf(" sleep status with the device %d, with the queue %d\n", static_cast<int>(s12),
static_cast<int>(fl::reflex::ReadSleepStatus(api, dx12.queue, sleep)));
Game queue12{};
queue12.setMarker = game.setMarker;
queue12.markerDevice = dx12.queue;
queue12.frame = 200000;
for (int i = 0; i < 300; ++i) {
Frame12(queue12, dx12);
}
std::printf("R5 D3D12, markers on the QUEUE: %u error(s), last status %d\n", queue12.markerErrors,
static_cast<int>(queue12.lastMarkerStatus));
PrintDigest("R5 D3D12, read with the device after that:", fl::reflex::ReadLatency(api, dx12.device, report),
report);
FreeDx12(dx12);
} else {
std::printf("R5 no Direct3D 12 device on the NVIDIA adapter\n");
}
// R6. The getters while the game sleeps (D139).
RunSleepLeg(factory, adapter, api, query, game.setMarker);
FreeDx11(dx11);
if (unload != nullptr) {
std::printf("NvAPI_Unload: %d\n", static_cast<int>(unload()));
}
ReleaseIf(adapter);
ReleaseIf(factory);
return 0;
}
} // namespace
int wmain(int argc, wchar_t** argv) {
if (argc >= 3 && wcscmp(argv[1], L"--stub") == 0) {
return RunStub(argv[2]);
}
if (argc >= 2 && wcscmp(argv[1], L"--real") == 0) {
return RunReal(argc >= 3 ? _wtoi(argv[2]) : 60);
}
std::printf("usage: fl-probe-reflex --stub <path to the stub nvapi64.dll> | --real [seconds beside a poller]\n");
return 2;
}
@@ -24,5 +24,7 @@ target_compile_definitions(fl-probe-signer PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
# load-bearing: a machine with no .NET shared framework must not be red for being
# itself, and an unrun leg is reported as unrun rather than as a negative.
add_test(NAME fl_signer_probe COMMAND fl-probe-signer)
set_tests_properties(fl_signer_probe PROPERTIES
PASS_REGULAR_EXPRESSION "BLOCKER: (FOUND|NOT PRESENT)")
# AND IT MUST REACH ITS LAST LINE (2026-11-13: a run cut short is not a pass -- the top-level file, above
# enable_testing()). The last line is "OK - N failure(s)" or "FAILURES - N failure(s)"; either is accepted, because
# this test's criterion was always that the answers are PRINTED, not that the machine agrees with them.
fl_test_completes(fl_signer_probe "BLOCKER: (FOUND|NOT PRESENT)(.|\n)*(OK|FAILURES) [^\n]*[0-9]+ failure\\(s\\)")
@@ -43,3 +43,5 @@ target_compile_definitions(fl-probe-vklayer PRIVATE
# blocked case would then pass for the wrong reason. The probe says so and
# exits 0.
add_test(NAME fl_vklayer_selfscan COMMAND fl-probe-vklayer)
# Its last line when nothing failed (a run cut short is not a pass -- the top-level file, above enable_testing()).
fl_test_completes(fl_vklayer_selfscan "VKLAYER SELF-SCAN OK \\(")
+11 -1
View File
@@ -19,7 +19,7 @@ add_executable(hook-harness main.cpp vk_hold.cpp gl_hold.cpp hwnd_hold.cpp proxy
# --probe-upscaler-resolve calls the OVERLAY'S resolver, not a copy of it, or it
# would prove a fact about GetProcAddress.
target_link_libraries(hook-harness PRIVATE FrameLedger.Shm fl_dxgi_vtable fl_native_flags fl_streamline_headers
fl_fidelityfx_headers fl_fsr3_host_headers fl_vulkan_headers opengl32 gdi32)
fl_fidelityfx_headers fl_fsr3_host_headers fl_vulkan_headers fl_nvapi_headers opengl32 gdi32)
target_include_directories(hook-harness PRIVATE "${CMAKE_SOURCE_DIR}/FrameLedger.Overlay/include")
target_compile_definitions(hook-harness PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
@@ -175,3 +175,13 @@ add_test(NAME fl_unhook_preserves_foreign COMMAND hook-harness --probe-unhook)
# timing threshold on a shared CI runner fails for reasons that have nothing to
# do with the code. Run it deliberately: hook-harness --probe-cost
# EVERY TEST ABOVE ENDS ON THE SAME LINE: main() prints "HARNESS OK (0 failure(s))" when every probe it was asked for
# passed, and that line is what ctest looks for -- a run cut short is not a pass (the top-level file, above
# enable_testing(); 2026-11-13).
foreach(fl_harness_test IN ITEMS
fl_vtable_indices fl_frame_identity fl_d3d12_acquisition fl_proxy_swapchain
fl_d3d12_vtable_indices fl_dxr_probe fl_dxr_inputs fl_upscaler_resolve
fl_sl_abi_guard fl_ffx_resolve fl_sl_inputs fl_adv_fields
fl_sl_seen fl_dxgi_count fl_unhook_preserves_foreign)
fl_test_completes(${fl_harness_test} "HARNESS OK \\(")
endforeach()
+753 -15
View File
@@ -97,7 +97,7 @@
// an FSR title does: one UPSCALE and one PREPARE (issued twice,
// same frameID) per application frame, one FRAMEGENERATION per
// frame at K > 1, then K presents (--presents-per-eval K)
// --ffx-topology 1x|2x|ue|fsr3host|fsr3host+mono
// --ffx-topology 1x|2x|2x-export|ue|fsr3host|fsr3host+mono
// which vendor shape --hold-presenting-ffx stands in: 2x (default)
// is the SDK 2.x pair of effect DLLs behind the LOADER (the game
// calls the loader; the loader forwards NOT through the leaves'
@@ -115,7 +115,30 @@
// --advanced send what Advanced metrics reads (train B, 0.1.0-beta.40): --hold-presenting-upscaled chains an
// sl::DLSSOptions into slEvaluateFeature's inputs, --hold-presenting-ffx fills the rest of the
// UPSCALE descriptor (sharpening, jitter, exposure, depth range, field of view, flags, frame time).
// The values are the kAdv* constants below; the injected fl_guard cases assert them
// The values are the kAdv* constants below; the injected fl_guard cases assert them.
// Since 0.1.0-beta.43 the upscaled hold also calls slSetConstants every frame, for viewport 0
// (kAdvSl*) and for a second viewport whose numbers must never be shown, with the matrices and
// the camera's position and axes - which the Overlay never reads - set to loud, changing values;
// and the ffx hold calls ffxConfigure every frame with a frame-generation configuration
// (kAdvFfxFg*) and with a key-value one, the swapchain, the contexts, the HUD-less resource and
// the frame id - never read either - loud and changing.
// Since 0.1.0-beta.44 the upscaled hold also asks the stub slGetFeatureVersion and
// slGetFeatureRequirements every sixteenth frame - a real game asks while it starts; this one asks
// again so that a hook installed later sees an answer - about DLSS and DLSS frame generation
// (answered), NIS (refused, with loud numbers left in the struct) and PCL with a struct whose GUID
// is broken (answered, and not to be kept).
// Since 0.1.0-beta.45, on the same frames, it asks slIsFeatureSupported about DLSS, DLSS frame
// generation, NIS (refused: not supported) and Reflex (refused: missing) with an adapter whose
// LUID pointer is wild; asks slIsFeatureLoaded about DLSS (yes), PCL (no) and NIS (refused);
// and switches DLSS on and DLSS frame generation on and off through slSetFeatureLoaded;
// allocates DLSS's resources and frees frame generation's on each of those frames, and calls
// slShutdown on every fourth of them - then goes on using the stub
// --churn-module <dll>
// load and free the module in a loop on a thread of its own, for the life of the process: a
// module list that keeps changing under whoever reads it (the guard's D123, 2026-11-12)
// --ffx-infinite-far
// with --advanced: the UPSCALE descriptor's cameraFar is FLT_MAX, as an engine with an infinite
// depth states the plane at infinity (0.1.0-beta.42, D119), instead of kAdvFfxFar
// --ffx-memory-query v1|v2
// before every UPSCALE, ask the entry module ffxQuery how much memory the upscaler holds, in
// the descriptor of ffx-api 1.1.2 (v1) or 2.0 (v2); the stub answers kAdvMemory*
@@ -1996,6 +2019,37 @@ bool ProbeSlInputs() {
// send. A UNIT PROBE, as --probe-sl-inputs is: what matters here is a struct of an OLDER VERSION than these headers
// declare, whose tail must not be read (owner decision D115), and the vendors' own sentinels and zeros, which must
// never leave the header as values. No fixture title can be made to send a version-1 DLSSOptions; this can.
// A read of sl::Constants at an address chosen by the caller, in a function of its own so that the SEH frame holds no
// object with a destructor. True when the read faulted.
bool ObserveSlConstantsFaults(const void* constants, fl::adv::Accumulators& a) {
__try {
fl::adv::ObserveSlConstants(*static_cast<const sl::Constants*>(constants), 0u, a);
return false;
} __except (EXCEPTION_EXECUTE_HANDLER) {
return true;
}
}
// The same for the two answers about a feature (0.1.0-beta.44).
bool ObserveSlFeatureRequirementsFaults(const void* requirements, fl::adv::Accumulators& a) {
__try {
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS,
*static_cast<const sl::FeatureRequirements*>(requirements), a);
return false;
} __except (EXCEPTION_EXECUTE_HANDLER) {
return true;
}
}
bool ObserveSlFeatureVersionFaults(const void* version, fl::adv::Accumulators& a) {
__try {
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, *static_cast<const sl::FeatureVersion*>(version), a);
return false;
} __except (EXCEPTION_EXECUTE_HANDLER) {
return true;
}
}
bool ProbeAdvFields() {
g_failures = 0;
const auto bitsOf = [](float v) { return std::bit_cast<uint32_t>(v); };
@@ -2159,6 +2213,60 @@ bool ProbeAdvFields() {
Check(off.ffxFlagsSeen.load() == 0u && off.ffxResets.load() == 0u, "nothing is invented");
}
// --- FSR's plane at infinity (0.1.0-beta.42, owner decision D119)
// -------------------------------------------------
{
const float flatMax = std::bit_cast<float>(0x7F7FFFFFu);
const float plusInf = std::bit_cast<float>(0x7F800000u);
Check(fl::adv::FfxDepthPlaneBits(0.1f) == bitsOf(0.1f) && fl::adv::FfxDepthPlaneBits(0.0f) == bitsOf(0.0f),
"an ordinary plane is its own bits");
Check(fl::adv::FfxDepthPlaneBits(flatMax) == FL_ADV_FLOAT_INFINITE &&
fl::adv::FfxDepthPlaneBits(plusInf) == FL_ADV_FLOAT_INFINITE,
"FLT_MAX and +infinity are the plane at infinity");
Check(fl::adv::FfxDepthPlaneBits(std::bit_cast<float>(0x7FC00000u)) == FL_ADV_FLOAT_NONE &&
fl::adv::FfxDepthPlaneBits(std::bit_cast<float>(0xFF800000u)) == FL_ADV_FLOAT_NONE &&
fl::adv::FfxDepthPlaneBits(std::bit_cast<float>(0xFF7FFFFFu)) == FL_ADV_FLOAT_NONE,
"a NaN, a negative infinity and -FLT_MAX are no plane");
Check(std::bit_cast<float>(static_cast<uint32_t>(FL_ADV_FLOAT_INFINITE)) > flatMax,
"the stored pattern IS +infinity, so a reader that never heard of it still reads a float that means it");
// Lies of P's shape: an inverted, infinite depth -- the far plane a small number, the near one FLT_MAX.
fl::adv::Accumulators a;
ffxDispatchDescUpscale d{};
d.cameraNear = flatMax;
d.cameraFar = 10.0f;
fl::adv::ObserveFfxUpscale(0u, d, a);
Check(a.ffxNearBits.load() == FL_ADV_FLOAT_INFINITE && a.ffxFarBits.load() == bitsOf(10.0f),
"the plane at infinity is kept beside the finite one -- it used to be dropped");
// ...and the other way round, as +infinity; then a NaN changes nothing that was kept.
d.cameraNear = 0.05f;
d.cameraFar = plusInf;
fl::adv::ObserveFfxUpscale(0u, d, a);
Check(a.ffxNearBits.load() == bitsOf(0.05f) && a.ffxFarBits.load() == FL_ADV_FLOAT_INFINITE,
"either plane may be the infinite one, and the last value of each is what is kept");
d.cameraNear = std::bit_cast<float>(0x7FC00000u);
d.cameraFar = std::bit_cast<float>(0xFF800000u);
fl::adv::ObserveFfxUpscale(0u, d, a);
Check(a.ffxNearBits.load() == bitsOf(0.05f) && a.ffxFarBits.load() == FL_ADV_FLOAT_INFINITE,
"a plane that is no plane leaves the last one in place");
// THE STREAMLINE ROUTE IS UNCHANGED: there FLT_MAX is INVALID_FLOAT, nobody's value.
fl::adv::Accumulators s;
sl::DLSSOptions o;
o.preExposure = sl::INVALID_FLOAT;
o.exposureScale = plusInf;
fl::adv::ObserveDlssOptions(o, s);
Check(s.dlssPreExposureBits.load() == FL_ADV_FLOAT_NONE && s.dlssExposureScaleBits.load() == FL_ADV_FLOAT_NONE,
"for Streamline FLT_MAX stays 'not set' and an infinity stays no value: the rule is the ffx route's");
d.preExposure = flatMax;
d.cameraFovAngleVertical = plusInf;
fl::adv::Accumulators other;
fl::adv::ObserveFfxUpscale(0u, d, other);
Check(other.ffxPreExposureMaxBits.load() == FL_ADV_FLOAT_NONE &&
other.ffxFovMaxBits.load() == FL_ADV_FLOAT_NONE,
"an exposure or a field of view of FLT_MAX or infinity is still no value");
}
// --- the ffx upscaler's memory, both query versions
// ------------------------------------------------------------------
{
@@ -2238,7 +2346,7 @@ bool ProbeAdvFields() {
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS; ++i) {
untouched = untouched && region->features[i] == 0u;
}
Check(untouched, "what a later release fills stays zero");
Check(untouched, "what no call wrote stays zero: the configure, the constants, every feature slot");
// A NEW REQUEST: a second session of a game that kept running. Its summaries are its own.
fl::adv::Reset(a);
@@ -2251,6 +2359,428 @@ bool ProbeAdvFields() {
"and nothing of the session before: no mask, no count, no range, no size");
delete region;
}
// --- sl::Constants, what the game tells Streamline about a frame (0.1.0-beta.43) ------------------------------
{
fl::adv::Accumulators a;
sl::Constants c;
c.jitterOffset = {-0.375f, 0.25f};
c.mvecScale = {0.5f, 0.25f};
c.cameraNear = 0.1f;
c.cameraFar = 5000.0f;
c.cameraFOV = 1.0f;
c.cameraAspectRatio = 1.6f;
c.depthInverted = sl::Boolean::eTrue;
c.cameraMotionIncluded = sl::Boolean::eFalse;
c.reset = sl::Boolean::eFalse;
c.motionVectorsJittered = sl::Boolean::eTrue; // motionVectors3D is left in its third state
fl::adv::ObserveSlConstants(c, 3u, a);
c.jitterOffset = {0.125f, -0.4375f};
c.cameraFOV = 0.6f;
c.reset = sl::Boolean::eTrue;
fl::adv::ObserveSlConstants(c, 3u, a);
Check(a.validMask.load() == fl::FL_ADV_VALID_SL_CONSTANTS && a.slConstantsCalls.load() == 2u,
"two calls, counted, and the group marked read");
Check(a.slJitterMaxXBits.load() == bitsOf(0.375f) && a.slJitterMaxYBits.load() == bitsOf(0.4375f),
"the jitter is the largest magnitude on each axis");
Check(a.slMvecScaleXBits.load() == bitsOf(0.5f) && a.slMvecScaleYBits.load() == bitsOf(0.25f),
"the motion-vector scale is kept");
Check(a.slNearBits.load() == bitsOf(0.1f) && a.slFarBits.load() == bitsOf(5000.0f), "the depth range is kept");
Check(a.slFovMinBits.load() == bitsOf(0.6f) && a.slFovMaxBits.load() == bitsOf(1.0f),
"the field of view is a range, lowest and highest (D114)");
Check(a.slAspectBits.load() == bitsOf(1.6f), "the aspect ratio is kept");
// Bits in the header's order: depthInverted 0, cameraMotionIncluded 1, motionVectors3D 2, reset 3,
// orthographicProjection 4, motionVectorsDilated 5, motionVectorsJittered 6.
Check(a.slFlagsSeenTrue.load() == ((1u << 0) | (1u << 3) | (1u << 6)),
"a Boolean seen true sets its bit: depth inverted, reset, jittered");
Check(a.slFlagsSeenFalse.load() == ((1u << 1) | (1u << 3) | (1u << 4) | (1u << 5)),
"a Boolean seen false sets its bit in the other word; one in its third state sets neither");
Check(a.slResets.load() == 1u, "a reset is counted");
// A SECOND VIEWPORT is counted as a call and summarised nowhere.
sl::Constants other;
other.jitterOffset = {0.9f, 0.9f};
other.cameraNear = 9.0f;
other.cameraFar = 99.0f;
other.cameraFOV = 2.0f;
other.depthInverted = sl::Boolean::eFalse;
other.reset = sl::Boolean::eTrue;
fl::adv::ObserveSlConstants(other, 4u, a);
Check(a.slConstantsCalls.load() == 3u, "a call for another viewport is a call");
Check(a.slNearBits.load() == bitsOf(0.1f) && a.slFovMaxBits.load() == bitsOf(1.0f) &&
a.slJitterMaxXBits.load() == bitsOf(0.375f) && a.slResets.load() == 1u &&
(a.slFlagsSeenFalse.load() & 1u) == 0u,
"and the summaries stay the first viewport's: no value, range, flag or reset of the second");
// The handle's own "no viewport" value is a viewport like another.
fl::adv::Accumulators last;
fl::adv::ObserveSlConstants(c, 0xFFFFFFFFu, last);
fl::adv::ObserveSlConstants(other, 0u, last);
Check(last.slNearBits.load() == bitsOf(0.1f) && last.slConstantsCalls.load() == 2u,
"a first viewport of 0xFFFFFFFF owns the summaries; viewport 0 after it does not");
// SENTINELS: a struct the game set nothing in. FLT_MAX is Streamline's INVALID_FLOAT - on THIS route it is
// "not set", never the plane at infinity (D119 is the ffx route's).
fl::adv::Accumulators unset;
sl::Constants blank;
fl::adv::ObserveSlConstants(blank, 0u, unset);
Check(unset.slNearBits.load() == FL_ADV_FLOAT_NONE && unset.slFarBits.load() == FL_ADV_FLOAT_NONE &&
unset.slFovMinBits.load() == FL_ADV_FLOAT_NONE && unset.slAspectBits.load() == FL_ADV_FLOAT_NONE &&
unset.slJitterMaxXBits.load() == FL_ADV_FLOAT_NONE &&
unset.slMvecScaleXBits.load() == FL_ADV_FLOAT_NONE,
"INVALID_FLOAT - FLT_MAX - is 'no value' in every member, a depth plane included");
Check(unset.slFlagsSeenTrue.load() == 0u &&
unset.slFlagsSeenFalse.load() == ((1u << 4) | (1u << 5) | (1u << 6)),
"the four Booleans in their third state are neither; the three the vendor defaults to false are false");
blank.cameraFOV = -1.0f;
blank.cameraAspectRatio = 0.0f;
blank.jitterOffset = {0.5f, std::bit_cast<float>(0x7FC00000u)};
fl::adv::ObserveSlConstants(blank, 0u, unset);
Check(unset.slFovMinBits.load() == FL_ADV_FLOAT_NONE && unset.slAspectBits.load() == FL_ADV_FLOAT_NONE &&
unset.slJitterMaxXBits.load() == FL_ADV_FLOAT_NONE,
"a field of view or an aspect ratio that is not positive is not one; half a jitter is no jitter");
// WHERE THE MEMBERS ARE, by the addresses of this build's own struct: the two ranges never read are bytes
// 32..351 (five matrices) and 368..423 (the pinhole offset, the camera's position and its three axes).
const auto at = [&c](const void* member) {
return static_cast<size_t>(static_cast<const unsigned char*>(member) -
reinterpret_cast<const unsigned char*>(&c));
};
Check(at(&c.cameraViewToClip) == 32u && at(&c.jitterOffset) == 352u && at(&c.mvecScale) == 360u,
"the five matrices are bytes 32..351; the jitter and the scale follow at 352 and 360");
Check(at(&c.cameraPinholeOffset) == 368u && at(&c.cameraNear) == 424u,
"the pinhole offset, the camera's position and its axes are bytes 368..423; the near plane is at 424");
// NOTHING OF THOSE TWO RANGES REACHES WHAT IS PUBLISHED. Two structs alike in every member that is read and
// different in every byte that is not: the accumulators come out byte for byte the same.
sl::Constants p = c;
sl::Constants q = c;
std::memset(reinterpret_cast<unsigned char*>(&p) + 32u, 0x11, 352u - 32u);
std::memset(reinterpret_cast<unsigned char*>(&p) + 368u, 0x11, 424u - 368u);
std::memset(reinterpret_cast<unsigned char*>(&q) + 32u, 0xEE, 352u - 32u);
std::memset(reinterpret_cast<unsigned char*>(&q) + 368u, 0xEE, 424u - 368u);
auto* regionP = new fl::FlAdvancedState{};
auto* regionQ = new fl::FlAdvancedState{};
fl::adv::Accumulators ap;
fl::adv::Accumulators aq;
fl::adv::ObserveSlConstants(p, 0u, ap);
fl::adv::ObserveSlConstants(q, 0u, aq);
fl::adv::Publish(ap, regionP, 5u, 1u);
fl::adv::Publish(aq, regionQ, 5u, 1u);
Check(std::memcmp(regionP, regionQ, sizeof(fl::FlAdvancedState)) == 0 && regionP->slNearBits == bitsOf(0.1f) &&
regionP->slConstantsCalls == 1u,
"two structs that differ only in the matrices and the camera publish the same bytes");
delete regionP;
delete regionQ;
// A VERSION-1 STRUCT ENDS WHERE VERSION 2's MEMBER BEGINS, and is read no further: laid against a page that
// cannot be read, it is read whole and nothing faults.
const size_t v1Size = at(&c.minRelativeLinearDepthObjectSeparation);
auto* pages =
static_cast<unsigned char*>(VirtualAlloc(nullptr, 8192, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE));
DWORD old = 0;
if (pages == nullptr || !VirtualProtect(pages + 4096, 4096, PAGE_NOACCESS, &old)) {
Check(false, "two pages, the second unreadable, for the version-1 struct");
} else {
unsigned char* v1 = pages + 4096 - v1Size;
std::memcpy(v1, &c, v1Size);
fl::adv::Accumulators edge;
Check(!ObserveSlConstantsFaults(v1, edge),
"a version-1 struct at the end of readable memory is read without a fault");
Check(edge.slNearBits.load() == bitsOf(0.1f) && edge.slFlagsSeenTrue.load() != 0u,
"and what it carries is read: the last member version 1 has is the last one read");
VirtualFree(pages, 0, MEM_RELEASE);
}
}
// --- slGetFeatureVersion and slGetFeatureRequirements: Streamline's answers about a feature (0.1.0-beta.44) -----
{
fl::adv::Accumulators a;
sl::FeatureVersion v;
v.versionSL = sl::Version(2, 14, 1);
v.versionNGX = sl::Version(310, 4, 0);
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, a);
sl::FeatureRequirements r;
r.flags = sl::FeatureRequirementFlags::eD3D12Supported | sl::FeatureRequirementFlags::eVSyncOffRequired;
r.maxNumCPUThreads = 2;
r.maxNumViewports = 32;
r.numRequiredTags = 3;
r.osVersionDetected = sl::Version(10, 0, 26100);
r.osVersionRequired = sl::Version(10, 0, 19041);
r.driverVersionDetected = sl::Version(591, 44, 0);
r.driverVersionRequired = sl::Version(512, 15, 0);
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS_G, r, a);
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS, r, a);
const auto word = [&a](uint32_t slot, uint32_t i) {
return a.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + i].load();
};
Check(word(0, 0) == sl::kFeatureDLSS + 1u && word(1, 0) == sl::kFeatureDLSS_G + 1u && word(2, 0) == 0u,
"a slot per feature, in the order first asked about, the id plus one; the next slot is empty");
Check(word(0, 1) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureRequirementsAnswered) &&
word(1, 1) == fl::adv::kFeatureRequirementsAnswered,
"word 1 says which question has an answer: both for DLSS, the requirements alone for frame generation");
Check(word(0, 2) == 2u && word(0, 3) == 14u && word(0, 4) == 1u && word(0, 5) == 310u && word(0, 6) == 4u &&
word(0, 7) == 0u,
"the two versions: major, minor, build");
Check(word(1, 2) == 0u && word(1, 5) == 0u, "a version nobody asked for is not there");
Check(word(1, 8) == 10u && word(1, 9) == 2u && word(1, 10) == 32u && word(1, 11) == 3u,
"the flags (D3D12 | V-Sync off required), the threads, the viewports, the number of required tags");
Check(word(1, 12) == 10u && word(1, 14) == 26100u && word(1, 15) == 10u && word(1, 17) == 19041u &&
word(1, 18) == 591u && word(1, 19) == 44u && word(1, 21) == 512u && word(1, 22) == 15u,
"Windows and the driver: what was found, then what is required");
Check((a.validMask.load() & fl::FL_ADV_VALID_SL_FEATURES) != 0u, "and the group is marked as read");
// The last answer about a feature is the one kept, in the slot it already has.
v.versionNGX = sl::Version(310, 5, 2);
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, a);
Check(word(0, 6) == 5u && word(0, 7) == 2u && word(2, 0) == 0u, "asked again: the same slot, the newer answer");
// A NEW REQUEST KEEPS THEM: a fact about the process, and a game asks once.
fl::adv::Reset(a);
auto* region = new fl::FlAdvancedState{};
fl::adv::Publish(a, region, 9u, 1u);
Check(region->features[0] == sl::kFeatureDLSS + 1u && region->features[FL_ADV_FEATURE_WORDS + 8u] == 10u &&
region->validMask == static_cast<uint32_t>(fl::FL_ADV_VALID_SL_FEATURES),
"a new request publishes the slots as they were, and their bit of the mask with them - alone");
delete region;
// TWELVE SLOTS: a thirteenth feature is not kept, and the id that cannot be stored plus one is refused.
fl::adv::Accumulators full;
for (uint32_t f = 0; f < FL_ADV_FEATURE_SLOTS + 1u; ++f) {
fl::adv::ObserveSlFeatureVersion(100u + f, v, full);
}
fl::adv::ObserveSlFeatureVersion(0xFFFFFFFFu, v, full);
bool twelve = true;
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS; ++i) {
twelve = twelve && full.features[static_cast<size_t>(i) * FL_ADV_FEATURE_WORDS].load() == 101u + i;
}
Check(twelve,
"twelve features fill the twelve slots in order; the thirteenth and feature 0xFFFFFFFF are dropped");
// 0.1.0-beta.45: WORD 1 OF A SLOT holds more than which question was answered.
{
fl::adv::Accumulators s;
const auto word1 = [&s](uint32_t slot) {
return s.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + 1u].load();
};
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, s);
fl::adv::ObserveSlFeatureSupported(sl::kFeatureDLSS, 0u, s);
fl::adv::ObserveSlFeatureSupported(sl::kFeatureNIS, 32u, s);
fl::adv::ObserveSlFeatureLoaded(sl::kFeatureDLSS, true, s);
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS, true, s);
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS_G, true, s);
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS_G, false, s);
Check(word1(0) ==
(fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
fl::adv::kFeatureLoadedAnswered | fl::adv::kFeatureLoadedValue | fl::adv::kFeatureSwitchedOn),
"one feature: its version, supported with eOk, loaded and yes, switched on - each its own bits");
Check(word1(1) == (fl::adv::kFeatureSupportAnswered | (32u << fl::adv::kFeatureSupportResultShift)),
"a refusal IS the answer to 'is it supported': the code is kept in bits 8..15");
Check(word1(2) == (fl::adv::kFeatureSwitchedOn | fl::adv::kFeatureSwitchedOff) &&
s.features[size_t{2} * FL_ADV_FEATURE_WORDS].load() == sl::kFeatureDLSS_G + 1u,
"switched on and then off: both bits, in a slot the switch itself claimed");
// The last answer replaces the one before, and leaves the neighbouring fields of the word alone.
fl::adv::ObserveSlFeatureSupported(sl::kFeatureNIS, 0u, s);
fl::adv::ObserveSlFeatureLoaded(sl::kFeatureDLSS, false, s);
fl::adv::ObserveSlFeatureSupported(sl::kFeatureDLSS, 31u, s);
Check(word1(1) == fl::adv::kFeatureSupportAnswered, "asked again and now supported: the code is 0 again");
Check(word1(0) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
(31u << fl::adv::kFeatureSupportResultShift) | fl::adv::kFeatureLoadedAnswered |
fl::adv::kFeatureSwitchedOn),
"a new answer to one question changes its own bits and no other's");
fl::adv::ObserveSlFeatureSupported(sl::kFeatureReflex, 4000u, s);
Check((word1(3) >> fl::adv::kFeatureSupportResultShift) == 0xFFu,
"a code a byte cannot carry is 0xFF, never another code's number");
// A NEW REQUEST clears what the game DID while it was watched and keeps what Streamline SAID.
fl::adv::Reset(s);
Check(word1(0) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
(31u << fl::adv::kFeatureSupportResultShift) | fl::adv::kFeatureLoadedAnswered) &&
word1(2) == 0u && s.features[size_t{2} * FL_ADV_FEATURE_WORDS].load() == sl::kFeatureDLSS_G + 1u,
"a new request clears the switches seen and keeps the answers; the slot itself stays claimed");
}
// 0.1.0-beta.45, the counted three: a feature's resources allocated and freed, and Streamline shut down.
{
fl::adv::Accumulators s;
const auto word1 = [&s](uint32_t slot) {
return s.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + 1u].load();
};
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS, true, s);
for (int i = 0; i < 3; ++i) {
fl::adv::ObserveSlAllocateResources(sl::kFeatureDLSS, s);
}
fl::adv::ObserveSlFreeResources(sl::kFeatureDLSS, s);
Check(word1(0) == (fl::adv::kFeatureSwitchedOn | (3u << fl::adv::kFeatureAllocShift) |
(1u << fl::adv::kFeatureFreeShift)),
"three allocations and one free of one feature: two four-bit counts beside the bits already there");
for (int i = 0; i < 40; ++i) {
fl::adv::ObserveSlAllocateResources(sl::kFeatureDLSS, s);
fl::adv::ObserveSlFreeResources(sl::kFeatureDLSS_G, s);
}
Check(word1(0) == (fl::adv::kFeatureSwitchedOn | (15u << fl::adv::kFeatureAllocShift) |
(1u << fl::adv::kFeatureFreeShift)) &&
word1(1) == (15u << fl::adv::kFeatureFreeShift),
"a count stops at 15 and never carries into the count beside it");
fl::adv::ObserveSlShutdown(s);
fl::adv::ObserveSlShutdown(s);
auto* counted = new fl::FlAdvancedState{};
fl::adv::Publish(s, counted, 3u, 1u);
Check(counted->slShutdowns == 2u && (counted->validMask & fl::FL_ADV_VALID_SL_SHUTDOWN) != 0u &&
counted->reservedSl[0] == 0u && counted->reservedSl[1] == 0u,
"two shutdowns: the count in its own word, its bit of the mask, the two words left reserved zero");
fl::adv::Reset(s);
fl::adv::Publish(s, counted, 4u, 2u);
Check(counted->slShutdowns == 0u && (counted->validMask & fl::FL_ADV_VALID_SL_SHUTDOWN) == 0u &&
word1(0) == 0u && word1(1) == 0u && counted->features[0] == sl::kFeatureDLSS + 1u,
"a new request: the counts and the shutdowns are the last session's and go; the slots stay claimed");
delete counted;
}
// WHERE THE MEMBERS ARE, by this build's own struct: everything read lies before the Vulkan members, and the
// pointer to the tag list sits between two members that are read.
const auto at = [&r](const void* member) {
return static_cast<size_t>(static_cast<const unsigned char*>(member) -
reinterpret_cast<const unsigned char*>(&r));
};
Check(at(&r.flags) == 32u && at(&r.numRequiredTags) == 44u && at(&r.requiredTags) == 48u &&
at(&r.osVersionDetected) == 56u && at(&r.driverVersionRequired) == 92u &&
at(&r.vkNumComputeQueuesRequired) == 104u,
"the flags at 32, the tag count at 44, its pointer at 48, the four versions at 56..103, Vulkan from 104");
// NOTHING OF THE POINTERS OR THE VULKAN MEMBERS REACHES WHAT IS PUBLISHED: two structs alike in what is read
// and different in every byte that is not come out the same.
sl::FeatureRequirements p = r;
sl::FeatureRequirements q = r;
std::memset(reinterpret_cast<unsigned char*>(&p) + 48u, 0x11, 8u);
std::memset(reinterpret_cast<unsigned char*>(&q) + 48u, 0xEE, 8u);
std::memset(reinterpret_cast<unsigned char*>(&p) + 104u, 0x11, sizeof(p) - 104u);
std::memset(reinterpret_cast<unsigned char*>(&q) + 104u, 0xEE, sizeof(q) - 104u);
auto* regionP = new fl::FlAdvancedState{};
auto* regionQ = new fl::FlAdvancedState{};
fl::adv::Accumulators ap;
fl::adv::Accumulators aq;
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS, p, ap);
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS, q, aq);
fl::adv::Publish(ap, regionP, 5u, 1u);
fl::adv::Publish(aq, regionQ, 5u, 1u);
Check(std::memcmp(regionP, regionQ, sizeof(fl::FlAdvancedState)) == 0 && regionP->features[11] == 3u,
"two answers that differ only in the pointers and the Vulkan members publish the same bytes");
delete regionP;
delete regionQ;
// A STRUCT CUT OFF RIGHT AFTER THE LAST MEMBER READ, against a page that cannot be read: read whole, no fault.
auto* pages =
static_cast<unsigned char*>(VirtualAlloc(nullptr, 8192, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE));
DWORD old = 0;
if (pages == nullptr || !VirtualProtect(pages + 4096, 4096, PAGE_NOACCESS, &old)) {
Check(false, "two pages, the second unreadable, for the cut-off answers");
} else {
unsigned char* cut = pages + 4096 - 104u;
std::memcpy(cut, &r, 104u);
fl::adv::Accumulators edge;
Check(!ObserveSlFeatureRequirementsFaults(cut, edge) && edge.features[21].load() == 512u,
"requirements that end where the Vulkan members begin are read without a fault, to the last member");
const size_t versionSize = sizeof(sl::FeatureVersion);
unsigned char* whole = pages + 4096 - versionSize;
std::memcpy(whole, &v, versionSize);
fl::adv::Accumulators edgeVersion;
Check(!ObserveSlFeatureVersionFaults(whole, edgeVersion) && edgeVersion.features[2].load() == 2u,
"a version answer at the end of readable memory is read without a fault");
VirtualFree(pages, 0, MEM_RELEASE);
}
}
// --- ffxConfigure with a frame-generation descriptor (0.1.0-beta.43) -------------------------------------------
{
fl::adv::Accumulators a;
ffxConfigureDescFrameGeneration c{};
c.header.type = FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION;
c.frameGenerationEnabled = true;
c.allowAsyncWorkloads = false;
c.onlyPresentGenerated = false;
c.flags = FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_VIEW;
c.generationRect = {10, 20, 2560, 1440};
fl::adv::ObserveFfxConfigure(3u, &c.header, a);
c.frameGenerationEnabled = false; // the player switched it off in the menu
c.flags = FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_TEAR_LINES;
c.generationRect = {0, 0, 1920, 1080};
fl::adv::ObserveFfxConfigure(3u, &c.header, a);
Check(a.validMask.load() == fl::FL_ADV_VALID_FFX_FG_CONFIG && a.ffxFgConfigures.load() == 2u,
"two frame-generation configures, counted, and the group marked read");
Check(a.ffxFgEnabledSeen.load() == 3u, "generation seen on and seen off: both bits");
Check(a.ffxFgAsyncSeen.load() == 1u && a.ffxFgOnlyGeneratedSeen.load() == 1u,
"a switch only ever seen off sets the 'off' bit alone");
Check(a.ffxFgFlagsSeen.load() ==
(FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_VIEW | FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_TEAR_LINES),
"the flags are every bit any configure carried");
Check(a.ffxFgRect.load() == fl::adv::PackRect(0, 0, 1920, 1080), "the rectangle is the last one, whole");
// The same call arriving at a second hooked module - the leaf behind the loader - is passed over.
fl::adv::ObserveFfxConfigure(2u, &c.header, a);
Check(a.ffxFgConfigures.load() == 2u, "one module's configures are counted, not one per hook");
// ANOTHER CONFIGURE TYPE through the same call is not a frame-generation configuration: only its type is
// looked at. A key-value descriptor is shorter than the one above, so reading it as one would run past it.
fl::adv::Accumulators other;
ffxConfigureDescFrameGenerationKeyValue kv{};
kv.header.type = FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION_KEYVALUE;
kv.key = 0xFFFFFFFFFFFFFFFFull;
kv.u64 = 0xFFFFFFFFFFFFFFFFull;
fl::adv::ObserveFfxConfigure(0u, &kv.header, other);
fl::adv::ObserveFfxConfigure(0u, nullptr, other);
Check(other.validMask.load() == 0u && other.ffxFgConfigures.load() == 0u && other.ffxFgOwner.load() == 0u,
"a configure of another type, and no descriptor at all, read nothing and own nothing");
// WHAT IS NEVER READ CHANGES NOTHING: two descriptors alike in the five members read and different in the
// swapchain, the callbacks' contexts, the HUD-less resource and the frame id publish the same bytes.
ffxConfigureDescFrameGeneration p = c;
ffxConfigureDescFrameGeneration q = c;
p.swapChain = reinterpret_cast<void*>(static_cast<uintptr_t>(0x1111));
p.presentCallbackUserContext = reinterpret_cast<void*>(static_cast<uintptr_t>(0x2222));
p.frameGenerationCallbackUserContext = reinterpret_cast<void*>(static_cast<uintptr_t>(0x3333));
p.HUDLessColor.resource = reinterpret_cast<void*>(static_cast<uintptr_t>(0x4444));
p.frameID = 5u;
q.swapChain = reinterpret_cast<void*>(static_cast<uintptr_t>(0xEEEE));
q.presentCallbackUserContext = reinterpret_cast<void*>(static_cast<uintptr_t>(0xDDDD));
q.frameGenerationCallbackUserContext = reinterpret_cast<void*>(static_cast<uintptr_t>(0xCCCC));
q.HUDLessColor.resource = reinterpret_cast<void*>(static_cast<uintptr_t>(0xBBBB));
q.frameID = 0xFFFFFFFFFFFFull;
auto* regionP = new fl::FlAdvancedState{};
auto* regionQ = new fl::FlAdvancedState{};
fl::adv::Accumulators ap;
fl::adv::Accumulators aq;
fl::adv::ObserveFfxConfigure(1u, &p.header, ap);
fl::adv::ObserveFfxConfigure(1u, &q.header, aq);
fl::adv::Publish(ap, regionP, 9u, 1u);
fl::adv::Publish(aq, regionQ, 9u, 1u);
Check(std::memcmp(regionP, regionQ, sizeof(fl::FlAdvancedState)) == 0 && regionP->ffxFgConfigures == 1u,
"two configurations that differ only in what is never read publish the same bytes");
Check(regionP->ffxFgRect[0] == 0 && regionP->ffxFgRect[1] == 0 && regionP->ffxFgRect[2] == 1920 &&
regionP->ffxFgRect[3] == 1080 && regionP->ffxFgEnabledSeen == 1u,
"the rectangle lands as left, top, width, height; the switches as their two bits");
delete regionP;
delete regionQ;
// A RECTANGLE THAT DOES NOT FIT IS NOBODY'S, never a clipped one.
Check(fl::adv::PackRect(-1, 0, 100, 100) == fl::adv::kRectUnfit &&
fl::adv::PackRect(0, 0, 0x8000, 100) == fl::adv::kRectUnfit &&
fl::adv::PackRect(0, 0, 0x7FFF, 0x7FFF) != fl::adv::kRectUnfit,
"a negative side or one past fifteen bits makes the rectangle 'unfit'; the largest that fits is kept");
fl::adv::Accumulators big;
c.generationRect = {0, 0, 100000, 1080};
fl::adv::ObserveFfxConfigure(0u, &c.header, big);
auto* regionBig = new fl::FlAdvancedState{};
fl::adv::Publish(big, regionBig, 9u, 1u);
Check(regionBig->ffxFgRect[0] == -1 && regionBig->ffxFgRect[1] == -1 && regionBig->ffxFgRect[2] == -1 &&
regionBig->ffxFgRect[3] == -1,
"and is published as four -1, which no rectangle is");
delete regionBig;
}
return g_failures == 0;
}
@@ -2703,6 +3233,23 @@ constexpr float kAdvFfxFar = 1000.0f;
constexpr float kAdvFfxFovLow = 0.9f; // radians; the two alternate, frame by frame
constexpr float kAdvFfxFovHigh = 1.1f;
constexpr float kAdvFfxFrameTimeMs = 16.0f;
// What --advanced hands slSetConstants (0.1.0-beta.43), for viewport 0. The jitter and the field of view alternate
// frame by frame; `reset` is true on one frame in sixty-four. A SECOND viewport (7) is set every frame with
// different numbers, which must never be the ones a session shows.
constexpr float kAdvSlJitterX = 0.3125f; // the larger magnitude of the two that alternate
constexpr float kAdvSlJitterY = 0.4375f;
constexpr float kAdvSlMvecScaleX = 0.5f;
constexpr float kAdvSlMvecScaleY = 0.25f;
constexpr float kAdvSlNear = 0.25f;
constexpr float kAdvSlFar = 4000.0f;
constexpr float kAdvSlFovLow = 0.8f;
constexpr float kAdvSlFovHigh = 1.2f;
constexpr float kAdvSlAspect = 1.75f;
constexpr uint32_t kAdvSlOtherViewport = 7u;
// What --advanced hands ffxConfigure before each frame's frame-generation dispatches (0.1.0-beta.43).
constexpr uint32_t kAdvFfxFgFlags = FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_PACING_LINES;
constexpr int32_t kAdvFfxFgRectWidth = 1920;
constexpr int32_t kAdvFfxFgRectHeight = 1080;
using StubTokenFn = sl::Result(STDMETHODCALLTYPE*)(sl::FrameToken*&, const uint32_t*);
alignas(16) unsigned char g_dummyFrameToken[64]{};
@@ -2803,6 +3350,79 @@ int HoldPresentingUpscaled(Gfx& g, int seconds, bool real, sl::Feature feature,
options.performancePreset = sl::DLSSPreset::ePresetM;
options.ultraPerformancePreset = sl::DLSSPreset::ePresetL;
const sl::BaseStructure* advancedInputs[] = {&options};
// --advanced, 0.1.0-beta.43: the per-frame constants, through the stub's slSetConstants. Everything the Overlay may
// read is a known value; EVERYTHING IT MAY NOT -- the five matrices, the pinhole offset, the camera's position and
// axes -- is filled with loud numbers that change every frame, so a read of them would show in what is published.
// The frame token by address, as the other stub entry points take it: a reference parameter is a pointer in
// the ABI, and the harness has no token object, only storage of the right size.
using StubSetConstantsFn =
sl::Result(STDMETHODCALLTYPE*)(const sl::Constants&, const void*, const sl::ViewportHandle&);
auto setConstants =
reinterpret_cast<StubSetConstantsFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slSetConstants")));
if (advanced && setConstants == nullptr) {
Check(false, "the stub exports slSetConstants");
return 1;
}
// --advanced, 0.1.0-beta.44: the two questions about a feature, through the stub's exports.
using StubGetFeatureVersionFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, sl::FeatureVersion&);
using StubGetFeatureRequirementsFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, sl::FeatureRequirements&);
auto getFeatureVersion =
reinterpret_cast<StubGetFeatureVersionFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slGetFeatureVersion")));
auto getFeatureRequirements = reinterpret_cast<StubGetFeatureRequirementsFn>(
reinterpret_cast<void*>(GetProcAddress(stub, "slGetFeatureRequirements")));
if (advanced && (getFeatureVersion == nullptr || getFeatureRequirements == nullptr)) {
Check(false, "the stub exports slGetFeatureVersion and slGetFeatureRequirements");
return 1;
}
// --advanced, 0.1.0-beta.45: whether a feature is supported, whether it is loaded, and switching one.
using StubIsFeatureSupportedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, const sl::AdapterInfo&);
using StubIsFeatureLoadedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, bool&);
using StubSetFeatureLoadedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, bool);
auto isFeatureSupported = reinterpret_cast<StubIsFeatureSupportedFn>(
reinterpret_cast<void*>(GetProcAddress(stub, "slIsFeatureSupported")));
auto isFeatureLoaded =
reinterpret_cast<StubIsFeatureLoadedFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slIsFeatureLoaded")));
auto setFeatureLoaded =
reinterpret_cast<StubSetFeatureLoadedFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slSetFeatureLoaded")));
if (advanced && (isFeatureSupported == nullptr || isFeatureLoaded == nullptr || setFeatureLoaded == nullptr)) {
Check(false, "the stub exports slIsFeatureSupported, slIsFeatureLoaded and slSetFeatureLoaded");
return 1;
}
using StubAllocateResourcesFn = sl::Result(STDMETHODCALLTYPE*)(void*, sl::Feature, const sl::ViewportHandle&);
using StubFreeResourcesFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, const sl::ViewportHandle&);
using StubShutdownFn = sl::Result(STDMETHODCALLTYPE*)();
auto allocateResources =
reinterpret_cast<StubAllocateResourcesFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slAllocateResources")));
auto freeResources =
reinterpret_cast<StubFreeResourcesFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slFreeResources")));
auto shutdownStreamline =
reinterpret_cast<StubShutdownFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slShutdown")));
if (advanced && (allocateResources == nullptr || freeResources == nullptr || shutdownStreamline == nullptr)) {
Check(false, "the stub exports slAllocateResources, slFreeResources and slShutdown");
return 1;
}
sl::Constants constants;
sl::Constants otherConstants;
sl::ViewportHandle otherViewport{kAdvSlOtherViewport};
constants.mvecScale = {kAdvSlMvecScaleX, kAdvSlMvecScaleY};
constants.cameraNear = kAdvSlNear;
constants.cameraFar = kAdvSlFar;
constants.cameraAspectRatio = kAdvSlAspect;
constants.depthInverted = sl::Boolean::eTrue;
constants.cameraMotionIncluded = sl::Boolean::eTrue;
constants.motionVectors3D = sl::Boolean::eFalse;
constants.orthographicProjection = sl::Boolean::eFalse;
constants.motionVectorsDilated = sl::Boolean::eFalse;
constants.motionVectorsJittered = sl::Boolean::eTrue;
otherConstants.jitterOffset = {0.9f, 0.9f};
otherConstants.mvecScale = {9.0f, 9.0f};
otherConstants.cameraNear = 9.0f;
otherConstants.cameraFar = 99.0f;
otherConstants.cameraFOV = 2.0f;
otherConstants.cameraAspectRatio = 9.0f;
otherConstants.depthInverted = sl::Boolean::eFalse;
otherConstants.orthographicProjection = sl::Boolean::eTrue;
if (advanced) {
std::printf(" --advanced: an sl::DLSSOptions (version %zu, output %ux%u) chained into every evaluation\n",
options.structVersion, kAdvDlssOutputW, kAdvDlssOutputH);
@@ -2821,6 +3441,55 @@ int HoldPresentingUpscaled(Gfx& g, int seconds, bool real, sl::Feature feature,
} else {
setTag(viewport, tags, numTags, nullptr);
}
if (advanced) {
const bool odd = (evaluated & 1) != 0;
const float loud = static_cast<float>(evaluated % 977) + 1000.0f;
constants.jitterOffset = {odd ? -kAdvSlJitterX : 0.125f, odd ? 0.0625f : -kAdvSlJitterY};
constants.cameraFOV = odd ? kAdvSlFovLow : kAdvSlFovHigh;
constants.reset = (evaluated % 64) == 5 ? sl::Boolean::eTrue : sl::Boolean::eFalse;
// What must never be read: a different loud value in each, every frame.
constants.cameraViewToClip.row[0] = {loud, loud + 1.0f, loud + 2.0f, loud + 3.0f};
constants.clipToPrevClip.row[3] = {loud + 4.0f, loud + 5.0f, loud + 6.0f, loud + 7.0f};
constants.cameraPinholeOffset = {loud + 8.0f, loud + 9.0f};
constants.cameraPos = {loud + 10.0f, loud + 11.0f, loud + 12.0f};
constants.cameraUp = {loud + 13.0f, loud + 14.0f, loud + 15.0f};
constants.cameraRight = {loud + 16.0f, loud + 17.0f, loud + 18.0f};
constants.cameraFwd = {loud + 19.0f, loud + 20.0f, loud + 21.0f};
setConstants(constants, g_dummyFrameToken, viewport);
setConstants(otherConstants, g_dummyFrameToken, otherViewport);
if ((evaluated % 16) == 3) {
for (const sl::Feature asked : {sl::kFeatureDLSS, sl::kFeatureDLSS_G, sl::kFeatureNIS}) {
sl::FeatureVersion version;
sl::FeatureRequirements requirements;
getFeatureVersion(asked, version);
getFeatureRequirements(asked, requirements);
}
// A struct that is not the one the headers describe: the stub answers, and nothing may be kept.
sl::FeatureVersion broken;
broken.structType = sl::StructType{};
getFeatureVersion(sl::kFeaturePCL, broken);
// 0.1.0-beta.45. The adapter carries a wild pointer where its LUID would be: followed, it faults.
sl::AdapterInfo adapter;
adapter.deviceLUID = reinterpret_cast<uint8_t*>(static_cast<uintptr_t>(1));
adapter.deviceLUIDSizeInBytes = 8;
for (const sl::Feature asked :
{sl::kFeatureDLSS, sl::kFeatureDLSS_G, sl::kFeatureNIS, sl::kFeatureReflex}) {
isFeatureSupported(asked, adapter);
}
bool loaded = false;
isFeatureLoaded(sl::kFeatureDLSS, loaded);
isFeatureLoaded(sl::kFeaturePCL, loaded);
isFeatureLoaded(sl::kFeatureNIS, loaded);
setFeatureLoaded(sl::kFeatureDLSS, true);
setFeatureLoaded(sl::kFeatureDLSS_G, (evaluated & 16) != 0);
// The command buffer is a wild pointer here too: counted, never looked at.
allocateResources(reinterpret_cast<void*>(static_cast<uintptr_t>(1)), sl::kFeatureDLSS, viewport);
freeResources(sl::kFeatureDLSS_G, viewport);
if ((evaluated % 64) == 3) {
shutdownStreamline();
}
}
}
// ONE EVALUATION PER PRESENT, which is what a real upscaled title does
// and what makes the drained record's identity checkable frame by frame.
eval(feature, g_dummyFrameToken, advanced ? advancedInputs : nullptr, advanced ? 1u : 0u, nullptr);
@@ -2962,7 +3631,9 @@ int HoldPresentingFg(Gfx& g, int seconds, bool real, int presentsPerEval) {
// DLL alone (its named UPSCALE export, no PREPARE, no frame generation -- the K = 1
// double-count control for that row), fsr3host+mono = Cyberpunk 2077's measured shape:
// the host upscales while the 1.1.x monolith prepares and generates.
enum class FfxTopology { Monolith, Loader, Ue, Fsr3Host, Fsr3HostMonolith };
// LoaderExport (2026-11-12, D125): the two leaves behind a loader that forwards a dispatch to their EXPORTS, as
// Cyberpunk 2077's loader 2.3.0 was measured to -- every dispatch then reaches two hooked modules.
enum class FfxTopology { Monolith, Loader, LoaderExport, Ue, Fsr3Host, Fsr3HostMonolith };
using PfnFsr3DispatchUpscale = decltype(&fsr3host::ffxFsr3ContextDispatchUpscale);
@@ -3021,6 +3692,22 @@ void AskQuality(PfnFfxQuery query, FfxQuery what) {
}
}
// --churn-module <dll>: one thread that loads and frees the module for as long as the process lives (D123's fixture).
wchar_t g_churnPath[MAX_PATH * 2]{};
DWORD WINAPI ChurnModuleThread(LPVOID) {
for (;;) {
if (HMODULE h = LoadLibraryW(g_churnPath); h != nullptr) {
FreeLibrary(h);
} else {
Sleep(1);
}
}
}
// --ffx-infinite-far (with --advanced): cameraFar is FLT_MAX rather than kAdvFfxFar.
bool g_ffxInfiniteFar = false;
int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTopology topology, bool prepare,
FfxQuery ask, bool advanced, FfxMemoryQuery askMemory) {
if (!HaveD3D11(g, "--hold-presenting-ffx")) {
@@ -3060,16 +3747,17 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
Check(false, "the SDK 2.x leaf stubs loaded for the ffx hold");
return 1;
}
if (topology == FfxTopology::Loader) {
if (topology == FfxTopology::Loader || topology == FfxTopology::LoaderExport) {
const HMODULE loader = LoadStubExactly(FL_STUB_FFX_LOADER);
if (loader == nullptr) {
Check(false, "the loader stub loaded for the ffx hold");
return 1;
}
auto bind =
reinterpret_cast<StubLoaderBindFn>(reinterpret_cast<void*>(GetProcAddress(loader, "FlStubLoaderBind")));
auto bind = reinterpret_cast<StubLoaderBindFn>(reinterpret_cast<void*>(
GetProcAddress(loader, topology == FfxTopology::LoaderExport ? "FlStubLoaderBindThroughExports"
: "FlStubLoaderBind")));
if (bind == nullptr) {
Check(false, "the loader stub exports FlStubLoaderBind");
Check(false, "the loader stub exports its bind entry");
return 1;
}
bind(upscaler, fg);
@@ -3106,9 +3794,12 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
return 1;
}
// The pre-V2 PREPARE is the 1.1.x monolith's, on both topologies that use it.
const bool topology2x = topology == FfxTopology::Loader || topology == FfxTopology::Ue;
const char* topologyName = topology == FfxTopology::Monolith ? "SDK 1.1.x (monolith)"
: topology == FfxTopology::Loader ? "SDK 2.x (two leaves behind the loader)"
const bool topology2x =
topology == FfxTopology::Loader || topology == FfxTopology::LoaderExport || topology == FfxTopology::Ue;
const char* topologyName = topology == FfxTopology::Monolith ? "SDK 1.1.x (monolith)"
: topology == FfxTopology::Loader ? "SDK 2.x (two leaves behind the loader)"
: topology == FfxTopology::LoaderExport
? "SDK 2.x (two leaves behind a loader that forwards to their exports)"
: topology == FfxTopology::Ue ? "UE5 (two leaves, no loader)"
: topology == FfxTopology::Fsr3Host ? "FSR 3.0 host DLL alone"
: "FSR 3.0 host DLL + SDK 1.1.x monolith";
@@ -3143,7 +3834,8 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
up.sharpness = kAdvFfxSharpness;
up.preExposure = kAdvFfxPreExposure;
up.cameraNear = kAdvFfxNear;
up.cameraFar = kAdvFfxFar;
// --ffx-infinite-far: the plane at infinity as an engine with an infinite depth states it (D119).
up.cameraFar = g_ffxInfiniteFar ? std::bit_cast<float>(0x7F7FFFFFu) : kAdvFfxFar;
up.frameTimeDelta = kAdvFfxFrameTimeMs;
up.flags = FFX_UPSCALE_FLAG_NON_LINEAR_COLOR_PQ;
}
@@ -3168,6 +3860,28 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
hostUp.renderSize.width = kTaggedRenderW;
hostUp.renderSize.height = kTaggedRenderH;
// --advanced, 0.1.0-beta.43: the frame-generation configuration a title sends every frame, and beside it a
// configure of another type, which the Overlay passes over. What may be read is a known value; WHAT MAY NOT --
// the swapchain, the callbacks' contexts, the HUD-less resource, the frame id -- is loud and changes every frame.
// Nothing is dereferenced: the stub looks at none of it.
const PfnFfxConfigure configureFg =
advanced && prepare && fgEntry != nullptr
? reinterpret_cast<PfnFfxConfigure>(reinterpret_cast<void*>(GetProcAddress(fgEntry, "ffxConfigure")))
: nullptr;
ffxConfigureDescFrameGeneration cfg{};
cfg.header.type = FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION;
cfg.frameGenerationEnabled = true;
cfg.allowAsyncWorkloads = false;
cfg.onlyPresentGenerated = false;
cfg.flags = kAdvFfxFgFlags;
cfg.generationRect = {0, 0, kAdvFfxFgRectWidth, kAdvFfxFgRectHeight};
ffxConfigureDescFrameGenerationKeyValue otherCfg{};
otherCfg.header.type = FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION_KEYVALUE;
if (advanced && prepare && fgEntry != nullptr && configureFg == nullptr) {
Check(false, "the frame-generation entry exports ffxConfigure");
return 1;
}
const ULONGLONG until = GetTickCount64() + static_cast<ULONGLONG>(seconds) * 1000ULL;
long long presented = 0;
long long frames = 0;
@@ -3193,6 +3907,16 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
} else {
dispatchUp(nullptr, &up.header);
}
if (configureFg != nullptr) {
const uintptr_t loud = 0x1000u + static_cast<uintptr_t>(frameId % 977u) * 0x10u;
cfg.swapChain = reinterpret_cast<void*>(loud);
cfg.presentCallbackUserContext = reinterpret_cast<void*>(loud + 1u);
cfg.frameGenerationCallbackUserContext = reinterpret_cast<void*>(loud + 2u);
cfg.HUDLessColor.resource = reinterpret_cast<void*>(loud + 3u);
cfg.frameID = frameId;
configureFg(nullptr, &cfg.header);
configureFg(nullptr, &otherCfg.header);
}
if (prepare && dispatchFg != nullptr) {
// TWICE, SAME frameID: the SDK's own sample re-issues the prepare when its
// configuration changes, and the vendor's contract is about the INDEX. A
@@ -3407,6 +4131,7 @@ int main(int argc, char** argv) {
} else if (std::strcmp(argv[i], "--ffx-topology") == 0 && i + 1 < argc) {
const char* t = argv[++i];
ffxTopology = std::strcmp(t, "1x") == 0 ? FfxTopology::Monolith
: std::strcmp(t, "2x-export") == 0 ? FfxTopology::LoaderExport
: std::strcmp(t, "ue") == 0 ? FfxTopology::Ue
: std::strcmp(t, "fsr3host") == 0 ? FfxTopology::Fsr3Host
: std::strcmp(t, "fsr3host+mono") == 0 ? FfxTopology::Fsr3HostMonolith
@@ -3418,6 +4143,8 @@ int main(int argc, char** argv) {
ffxQuery = std::strcmp(q, "sizes") == 0 ? FfxQuery::Sizes
: std::strcmp(q, "ratios") == 0 ? FfxQuery::Ratios
: FfxQuery::None;
} else if (std::strcmp(argv[i], "--ffx-infinite-far") == 0) {
g_ffxInfiniteFar = true;
} else if (std::strcmp(argv[i], "--advanced") == 0) {
advancedInputs = true;
} else if (std::strcmp(argv[i], "--ffx-memory-query") == 0 && i + 1 < argc) {
@@ -3442,6 +4169,17 @@ int main(int argc, char** argv) {
} else {
i += 2;
}
} else if (std::strcmp(argv[i], "--churn-module") == 0 && i + 1 < argc) {
// The fixture for D123: a process whose module list keeps changing, as a game's does at its launch. One
// thread loads and frees the named module for the life of the process.
const char* path = argv[++i];
MultiByteToWideChar(CP_ACP, 0, path, -1, g_churnPath, static_cast<int>(std::size(g_churnPath)));
HANDLE t = CreateThread(nullptr, 0, &ChurnModuleThread, nullptr, 0, nullptr);
std::printf(" --churn-module %s -> %s\n", path, t != nullptr ? "started" : "FAILED");
if (t == nullptr) {
return 3;
}
CloseHandle(t);
} else if (std::strcmp(argv[i], "--load") == 0 && i + 1 < argc) {
// The fixture for the guard's signer half: put a named module into
// THIS process before the guard looks. Loaded, not injected, and it
@@ -3464,13 +4202,13 @@ int main(int argc, char** argv) {
std::strcmp(argv[i], "--ffx-topology") == 0 || std::strcmp(argv[i], "--ffx-no-prepare") == 0 ||
std::strcmp(argv[i], "--ffx-query") == 0 || std::strcmp(argv[i], "--sl-tag-for-frame") == 0 ||
std::strcmp(argv[i], "--advanced") == 0 || std::strcmp(argv[i], "--ffx-memory-query") == 0 ||
std::strcmp(argv[i], "--sl-tag-whole-resource") == 0 ||
std::strcmp(argv[i], "--ffx-infinite-far") == 0 || std::strcmp(argv[i], "--sl-tag-whole-resource") == 0 ||
std::strcmp(argv[i], "--sl-tag-dlssg-inputs") == 0 || std::strcmp(argv[i], "--load") == 0 ||
std::strcmp(argv[i], "--load-after-ms") == 0) {
std::strcmp(argv[i], "--churn-module") == 0 || std::strcmp(argv[i], "--load-after-ms") == 0) {
if (std::strcmp(argv[i], "--plus-ui") == 0 || std::strcmp(argv[i], "--present-interval-ms") == 0 ||
std::strcmp(argv[i], "--presents-per-eval") == 0 || std::strcmp(argv[i], "--ffx-topology") == 0 ||
std::strcmp(argv[i], "--ffx-query") == 0 || std::strcmp(argv[i], "--ffx-memory-query") == 0 ||
std::strcmp(argv[i], "--load") == 0) {
std::strcmp(argv[i], "--load") == 0 || std::strcmp(argv[i], "--churn-module") == 0) {
++i;
}
if (std::strcmp(argv[i], "--load-after-ms") == 0) {
@@ -84,3 +84,20 @@ fl_add_vendor_stub(fl_stub_ffx_loader "amd_fidelityfx_loader_dx12" stub_amd_fide
# is therefore hookinventory-check Pass C's SECOND positive control for the export
# parser, beside the ffx-api leaf.
fl_add_vendor_stub(fl_stub_ffx_fsr3_host "ffx_fsr3_x64" stub_ffx_fsr3_x64.cpp)
# --- NVIDIA NVAPI, for the spike of Reflex route D (docs/spike-notes §31, owner decision D132) ---
#
# A stand-in for nvapi64.dll: the real module's one way in (nvapi_QueryInterface) answering the two getters route D
# would call, with knobs for what a driver cannot be made to do on demand -- a missing getter, a report of nothing,
# an error, a call that does not return for seconds. Used by fl-probe-reflex only; the Overlay is not involved and
# no inventory row names it, so it takes the vendored NVAPI headers (the include directory alone -- nvapi64.lib is
# not linked) and nothing of the hook inventory.
#
# ITS OWN SUBDIRECTORY for its outputs: a file called nvapi64.lib beside the other stubs' import libraries would be
# one careless link line away from being taken for the vendored one.
fl_add_vendor_stub(fl_stub_nvapi64 "nvapi64" stub_nvapi64.cpp)
target_include_directories(fl_stub_nvapi64 SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/third_party/nvapi")
set_target_properties(fl_stub_nvapi64 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nvapi"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nvapi"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nvapi")
@@ -0,0 +1,61 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// The knobs and counters of the stand-in nvapi64.dll (stub_nvapi64.cpp), as a named section another process can open.
//
// WHY A SECTION. The probe loads the stub into itself and calls its exports. The injected tests cannot: the stub is
// in the harness's process, and a test that asks "did the Overlay call the driver at all" has to read the stub's
// count from outside -- the harness's output is not captured. The stub creates `Local\FrameLedger.StubNvapi.<pid>`
// when it is loaded and keeps every knob and count in it; the exports the probe calls write the same words.
//
// A TEST FIXTURE'S, in a fixture's own namespace of names. Nothing shipped opens it.
#ifndef FRAMELEDGER_FL_STUB_NVAPI_SHARED_H
#define FRAMELEDGER_FL_STUB_NVAPI_SHARED_H
#include <cstdint>
namespace fl::stubnv {
// What GetLatency does (`mode`).
enum Mode : std::uint32_t {
kModeReports = 0, // sixty-four frames, their ids ten further on at every call
kModeNothing = 1, // OK and a report of nothing: a game that sets no marker
kModeError = 2, // NVAPI_ERROR, from both getters
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
};
// One frame of kModeReports, in microseconds: every frame has these spans.
inline constexpr std::uint32_t kSimulationUs = 800u;
inline constexpr std::uint32_t kSubmitUs = 1150u;
inline constexpr std::uint32_t kPresentUs = 150u;
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
// Plain words, read and written with interlocked operations on both sides.
struct Shared {
std::uint32_t mode; // Mode
std::uint32_t blockMs; // GetLatency sleeps this long before it answers
std::uint32_t hideGetters; // nvapi_QueryInterface answers null for both getters
std::uint32_t queries; // nvapi_QueryInterface calls
std::uint32_t latencyCalls; // GetLatency calls
std::uint32_t sleepStatusCalls; // GetSleepStatus calls
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";
} // namespace fl::stubnv
#endif // FRAMELEDGER_FL_STUB_NVAPI_SHARED_H
@@ -26,6 +26,16 @@
//
// IT IS A FIXTURE, NOT A CLAIM ABOUT THE REAL LOADER'S INTERNALS beyond the one
// measured fact: the leaf exports stay silent behind it.
//
// AND A SECOND MEASURED FACT, 2026-11-12, FOR A LATER LOADER. Cyberpunk 2077's
// loader 2.3.0 hands a dispatch on to the leaf's EXPORT: each frame-generation
// dispatch type was logged on the loader and on the frame-generation leaf. So the
// stub has a second way to be bound -- FlStubLoaderBindThroughExports -- that
// forwards through the leaves' exported ffxDispatch, and with all four modules
// hooked the Overlay then sees every dispatch at two of them. What it does with
// that is owner decision D125: an UPSCALE is counted at the first module that
// sees it. No title run so far upscales through such a loader; the fixture is how
// the rule is held.
#include <ffx_api.h>
@@ -51,7 +61,7 @@ Bound g_upscaler;
Bound g_frameGeneration;
volatile LONG g_forwarded = 0;
void Bind(Bound& b, HMODULE h) {
void Bind(Bound& b, HMODULE h, bool dispatchThroughExport = false) {
if (h == nullptr) {
b = Bound{};
return;
@@ -60,9 +70,10 @@ void Bind(Bound& b, HMODULE h) {
b.destroy = reinterpret_cast<PfnFfxDestroyContext>(reinterpret_cast<void*>(GetProcAddress(h, "ffxDestroyContext")));
b.configure = reinterpret_cast<PfnFfxConfigure>(reinterpret_cast<void*>(GetProcAddress(h, "ffxConfigure")));
b.query = reinterpret_cast<PfnFfxQuery>(reinterpret_cast<void*>(GetProcAddress(h, "ffxQuery")));
// DISPATCH GOES THROUGH THE DIRECT ENTRY, NOT THE EXPORT -- see the header comment.
b.dispatch =
reinterpret_cast<PfnFfxDispatch>(reinterpret_cast<void*>(GetProcAddress(h, "FlStubFfxDispatchDirect")));
// DISPATCH GOES THROUGH THE DIRECT ENTRY, NOT THE EXPORT -- see the header comment -- unless this is the later
// loader's shape (FlStubLoaderBindThroughExports).
b.dispatch = reinterpret_cast<PfnFfxDispatch>(
reinterpret_cast<void*>(GetProcAddress(h, dispatchThroughExport ? "ffxDispatch" : "FlStubFfxDispatchDirect")));
}
// Route by EFFECT ID, which is what the real loader's provider lookup keys on
@@ -90,6 +101,12 @@ __declspec(dllexport) void FlStubLoaderBind(HMODULE upscaler, HMODULE frameGener
Bind(g_frameGeneration, frameGeneration);
}
// The loader 2.3 shape (measured on Cyberpunk 2077, 2026-11-12): dispatches are handed to the leaves' exports.
__declspec(dllexport) void FlStubLoaderBindThroughExports(HMODULE upscaler, HMODULE frameGeneration) {
Bind(g_upscaler, upscaler, true);
Bind(g_frameGeneration, frameGeneration, true);
}
__declspec(dllexport) unsigned int FlStubLoaderForwarded() {
return static_cast<unsigned int>(InterlockedCompareExchange(&g_forwarded, 0, 0));
}
Loaded 100 of 118 files, more files were not shown because too many files have changed in this diff. Show more