Compare commits
42
Commits
No files matched your search
@@ -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
@@ -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.38. In the app: Help ▸ Accessibility.*
|
||||
*Beta software: this page describes version 0.1.0-beta.45. In the app: Help ▸ Accessibility.*
|
||||
|
||||
## What FrameLedger aims for
|
||||
|
||||
|
||||
+20
-90
@@ -35,99 +35,22 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **"Advanced metrics" is planned, and its inventory is written — nothing reads it yet.** The owner asked for a
|
||||
setting, *Thông số nâng cao*, with a navigation item of its own that shows as much as the NVAPI and Streamline
|
||||
headers and PawnIO make available, each value under what it belongs to: one game session, or the PC. This pull
|
||||
request is the first of that train and changes nothing you can see or record. It adds the list everything else in
|
||||
the train reads — `AdvancedMetricCatalog`, 137 entries: what the Agent will read from NVAPI and
|
||||
LibreHardwareMonitor (the card's firmware, architecture and cores; its memory with evictions and promotions; its
|
||||
utilisation by domain; what a display can do with HDR and variable refresh; the driver's profile; and, as
|
||||
administrator with PawnIO, the processor per core, the motherboard, the memory modules and the drives'
|
||||
temperatures), what can only be read inside a game and waits for a later release, **and what is never read with the
|
||||
reason** — a serial number, a display's EDID, the list of programs that are encoding, the camera's position, what
|
||||
a vendor's licence closes. `docs/18_GPU_VENDOR_APIS.md` §Advanced metrics holds the design, the owner's decisions
|
||||
D101–D108 and the same list as a table; a test fails when the table and the catalog differ in either direction.
|
||||
|
||||
- **The NVIDIA bridge can read what Advanced metrics will show — and nothing calls it yet.**
|
||||
`FrameLedger.NvapiBridge.dll`, the library the Agent loads into its own process and never into a game, gains five
|
||||
reads (its ABI 3): the card's facts — firmware version, architecture, ray-tracing and tensor core counts, base and
|
||||
boost clocks, its memory sizes, the driver's package; what it says now — free and used video memory with evictions
|
||||
and promotions, the frame-buffer, video and bus utilisation, the performance state, the encoder's load; what each
|
||||
connected display can do with HDR and variable refresh; the state of the display a game presents on; and every
|
||||
setting of a driver profile. On the development PC's RTX 5080 all twenty facts and eight of the ten live groups
|
||||
answer — the card has no board or power-supply temperature sensor, so those two will read N/A.
|
||||
**It reads no identifier**: no serial number, no unique id, no display EDID, and not which programs are encoding.
|
||||
- **"The bridge never calls a setter" is now a build check.** A new gate, `tools/nvapi-readonly-check.ps1`, compares
|
||||
every NVAPI call in the bridge's source with a committed list of forty-four reads, in both directions, and refuses a
|
||||
name that sets, saves, restores, registers or controls something — or returns an identifier — even when someone
|
||||
adds it to the list.
|
||||
|
||||
- **The reader behind Advanced metrics exists, was measured on a real PC, and is still not switched on.** One
|
||||
reader for the whole Agent, on a thread of its own, that runs only while a session or the page needs it: NVIDIA's
|
||||
figures every second, and every sensor LibreHardwareMonitor has for the graphics card — each fan and its duty, the
|
||||
core voltage, PCI Express traffic, the load of every engine. When the Agent runs as administrator with PawnIO
|
||||
installed it will also read the processor per core, the memory and the motherboard's sensor chip.
|
||||
**A drive's temperature is not read**: the library cannot list drives without touching removable ones, so that
|
||||
group is never opened and the value will read N/A with that reason.
|
||||
- **`FrameLedger.CaptureHost probe-advanced`** (a developer tool, not shipped): runs that reader for a few seconds
|
||||
on your own rights and prints everything it read and what it cost. On the development PC it read 35 facts and 58
|
||||
values a second — and showed that one refresh of the sensor library takes 14 ms of processor time, so the reader
|
||||
refreshes it every five seconds, where NVIDIA's own figures (0.4 ms) stay at one a second.
|
||||
|
||||
- **The ledger can hold Advanced metrics — and holds none yet.** Schema 23 adds two tables: one for the facts of
|
||||
the PC, stored once per distinct set, and one for what a session recorded with the option on knows — its own
|
||||
facts, which sources answered and why the others did not, and the statistics of its extra series. Nothing is
|
||||
added to the session row itself, so what the JSON export and a bug bundle carry does not grow. The extra series
|
||||
are stored beside the others under names of their own, with a real "no reading" for a second in which a sensor
|
||||
was not read. One hour of them is about 0.2 MB. **A session recorded with the option off stores nothing of this**,
|
||||
and the option does not exist yet. *A 0.1.0-beta.38 cannot open a ledger a later build has migrated.*
|
||||
|
||||
- **Settings ▸ Recording ▸ Advanced metrics — the switch exists, off by default.** On, the capture agent reads more
|
||||
from the graphics driver and the hardware sensors during a session and stores it with the session: the graphics
|
||||
card's memory, load, clocks, fans, voltages and power in detail, what each display can do with HDR and variable
|
||||
refresh and what the game's display did, the driver's settings for the game — and, when the agent runs as
|
||||
administrator with PawnIO installed, the processor per core, the memory and the motherboard's sensors. **Off,
|
||||
nothing more is read or stored**, and the shared reader is not even started. It applies from the next session, and
|
||||
a session recorded while it was off is not filled in later. NVIDIA's figures are read once a second, the sensors
|
||||
every five. **No page shows what is stored yet** — that is the next pull requests' — and none of it is in an
|
||||
export or a bug report.
|
||||
- **The App can ask the agent what this PC reads right now — and no page asks yet.** A new request,
|
||||
`GetAdvancedMachine`, answers what the agent's shared reader last read: the PC's facts, the newest value of every
|
||||
series, and which sources answer or why they do not. It never touches a sensor itself, so it cannot hold up the
|
||||
pipe. Each request also keeps the reader running for five seconds, which is how "with no game running, sensors are
|
||||
read only while the page is open" works without anything telling the agent that a page closed. With Advanced
|
||||
metrics off it answers that it is off, and nothing is read. On the App's side `AdvancedMachineFeed` asks once a
|
||||
second while a page watches it and keeps each value with the moment it was read.
|
||||
- **The Advanced page.** While Advanced metrics is on, **Advanced** is the last item in the list on the left, and
|
||||
**Ctrl+6** opens it. **This PC** shows what the graphics driver and the sensors say right now — the card's
|
||||
firmware, cores and memory, what each display can do, the driver's settings, and every reading with the time it
|
||||
was read at and a chart of its last five minutes. It is read only while the page is open, and is not stored.
|
||||
**Session** shows what a session recorded with the option on kept: the PC as it was, what belonged to that session,
|
||||
the lowest, average and highest of each reading, and a chart over the session. **Sources** lists every reading
|
||||
FrameLedger knows of and, for each one it does not read, why — the agent is not an administrator, PawnIO is not
|
||||
installed, it comes with a later release, or it is never read. A session's summary has an **Advanced metrics…**
|
||||
button that opens that session there. In `en`, `vi` and `ja`; the user guide has a page for it.
|
||||
- **The terms window shows the Privacy Policy 2.15 and the Disclaimer 2.15 once.** The Privacy Policy names what
|
||||
Advanced metrics reads and stores, only while it is on, and what it never reads: a serial number, a display's
|
||||
identification data, a list of other programs. The Disclaimer's two sentences about PawnIO and about running the
|
||||
agent as administrator said "the CPU temperature"; they now also name the processor's, the memory's and the
|
||||
motherboard's sensors, read with Advanced metrics on. The same sentence changed in Settings, the first run, the
|
||||
administrator dialog, the guide and `LIMITATIONS.md`.
|
||||
|
||||
### Changed
|
||||
|
||||
- **A crash file from a newer build no longer loses its tail in an older one.** The file a session writes as it goes
|
||||
(so that a crash keeps what was recorded) is made of chunks; a reader that met a chunk of a kind it did not know
|
||||
stopped there. It now passes over a whole chunk it does not know and reads on.
|
||||
- **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.**
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A sentence in the documents that kept a function from being called.** `docs/18_GPU_VENDOR_APIS.md` said the
|
||||
vendored NVAPI headers do not declare `NvAPI_GPU_GetMemoryInfoEx`. They do — in `nvapi_lite_common.h`, which
|
||||
`nvapi.h` includes; the search that found nothing had looked in `nvapi.h` alone. The row is corrected, and the
|
||||
bridge will call it for the advanced memory rows. Nothing about the memory figures FrameLedger shows today changes.
|
||||
- **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.
|
||||
|
||||
## Releases
|
||||
|
||||
@@ -135,6 +58,13 @@ Newest first. Each file holds that release's section exactly as it stood here.
|
||||
|
||||
| Version | Date | Notes |
|
||||
|---|---|---|
|
||||
| `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) |
|
||||
| `0.1.0-beta.38` | 2026-11-11 | [`docs/changelog/0.1.0-beta.38.md`](docs/changelog/0.1.0-beta.38.md) |
|
||||
| `0.1.0-alpha.4` | 2026-11-11 | [`docs/changelog/0.1.0-alpha.4.md`](docs/changelog/0.1.0-alpha.4.md) |
|
||||
| `0.1.0-beta.37` | 2026-11-11 | [`docs/changelog/0.1.0-beta.37.md`](docs/changelog/0.1.0-beta.37.md) |
|
||||
|
||||
@@ -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**: a spike on `hook-harness` and a stub comes first (`spike-notes` §31), and a release that carries it needs the owner's go on that result. 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`.
|
||||
|
||||
@@ -118,6 +120,21 @@ src/
|
||||
# snapshot - each request is the page's hold on it (PR-6, D107). Recording/
|
||||
# AdvancedSessionBuilder stores what a session's samples carried (schema 0023:
|
||||
# machine_profiles + session_advanced, adv.* series with NaN for a gap, D102).
|
||||
# Train B (0.1.0-beta.40, D111): Capture/InGameAdvancedSampler turns the shared
|
||||
# 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).
|
||||
FrameLedger.Infrastructure/ # SQLite, shm reader, vendor APIs, injector interop, parsers,
|
||||
# and Capture/ (PR-C): ShmRingAttacher/ShmCaptureSink over the
|
||||
# reader, HeldProcessLivenessSource, TargetResolver (path only,
|
||||
@@ -171,8 +188,13 @@ tools/ # accuracy-check, changelog-check, chokepoint-che
|
||||
# wiki-build (beta.17: builds and checks the wiki; the wiki-check gate),
|
||||
# buildid-check (beta.18: the release's build id in the shipped natives),
|
||||
# docs-split-check (beta.24, D66: CHANGELOG/HANDOFF and their parts agree),
|
||||
# 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),
|
||||
# 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)
|
||||
# (six names added 2026-10-04)
|
||||
# (PowerShell). This line used to name three, one of which
|
||||
# — resx-audit — ~~does not exist~~ exists since 2026-09-13 with
|
||||
@@ -205,7 +227,7 @@ Dependency direction: `App/Agent → Application → Domain`; **`Application →
|
||||
|
||||
**Licence header —** every first-party source file (`.cs .cpp .h .inl .ps1 .xaml`) opens with two comment lines, `SPDX-License-Identifier: GPL-3.0-only` and `Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE` (beta.12, owner decision D45). GPLv3 §7 requires additional terms to be named in the source files, and `NOTICE` holds them — (b) preserve the notices, (c) mark modified versions, (e) no trademark rights in the name. `tools/notice-check.ps1` is a `build.ps1` gate; `-Fix` writes a missing header. `src/native/third_party/` is excluded.
|
||||
|
||||
**Struct mirroring —** ~~`FlFrameRecord`, `FlShmHandshake`, `FlWriterState` and `FlControlBlock`~~ `FlShmHandshake`, `FlWriterState`, `FlControlBlock`, `FlDisplayState` (layout 4, beta.10), `FlFrameRecord` and `FlTolerance` (D33, beta.9) each exist twice *(corrected 2026-10-04)*: `src/native/FrameLedger.Shm/include/fl_shm.h` / `fl_tolerance.h` (**normative**) and `src/FrameLedger.Shared/ShmLayout.cs` as `[StructLayout(LayoutKind.Sequential)]`. `ShmLayoutMirrorTests` asserts size and every field offset on both sides **against JSON emitted by ~~`tools/fl-layout-dump`~~ `src/native/tools/fl-layout-dump`**, never a transcribed table, and walks the field list in both directions so a field added on either side alone fails.
|
||||
**Struct mirroring —** ~~`FlFrameRecord`, `FlShmHandshake`, `FlWriterState` and `FlControlBlock`~~ `FlShmHandshake`, `FlWriterState`, `FlControlBlock`, `FlDisplayState` (layout 4, beta.10), `FlAdvancedState` (layout 5, 2026-11-11, Advanced metrics train B), `FlFrameRecord` and `FlTolerance` (D33, beta.9) each exist twice *(corrected 2026-10-04)*: `src/native/FrameLedger.Shm/include/fl_shm.h` / `fl_tolerance.h` (**normative**) and `src/FrameLedger.Shared/ShmLayout.cs` as `[StructLayout(LayoutKind.Sequential)]`. `ShmLayoutMirrorTests` asserts size and every field offset on both sides **against JSON emitted by ~~`tools/fl-layout-dump`~~ `src/native/tools/fl-layout-dump`**, never a transcribed table, and walks the field list in both directions so a field added on either side alone fails.
|
||||
|
||||
It also asserts **blittability** (`RuntimeHelpers.IsReferenceOrContainsReferences`), because offsets cannot see it: measured 2026-08-05, swapping the `fixed byte BuildId[32]` for this repo's own `[MarshalAs(ByValTStr)] string` idiom keeps `Marshal.SizeOf` at 64 and every offset correct while `Unsafe.SizeOf` collapses to **40** — a mirror that passes the obvious checks and cannot be read out of a memory-mapped view.
|
||||
|
||||
|
||||
+65
-3
@@ -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.38.*
|
||||
*Beta software: this page describes version 0.1.0-beta.45.*
|
||||
|
||||
## 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
|
||||
@@ -176,6 +183,59 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
|
||||
- **Advanced metrics** (since 0.1.0-beta.39; Settings ▸ Recording, off by default) stores more of what the graphics
|
||||
driver and the sensors report with each session. Its limits:
|
||||
- **A session recorded while it was off is not filled in later**, and switching it on applies from the next session.
|
||||
- **What a game tells DLSS and FSR** (since 0.1.0-beta.40) is kept only for a game FrameLedger measures from
|
||||
inside, and only where the game hands it over in a call FrameLedger intercepts. **Most games set their DLSS
|
||||
options through a call it cannot see and show nothing**; the FSR rows need FSR 3.1 or later through AMD's own
|
||||
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. 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
|
||||
@@ -254,7 +314,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))
|
||||
|
||||
|
||||
@@ -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.38`** (2026-11-11), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.45`** (2026-11-12), 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
|
||||
@@ -109,6 +109,26 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
|
||||
> been checked against another tool. The processor's, the memory's and the motherboard's need the Agent as
|
||||
> administrator with PawnIO and have never been read on real hardware; a drive's temperature is not read. The
|
||||
> Advanced page shows them as they were stored, and what the PC reads at the moment only while that page is open.
|
||||
> - **What a game tells its upscaler (since beta.40; only with Advanced metrics on, only for a game measured from
|
||||
> inside):** the output size, presets and exposure a game hands DLSS, and the sharpening, jitter, exposure, depth
|
||||
> 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. 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
|
||||
@@ -185,7 +205,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest beta is `v0.1.0-beta.38` (2026-11-11); before it `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.45` (2026-11-12); before it `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**.
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -489,6 +489,16 @@ function Invoke-ProjectGates {
|
||||
Invoke-Checked 'nvapi-readonly-check (self-test)' { & $nvapiTool -SelfTest }
|
||||
Invoke-Checked 'nvapi-readonly-check' { & $nvapiTool -RepoRoot $repo }
|
||||
|
||||
# 2026-11-12 (D116): the same for the code loaded into a game. Advanced metrics, train B, reads more members of
|
||||
# the vendors' structs than the frame record ever needed, and the same structs hold where the player's camera is.
|
||||
# Every such read is in one header, each member on tools/overlay-allowed-fields.txt in both directions; a camera's
|
||||
# position, axes and matrices are named nowhere in the Overlay or the Vulkan layer, whatever the list says. Text
|
||||
# only.
|
||||
Write-Step 'overlay-fields-check'
|
||||
$fieldsTool = Join-Path $repo 'tools/overlay-fields-check.ps1'
|
||||
Invoke-Checked 'overlay-fields-check (self-test)' { & $fieldsTool -SelfTest }
|
||||
Invoke-Checked 'overlay-fields-check' { & $fieldsTool -RepoRoot $repo }
|
||||
|
||||
Write-Step 'docs-split-check'
|
||||
$splitTool = Join-Path $repo 'tools/docs-split-check.ps1'
|
||||
Invoke-Checked 'docs-split-check (self-test)' { & $splitTool -SelfTest }
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ Draw live FPS/frametime/upscaler info inside the game. Only for games already ho
|
||||
## Non-functional requirements
|
||||
|
||||
- **NFR-1 Game-side overhead:** ≤ 1 µs per present, ≤ 8 MB resident, measured game FPS impact ≤ 0.5% vs uninstrumented.
|
||||
- **NFR-2 Agent overhead:** ≤ 1% of one core during capture, ≤ 150 MB working set, ~0% idle. *(D101, 2026-11-11: the limits hold with Advanced metrics on — FR-5.6. Its reads run on a thread of their own, the slow ones seldom, and with no game running only while its page is open (D107), so "~0% idle" is not spent on it. **Unmeasured** until the owner's run with the option on and off, `HANDOFF` §Owner-only.)*
|
||||
- **NFR-2 Agent overhead:** ~~≤ 1% of one core during capture~~ **≤ 2.5 % of one core during capture** *(owner decision D117, 2026-11-11: the 1 % had never been measured; measured in a real Agent it is 1.93 % with Advanced metrics off and 2.04 % with it on — `20_OPEN_QUESTIONS` §M16, `tools/agent-cost.ps1` — nearly all of it the once-a-second read of the graphics card's sensors, which stays)*, ≤ 150 MB working set *(measured: 113 MiB off, 119 MiB on)*, ~0% idle. *(D101, 2026-11-11: the limits hold with Advanced metrics on — FR-5.6. Its reads run on a thread of their own, the slow ones seldom, and with no game running only while its page is open (D107), so "~0% idle" is not spent on it. Measured on the development PC in a session that is not hooked; a hooked session, an elevated Agent with PawnIO's groups and a real game are the owner's run, `HANDOFF` §Owner-only.)*
|
||||
- **NFR-3 Stability:** faults **originating in our own hook bodies** are contained by `FL_HOOK_GUARD`, counted, and self-disable the Overlay after 3 occurrences; the safety-unhook path completes within one frame. The Overlay adds no allocation, lock, syscall or logging to the present path.
|
||||
|
||||
> This deliberately does **not** say "must never crash a game" (`20_OPEN_QUESTIONS` §H8). SEH containment cannot reliably catch stack overflow, cannot intercept `__fastfail` — and `-D_HAS_EXCEPTIONS=0` converts a would-be STL throw into exactly that (`spike-notes.md` §H3) — and does not help when the game installs a vectored exception handler that runs first. An absolute promise the mechanism cannot support does not belong in a requirement, and must stay out of user-facing text: the Disclaimer already says injection carries risk, and that wording is the honest one.
|
||||
|
||||
@@ -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
|
||||
|
||||
+4
-1
@@ -26,6 +26,9 @@ public interface IFrameSource : IAsyncDisposable
|
||||
> DrainResult Drain(Span<FlFrameRecord> into, IList<ulong> gapIndices);
|
||||
> void PublishGuardResult(uint completedEvaluations, bool unhookRequested);
|
||||
> void SetPaused(bool paused); void RequestLogFlush();
|
||||
> FlAdvancedState? AdvancedState { get; } void SetAdvancedRequested(bool requested); // region 5, train B (2026-11-12): the
|
||||
> // word is written either way as the ring is attached, before the first guard result; the region is read only by
|
||||
> // a session whose observer WantsInGameAdvanced, and carried on CaptureProgress.InGameAdvanced
|
||||
> }
|
||||
> public sealed class CaptureSession(...) // the loop: gate → inject → attach → drain, until something ends it
|
||||
> {
|
||||
@@ -537,7 +540,7 @@ Crash-within-60s-of-injection happening twice for the same game ⇒ **hooking au
|
||||
|---|---|
|
||||
| Game process, per present | ≤ 1 µs; no syscall, no allocation, no lock, no logging (`17_HOOK_ENGINE`) |
|
||||
| Game process, resident | ≤ 8 MB (DLL + ring) |
|
||||
| Agent, during capture | ≤ 1% of one core average, ≤ 150 MB working set |
|
||||
| Agent, during capture | ~~≤ 1%~~ ≤ 2.5 % of one core average *(NFR-2 as D117 amended it, 2026-11-11: measured 1.93 %, `20_OPEN_QUESTIONS` §M16)*, ≤ 150 MB working set |
|
||||
| Agent, idle | ~0% (1 Hz process poll only) |
|
||||
| Measured game FPS impact | ≤ 0.5% vs uninstrumented, verified per release (`14_TESTING` §Hook overhead) |
|
||||
|
||||
|
||||
+16
-1
@@ -757,7 +757,22 @@ Sequential embedded SQL (`Migrations/0001_init.sql`, `0002_*.sql`, …), applied
|
||||
> option off has no row** — that absence is how the App says "the option was off when this was recorded" rather than
|
||||
> "nothing answered" — and is never given one. The JSON is `Application.Advanced.AdvancedJson`'s (camel case, nulls
|
||||
> left out, a status by its name); writing is strict, reading is tolerant, and **only a fact whose catalog entry is
|
||||
> read may be written** (`AdvancedJson.Storable`), so no identifier reaches either table (D104). A session deleted
|
||||
> read may be written** (`AdvancedJson.Storable`), so no identifier reaches either table (D104). **Since
|
||||
> 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`. **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;
|
||||
|
||||
+77
-5
@@ -14,15 +14,17 @@ in beta.9 without a row here)*:
|
||||
|
||||
Created by the Overlay on init, opened by the Agent. Name is deliberately plain and identifiable (`19_SAFETY` — no obfuscated object names).
|
||||
|
||||
Layout — **~~four~~ five regions, each exactly one 64-byte cache line before the ring** (layout 4 since
|
||||
2026-09-27, beta.10: region 4 is new and the ring moved from `0xC0` to `0x100`):
|
||||
Layout — **~~four~~ ~~five~~ six regions** (layout 4 since 2026-09-27, beta.10: region 4 is new and the ring moved
|
||||
from `0xC0` to `0x100`; **layout 5 since 2026-11-11**, Advanced metrics train B: region 5 is new — twenty-three cache
|
||||
lines, where the four before it are one each — and the ring moved from `0x100` to `0x6C0`):
|
||||
|
||||
```
|
||||
[0x0000] FlShmHandshake 64 B write-once by the Overlay at init
|
||||
[0x0040] FlWriterState 64 B Overlay-written (writeIndex touched every present)
|
||||
[0x0080] FlControlBlock 64 B Agent-written
|
||||
[0x00C0] FlDisplayState 64 B Overlay-written, at most every 500 ms per chain (layout 4)
|
||||
[0x0100] FlFrameRecord[capacity] (64 B each, power-of-two capacity)
|
||||
[0x0100] FlAdvancedState 1472 B Overlay-written by its watchdog, once a second, only while the Agent asks (layout 5)
|
||||
[0x06C0] FlFrameRecord[capacity] (64 B each, power-of-two capacity)
|
||||
```
|
||||
|
||||
The header is split in two on purpose. The immutable handshake and the
|
||||
@@ -72,7 +74,8 @@ struct alignas(64) FlControlBlock { // Agent-written
|
||||
uint32_t overlayEnabled; // @8 in-game overlay draw toggle (v1.1)
|
||||
uint32_t guardTicks; // @12 completed guard evaluations, NOT a timer
|
||||
uint32_t logFlushRequested; // @16 a COUNTER: bumped by the Agent at session end; the watchdog flushes the native log on a change (17_HOOK_ENGINE §Native logging, 2026-09-06)
|
||||
uint32_t reserved[11]; // @20..63 must be zero
|
||||
uint32_t advancedRequested; // @20 0, or this session's request for Advanced metrics (D111): non-zero, new to this ring; written at attach, either way
|
||||
uint32_t reserved[10]; // @24..63 must be zero
|
||||
};
|
||||
|
||||
struct alignas(64) FlDisplayState { // Overlay-written (layout 4, 2026-09-27, beta.10)
|
||||
@@ -93,9 +96,78 @@ static_assert(sizeof(FlShmHandshake) == 64);
|
||||
static_assert(sizeof(FlWriterState) == 64);
|
||||
static_assert(sizeof(FlControlBlock) == 64);
|
||||
static_assert(sizeof(FlDisplayState) == 64);
|
||||
static_assert(FL_SHM_DISPLAY_OFFSET == 0xC0 && FL_SHM_RING_OFFSET == 0x100 && FL_SHM_RING_OFFSET % 64 == 0);
|
||||
static_assert(sizeof(FlAdvancedState) == 1472); // region 5: fl_shm.h is its declaration, member by member
|
||||
static_assert(FL_SHM_DISPLAY_OFFSET == 0xC0 && FL_SHM_ADVANCED_OFFSET == 0x100 && FL_SHM_RING_OFFSET == 0x6C0 && FL_SHM_RING_OFFSET % 64 == 0);
|
||||
```
|
||||
|
||||
**Region 5 — what a hooked game told its upscaler (layout 5, 2026-11-11; Advanced metrics train B, owner decisions
|
||||
D111 and D113; written by the Overlay's watchdog since 0.1.0-beta.40).** `18_GPU_VENDOR_APIS` §Train B is the design.
|
||||
What the region is, as a contract between the two sides:
|
||||
|
||||
- **Off means nothing is read and nothing is written.** `FlControlBlock.advancedRequested` is the Agent's word that
|
||||
this session records Advanced metrics — written at attach, either way, because the control block outlives a session
|
||||
(`ShmRingReader.SetAdvancedRequested`). While it is 0 the Overlay reads no field and installs no hook beyond what
|
||||
it did before, and writes nothing here: a ring nobody ever asked is zero from end to end (`fl_guard` checks every
|
||||
byte, with a target that sends everything), and `validMask == 0` means "nothing was read", never "the game used
|
||||
none of it".
|
||||
- **"On" is a request, not a 1** *(2026-11-12)*. A game outlives a session, and so do the summaries the Overlay keeps
|
||||
inside it — a range, a count, a mask of what was ever seen. So the word is a value no session of this ring used
|
||||
before (above the word as it stands and above the request the region last answered; never 0), the watchdog starts
|
||||
its summaries afresh at a value it has not seen, and every publication names the request it answers
|
||||
(`FlAdvancedState.request`, the word that was `reserved0`). The reader returns only a publication that names the
|
||||
value it wrote: what a second session of the same game finds in the region before the first tick is the first
|
||||
session's, and is not read. After an "off" the region keeps its last publication, untouched.
|
||||
- **One writer, once a second.** The detours keep process-local accumulators; the watchdog copies them here at its
|
||||
tick. No game thread writes the region, so the seqlock has a single writer: `seq` odd, the fields, `seq` even.
|
||||
- **The reader keeps its last consistent copy** (`ShmRingReader.AdvancedState`): null until something was published
|
||||
for its request;
|
||||
the same copy while `seq` has not moved, without copying 1472 bytes again; and that copy still when the writer is
|
||||
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" — 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~~ 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.
|
||||
- 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.
|
||||
|
||||
**Region 4 — the presenting swap chain's display facts (layout 4, 2026-09-27, beta.10).** The owner asked for the game's
|
||||
window size and display mode (exclusive fullscreen / borderless / windowed) and the share of a session each took. The two
|
||||
facts only the process knows — whether the chain is in exclusive fullscreen, and which window it presents to — are
|
||||
|
||||
+19
-1
@@ -868,7 +868,25 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
> (`SessionSummaryViewModel.HasAdvanced`); it asks for that session through `Services.AdvancedSelection` and
|
||||
> navigates, and a page already on screen takes the request at once.
|
||||
> - **Sources** — every entry of `AdvancedMetricCatalog`: its label, what it belongs to, its source, and *Read*, or
|
||||
> the reason it is not (`AdvReach_*`), or — live — why its source is silent (`AdvSource_*`).
|
||||
> the reason it is not (`AdvReach_*`), or — live — why its source is silent (`AdvSource_*`). An entry read inside
|
||||
> the game (reach `Game`, 0.1.0-beta.40) says *Read inside a game FrameLedger measures, when the game makes the
|
||||
> 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. **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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -410,6 +410,7 @@ Seven self-test cases, both directions; `./tools/notice-check.ps1 -Fix` writes a
|
||||
14. `tools/changelog-check.ps1 -SelfTest` — nine cases, five expected RED. The live half needs a pull request's changed-file list and is supplied by `ci.yml`
|
||||
14b. `tools/release-notes.ps1 -SelfTest` — five cases over a fixture changelog (a dated and an undated section, a missing one, a prefix that must not match, an empty one), and since beta.24 three over a temporary tree: a version with its own `docs/changelog/<version>.md` is read from it, one without from `CHANGELOG.md`, a prefix of a file name is not that file. The live half needs a tag's version and runs in `release.yml`, where a missing or empty section is a red release (P4 PR-5)
|
||||
14e. **`tools/nvapi-readonly-check.ps1 -SelfTest`, then live** (owner decision D108, 2026-11-11) — every `NvAPI_*` call in `src/native/FrameLedger.NvapiBridge/src/fl_nvapi_bridge.cpp`, the one translation unit that links `nvapi64.lib` into a shipped binary, is on `tools/nvapi-allowed-calls.txt` and every name there is called; a name that sets, saves, restores, deletes, registers, resets, enables, disables or controls something is red **even when the list names it**, and so is one that returns an identifier (D104) — three reads the verb rule would refuse are exempt by name, each with its reason. Comments and string literals are taken out first, so a setter named in the comment that says it is never called is not a call. Seventeen self-test cases, both directions. Text only: it runs with or without the native build. `18_GPU_VENDOR_APIS` §Runtime policy's "never call a setter", which was a sentence until the bridge went from fourteen calls to forty-four
|
||||
14f. **`tools/overlay-fields-check.ps1 -SelfTest`, then live** (owner decision D116, 2026-11-12) — the same for the code loaded into a game: every member of a vendor's struct the Overlay reads for Advanced metrics is read in ONE header, `src/native/FrameLedger.Overlay/include/fl_adv_fields.h`, through parameters with fixed names, and is on `tools/overlay-allowed-fields.txt`; every name there is read; the parameters are not aliased and `->` reaches nothing but `desc` and the Overlay's own `region`; no other Overlay or Vulkan-layer source reads a listed member; **a camera's position, axes and matrices** (`cameraPos`, `cameraUp`, `cameraRight`, `cameraFwd`, the five matrices, `cameraPinholeOffset`, `cameraPosition`, `cameraForward`) **are named nowhere in those sources and not on the list, whatever the list says**; and neither `sl::Constants` nor `ffxDispatchDescFrameGenerationPrepareV2` is copied by value or measured with `sizeof`. Comments and string literals are taken out first. Nineteen self-test cases, both directions. Text only. It reads names, not types — which struct version carries a member is `17_HOOK_ENGINE` §Which struct version carries which field and ctest `fl_adv_fields`
|
||||
14d. **`tools/docs-split-check.ps1 -SelfTest`, then live** (beta.24, owner decision D66) — `CHANGELOG.md` holds no released section beside `[Unreleased]`; each `docs/changelog/<version>.md` holds one `## ` heading, its own `## [<version>] - date`, and no relative link (the App renders release notes as `CHANGELOG.md`); `CHANGELOG.md` and the files under `docs/changelog/`, and `docs/HANDOFF.md` and the files under `docs/handoff/` — and since PR-5 `docs/20_OPEN_QUESTIONS.md` and `docs/open-questions/`, `docs/spike-notes.md` and `docs/spike-notes/` — name each other in both directions. Eleven self-test cases, both directions
|
||||
14c. **`tools/buildid-check.ps1 -SelfTest`** (beta.18) — eight cases, both directions: a binary built from a dirty tree (`-dirty`, or the short form's `+`), one with no id, a missing one, and an expected id that is dirty or not an id are red. The live half needs the release's clean-checkout id and runs in `release.yml` over the published tree (§Release-time token substitution)
|
||||
15. `tools/resx-audit.ps1` — ~~**skipped loudly; it does not exist, and no `.resx` file does either**~~ **built 2026-09-13 (P3 PR-2)**: `-SelfTest` first (11 fixture cases, both directions), then the live pass over every `Strings.resx` family under `src/` — key sets equal across en/vi/ja, `Safety_*` in `ja` marked for review or signed, `Strings.Designer.cs` current with `tools/resx-gen.ps1`. A tree with no family is red (`09_I18N` §Translation workflow)
|
||||
|
||||
+5
-2
@@ -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`
|
||||
@@ -447,7 +450,7 @@ the comment below; the rest are fixed in the same train (beta.24 PR-2).
|
||||
| `cpp:S935` `FlGetBuildId` returns no value | 1 | **False positive** | `FL_BUILD_ID` is defined by the build (`12_BUILD` §Version); the analysis compiles without it. |
|
||||
| `cpp:S3519` out-of-bounds `memcpy` | 1 | **False positive** | `fl_patch_check.h` reads the prologue of a function this DLL hooked, under SEH, by design (`17_HOOK_ENGINE` §Unhooking). |
|
||||
| `cpp:S836` garbage value returned | 1 | **False positive** | `hook-harness`'s `VtableOf` reads the vtable of a COM object it created itself. |
|
||||
| `csharpsquid:S3869` `DangerousGetHandle` | 1 | **Accept** | `ParentDump` passes the dump file's handle to `MiniDumpWriteDump` inside the `using` that owns the stream, on the same thread, so it cannot be released during the call; CsWin32 generates no `SafeHandle` overload here (`NativeMethods.json`: `useSafeHandles: false`). |
|
||||
| `csharpsquid:S3869` `DangerousGetHandle` | 1 | **Accept** | `ParentDump` passes the dump file's handle to `MiniDumpWriteDump` inside the `using` that owns the stream, on the same thread, so it cannot be released during the call; CsWin32 generates no `SafeHandle` overload here (`NativeMethods.json`: `useSafeHandles: false`). **Raised again 2026-11-12:** #398 moved that call into `TryWriteOnce` (the dump is now tried three times), and SonarCloud tracks an issue by where it is — the accepted one closed and a new one opened on the same expression, as a blocker on new code. Nothing about the call changed; it is to be accepted again (HANDOFF owner-only item 38 (j)). |
|
||||
| `cpp:S1669`, `cpp:S6191`, `csharpsquid:S4036`, `githubactions:S7637`, `csharpsquid:S2190`, `S3427`, `S8949` | 35 | **Fixed** in beta.24 PR-2 — 5 of the 23 `S1669` were in the vendored Vulkan headers and leave with the exclusions | — |
|
||||
|
||||
**`cpp:S5813`, the 17 accepted, and why each string is terminated** (lines as of beta.24):
|
||||
|
||||
+9
-2
@@ -28,7 +28,7 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
|
||||
- **Ring buffer:** SPSC correctness under a hammering writer thread; seqlock torn-read detection; wrap and overwrite-oldest semantics; power-of-two capacity assumptions. Include the **one-full-lap case**: a reader stalled exactly `capacity` records must not validate a different frame as unchanged (this is what the never-reset `seq` counter defends, `07_IPC` §Protocol rules).
|
||||
- **Drop accounting:** the reader-side computation (`writeIndex - readIndex > capacity`) reports the right count and resumes at the right index. The writer has no drop counter to test — by design.
|
||||
- **Torn records produce gap markers,** not silently shortened streams; a golden test asserts the gap does not appear as a stutter.
|
||||
- **Record and header layout:** `static_assert(sizeof(...) == 64)` and `offsetof` assertions for `FlFrameRecord` **and all ~~three~~ four header structs** (`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.
|
||||
- **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.
|
||||
- **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.
|
||||
@@ -145,7 +145,7 @@ own work item on the STA thread and puts back — and with the keys a parameter,
|
||||
## Hook overhead measurement (NFR-1, per release)
|
||||
|
||||
1. `hook-harness` in a fixed workload, present-rate uncapped: 3 runs hooked vs 3 unhooked → mean present-call cost delta must be ≤ 1 µs (measured with QPC around the call site in an instrumented harness build).
|
||||
2. Real game, fixed 10-minute scene, capture ON vs OFF, 3 runs each: **game's own Avg FPS delta ≤ 0.5%**, Agent CPU ≤ 1% of a core, Agent RSS ≤ 150 MB, Overlay resident ≤ 8 MB.
|
||||
2. Real game, fixed 10-minute scene, capture ON vs OFF, 3 runs each: **game's own Avg FPS delta ≤ 0.5%**, Agent CPU ~~≤ 1%~~ ≤ 2.5 % of a core *(NFR-2 as D117 amended it, 2026-11-11; `tools/agent-cost.ps1` measures the unhooked half without a game)*, Agent RSS ≤ 150 MB, Overlay resident ≤ 8 MB.
|
||||
|
||||
> **NOT MEASURED. The runbook exists as of 2026-09-10 (P2 PR-G); the run is the owner's.**
|
||||
> `tools/fps-impact-runbook.ps1` sequences the six launches, holds consent granted for the ON leg and
|
||||
@@ -158,6 +158,13 @@ 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`.
|
||||
|
||||
## 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.~~
|
||||
|
||||
+215
-12
@@ -194,12 +194,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 |
|
||||
| ✅ 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 |
|
||||
| ✅ **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". |
|
||||
| ✅ **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
|
||||
@@ -300,6 +305,72 @@ So:
|
||||
> **`third_party/streamline/README.md` asserted this pass existed for five days
|
||||
> before it did**, which is why it is described here rather than only there.
|
||||
|
||||
### Which struct version carries which field (owner decision D115, 2026-11-11)
|
||||
|
||||
**A field of a vendor struct is read only where it is proven to be there.** A game hands a hook a struct of the
|
||||
version it was built against; a member a later version added lies past the end of what an older game allocated, and
|
||||
reading it is reading game memory outside the argument (rule 4) — not merely a wrong value. So every read of a tail
|
||||
member is gated on the struct's own version, and the gate comes from this table, not from the one header in the tree
|
||||
— which declares only the newest shape, and for `sl::DLSSOptions` says nothing about which version added what.
|
||||
|
||||
Established 2026-11-11 from the upstream tags, through GitHub's API: each tag's header was fetched by blob and the
|
||||
struct's declarations — type, name and order — compared across tags. The members' own types were checked at the
|
||||
oldest and the newest tag (`enum Boolean : char`, `enum class DLSSMode : uint32_t`, `enum class DLSSPreset :
|
||||
uint32_t`, `float2`/`float3`/`float4x4`; no `#pragma pack` in either).
|
||||
|
||||
**Streamline** (`NVIDIA-RTX/Streamline`; tags v2.0.0, v2.1.0, v2.2.0, v2.4.0, v2.4.15, v2.7.2, v2.7.30, v2.7.32,
|
||||
v2.8.0, v2.9.0, v2.10.0, v2.10.3, v2.11.1, v2.12.0, v2.14.1, v2.14.16):
|
||||
|
||||
| Struct | `structVersion` | First tag (blob of the header) | Members that version adds, in order |
|
||||
|---|---|---|---|
|
||||
| `sl::DLSSOptions` (`include/sl_dlss.h`) | 1 | v2.0.0 (`7de7411e507d`) | `mode`, `outputWidth`, `outputHeight`, `sharpness`, `preExposure`, `exposureScale`, `colorBuffersHDR`, `indicatorInvertAxisX`, `indicatorInvertAxisY`, `dlaaPreset`, `qualityPreset`, `balancedPreset`, `performancePreset`, `ultraPerformancePreset` |
|
||||
| | 2 | v2.1.0 (`60882f60e6f4`) | `ultraQualityPreset`, `useAutoExposure` |
|
||||
| | 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`). **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
|
||||
or version, so the question is whether the declaration ever changed:
|
||||
|
||||
| Struct | Tags | Result |
|
||||
|---|---|---|
|
||||
| `ffxDispatchDescUpscale` | v1.1.0 (`68860479bb94`) … v2.4.0 (`9d4a3e5f6c60`) | **one declaration in all ten**: twenty-three members, `flags` the last |
|
||||
| `ffxConfigureDescFrameGeneration` | v1.1.0 (`0ecdd4b4e59b`) … v2.4.0 (`823a3b4720f1`) | **one declaration in all ten**: thirteen members |
|
||||
| `FfxApiResource`, `FfxApiResourceDescription`, `FfxApiFloatCoords2D`, `FfxApiDimensions2D`, `FfxApiRect2D` | v1.1.0 … v2.4.0 | one declaration each in all ten |
|
||||
| `ffxQueryDescUpscaleGetGPUMemoryUsage` (`0x00010008`), `FfxApiEffectMemoryUsage` | from v1.1.2 | one declaration since; a game that sends the type knows the struct |
|
||||
| `ffxQueryDescUpscaleGetGPUMemoryUsageV2` (`0x00010009`) | from v2.0.0 | one declaration since |
|
||||
|
||||
**What follows for a hook** (Advanced metrics, train B):
|
||||
|
||||
- `sl::DLSSOptions`: a member is read at `structVersion >=` the row that adds it — never "at least 1" for the tail.
|
||||
- `sl::Constants`: everything this project may read is version 1's. The camera's position, axes and matrices are
|
||||
never read at any version (rule 4; the catalog's `PlayerState`).
|
||||
- `ffxDispatchDescUpscale`, `ffxConfigureDescFrameGeneration`: every member may be read on the ffx-api route, since
|
||||
no ffx-api release has a shorter one. `ffxDispatchDescFrameGenerationPrepareV2`'s camera arrays are never read.
|
||||
- **Not established, so nothing more is read there**: the FSR 3.0 host's legacy descriptors (`fsr3-v3.0.x`) beyond
|
||||
the `renderSize` the existing hook pins; any struct of a Streamline or FidelityFX release newer than the last tag
|
||||
above — a re-vendoring re-runs this comparison (`third_party/*/README.md` §Checklist).
|
||||
|
||||
### Ray tracing
|
||||
| Hook | Yields |
|
||||
|---|---|
|
||||
@@ -334,7 +405,7 @@ So:
|
||||
| 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` *(**never built.** The two hooks cannot be: neither function is an export — `20_OPEN_QUESTIONS` §M14. What a call-only route would take is read through in `spike-notes` §30, 2026-11-12, and waits for the owner's go or no)* | 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.
|
||||
@@ -571,7 +642,7 @@ Field notes — each of these was a defect in an earlier revision:
|
||||
- **SPSC lock-free ring**, capacity a power of two (default 8192 records = 512 KB), overwrite-oldest.
|
||||
- Writer/reader seqlock protocol, including the rule that the payload write must
|
||||
**exclude** the `seq` field and that `seq` is never reset: `07_IPC` §Protocol rules.
|
||||
- Header: ~~three~~ **four** separate 64-byte lines before the ring *(corrected 2026-10-04: since layout 4, 2026-09-27,
|
||||
- Header: ~~three~~ **four** separate 64-byte lines before the ring — and, since layout 5 (2026-11-11), region 5's twenty-three, which the watchdog alone writes and only while the Agent asks (`07_IPC` §Region 5) — *(corrected 2026-10-04: since layout 4, 2026-09-27,
|
||||
beta.10, `FlDisplayState` at 0xC0 — Overlay-written at most every 500 ms; the ring starts at 0x100)* — `FlShmHandshake` (write-once),
|
||||
`FlWriterState` (Overlay-written: `writeIndex`, `status`, `apiMask`, `faultCount`),
|
||||
and `FlControlBlock` (**Agent**-written: `pauseRequested`, `unhookRequested`,
|
||||
@@ -643,7 +714,7 @@ 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.
|
||||
- The trampoline call to the original is always executed exactly once, on every path, including error paths.
|
||||
|
||||
@@ -663,6 +734,82 @@ 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). 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.
|
||||
|
||||
@@ -691,6 +838,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
|
||||
@@ -702,13 +855,19 @@ 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).
|
||||
> **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
|
||||
@@ -719,15 +878,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**,
|
||||
@@ -753,7 +956,7 @@ verification a dev-machine-only affair before:
|
||||
- **WARP** (`D3D_DRIVER_TYPE_WARP`) — a software rasteriser, so no adapter is required.
|
||||
- **`CreateSwapChainForComposition`** — no `HWND`, so no dependency on a window station or an interactive session.
|
||||
|
||||
Current modes: `--probe-vtable` (§H4, ctest `fl_vtable_indices`), `--probe-proxy` (§H5, ctest `fl_proxy_swapchain`), `--probe-unhook` (§H7, ctest `fl_unhook_preserves_foreign`), `--probe-cost` (NFR-1, measurement only), **`--probe-frames`** (ctest `fl_frame_identity` — what counts as a frame, against `GetLastPresentCount`), **`--probe-d3d12`** (ctest `fl_d3d12_acquisition` — device → command queue → swapchain), `--present N`, `--hold N`, **`--real`** and **`--plus-ui K``**, **`--vulkan --hold-presenting N`** (P1 item 3, real loader, exit 77 = cannot run here) and **`--opengl --hold-presenting N`** (P1 item 4, gdi32 `SwapBuffers` on a hidden window, Microsoft's generic renderer — runs on CI). *(Added 2026-10-04, each with its own ctest: `--probe-d3d12-vtable`, `--probe-dxr`, `--probe-dxr-inputs`, `--probe-upscaler-resolve`, `--probe-sl-abi`, `--probe-ffx-resolve`, `--probe-sl-inputs`, `--probe-sl-seen`, `--probe-dxgi-count`; and the `--hold-presenting-*` injection fixtures with `--load` / `--load-after-ms`.)*
|
||||
Current modes: `--probe-vtable` (§H4, ctest `fl_vtable_indices`), `--probe-proxy` (§H5, ctest `fl_proxy_swapchain`), `--probe-unhook` (§H7, ctest `fl_unhook_preserves_foreign`), `--probe-cost` (NFR-1, measurement only), **`--probe-frames`** (ctest `fl_frame_identity` — what counts as a frame, against `GetLastPresentCount`), **`--probe-d3d12`** (ctest `fl_d3d12_acquisition` — device → command queue → swapchain), `--present N`, `--hold N`, **`--real`** and **`--plus-ui K``**, **`--vulkan --hold-presenting N`** (P1 item 3, real loader, exit 77 = cannot run here) and **`--opengl --hold-presenting N`** (P1 item 4, gdi32 `SwapBuffers` on a hidden window, Microsoft's generic renderer — runs on CI). *(Added 2026-10-04, each with its own ctest: `--probe-d3d12-vtable`, `--probe-dxr`, `--probe-dxr-inputs`, `--probe-upscaler-resolve`, `--probe-sl-abi`, `--probe-ffx-resolve`, `--probe-sl-inputs`, `--probe-sl-seen`, `--probe-dxgi-count`; and the `--hold-presenting-*` injection fixtures with `--load` / `--load-after-ms`.)* *(Added 2026-11-12, Advanced metrics train B: `--probe-adv-fields`, ctest `fl_adv_fields` — `fl_adv_fields.h` alone: a struct of a lower version is not read past its end, the vendors' sentinels never leave as values, the summaries, the publication, a new request starting afresh; and `--advanced` / `--ffx-memory-query v1|v2`, which make the `--hold-presenting-upscaled` and `--hold-presenting-ffx` fixtures send what Advanced metrics reads.)*
|
||||
|
||||
> **Every present here used to carry `DXGI_PRESENT_TEST`, which submits nothing.** Measured: 500 of them leave `GetLastPresentCount` at 0 while 37 real presents move it by 37. "N presents → N records" was therefore satisfiable only by a writer counting non-frames. `--real` issues real presents; the test-present path is kept as a named mode because it is what an alt-tabbed title actually runs.
|
||||
|
||||
|
||||
+196
-30
@@ -609,7 +609,8 @@ and labelled with the hardware's words. A sensor with no family is not read.
|
||||
costs 14 ms (62 ms elapsed)**. Once a second that refresh alone is 1.4% of one core, above NFR-2's 1% for the
|
||||
whole Agent. So NVAPI is read every tick and **the sensor library every fifth** (0.28%), and on the ticks between a
|
||||
sensor has no reading — its last value is not repeated. The same refresh is what the L2 telemetry layer does once
|
||||
a second in every session: that cost is not this feature's, and is `20_OPEN_QUESTIONS` §M16.
|
||||
a second in every session: that cost is not this feature's, and is `20_OPEN_QUESTIONS` §M16 — measured in a real
|
||||
Agent on 2026-11-11 (1.93 % of one core off, 2.04 % on) and answered by amending NFR-2 to 2.5 % (D117).
|
||||
|
||||
### From the reader to the ledger (built 2026-11-11; fed since the switch)
|
||||
|
||||
@@ -631,6 +632,17 @@ and labelled with the hardware's words. A sensor with no family is not read.
|
||||
`RecorderOptions.AdvancedMetrics` through `SettingsRecorderPolicy`, at each session's start like the other recording
|
||||
settings; exactly `1` is on. From there:
|
||||
|
||||
- **The process has one sensor library** *(2026-11-12)*. One *reader* was never the whole of it: a session's L2
|
||||
source and its CPU-temperature reader each open a LibreHardwareMonitor `Computer` of their own beside the
|
||||
Advanced reader's, and the library keeps part of its state — the driver it reads the processor through, its bus
|
||||
mutexes — per process. `Computer.Close()` lets go of that part whoever else is still reading. The first sessions
|
||||
recorded as administrator with PawnIO showed it (`20_OPEN_QUESTIONS` §M13): a processor device that faulted out
|
||||
some seconds after each session's sources closed, and one session whose reader could not open at all. Every
|
||||
`Computer` is now opened and closed through `Infrastructure.Telemetry.LhmLibrary` (`LhmComputerAdapter` is its
|
||||
user): opens and closes never run at once, and a `Computer` closed while another is in use is **parked** — left
|
||||
open, read by nobody, handed to the next user of the same groups — until the last user lets go, when all are
|
||||
closed. The reads are not serialised: the readers keep their own threads, so a sensor that hangs in one still
|
||||
holds up neither the other nor the pipe.
|
||||
- **The Agent has one reader** — `AgentServices` registers `AdvancedHardwareHub` as `IAdvancedHardware`, a tick a
|
||||
second and a linger of ten — and nothing starts it but a holder. `SessionRecorder` holds it for a session's length
|
||||
**only when the option is on**, and `AgentRecording` gives the session's `TelemetryPoller` the reader on the same
|
||||
@@ -703,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 | 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 | a plan of its own; overhead measured |
|
||||
| C | 0.1.0-beta.41 | Reflex latency per frame | a spike, then the owner's go or no |
|
||||
| D | 0.1.0-beta.42 | 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
|
||||
@@ -720,6 +733,154 @@ raises are the owner's: replacing the pointer the game receives is a **write**,
|
||||
a wrapper must outlive the Overlay's own unhook. If the spike cannot answer all of it, the route stays refused and
|
||||
the page says so.
|
||||
|
||||
### Train B (planned 2026-11-11, owner decisions D110–D116)
|
||||
|
||||
What the catalog marks `HookedCall` and `NewHook`. Planned the day train A shipped, the owner's decisions asked while
|
||||
planning, the design reviewed against the code before it was approved.
|
||||
|
||||
- **D111 — off means off inside the game too.** The Agent writes one word of the control block
|
||||
(`advancedRequested`, ~~0 or 1~~ 0 or that session's request, unconditionally at attach) when the session records Advanced metrics. The Overlay
|
||||
reads a new field, and installs a new hook, only while it is set; with the option off it hooks and reads exactly
|
||||
what 0.1.0-beta.39's does.
|
||||
**Built 2026-11-12 (0.1.0-beta.40, PR-3), with one thing the plan did not have:** "on" is not a 1 but a
|
||||
*request* — a value no session of that ring used before. A game outlives a session, and the Overlay's summaries
|
||||
with it; a second session of a game that kept running would have read the first one's field of view and counts.
|
||||
The watchdog starts its summaries afresh at a request it has not seen and names the request in every publication;
|
||||
the Agent reads only what answers its own (`07_IPC` §Region 5). The detours consult one process-local flag, the
|
||||
watchdog is the region's one writer, and `fl_guard` shows the off half on a target that sends everything: every
|
||||
byte of the region zero until asked, untouched after an "off", a count that starts again at the next request.
|
||||
**The Agent and the App, 2026-11-12 (PR-4).** A session that records Advanced metrics says so through
|
||||
`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 (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
|
||||
is rewritten when a range widens and not once a second; the readings ride the newest telemetry sample of the tick.
|
||||
**No schema change**: the facts go into `session_advanced.facts_json` beside the driver's, the series into
|
||||
`sensor_blobs` under their `adv.` names, the `.partial`'s chunks 9 and 10 carry both. `AdvancedSources.InGame`
|
||||
(optional; absent in every row 0.1.0-beta.39 wrote) says what became of those entries in the session: `Reading`,
|
||||
`NothingSeen` — measured inside the game, and the game made none of the calls where they can be seen — or
|
||||
`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
|
||||
`slEvaluateFeature`, the FSR upscale dispatch, the FSR memory query — shared-memory layout 5, the Agent and the
|
||||
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
|
||||
second release, the owner chose to release it at once. So: second release beta.42, third beta.43, train C
|
||||
beta.44, train D beta.45. Text written before that day says beta.41 and beta.42 for the second and third — in
|
||||
the released changelogs and the moved HANDOFF sections, which are not edited, and in the comments of `fl_shm.h`
|
||||
and `ShmLayout.cs`, which the release that fills each member rewrites (they were left so that the code loaded
|
||||
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
|
||||
carries which field): the table from the upstream tags, not the one header in the tree.
|
||||
- **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. 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.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,
|
||||
versions — and never the camera's position, axes or matrices.
|
||||
|
||||
### Left out, by name
|
||||
|
||||
Present in the vendored `nvapi.h`, readable from the Agent, and not in the inventory — each is either not a
|
||||
@@ -734,10 +895,13 @@ info-frame controls. `NvAPI_DISP_GetTiming` calculates a timing from an input an
|
||||
|
||||
One row per entry of `AdvancedMetricCatalog`, in its order; `AdvancedMetricCatalogTests` fails when this table and
|
||||
the catalog differ in either direction. **Reach** is where a value can be read from, or why it is not read: `Agent`
|
||||
(the Agent's own process), `AgentElevated` (the same, as administrator with PawnIO), `HookedCall` (an argument of a
|
||||
call the Overlay already hooks — Train B), `NewHook` (a hook that is not built — Train B), `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 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; 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`).
|
||||
|
||||
**NVAPI, the graphics card: facts**
|
||||
|
||||
@@ -880,33 +1044,35 @@ read by a build of Train A.
|
||||
|
||||
| Id | What it is | Scope | Source | Reach | Unit |
|
||||
|---|---|---|---|---|---|
|
||||
| `sl.dlss.output_size` | The output size the game gave DLSS | SessionFact | Streamline | HookedCall | Text |
|
||||
| `sl.dlss.presets` | The DLSS model preset per quality mode | SessionFact | Streamline | HookedCall | Text |
|
||||
| `sl.dlss.hdr_input` | The game told DLSS its colour buffers are HDR | SessionFact | Streamline | HookedCall | Flag |
|
||||
| `sl.dlss.auto_exposure` | DLSS auto-exposure | SessionFact | Streamline | HookedCall | Flag |
|
||||
| `sl.dlss.alpha_upscaling` | DLSS upscales the alpha channel | SessionFact | Streamline | HookedCall | Flag |
|
||||
| `sl.dlss.exposure` | Pre-exposure and exposure scale given to DLSS | SessionFact | Streamline | HookedCall | Text |
|
||||
| `ffx.upscale.sharpening` | FSR sharpening: on or off, and its strength | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.jitter` | The jitter offsets the game gave FSR | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.exposure` | Pre-exposure given to FSR | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.depth` | Near and far planes and field of view given to FSR | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.flags` | The flags of the game's FSR dispatch | SessionFact | FidelityFx | HookedCall | Text |
|
||||
| `ffx.upscale.frame_time_delta` | The frame time the game reported to FSR | Series | FidelityFx | HookedCall | Milliseconds |
|
||||
| `ffx.memory_usage` | FSR's own video memory, when the game asks it | Series | FidelityFx | HookedCall | Mebibytes |
|
||||
| `sl.dlss.output_size` | The output size the game gave DLSS | SessionFact | Streamline | Game | Text |
|
||||
| `sl.dlss.presets` | The DLSS model preset per quality mode | SessionFact | Streamline | Game | Table |
|
||||
| `sl.dlss.hdr_input` | The game told DLSS its colour buffers are HDR | SessionFact | Streamline | Game | Flag |
|
||||
| `sl.dlss.auto_exposure` | DLSS auto-exposure | SessionFact | Streamline | Game | Flag |
|
||||
| `sl.dlss.alpha_upscaling` | DLSS upscales the alpha channel | SessionFact | Streamline | Game | Flag |
|
||||
| `sl.dlss.exposure` | Pre-exposure and exposure scale given to DLSS | SessionFact | Streamline | Game | Table |
|
||||
| `ffx.upscale.sharpening` | FSR sharpening: on or off, and its strength | SessionFact | FidelityFx | Game | Table |
|
||||
| `ffx.upscale.jitter` | The largest jitter offset the game gave FSR | SessionFact | FidelityFx | Game | Table |
|
||||
| `ffx.upscale.exposure` | Pre-exposure given to FSR | SessionFact | FidelityFx | Game | Text |
|
||||
| `ffx.upscale.depth` | Near and far planes and the range of the field of view given to FSR | SessionFact | FidelityFx | Game | Table |
|
||||
| `ffx.upscale.flags` | The flags of the game's FSR dispatch | SessionFact | FidelityFx | Game | Text |
|
||||
| `ffx.upscale.frame_time_delta` | The frame time the game reported to FSR | Series | FidelityFx | Game | Milliseconds |
|
||||
| `ffx.memory_usage` | FSR's own video memory, when the game asks it | Series | FidelityFx | Game | Mebibytes |
|
||||
|
||||
**Inside the game: hooks that are not built**
|
||||
|
||||
| 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: routes a spike decides**
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1549,6 +1549,13 @@ 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.
|
||||
|
||||
### 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 +1868,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). |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| M13 ❓ | **Advanced metrics — LibreHardwareMonitor's CPU, memory, motherboard and storage groups, elevated, with PawnIO (D103, 2026-11-11).** Never opened by any build: §M10's elevated run has not been taken either, and this is a larger surface — a sensor chip on the LPC bus, the embedded controller, SPD over SMBus, SMART. Unknown: whether each group opens on the owner's board, what a refresh costs, whether opening the storage group touches removable drives (this PC once had a failing USB drive), and whether any group enables a privilege (`PrivilegeFootprintTests`). | **One elevated run with the probe verb, before the option exists.** Pre-committed: the storage group cannot be opened without touching removable drives → `lhm.storage.*` stays N/A in beta.39 and its reach reads `Deferred`; a node that throws twice → skipped for the session; the Agent above 1% of one core or 150 MB with the option on (NFR-2) → the slow groups are read less often or dropped before the release; a privilege enabled by a group → that group is not opened, and the owner is asked. **Two of the four answered 2026-11-11, before the option exists.** (1) **Storage: not opened, by the first outcome.** LibreHardwareMonitor 0.9.6's `StorageGroup` lists every drive through DiskInfoToolkit's `ReloadStorages` with no filter by bus and follows drives plugged in later — it cannot be opened without touching removable drives. `lhm.storage.*` reads `Deferred`, and `LhmGroups` has no member for it. (2) **Cost, unelevated, measured with `probe-advanced`** on the dev box: one refresh of the graphics-card group alone is 14 ms of processor time (62 ms elapsed) — 1.4% of one core at one a second, above NFR-2 — and one NVAPI read 0.4 ms. By the third outcome the sensor library is read every fifth tick (0.28%). **Still open, and the owner's**: the same probe as administrator with PawnIO — whether the processor, memory and motherboard groups open on this board, what they cost, and `PrivilegeFootprintTests`' new case on a token that holds the privileges (CI's does; the dev box's unelevated run passes by construction). **The first run was taken on 2026-11-12, by the owner, in ordinary use** (0.1.0-beta.40, the Agent as administrator with PawnIO, an i7-14700KF on a board with an IT8689E chip, an RTX 5080), and read here from a copy of the ledger and the Agent's log, not from a probe. **The groups open and read**: nine of ten sessions stored 119 processor series (a clock and a load per thread, temperatures, powers, voltages), 14 memory series and 21 motherboard series (six fans, six temperatures, nine voltages) beside the card's 41 — 195 from the sensor library in all. **No value was compared with another tool**; that is still the owner's. **Two faults, one cause** (`Infrastructure.Telemetry.LhmLibrary`): the Agent held up to three `Computer`s at once, and the library keeps the driver it reads the processor through and its bus mutexes per process — closing one `Computer` let go of them under the others. After seven sessions the Advanced reader's processor device threw `NullReferenceException` twice and was left alone (the page lost the processor until the reader reopened); once a session's start met another instance's close, the reader's `Open` threw `ObjectDisposedException`, and that session stored 17 series instead of 212. **Fixed 2026-11-12**: opens and closes are serialised and a `Computer` is parked, not closed, while another is in use. The cause is read from the log's timing and was not reproduced — it needs this elevation — so **whether the faults are gone is the owner's next sessions to show**: no `advanced: a device is left alone` and no `did not open` in the Agent's log. **First evidence, 2026-11-12, 0.1.0-beta.41, the same PC:** seven sessions between 06:38 and 07:01 with no `advanced:` line at all, each with the option on storing 212 or 213 series; on beta.40 that morning the processor device faulted out after each of six sessions (04:34–05:07) — thirteen of sixteen over the night. The reader failing to open was seen once in sixteen, so this is not yet enough to call that one gone. Still open: any value beside another tool. |
|
||||
| M16 ✅ | **The L2 telemetry layer's cost — the first number, and it is above NFR-2 (found 2026-11-11, measuring something else).** `LhmTelemetrySource` refreshes LibreHardwareMonitor's graphics-card group once a second in every recorded session. `probe-advanced` measured that refresh, through the same library and the same group, at **14 ms of processor time** on the dev box (RTX 5080, 41 mapped sensors, about twenty of them the Direct3D engine nodes the library enumerates per card) — 1.4% of one core, where NFR-2 allows the whole Agent 1% during capture and `14_TESTING` §Hook overhead's Agent figure has never been measured. This is a measurement of the call, not yet of a session: L2's own poller was not instrumented. | **Measure L2 in a session** (the Agent's processor time over a ten-minute capture, telemetry at 1000 ms and at 2000 ms). Pre-committed: at or under 1% → this row closes with the number; above → the owner chooses between a slower default for `telemetry.interval_ms`, reading the sensors the layer keeps from NVAPI on NVIDIA cards (L3 already has most, at 0.4 ms), or amending NFR-2 to what is measured. Not decided here, and nothing about L2 changes in the Advanced-metrics train. **Measured in a real Agent, 2026-11-11 (owner decision D110), and answered (D117).** `tools/agent-cost.ps1` runs the shipped `FrameLedger.Agent.exe --console capture` against a copy of hook-harness in a scratch data folder — a session that is not hooked, so the telemetry poller runs as in every session and nothing drains frames — and reads the Agent process's own processor time at exit; the cost per second is the slope between a 45 s and a 165 s session, two runs of each. Dev box (RTX 5080, not elevated, layers `l1+lhm+nvapi`): **19.3 ms of processor time per second of session = 1.93 % of one core with Advanced metrics off** (2,312 and 2,312 ms over 45 s; 4,594 and 4,656 ms over 165 s), **20.4 ms = 2.04 % with it on** (2,984 and 3,000; 5,547 and 5,344); peak working set 113 MiB and 119 MiB. A first pass with 30 s and 90 s sessions gave 1.56 % and 2.21 % — its two short runs differed by 670 ms, which is why the lengths were raised. So the probe's number holds in a session: the Agent's steady cost is about twice NFR-2's 1 %, nearly all of it the layer every session has always used, and the new option adds about a tenth of a percent. **The owner's answer: NFR-2 is amended to ≤ 2.5 % of one core** — the limit had never been measured, the sensors keep their one reading a second, and nothing in the code changes. Not measured: a hooked session (the drain's cost on top), a session with the Agent elevated and PawnIO's groups open, another PC. |
|
||||
| M14 ❓ | **Reflex latency per frame — is there a route within rules 4 and 5? (Train C, 2026-11-11.)** `17_HOOK_ENGINE` §Memory / latency names hooks on `NvAPI_D3D_SetSleepMode` / `SetLatencyMarker` and a call to `NvAPI_D3D_GetLatency`. NVAPI resolves all three through `nvapi_QueryInterface` by id — they are not exports, so a hook on them is a patch at an address learned at run time, the class refused on 2026-08-09. The route to try first needs no hook: the Overlay's own background thread **calls** `GetLatency` with the device of the swap chain it already hooks, once a second (the call returns the last 64 frames' reports). Unknown: whether calling into the driver from that thread is safe on every device kind, what it costs, what it returns when the game never enabled Reflex, and what it means for the Disclaimer's sentence about that thread. | **A spike on `hook-harness` and a stub first, then one real title.** Pre-committed: no route without a patch at a run-time address or a loader-lock call on the game's thread → Reflex stays N/A and the page says why; overhead above NFR-1 → the same. The owner says go or no on the spike's result. **2026-11-12 — the reading that comes before that spike is `spike-notes` §30** (owner decision D130: a document first, beside 0.1.0-beta.45; nothing was run). It finds: a hook on NVAPI's latency functions is the refused class, and a hook on Streamline's Reflex and PCL functions is train D's wrapper (§M15) — and would miss a game that fetched them before the attach, as `slInit` is missed (D129); the Overlay calling `slReflexGetState` itself breaks the thread contract the vendor's header states; **what remains is the route named in this row**, the Overlay calling two driver getters with the game's device, and a no-injection ETW route that gives the game-side markers only and makes the game post messages to its own window. Corrected there: `nvapi64.dll` exports **two** functions on the dev box (`nvapi_Direct_GetMethod` beside `nvapi_QueryInterface`), not one. The go or no is the owner's, and a go needs the owner's ruling that calling a driver getter with the game's device is inside rule 4. **2026-11-13 — the owner answered (D132, D133).** Route D goes to the spike this row names, on `hook-harness` and a stub `nvapi64.dll`, with the ruling: a driver's read-only getter called with the device of the swap chain the Overlay hooks is inside rule 4 (`CLAUDE.md`, the rule's note of that day). No real game before the owner has seen the result, and nothing shipped changes for the spike (`spike-notes` §31, written after 0.1.0-beta.46). Route C is **refused**; the ETW route **stays closed**, and §G is not reopened. |
|
||||
| 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 |
|
||||
|
||||
|
||||
+363
-87
@@ -77,117 +77,195 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
| `§beta.35` | [`handoff/history/0.1.0-beta.35.md`](handoff/history/0.1.0-beta.35.md) |
|
||||
| `§beta.36` | [`handoff/history/0.1.0-beta.36.md`](handoff/history/0.1.0-beta.36.md) |
|
||||
| `§beta.37` | [`handoff/history/0.1.0-beta.37.md`](handoff/history/0.1.0-beta.37.md) |
|
||||
| `§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) |
|
||||
| `§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-11, 0.1.0-beta.38: Qodana Ultimate in two reports — and the next work is the owner's "Thông số nâng cao"
|
||||
## **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.38.md`; this is what no other file carries.* This release closes the plan of
|
||||
2026-11-11 — **beta.37** → **alpha.4** → **Qodana Ultimate in two reports**. The plan was one session's, and its START
|
||||
HERE was moved whole: all three parts, the decisions D94–D100, the choices and the traps are
|
||||
[`handoff/history/0.1.0-beta.37.md`](handoff/history/0.1.0-beta.37.md) — the two Qodana sections are its last two.
|
||||
#384 moved the managed job to Qodana for .NET and settled what it reports; #385 added the C++ as a second report; this
|
||||
release ships the one change to shipped code that came of it: the App's link opener refuses anything but a web or a
|
||||
mail address.
|
||||
*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).
|
||||
|
||||
### NEXT — the owner's request of 2026-11-11, for the session(s) after this one
|
||||
### What this release decided, beyond D129–D131
|
||||
|
||||
Sent while this session was still running, and recorded here as it was written:
|
||||
- **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.
|
||||
|
||||
> "Xong phiên này, bạn cập nhật (những) phiên tiếp theo với các phiên bản về Setting "Thông số nâng cao" hoặc tương tự
|
||||
> và hiển thị tại 1 navigation riêng, khai thác số liệu, dữ liệu, biểu đồ mức tối đa, toản bộ mà các header `.h` của
|
||||
> Streamline và NVAPI hoặc pawnIO có thể sử dụng và hiển thị nhé."
|
||||
### Traps this train left
|
||||
|
||||
That is: once this session is done, the following session or sessions — and their versions — are about a setting
|
||||
called *"Thông số nâng cao"* (advanced metrics) or similar, shown in **a navigation item of its own**, that exploits
|
||||
to the maximum the numbers, the data and the charts that the `.h` headers of **Streamline** and **NVAPI**, or
|
||||
**PawnIO**, make available.
|
||||
- **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.
|
||||
|
||||
**Nothing of it was designed or begun here.** It is a new task, and it starts the way every train does — a plan, with
|
||||
the owner's decisions asked while planning. What follows is this session's reading, not the owner's words:
|
||||
### What the owner's seven sessions on beta.45 showed (2026-11-13)
|
||||
|
||||
- **An inventory comes first, from the headers in the tree**: `src/native/third_party/streamline`, `nvapi`,
|
||||
`fidelityfx`; and what LibreHardwareMonitorLib reads through PawnIO (CPU and board sensors — optional, elevated
|
||||
only). For each item: what it is, and **where it can be read from** — the Agent's own process (NVAPI through
|
||||
`FrameLedger.NvapiBridge`, LibreHardwareMonitor) or only inside the game, through a hook (Streamline).
|
||||
- **Anything read inside a game is a hook**, and the rules that govern hooks are not this feature's to bend: rules 4
|
||||
and 5, `17_HOOK_ENGINE` §Hook inventory, the overhead stated, the open S-series of `20_OPEN_QUESTIONS`; the
|
||||
anti-cheat guard and rule 2 untouched. Rule 6 governs any frame rate it shows beside frame generation, rule 7 any
|
||||
Yes/No it shows, and rule 8 says it calls nothing on the network.
|
||||
- **Questions that are the owner's**: on or off by default; what is stored in the ledger (a schema change, the size
|
||||
of a session) and what is shown live only; what a PC without an NVIDIA card shows (N/A, never a guess); whether
|
||||
the page asks for the elevation PawnIO needs; how many releases, and in what order.
|
||||
- **What a new page owes**: strings in `en`, `vi`, `ja`; `ACCESSIBILITY.md` §For contributors for the page and each
|
||||
chart; `LIMITATIONS.md` and the guide; `08_UI`.
|
||||
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.
|
||||
|
||||
#### Planned 2026-11-11, and approved by the owner — four trains, the first begun
|
||||
| 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 |
|
||||
|
||||
The plan was made the same day, the owner's decisions asked while planning. **The design, the decisions D101–D108 and
|
||||
the inventory are [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics**; what follows is only what that
|
||||
section does not carry — the order, and what was asked.
|
||||
- **`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).
|
||||
|
||||
- **The owner's four answers.** (1) Inside the game: **everything, in stages — and the refusal of 2026-08-09 is
|
||||
re-examined**, not taken as final. (2) **Stored in full with the session.** (3) **Off by default, and off means
|
||||
nothing more is read or stored**; the navigation item is hidden. (4) PawnIO: **the page says what is missing and
|
||||
links to the admin mode's setting** (D34); it never asks for the rights itself.
|
||||
- **Four trains, one release each, in this order**: **A** (0.1.0-beta.39) what the Agent can read — NVAPI,
|
||||
LibreHardwareMonitor — with storage and the page, **and nothing changed in code loaded into a game**; **B**
|
||||
(beta.40) inside the game, on calls already hooked and on functions Streamline exports, shared-memory layout 5;
|
||||
**C** (beta.41) Reflex latency, after a spike; **D** (beta.42) the Streamline state behind `slGetFeatureFunction`,
|
||||
after a spike. **Why this order**: A needs no hook, so it ships the page, the storage and the option first and
|
||||
every later train only fills rows; B is hooks of a kind already built; C and D are routes nobody has proven safe,
|
||||
and each ends in the owner's go or no.
|
||||
- **The approval covers train A whole** — its eight pull requests through the release. **B, C and D each begin with a
|
||||
plan of their own**, their decisions asked then. For D the owner will be asked one thing nothing else has needed:
|
||||
handing the game a wrapper in place of the function it asked for is a write, and rule 4 as written forbids it.
|
||||
- **Train A's pull requests**: (1) decisions, inventory, the catalog; (2) the NVAPI bridge's ABI 3 and the read-only
|
||||
gate; (3) LibreHardwareMonitor's groups and the shared reader, not yet composed; (4) the `.partial` chunks and
|
||||
schema 0023, produced by nobody yet; (5) the option goes live, with Privacy 2.15; (6) the pipe request and the
|
||||
App's feed; (7) the page, the navigation item, Ctrl+6; (8) the release. A setting and its guide text, a navigation
|
||||
item and its guide text, a schema script and its writer each land in ONE pull request — the guide tests, the
|
||||
viewer-mode test and the registry test are red otherwise.
|
||||
- **What the owner will be asked to run** (the release's owner-only item): the NVAPI rows on the RTX 5080 — CI has no
|
||||
driver and never takes that branch; one run as administrator with PawnIO, which is also the first there has ever
|
||||
been (`20_OPEN_QUESTIONS` §M10); the Agent's processor time and memory with the option on and off (NFR-2).
|
||||
- **A trap already paid for**: LibreHardwareMonitor's storage group may touch every drive when it opens, and this
|
||||
PC once had a failing USB drive. If the group cannot be opened without touching removable drives, storage stays
|
||||
N/A in beta.39 — decided before the first run, not after it. **It cannot (read in the library's source,
|
||||
2026-11-11), so it is not opened**: a drive's temperature reads N/A in beta.39, and the reason is on the page.
|
||||
- **Measure before composing.** `FrameLedger.CaptureHost probe-advanced` ran the reader on this PC before any Agent
|
||||
code used it, and found the sensor library's refresh at 14 ms of processor time — so the reader reads it every
|
||||
fifth tick. The same number says the telemetry layer every session already uses costs more than NFR-2 allows
|
||||
(`20_OPEN_QUESTIONS` §M16): **not this train's to fix, and the owner's to decide** — ask it when this train is out.
|
||||
### 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
|
||||
|
||||
- **`LogNoteW`** (`src/native/FrameLedger.Overlay/src/dllmain.cpp`): a function nothing calls, found by the native
|
||||
report and **not removed** — D100 changes code loaded into a game for a defect only, and dead code is not one. The
|
||||
owner says whether it goes (owner-only item 36 (d)); `.editorconfig` has a section, naming it, that goes with it.
|
||||
- ~~**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, as beta.37's and alpha.4's were in #384.~~ **Recorded
|
||||
2026-11-11, in the first pull request of the Advanced-metrics train: 0.1.0-beta.38 was released
|
||||
2026-11-11T02:56:51Z** from the signed tag on `b7d6550`, by run 42947853293 — one run for the one tag push, where
|
||||
alpha.4's push had started two. Eight assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed;
|
||||
the shipped natives carry `FL_BUILD_ID v0.1.0-beta.38`. The delta from beta.37 is 699,201 bytes beside a full
|
||||
package of 110,325,438 — "Delta processed 0452 files. 0022 patched, 0430 unchanged". The wiki was published by run
|
||||
42949461191. The rehearsal on the release branch (run 42944533749) had made a delta of 727,036 bytes with the same
|
||||
file counts.
|
||||
- **The Qodana licence** is read from the job's log (*Qodana license plan: Ultimate*, and the day the subscription is
|
||||
active until). When it lapses both jobs are red and advisory; `qodana.yaml`'s first comment is the way back.
|
||||
- **C# 15's constructs** wait for a ReSharper engine that reads them (`20_OPEN_QUESTIONS` §G, the row added with
|
||||
beta.37): the linter is now Qodana for .NET, whose engine is the same one — re-run the canary (`spike-notes` §29)
|
||||
when the action's pin moves.
|
||||
- **The alpha line rests** (D98). No sync and no alpha follow this release.
|
||||
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 36 — beta.38 on real hardware, the links, the two Qodana Cloud projects, and `LogNoteW`.
|
||||
**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).
|
||||
|
||||
## 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.
|
||||
@@ -466,6 +544,178 @@ section does not carry — the order, and what was asked.
|
||||
and `qodana.yaml` says the way back. (d) **`LogNoteW`**: the Overlay has one function nothing calls
|
||||
(`src/native/FrameLedger.Overlay/src/dllmain.cpp`). Say whether it is removed — a pull request of its own, eleven
|
||||
lines — or kept; either way the `.editorconfig` section that names it is then removed or reworded.
|
||||
37. **beta.39, Advanced metrics on real hardware** (D101–D109). (a) **The update from beta.38**: the terms window
|
||||
shows the **Privacy Policy 2.15** and the **Disclaimer 2.15** once; the ledger moves to schema 23 and every
|
||||
earlier session opens as before. (b) **The switch**: Settings ▸ Recording ▸ *Advanced metrics* on — **Advanced**
|
||||
appears as the last item on the left at once, **Ctrl+6** opens it; off — it goes, and Ctrl+6 does nothing.
|
||||
(c) **This PC, on the RTX 5080**: the facts (firmware, cores, memory sizes, the display's HDR and variable
|
||||
refresh), the *Right now* table beside the NVIDIA app or HWiNFO — the first comparison of any of these values
|
||||
with another tool — and the chart moving; a fan's *Read at* a few seconds behind the memory's. Leave the page: the
|
||||
Agent's log says the reader closes some fifteen seconds later, and opens again when the page does. (d) **A
|
||||
session with a real game, the option on**: it is on *Session* with its statistics and its chart; its summary has
|
||||
**Advanced metrics…** and the button opens it there; *variable refresh was active* and the colour space against
|
||||
what the game and the display really did; the driver's settings for the game against the NVIDIA app. A session
|
||||
recorded with the option off is not on the list. (e) **As administrator, with PawnIO installed** — the first run
|
||||
there has ever been (`20_OPEN_QUESTIONS` §M10, §M13): the processor per core, the memory and the motherboard's
|
||||
sensors appear on *This PC* and *Sources* says *Read*; watch for a pause or a hang when the page first opens,
|
||||
and compare a few values with HWiNFO. Without it, *Sources* gives the reason in words. (f) **What it costs**: the
|
||||
Agent's processor time and memory during a session with the option on and with it off (NFR-2: ~~1 %~~ 2.5 % of one
|
||||
core since D117, 150 MB) — ~~and with that in hand, the answer to §M16~~ §M16 was measured without a game and
|
||||
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.
|
||||
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** (START HERE §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).
|
||||
|
||||
**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 —
|
||||
@@ -588,6 +838,32 @@ Where each owner decision is recorded — the file and its section, and a label
|
||||
| D106 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics | a `.partial` chunk of an unknown type with a right checksum is skipped, where it ended the read |
|
||||
| D107 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics | with no game running the Agent reads sensors only while the page is open |
|
||||
| D108 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics | "never call a setter" is a build gate: every `NvAPI_*` call of the bridge is held to a committed list |
|
||||
| D110 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §M16 | the L2 telemetry layer's cost is measured in a real Agent before anything is changed (`tools/agent-cost.ps1`); what to do about the number is asked after |
|
||||
| D117 | [`02_SPEC.md`](02_SPEC.md) NFR-2 | asked with the measurement in hand (1.93 % off, 2.04 % on): NFR-2 is amended to ≤ 2.5 % of one core during capture; the sensors keep one reading a second and no code changes |
|
||||
| D111 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | inside the game too, off means nothing more is read: the Overlay reads new fields and installs new hooks only while the Agent's control word says the session records Advanced metrics |
|
||||
| D112 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | `slInit` is not hooked in train B; if ever, never `applicationId`, `projectId` or the paths |
|
||||
| D113 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | train B is three releases: beta.40 fields of calls already hooked (no new patch site), beta.41 `slSetConstants` + `ffxConfigure`, beta.42 `slGetFeatureVersion` + `slGetFeatureRequirements`; each waits for the owner's run of the one before; C is beta.43, D beta.44 |
|
||||
| D114 | [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B | the field of view is stored as a session's range, never as a series |
|
||||
| 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 | `HANDOFF` START HERE §NEXT | 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 |
|
||||
| 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`) |
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.39 was cut, 2026-11-11 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.39] - 2026-11-11
|
||||
|
||||
**The thirty-ninth pre-release: Advanced metrics.** A new setting, **off unless you switch it on** — Settings ▸
|
||||
Recording ▸ *Advanced metrics* — and a page of its own. With it on, the capture agent reads more from the graphics
|
||||
driver and the hardware sensors during a session and keeps it with the session: the graphics card's memory, load,
|
||||
clocks, fans, voltages and power in detail; what each display can do with HDR and variable refresh, and what the
|
||||
game's display did; the driver's settings, global and for the game; and — when the agent runs as administrator with
|
||||
PawnIO installed — the processor per core, the memory and the motherboard's sensors. The **Advanced** page (the last
|
||||
item on the left, **Ctrl+6**) shows it under what it belongs to: **This PC**, read only while the page is open and
|
||||
never stored; **Session**, what one session kept, in tables and a chart; **Sources**, every reading FrameLedger knows
|
||||
of and, for each one it does not read, why. With the setting off, nothing more is read or stored and the page is not
|
||||
there. The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**What it is not, yet.** None of these readings has been checked against another tool. The processor's, the memory's
|
||||
and the motherboard's sensors have never been read on real hardware — the first run as administrator with PawnIO is
|
||||
still to come. The driver's own figures exist on NVIDIA cards only, and no AMD or Intel card was tested. A drive's
|
||||
temperature is not read. Nothing is read inside the game by this release: the readings that need a hook come with
|
||||
later ones. `LIMITATIONS.md` §Sensors lists every limit.
|
||||
|
||||
**Updating from `0.1.0-beta.38`:** Help ▸ Check for updates, then *Restart to update* with no game running. The terms
|
||||
window shows the **Privacy Policy 2.15** and the **Disclaimer 2.15** once — they name what Advanced metrics reads and
|
||||
stores, only while it is on, and that PawnIO and the administrator mode then read more than the CPU temperature. The
|
||||
ledger moves to **schema 23** (two tables are added; nothing that was there changes), so a 0.1.0-beta.38 cannot open
|
||||
it afterwards. The detection rules stay at `2026.11.2`. With the setting off, nothing about capture or measurement
|
||||
changes: the code FrameLedger loads into a game — the overlay, the Vulkan layer, the shared-memory layout, the
|
||||
injector — is 0.1.0-beta.38's, line for line.
|
||||
|
||||
*The entries below are in the order the seven pull requests landed. One that says "not yet" describes that pull
|
||||
request; a later entry is what followed.*
|
||||
|
||||
### Added
|
||||
|
||||
- **"Advanced metrics" is planned, and its inventory is written — nothing reads it yet.** The owner asked for a
|
||||
setting, *Thông số nâng cao*, with a navigation item of its own that shows as much as the NVAPI and Streamline
|
||||
headers and PawnIO make available, each value under what it belongs to: one game session, or the PC. This pull
|
||||
request is the first of that train and changes nothing you can see or record. It adds the list everything else in
|
||||
the train reads — `AdvancedMetricCatalog`, 137 entries: what the Agent will read from NVAPI and
|
||||
LibreHardwareMonitor (the card's firmware, architecture and cores; its memory with evictions and promotions; its
|
||||
utilisation by domain; what a display can do with HDR and variable refresh; the driver's profile; and, as
|
||||
administrator with PawnIO, the processor per core, the motherboard, the memory modules and the drives'
|
||||
temperatures), what can only be read inside a game and waits for a later release, **and what is never read with the
|
||||
reason** — a serial number, a display's EDID, the list of programs that are encoding, the camera's position, what
|
||||
a vendor's licence closes. `docs/18_GPU_VENDOR_APIS.md` §Advanced metrics holds the design, the owner's decisions
|
||||
D101–D108 and the same list as a table; a test fails when the table and the catalog differ in either direction.
|
||||
|
||||
- **The NVIDIA bridge can read what Advanced metrics will show — and nothing calls it yet.**
|
||||
`FrameLedger.NvapiBridge.dll`, the library the Agent loads into its own process and never into a game, gains five
|
||||
reads (its ABI 3): the card's facts — firmware version, architecture, ray-tracing and tensor core counts, base and
|
||||
boost clocks, its memory sizes, the driver's package; what it says now — free and used video memory with evictions
|
||||
and promotions, the frame-buffer, video and bus utilisation, the performance state, the encoder's load; what each
|
||||
connected display can do with HDR and variable refresh; the state of the display a game presents on; and every
|
||||
setting of a driver profile. On the development PC's RTX 5080 all twenty facts and eight of the ten live groups
|
||||
answer — the card has no board or power-supply temperature sensor, so those two will read N/A.
|
||||
**It reads no identifier**: no serial number, no unique id, no display EDID, and not which programs are encoding.
|
||||
- **"The bridge never calls a setter" is now a build check.** A new gate, `tools/nvapi-readonly-check.ps1`, compares
|
||||
every NVAPI call in the bridge's source with a committed list of forty-four reads, in both directions, and refuses a
|
||||
name that sets, saves, restores, registers or controls something — or returns an identifier — even when someone
|
||||
adds it to the list.
|
||||
|
||||
- **The reader behind Advanced metrics exists, was measured on a real PC, and is still not switched on.** One
|
||||
reader for the whole Agent, on a thread of its own, that runs only while a session or the page needs it: NVIDIA's
|
||||
figures every second, and every sensor LibreHardwareMonitor has for the graphics card — each fan and its duty, the
|
||||
core voltage, PCI Express traffic, the load of every engine. When the Agent runs as administrator with PawnIO
|
||||
installed it will also read the processor per core, the memory and the motherboard's sensor chip.
|
||||
**A drive's temperature is not read**: the library cannot list drives without touching removable ones, so that
|
||||
group is never opened and the value will read N/A with that reason.
|
||||
- **`FrameLedger.CaptureHost probe-advanced`** (a developer tool, not shipped): runs that reader for a few seconds
|
||||
on your own rights and prints everything it read and what it cost. On the development PC it read 35 facts and 58
|
||||
values a second — and showed that one refresh of the sensor library takes 14 ms of processor time, so the reader
|
||||
refreshes it every five seconds, where NVIDIA's own figures (0.4 ms) stay at one a second.
|
||||
|
||||
- **The ledger can hold Advanced metrics — and holds none yet.** Schema 23 adds two tables: one for the facts of
|
||||
the PC, stored once per distinct set, and one for what a session recorded with the option on knows — its own
|
||||
facts, which sources answered and why the others did not, and the statistics of its extra series. Nothing is
|
||||
added to the session row itself, so what the JSON export and a bug bundle carry does not grow. The extra series
|
||||
are stored beside the others under names of their own, with a real "no reading" for a second in which a sensor
|
||||
was not read. One hour of them is about 0.2 MB. **A session recorded with the option off stores nothing of this**,
|
||||
and the option does not exist yet. *A 0.1.0-beta.38 cannot open a ledger a later build has migrated.*
|
||||
|
||||
- **Settings ▸ Recording ▸ Advanced metrics — the switch exists, off by default.** On, the capture agent reads more
|
||||
from the graphics driver and the hardware sensors during a session and stores it with the session: the graphics
|
||||
card's memory, load, clocks, fans, voltages and power in detail, what each display can do with HDR and variable
|
||||
refresh and what the game's display did, the driver's settings for the game — and, when the agent runs as
|
||||
administrator with PawnIO installed, the processor per core, the memory and the motherboard's sensors. **Off,
|
||||
nothing more is read or stored**, and the shared reader is not even started. It applies from the next session, and
|
||||
a session recorded while it was off is not filled in later. NVIDIA's figures are read once a second, the sensors
|
||||
every five. **No page shows what is stored yet** — that is the next pull requests' — and none of it is in an
|
||||
export or a bug report.
|
||||
- **The App can ask the agent what this PC reads right now — and no page asks yet.** A new request,
|
||||
`GetAdvancedMachine`, answers what the agent's shared reader last read: the PC's facts, the newest value of every
|
||||
series, and which sources answer or why they do not. It never touches a sensor itself, so it cannot hold up the
|
||||
pipe. Each request also keeps the reader running for five seconds, which is how "with no game running, sensors are
|
||||
read only while the page is open" works without anything telling the agent that a page closed. With Advanced
|
||||
metrics off it answers that it is off, and nothing is read. On the App's side `AdvancedMachineFeed` asks once a
|
||||
second while a page watches it and keeps each value with the moment it was read.
|
||||
- **The Advanced page.** While Advanced metrics is on, **Advanced** is the last item in the list on the left, and
|
||||
**Ctrl+6** opens it. **This PC** shows what the graphics driver and the sensors say right now — the card's
|
||||
firmware, cores and memory, what each display can do, the driver's settings, and every reading with the time it
|
||||
was read at and a chart of its last five minutes. It is read only while the page is open, and is not stored.
|
||||
**Session** shows what a session recorded with the option on kept: the PC as it was, what belonged to that session,
|
||||
the lowest, average and highest of each reading, and a chart over the session. **Sources** lists every reading
|
||||
FrameLedger knows of and, for each one it does not read, why — the agent is not an administrator, PawnIO is not
|
||||
installed, it comes with a later release, or it is never read. A session's summary has an **Advanced metrics…**
|
||||
button that opens that session there. In `en`, `vi` and `ja`; the user guide has a page for it.
|
||||
- **The terms window shows the Privacy Policy 2.15 and the Disclaimer 2.15 once.** The Privacy Policy names what
|
||||
Advanced metrics reads and stores, only while it is on, and what it never reads: a serial number, a display's
|
||||
identification data, a list of other programs. The Disclaimer's two sentences about PawnIO and about running the
|
||||
agent as administrator said "the CPU temperature"; they now also name the processor's, the memory's and the
|
||||
motherboard's sensors, read with Advanced metrics on. The same sentence changed in Settings, the first run, the
|
||||
administrator dialog, the guide and `LIMITATIONS.md`.
|
||||
|
||||
### Changed
|
||||
|
||||
- **A crash file from a newer build no longer loses its tail in an older one.** The file a session writes as it goes
|
||||
(so that a crash keeps what was recorded) is made of chunks; a reader that met a chunk of a kind it did not know
|
||||
stopped there. It now passes over a whole chunk it does not know and reads on.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A sentence in the documents that kept a function from being called.** `docs/18_GPU_VENDOR_APIS.md` said the
|
||||
vendored NVAPI headers do not declare `NvAPI_GPU_GetMemoryInfoEx`. They do — in `nvapi_lite_common.h`, which
|
||||
`nvapi.h` includes; the search that found nothing had looked in `nvapi.h` alone. The row is corrected, and the
|
||||
bridge will call it for the advanced memory rows. Nothing about the memory figures FrameLedger shows today changes.
|
||||
@@ -0,0 +1,99 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.40 was cut, 2026-11-12 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.40] - 2026-11-12
|
||||
|
||||
**The fortieth pre-release: Advanced metrics, inside the game.** With **Advanced metrics** on (Settings ▸ Recording;
|
||||
off unless you switch it on), a session of a game FrameLedger measures from inside now also keeps **what the game
|
||||
itself tells its upscaler**: for DLSS the output size, the model preset for each quality mode, whether the game said
|
||||
its colour buffers are HDR, auto-exposure, alpha upscaling and the exposure values; for FSR the sharpening, the
|
||||
largest jitter offset, the exposure, the near and far planes, the **range** of the field of view, the flags, the
|
||||
frame time the game reported and FSR's own video memory when the game asked for it. The **Advanced** page shows them
|
||||
under the session, in the vendor's own notation, and the session says in a sentence what became of them. With the
|
||||
setting off nothing more is read inside a game: the component in the game runs the same reads as before, and a test
|
||||
that injects into a window sending all of it finds the new memory region empty to the last byte. The same unsigned
|
||||
installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**What it is not, yet.** **None of this has been read from a real game** — only from the project's own test window.
|
||||
**Many games will show nothing**: most set their DLSS options through a call FrameLedger cannot intercept, and the
|
||||
FSR rows need FSR 3.1 or later through AMD's own library (a game that upscales through the older FSR 3.0 interface
|
||||
shows none). The session then says *the game made none of the calls these are read from* — which never means the
|
||||
game uses no upscaler; its summary names the upscaler as before. These are the game's words to the upscaler, not a
|
||||
check of what the upscaler did. **Never read:** where the camera is, which way it looks, its matrices — a build
|
||||
check refuses those names anywhere in the code loaded into a game. No new hook is installed by this release; two
|
||||
further steps of this train add hooks, each after this one has been run on real games. `LIMITATIONS.md` §Sensors
|
||||
lists every limit.
|
||||
|
||||
**Updating from `0.1.0-beta.39`:** Help ▸ Check for updates, then *Restart to update* with no game running. The terms
|
||||
window shows the **Privacy Policy 2.16** once — it names what is stored of the game's upscaler parameters, only with
|
||||
Advanced metrics on and only for a game FrameLedger injects into, and what is never read. The Disclaimer stays 2.15.
|
||||
**A game that is running when you update must be restarted before FrameLedger measures it again**: the shared memory
|
||||
between the game and the agent has a new layout (version 5), and the component inside the game is new. The ledger
|
||||
stays at schema 23 and the detection rules at `2026.11.2`.
|
||||
|
||||
*The entries below are in the order the four pull requests landed. One that says "not yet" describes that pull
|
||||
request; a later entry is what followed.*
|
||||
|
||||
### Added
|
||||
|
||||
- **Advanced metrics inside the game is planned — three releases, and nothing reads it yet.** The readings that
|
||||
exist only inside a game — the options a game gives DLSS and FSR, FSR's own memory, later the constants a game
|
||||
gives Streamline and its frame-generation configuration — come in three steps (owner decisions D110–D116):
|
||||
first more fields of calls FrameLedger already intercepts, with no new hook; then two new hooks; then two more.
|
||||
Each step waits for the one before to be run on real games. With Advanced metrics off, nothing more is read
|
||||
inside a game either. This pull request changes nothing you can see or record: it records the decisions, and
|
||||
**which version of each vendor struct carries which field**, compared across every upstream release of Streamline
|
||||
2.x and of the FidelityFX API — a field is read only where it is proven to be there.
|
||||
- **`tools/agent-cost.ps1`** (a developer tool): what the shipped capture agent costs while it records, measured on
|
||||
the real program against the project's own test window, with Advanced metrics off and on.
|
||||
|
||||
- **The shared memory between a game and the agent has room for what a game tells its upscaler — and nothing
|
||||
writes it yet.** Its layout is version 5: one new region, sized once for the three releases of this train, and
|
||||
one new word by which the agent says "this session records Advanced metrics". With that word at zero — every
|
||||
session, until the next pull request, and afterwards every session with the option off — the region stays empty and
|
||||
the component inside the game does exactly what it did before. **A game that is running when you update must be
|
||||
restarted before FrameLedger measures it again**, as after every update.
|
||||
|
||||
- **The component inside a game can read what the game tells its upscaler — and only when asked.** For a game
|
||||
FrameLedger injects into, and only while the agent asks for it (nothing asks yet: that is the next pull request,
|
||||
and then only with Advanced metrics on), the calls FrameLedger already intercepts are read a little further: the
|
||||
options a game hands DLSS with each evaluation (output size, presets, exposure, three switches), what it hands
|
||||
FSR with each upscale (sharpening, the jitter's size, exposure, the depth range, the field of view as a range,
|
||||
flags, the frame time it reports), and FSR's own memory when the game itself asks for it. **No new hook**, and
|
||||
with the request off the same code as before runs: a test injects into a window that sends all of it and finds
|
||||
the new memory region empty to the last byte. **Never the camera's position, its axes or its matrices** — a
|
||||
build check now refuses those names anywhere in the code loaded into a game (`tools/overlay-fields-check.ps1`).
|
||||
Many games set their DLSS options through a call that cannot be intercepted, and will show nothing here.
|
||||
Measured cost while asked: 22–23 billionths of a second per frame for FSR, 10–12 for DLSS; not measurable when
|
||||
not asked.
|
||||
- **A second session of a game that kept running starts its summaries afresh.** The ranges and counts kept inside the
|
||||
game belong to the session that asked for them: each session asks with a request of its own, and the agent reads
|
||||
only what answers it.
|
||||
|
||||
- **Advanced metrics: what the game tells DLSS and FSR, kept with the session.** With Advanced metrics on, a session
|
||||
of a game FrameLedger measures from inside now also keeps what the game itself handed to its upscaler: for DLSS the
|
||||
output size, the model preset for each quality mode, whether the game said its colour buffers are HDR,
|
||||
auto-exposure, alpha upscaling and the exposure values; for FSR the sharpening, the largest jitter offset, the
|
||||
exposure, the near and far planes, the **range** of the field of view, the flags, the frame time the game reported
|
||||
(as a chart) and FSR's own video memory at the moments the game asked. The Advanced page shows them under the
|
||||
session, in the vendor's own notation. **Many games will show nothing**, and the session says why — most games
|
||||
set their DLSS options through a call FrameLedger cannot see, and the FSR rows need FSR 3.1 or later through AMD's
|
||||
library; it never means the game uses no upscaler. **Never read:** where the camera is, which way it looks, its
|
||||
matrices. With the option off nothing more is read inside a game, exactly as before. Not yet read from a real game.
|
||||
- **Privacy Policy 2.16** names the above: what is stored, only with the option on and only for a game FrameLedger
|
||||
injects into, and what is never read. You are shown it once after updating.
|
||||
|
||||
### Changed
|
||||
|
||||
- **The agent's processor budget says what was measured.** The specification promised that the capture agent uses
|
||||
at most 1 % of one processor core while recording; nobody had measured it. Measured on the development PC it is
|
||||
1.93 % — 2.04 % with Advanced metrics on — nearly all of it the once-a-second read of the graphics card's sensors
|
||||
that every session has always made, and its memory is 113 MiB (119 with the option on) against a limit of 150.
|
||||
The owner chose to keep the readings and amend the limit: **NFR-2 is now ≤ 2.5 % of one core** (D117). Nothing the
|
||||
agent does changes.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A crash dump is tried up to three times.** When FrameLedger or its agent stops on an error it never expected, a
|
||||
small helper writes a dump of the program for a bug report - while the program's other threads are still
|
||||
running. Windows can fail that once when the program changes under it, and one failure used to mean no dump at
|
||||
all. It is now tried again, twice, a moment apart.
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.41 was cut, 2026-11-12 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.41] - 2026-11-12
|
||||
|
||||
**The forty-first pre-release: one fix, for Advanced metrics with the agent as administrator.** If you run the
|
||||
capture agent as administrator with PawnIO installed and have **Advanced metrics** on, 0.1.0-beta.40 and
|
||||
0.1.0-beta.39, which has the same code and where it was not looked for, could lose sensors: after most sessions the Advanced page stopped showing the processor's readings
|
||||
until it was reopened, and now and then a whole session was stored with the graphics driver's seventeen readings
|
||||
and none of the two hundred from the sensor library. The agent was closing the sensor library in one place while
|
||||
another place was still reading it. It now opens and closes it in one place only, and never while something is
|
||||
reading. If you do not use that combination, nothing changes for you. The same unsigned installer: verify its hash
|
||||
against `SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**What it is not, yet.** The fix was made from the agent's log of ten real sessions; the fault needs an
|
||||
administrator's agent with PawnIO to show, and has not been seen to be gone on such a PC yet. After a few sessions
|
||||
the agent's log (Logs page) should no longer say *a device is left alone* or *the sensor library did not open*.
|
||||
Everything 0.1.0-beta.40's notes say is not yet done still stands.
|
||||
|
||||
**Updating from `0.1.0-beta.40`:** 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
|
||||
FrameLedger loads into a game — the overlay, the Vulkan layer, the shared-memory layout, the injector — is
|
||||
0.1.0-beta.40's, line for line**; as after every update, a game that was running across it must be restarted
|
||||
before it is measured again.
|
||||
|
||||
**A note on numbers.** The plan for Advanced metrics had named 0.1.0-beta.41 for its next step inside the game (two
|
||||
new hooks). This fix took the number; that step is now 0.1.0-beta.42, and the ones after it move by one as well.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Advanced metrics: the processor's sensors no longer drop out after a session, and a session no longer loses its
|
||||
sensors at the start.** With the agent running as administrator and PawnIO installed, the sensor library was being
|
||||
closed by one part of the agent while another part was still reading it. After most sessions the Advanced page
|
||||
lost the processor's readings until it was reopened, and one session in ten stored only the graphics driver's
|
||||
seventeen series instead of two hundred and twelve. The agent now opens and closes the sensor library in one
|
||||
place, and does not close it while anything is still reading. Found in the first sessions recorded that way; the
|
||||
cause was read from the log and could not be reproduced without that setup, so the next sessions will show
|
||||
whether it is gone — the agent's log should no longer say *a device is left alone* or *the sensor library did not
|
||||
open*. Nothing changes in the code loaded into a game.
|
||||
- **Two comparisons in the Advanced-metrics code say what they mean.** Whether a game gave FSR one field of view or
|
||||
a range of them was decided by comparing two decimal numbers for equality; it is now decided by comparing the two
|
||||
stored values bit for bit. Nothing you see changes. (Found by SonarCloud after 0.1.0-beta.40 was merged.)
|
||||
@@ -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.
|
||||
@@ -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.)
|
||||
@@ -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).
|
||||
@@ -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.
|
||||
@@ -0,0 +1,104 @@
|
||||
# HANDOFF history — 0.1.0-beta.38
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.39 was cut, 2026-11-11 (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/`.*
|
||||
|
||||
## **START HERE** — 2026-11-11, 0.1.0-beta.38: Qodana Ultimate in two reports — and the next work is the owner's "Thông số nâng cao"
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.38.md`; this is what no other file carries.* This release closes the plan of
|
||||
2026-11-11 — **beta.37** → **alpha.4** → **Qodana Ultimate in two reports**. The plan was one session's, and its START
|
||||
HERE was moved whole: all three parts, the decisions D94–D100, the choices and the traps are
|
||||
[`handoff/history/0.1.0-beta.37.md`](handoff/history/0.1.0-beta.37.md) — the two Qodana sections are its last two.
|
||||
#384 moved the managed job to Qodana for .NET and settled what it reports; #385 added the C++ as a second report; this
|
||||
release ships the one change to shipped code that came of it: the App's link opener refuses anything but a web or a
|
||||
mail address.
|
||||
|
||||
### NEXT — the owner's request of 2026-11-11, for the session(s) after this one
|
||||
|
||||
Sent while this session was still running, and recorded here as it was written:
|
||||
|
||||
> "Xong phiên này, bạn cập nhật (những) phiên tiếp theo với các phiên bản về Setting "Thông số nâng cao" hoặc tương tự
|
||||
> và hiển thị tại 1 navigation riêng, khai thác số liệu, dữ liệu, biểu đồ mức tối đa, toản bộ mà các header `.h` của
|
||||
> Streamline và NVAPI hoặc pawnIO có thể sử dụng và hiển thị nhé."
|
||||
|
||||
That is: once this session is done, the following session or sessions — and their versions — are about a setting
|
||||
called *"Thông số nâng cao"* (advanced metrics) or similar, shown in **a navigation item of its own**, that exploits
|
||||
to the maximum the numbers, the data and the charts that the `.h` headers of **Streamline** and **NVAPI**, or
|
||||
**PawnIO**, make available.
|
||||
|
||||
**Nothing of it was designed or begun here.** It is a new task, and it starts the way every train does — a plan, with
|
||||
the owner's decisions asked while planning. What follows is this session's reading, not the owner's words:
|
||||
|
||||
- **An inventory comes first, from the headers in the tree**: `src/native/third_party/streamline`, `nvapi`,
|
||||
`fidelityfx`; and what LibreHardwareMonitorLib reads through PawnIO (CPU and board sensors — optional, elevated
|
||||
only). For each item: what it is, and **where it can be read from** — the Agent's own process (NVAPI through
|
||||
`FrameLedger.NvapiBridge`, LibreHardwareMonitor) or only inside the game, through a hook (Streamline).
|
||||
- **Anything read inside a game is a hook**, and the rules that govern hooks are not this feature's to bend: rules 4
|
||||
and 5, `17_HOOK_ENGINE` §Hook inventory, the overhead stated, the open S-series of `20_OPEN_QUESTIONS`; the
|
||||
anti-cheat guard and rule 2 untouched. Rule 6 governs any frame rate it shows beside frame generation, rule 7 any
|
||||
Yes/No it shows, and rule 8 says it calls nothing on the network.
|
||||
- **Questions that are the owner's**: on or off by default; what is stored in the ledger (a schema change, the size
|
||||
of a session) and what is shown live only; what a PC without an NVIDIA card shows (N/A, never a guess); whether
|
||||
the page asks for the elevation PawnIO needs; how many releases, and in what order.
|
||||
- **What a new page owes**: strings in `en`, `vi`, `ja`; `ACCESSIBILITY.md` §For contributors for the page and each
|
||||
chart; `LIMITATIONS.md` and the guide; `08_UI`.
|
||||
|
||||
#### Planned 2026-11-11, and approved by the owner — four trains, the first begun
|
||||
|
||||
The plan was made the same day, the owner's decisions asked while planning. **The design, the decisions D101–D108 and
|
||||
the inventory are [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced metrics**; what follows is only what that
|
||||
section does not carry — the order, and what was asked.
|
||||
|
||||
- **The owner's four answers.** (1) Inside the game: **everything, in stages — and the refusal of 2026-08-09 is
|
||||
re-examined**, not taken as final. (2) **Stored in full with the session.** (3) **Off by default, and off means
|
||||
nothing more is read or stored**; the navigation item is hidden. (4) PawnIO: **the page says what is missing and
|
||||
links to the admin mode's setting** (D34); it never asks for the rights itself.
|
||||
- **Four trains, one release each, in this order**: **A** (0.1.0-beta.39) what the Agent can read — NVAPI,
|
||||
LibreHardwareMonitor — with storage and the page, **and nothing changed in code loaded into a game**; **B**
|
||||
(beta.40) inside the game, on calls already hooked and on functions Streamline exports, shared-memory layout 5;
|
||||
**C** (beta.41) Reflex latency, after a spike; **D** (beta.42) the Streamline state behind `slGetFeatureFunction`,
|
||||
after a spike. **Why this order**: A needs no hook, so it ships the page, the storage and the option first and
|
||||
every later train only fills rows; B is hooks of a kind already built; C and D are routes nobody has proven safe,
|
||||
and each ends in the owner's go or no.
|
||||
- **The approval covers train A whole** — its eight pull requests through the release. **B, C and D each begin with a
|
||||
plan of their own**, their decisions asked then. For D the owner will be asked one thing nothing else has needed:
|
||||
handing the game a wrapper in place of the function it asked for is a write, and rule 4 as written forbids it.
|
||||
- **Train A's pull requests**: (1) decisions, inventory, the catalog; (2) the NVAPI bridge's ABI 3 and the read-only
|
||||
gate; (3) LibreHardwareMonitor's groups and the shared reader, not yet composed; (4) the `.partial` chunks and
|
||||
schema 0023, produced by nobody yet; (5) the option goes live, with Privacy 2.15; (6) the pipe request and the
|
||||
App's feed; (7) the page, the navigation item, Ctrl+6; (8) the release. A setting and its guide text, a navigation
|
||||
item and its guide text, a schema script and its writer each land in ONE pull request — the guide tests, the
|
||||
viewer-mode test and the registry test are red otherwise.
|
||||
- **What the owner will be asked to run** (the release's owner-only item): the NVAPI rows on the RTX 5080 — CI has no
|
||||
driver and never takes that branch; one run as administrator with PawnIO, which is also the first there has ever
|
||||
been (`20_OPEN_QUESTIONS` §M10); the Agent's processor time and memory with the option on and off (NFR-2).
|
||||
- **A trap already paid for**: LibreHardwareMonitor's storage group may touch every drive when it opens, and this
|
||||
PC once had a failing USB drive. If the group cannot be opened without touching removable drives, storage stays
|
||||
N/A in beta.39 — decided before the first run, not after it. **It cannot (read in the library's source,
|
||||
2026-11-11), so it is not opened**: a drive's temperature reads N/A in beta.39, and the reason is on the page.
|
||||
- **Measure before composing.** `FrameLedger.CaptureHost probe-advanced` ran the reader on this PC before any Agent
|
||||
code used it, and found the sensor library's refresh at 14 ms of processor time — so the reader reads it every
|
||||
fifth tick. The same number says the telemetry layer every session already uses costs more than NFR-2 allows
|
||||
(`20_OPEN_QUESTIONS` §M16): **not this train's to fix, and the owner's to decide** — ask it when this train is out.
|
||||
|
||||
### Left open by this session
|
||||
|
||||
- **`LogNoteW`** (`src/native/FrameLedger.Overlay/src/dllmain.cpp`): a function nothing calls, found by the native
|
||||
report and **not removed** — D100 changes code loaded into a game for a defect only, and dead code is not one. The
|
||||
owner says whether it goes (owner-only item 36 (d)); `.editorconfig` has a section, naming it, that goes with it.
|
||||
- ~~**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, as beta.37's and alpha.4's were in #384.~~ **Recorded
|
||||
2026-11-11, in the first pull request of the Advanced-metrics train: 0.1.0-beta.38 was released
|
||||
2026-11-11T02:56:51Z** from the signed tag on `b7d6550`, by run 42947853293 — one run for the one tag push, where
|
||||
alpha.4's push had started two. Eight assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed;
|
||||
the shipped natives carry `FL_BUILD_ID v0.1.0-beta.38`. The delta from beta.37 is 699,201 bytes beside a full
|
||||
package of 110,325,438 — "Delta processed 0452 files. 0022 patched, 0430 unchanged". The wiki was published by run
|
||||
42949461191. The rehearsal on the release branch (run 42944533749) had made a delta of 727,036 bytes with the same
|
||||
file counts.
|
||||
- **The Qodana licence** is read from the job's log (*Qodana license plan: Ultimate*, and the day the subscription is
|
||||
active until). When it lapses both jobs are red and advisory; `qodana.yaml`'s first comment is the way back.
|
||||
- **C# 15's constructs** wait for a ReSharper engine that reads them (`20_OPEN_QUESTIONS` §G, the row added with
|
||||
beta.37): the linter is now Qodana for .NET, whose engine is the same one — re-run the canary (`spike-notes` §29)
|
||||
when the action's pin moves.
|
||||
- **The alpha line rests** (D98). No sync and no alpha follow this release.
|
||||
|
||||
**Owner-only:** item 36 — beta.38 on real hardware, the links, the two Qodana Cloud projects, and `LogNoteW`.
|
||||
@@ -0,0 +1,111 @@
|
||||
# HANDOFF history — 0.1.0-beta.39
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.40 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/`.*
|
||||
|
||||
## **START HERE** — 2026-11-11, 0.1.0-beta.39: Advanced metrics, train A — and train B begins with a plan of its own
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.39.md`; this is what no other file carries.* The owner's request of 2026-11-11
|
||||
— a setting, *Thông số nâng cao*, with a navigation item of its own — was planned the same day, approved, and its
|
||||
**first train of four is this release**: what the Agent can read (NVAPI, LibreHardwareMonitor), stored with the
|
||||
session, shown on a page, and **nothing changed in code loaded into a game**. Seven pull requests and this one:
|
||||
#387 (decisions, inventory, the catalog), #388 (the NVAPI bridge's ABI 3, the read-only gate), #389 (the shared
|
||||
reader, measured before composed), #390 (schema 0023, the `.partial` chunks), #391 (the switch, Privacy 2.15,
|
||||
Disclaimer 2.15), #392 (the pipe request, the App's feed), #393 (the page, the navigation item, Ctrl+6). **The
|
||||
design, the decisions D101–D108 and the inventory are [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Advanced
|
||||
metrics; the screen is `08_UI` §Advanced.** The request as the owner wrote it, the four answers and the order of the
|
||||
four trains are [`handoff/history/0.1.0-beta.38.md`](handoff/history/0.1.0-beta.38.md) §NEXT.
|
||||
|
||||
### What this train decided that the plan had not
|
||||
|
||||
- **D109 — the Disclaimer goes to 2.15 with the Privacy Policy.** The plan approved the Privacy Policy's content only.
|
||||
Writing #391 found two sentences of the Disclaimer (§5, §5A) that said PawnIO and the admin mode were for the CPU
|
||||
temperature alone, which the option makes false; the owner was asked with both quoted and chose to amend them. The
|
||||
admin mode's own disclosure followed (`agent-admin-dialog/2`).
|
||||
- **Storage is not read at all** (D103's outcome, decided before the first run): LibreHardwareMonitor cannot list
|
||||
drives without touching removable ones, so the group is never opened and a drive's temperature is N/A with that
|
||||
reason. Power supplies and fan controllers are refused for the same kind of reason (a search of every USB device).
|
||||
- **The sensors are read every fifth second**, NVIDIA's figures every second — set by a measurement
|
||||
(`CaptureHost probe-advanced`: 14 ms of processor time per refresh of the sensor library), not by taste.
|
||||
- **The page's hold on the reader is the request itself**: nothing tells the Agent that a page opened or closed
|
||||
(`07_IPC` `GetAdvancedMachine`). A design with an "open" and a "close" message was not written, because a pipe
|
||||
that drops would leave the reader running.
|
||||
|
||||
### NEXT
|
||||
|
||||
1. ~~**Ask the owner `20_OPEN_QUESTIONS` §M16 before anything else.**~~ **Asked 2026-11-11 — D110: measure it in a
|
||||
real Agent first.** `tools/agent-cost.ps1` does, and §M16 holds the numbers: 1.93 % of one core with Advanced
|
||||
metrics off, 2.04 % on. **D117: NFR-2 is amended to ≤ 2.5 %**; nothing in the code changes.
|
||||
2. ~~**Train B (0.1.0-beta.40) starts with a plan of its own**~~ **Train B was planned and approved the same day**
|
||||
(D111–D116): [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B is the design. What that section does not
|
||||
carry:
|
||||
- **The approval covers 0.1.0-beta.40 whole** — five pull requests: (1) the decisions, the struct-version table,
|
||||
§M16 measured; (2) shared-memory layout 5, written by nobody yet; (3) the Overlay reads the extra fields of the
|
||||
calls it already hooks, behind the control word, with `overlay-fields-check` and the overhead measured; (4) the
|
||||
Agent's sampler, the catalog's new reach, the page's words, Privacy 2.16; (5) the release, owner-only item 38.
|
||||
- **beta.41 and beta.42 are designed and not begun.** Each starts only when the owner says the release before it
|
||||
passed its owner-only item on real games — that wait is what the split is for.
|
||||
- **The design was reviewed against the code before approval, and the review changed it**: the split itself; the
|
||||
struct-version table (the tree holds one version of each header); storing a vendor `Boolean` or preset as its
|
||||
value plus one and refusing the vendors' sentinels (`INVALID_FLOAT` is FLT_MAX); flags as "ever seen" masks and
|
||||
the frame time as a sum the watchdog drains, since a value sampled once a second aliases a per-frame one; the
|
||||
new region written by the watchdog alone and only while requested; `AdvancedSources`' new member optional, so a
|
||||
beta.39 row still parses; `kMaxPatches = 48` to be checked before a patch is added.
|
||||
3. **Trains C and D** (Reflex latency; the Streamline state behind `slGetFeatureFunction`) each begin with a spike
|
||||
and end in the owner's go or no. D needs an amendment of rule 4 if it goes ahead — handing the game a wrapper is
|
||||
a write — and that question is put to the owner then, not assumed.
|
||||
|
||||
### 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, as beta.38's were in #387.~~ **Recorded 2026-11-11, in the
|
||||
first pull request of train B: 0.1.0-beta.39 was released 2026-11-11T13:52:07Z** from the signed tag on `e63cd49`
|
||||
(#394), by run 43031168146 — 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.39`.
|
||||
The delta from beta.38 is 3,144,205 bytes beside a full package of 110,678,706 — "Delta processed 0452 files. 0026
|
||||
patched, 0426 unchanged". The wiki was published by run 43033077805. The rehearsal on the release branch (run
|
||||
43026873256) had made a delta of 3,159,090 bytes with the same file counts.
|
||||
- **Nothing here was seen in the running App.** The page was rendered to images from a test over fixture data and
|
||||
looked at; a chart does not render into such an image. No real Agent answered a real App, no session was recorded
|
||||
with the option on, and no value was compared with another tool. All of that is owner-only item 37.
|
||||
- **The first run as administrator with PawnIO is still to come** (`20_OPEN_QUESTIONS` §M10, §M13): the processor,
|
||||
memory and motherboard groups have been opened on no PC. The reader leaves a device alone after two faults, and
|
||||
runs on a thread of its own, so a sensor that hangs holds up neither a session's samples nor the pipe — that is
|
||||
the design, and it has not been tried.
|
||||
- **The `vi` strings were written by the assistant and the `ja` ones are marked `review`** — 245 keys each, every
|
||||
catalog entry among them.
|
||||
- **`LogNoteW`** is still there (owner-only item 36 (d)), and the alpha line still rests (D98): no alpha follows this
|
||||
release.
|
||||
|
||||
### Traps this train paid for
|
||||
|
||||
- **A pull request whose workflows never start.** #390 was opened and GitHub started none of its three workflows —
|
||||
`gh pr checks` said "no checks reported" ten minutes later, with nothing queued. Closing and reopening the pull
|
||||
request starts them (`pull_request: reopened`); **closing drops auto-merge, so enable it again.** After every
|
||||
`gh pr create`, ask the API for the runs of the head commit before walking away.
|
||||
- **`ShmDrainIntegrationTests.TheGuardInjectsTheOverlayAndTheReaderDrainsRealFrames` was red once** in a local gate
|
||||
(#392's first run): the guard's re-scan refused the harness mid-run, under the gate's load. It passed alone and in
|
||||
the rerun; nothing in that pull request is on its path; it was not diagnosed. ~~If it shows again, read the verdict's
|
||||
reason first — the assertion prints only that it was a refusal.~~ **It showed again the same day** (train B's first
|
||||
local gate), on another line: the Overlay's status was still `Init` with fifty records already drained. That one
|
||||
is a race in the test and is fixed — the Overlay publishes `Ready` after its last hook, later than its first
|
||||
record, so the test now waits `Init` out, bounded. The refusal was not reproduced; the assertion now prints the
|
||||
verdict, so the next one says why.
|
||||
- **`PagesLoadTests.EveryTextFollowsAThemeSwitch` was red once on a hosted runner** (#393's first run, green three
|
||||
times locally): *Settings: "Processor" shows in a fresh one only*. Every build of the Settings page in that fixture
|
||||
made a `SystemInfoViewModel` of its own, whose lines arrive from the thread pool, so two pages built a moment apart
|
||||
could differ by a row. The fixture now loads one and awaits it (`Surfaces.SystemInfo`) — fixed in the release's
|
||||
pull request, test code only. A surface whose view model loads by itself is loaded once, awaited, then shared.
|
||||
- **SonarCloud's coverage of new code** (advisory, 80 % asked) was 75.3 % on #391: the uncovered part was Win32
|
||||
(`WindowGeometryProbe.MonitorDeviceOf`). A lookup that takes a named window, as `Observe` does, can be tested
|
||||
against the harness's window; one that only searches for a visible window cannot, on a hosted runner.
|
||||
- **The App's own accessibility tests will refuse a page** that sets `AutomationProperties.LiveSetting` in XAML, that
|
||||
names a page-local resource key, whose item types have no `ToString`, or whose grid has an unnamed filler column —
|
||||
and a navigation item or a guide page that the guide's contents do not name. All of it is one test run away:
|
||||
run `FrameLedger.App.Tests` whole before the gate.
|
||||
- **An image of a page from a test** (`RenderTargetBitmap` over the hosted frame) shows the layout and the text, and
|
||||
costs a temporary test; ScottPlot draws nothing into it.
|
||||
- **`sed -i` on a file the Write tool made** is harmless only because both are LF until the normalising step; on a
|
||||
CRLF file it is the trap `handoff/traps.md` already names.
|
||||
|
||||
**Owner-only:** item 37 — beta.39 on real hardware: the update and its two terms, the switch and the page, a session
|
||||
with a real game, the first run as administrator with PawnIO, and what the Agent costs with the option on and off.
|
||||
@@ -0,0 +1,148 @@
|
||||
# HANDOFF history — 0.1.0-beta.40
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.41 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 day it was written**: what it calls beta.41 and beta.42 are train B's second and third releases, now beta.42 and beta.43 (D118).*
|
||||
|
||||
## **START HERE** — 2026-11-12, 0.1.0-beta.40: Advanced metrics inside the game, the first of train B's three releases
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.40.md`; this is what no other file carries.* Train B of the owner's
|
||||
"Thông số nâng cao" was planned and approved on 2026-11-11 (D110–D117) as **three releases**, and this is the first:
|
||||
what a hooked game tells its upscaler, read from **calls the Overlay already hooked — no new patch site** — only
|
||||
while the session records Advanced metrics. Four pull requests and this one: #395 (the decisions, the struct-version
|
||||
table, §M16 measured, NFR-2 amended), #396 (shared-memory layout 5, region 5), #397 (the Overlay's reads, the
|
||||
`overlay-fields-check` gate, the overhead measured), #398 (the Agent's sampler, the catalog's reach `Game`, the
|
||||
page's words, Privacy Policy 2.16). **The design is [`18_GPU_VENDOR_APIS.md`](18_GPU_VENDOR_APIS.md) §Train B; the
|
||||
contract of the new region is [`07_IPC.md`](07_IPC.md) §Region 5; what each hooked call reads is
|
||||
[`17_HOOK_ENGINE.md`](17_HOOK_ENGINE.md) §Hook inventory.** The plan as approved, the review that changed it and the
|
||||
order of the trains are [`handoff/history/0.1.0-beta.39.md`](handoff/history/0.1.0-beta.39.md) §NEXT.
|
||||
|
||||
### What this train decided that the plan had not
|
||||
|
||||
None of these is an owner decision; each was found while building, and is written where it binds.
|
||||
|
||||
- **"On" is a request of the session's own, not a 1** (#397, `07_IPC` §Region 5). The plan had the control word as
|
||||
0 or 1. A game outlives a session, and the Overlay's summaries with it — a second session of a game that kept
|
||||
running would have read the first one's field-of-view range and counts. The Agent now writes a value no session of
|
||||
that ring used, the watchdog starts its summaries afresh at a value it has not seen and names it in every
|
||||
publication, and the reader keeps only a publication that names its own. Found while writing the injected test,
|
||||
before anything shipped; layout 5 was changed in place (`reserved0` became `request`), which was possible only
|
||||
because no release had carried it.
|
||||
- **One module's calls are counted**, for the memory query as for the dispatch: a loader that passes a call on to a
|
||||
leaf's export is seen at two hooks.
|
||||
- **Five of the thirteen entries are tables**, not text (`sl.dlss.presets`, `sl.dlss.exposure`,
|
||||
`ffx.upscale.sharpening`, `.jitter`, `.depth`): a row's name is the vendor's own member name, so nothing but a
|
||||
switch's on/off and a flag's name needs translating. The catalog's unit and two summaries changed; no id did.
|
||||
- **What became of the in-game entries is stored with the session** (`AdvancedSources.InGame`): read, nothing seen,
|
||||
not hooked. Without it a session whose game set its DLSS options through `slDLSSSetOptions` would look like a
|
||||
game with no upscaler.
|
||||
- **The Disclaimer stays 2.15.** The accuracy statement gained an item, as in beta.19, beta.20 and beta.25, none of
|
||||
which moved it; the Privacy Policy went to 2.16 with the content the plan approved.
|
||||
- **A crash dump is tried three times** (#398). Not this train's subject: `CrashDumpHelperTests` failed under the
|
||||
full gate for the third time in two days, and the cause — `MiniDumpWriteDump` of a running process that changes
|
||||
under it — costs a real crash its only dump in exactly the same way.
|
||||
|
||||
### NEXT
|
||||
|
||||
1. **The owner runs item 38** — this release on real games. **Nothing of train B is begun before that**: the wait
|
||||
is what the split into three releases is for (D113).
|
||||
2. **0.1.0-beta.41, when the owner says item 38 passed**: two new hooks, `slSetConstants` and `ffxConfigure`. The
|
||||
design is in `18` §Train B and the plan in [`handoff/history/0.1.0-beta.39.md`](handoff/history/0.1.0-beta.39.md)
|
||||
§NEXT; region 5 already has their members (`sl*`, `ffxFg*`), so no layout changes. What to settle first, in a
|
||||
plan of its own: `kMaxPatches = 48` against the patch count with the new rows; the window of `sl::Constants` that
|
||||
is read, pinned by `static_assert` so that the camera members stay outside it; the overhead of a call made every
|
||||
frame for every viewport, measured before the merge; `overlay-fields-check`'s list and its parameters for the two
|
||||
new structs.
|
||||
3. **0.1.0-beta.42, when the owner says the one before passed**: `slGetFeatureVersion` and
|
||||
`slGetFeatureRequirements` — calls a game makes while starting, so most sessions will say the game did not make
|
||||
them after FrameLedger attached. The release notes and the page say so.
|
||||
4. **Trains C and D** (Reflex latency → beta.43; the Streamline state behind `slGetFeatureFunction` → beta.44) each
|
||||
begin with a spike and end in the owner's go or no. D needs an amendment of rule 4 if it goes ahead.
|
||||
|
||||
### 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, as beta.39's were in #395.~~ **Recorded 2026-11-12, in the
|
||||
pull request after the release: 0.1.0-beta.40 was released 2026-11-11T19:30:13Z** (02:30 on the 12th in the
|
||||
owner's time zone, which is the date the changelog carries; the legal documents' *Effective* date is the UTC one,
|
||||
2026-11-11 — the fifth release to straddle midnight that way, after beta.9, .10, .12 and .14) from the signed tag
|
||||
on `5268332` (#399), by run 43085044822 — 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.40`. The delta from beta.39 is 2,413,166 bytes beside a full package of 110,707,319 — "Delta processed
|
||||
0452 files. 0025 patched, 0427 unchanged". The wiki was published by run 43087844607. The rehearsal on the release
|
||||
branch (run 43082208739) had made a delta of 2,426,184 bytes with the same file counts.
|
||||
- **Nothing here was read from a real game, and nothing was seen in the running App.** The values come from
|
||||
`hook-harness --advanced` and the FidelityFX stub; the page's new rows were loaded by its tests and looked at by
|
||||
nobody. All of it is owner-only item 38.
|
||||
- **Whether any shipping title chains `sl::DLSSOptions` into `slEvaluateFeature`** is not known. If none of the
|
||||
owner's games does, the six `sl.dlss.*` entries read N/A everywhere until train D, and the page already says why.
|
||||
- **The aliasable part of FSR's memory** is read and published and not shown: the catalog has one memory entry.
|
||||
- **What the owner's first evening with it showed** (2026-11-12, read from a copy of the ledger and the Agent's log;
|
||||
ten hooked sessions on eight games, no fault in any, the Overlay `Ready` at every end):
|
||||
- **Read from a real game for the first time: Lies of P** (FSR 3 through `amd_fidelityfx_dx12.dll` 1.0.1, the
|
||||
SDK 1.1.x monolith) — sharpening on at 0.5, jitter up to 0.48 / 0.49 of a pixel, pre-exposure 0.25–1, a vertical
|
||||
field of view from 21.6° to 73.7°, no flag, and a reported frame time whose median is 16.67 ms beside a native
|
||||
rate of 55.6 FPS. The series starts 83 seconds in and has no gap after. Whether these match the game's own
|
||||
settings is still the owner's to say (item 38 (c)).
|
||||
- **`cameraNear` is absent there and `cameraFar` is 10.** Most likely the game runs an inverted, infinite depth
|
||||
and passes `FLT_MAX` for the plane at infinity, which the Overlay refuses as a value nobody set. "Infinite" would
|
||||
be the true answer. It is a change in code loaded into a game: decide it in beta.41's plan, not before.
|
||||
- **Every other game said *the game made none of the calls***, as expected: all ran DLSS. Dying Light: The Beast
|
||||
evaluates DLSS through Streamline and chains no `DLSSOptions` — the first evidence on that open question, and
|
||||
it is a no. Valor Mortis, Phantom Blade Zero, Clair Obscur and Kingdom Come: Deliverance II ship AMD's FSR 3.1+
|
||||
libraries and did not upscale through them in these sessions, so **no FSR 3.1+ title has been read yet**.
|
||||
- **The option off stored nothing** (Black Myth: Wukong, one session each way), and **a game under the user-mode
|
||||
anti-cheat exception ran with it on** (Girls' Frontline 2, trial 1 of 2).
|
||||
- **Valor Mortis ended with an access violation 51 seconds after injection, once**; the next launch ran fourteen
|
||||
minutes on the same build. The Overlay counted no fault and Windows logged no application error. Not attributed
|
||||
and not ruled out; its crash count stands at 1, and a second such end switches its hooking off.
|
||||
- **The sensor library was closed under its other users** — a defect of train A that only an elevated Agent with
|
||||
PawnIO can show. `20_OPEN_QUESTIONS` §M13 has what was seen; `LhmLibrary` is the fix; the owner's next sessions
|
||||
say whether it holds.
|
||||
- **`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 now been read on one PC and compared with nothing.
|
||||
The sentence is the owner's to reword.
|
||||
- ~~**SonarCloud on #398** had not answered when this was written; #397's three findings are fixed in #398.~~
|
||||
**It answered after the merge, with three findings on new code**, handled in the pull request after the release:
|
||||
two `csharpsquid:S1244` in `InGameAdvancedSampler` — a lowest and a highest float compared with `==` to tell one
|
||||
value from a range; they are now told apart by their bits, which is what was meant — and one
|
||||
`csharpsquid:S3869`, a blocker, on `ParentDump`'s `DangerousGetHandle`. That one is **not new and not fixed**: the
|
||||
owner accepted it in beta.24 (`13_CI_CD` §SonarCloud), #398 moved the same expression into a new method, and
|
||||
SonarCloud tracks an issue by its place. It needs the owner's *Accept* again — item 38 (j).
|
||||
- **The `vi` strings were written by the assistant and the `ja` ones are marked `review`** — fourteen more keys and
|
||||
the reworded Settings text.
|
||||
- **`LogNoteW`** is still there (owner-only item 36 (d)), item 37 is still unrun, and the alpha line still rests
|
||||
(D98): no alpha follows this release.
|
||||
|
||||
### Traps this train paid for
|
||||
|
||||
- **A library that is "one object per user" may still be one per process underneath.** Three `Computer`s of
|
||||
LibreHardwareMonitor shared a driver handle and mutexes; each was tested alone, unelevated, where the shared part
|
||||
is never opened. Before composing a second instance of anything that talks to a driver, ask what its `Close`
|
||||
closes. And `first ??= TryClose(x)` in a loop stops closing at the first throw — the test for "all are closed
|
||||
even when one throws" caught it in the fix itself.
|
||||
- **A heredoc in the tool's shell breaks on an odd number of apostrophes** — a script with `game's` in it fails with
|
||||
"unexpected EOF while looking for matching `'`" before Python ever runs. Write the script to a file and run the
|
||||
file.
|
||||
- **A region that outlives its reader needs to say whose data it holds.** Region 4 never had the problem — it is
|
||||
the swap chain's state, the same for any session. Region 5 holds summaries, and a summary has a beginning. Ask of
|
||||
any new shared state: what does the second session of the same process read in its first second?
|
||||
- **SonarCloud's engine does not see a Catch2 `REQUIRE` end a path**: `REQUIRE(OpenRingFor(pid, r))` followed by
|
||||
`r.st->…` is a null dereference to it (`cpp:S2259`, a failed gate on new code). An explicit `return` after the
|
||||
`REQUIRE` is what it follows. And a `LARGE_INTEGER` read through `QuadPart` is initialised through `QuadPart`
|
||||
(`cpp:S6232`) — `13_CI_CD` §SonarCloud has had the rule since #336; new code still forgot it.
|
||||
- **SonarCloud fails after the merge.** Its job is advisory and slower than the required checks, so auto-merge lands
|
||||
the pull request first. Read its result on the merged pull request before building on it.
|
||||
- **`MA0051` counts sixty lines, comments included**, and `CaptureSession.SuperviseAsync` was at fifty-nine: one
|
||||
line more is a build error. What a session asks once belongs where the session's state is made, not in the loop.
|
||||
- **`RCS1242` refuses `in` for a struct that is not `readonly`** — the mirror structs are not. Pass the object that
|
||||
holds the struct and take `ref readonly` inside.
|
||||
- **`/W4 /WX` refuses `alignas` on a struct it then has to pad** (C4324): align the variable, not the type.
|
||||
- **The `.resx` files hold a literal apostrophe**, not `'`: an edit script that searches for the entity finds
|
||||
nothing and stops half-way through.
|
||||
- **`ISessionRepository.FindAdvancedSensorsAsync` returns `t_ms` too**: "no advanced series" is "no series under
|
||||
`adv.`", not an empty list.
|
||||
- **PowerShell reads a backtick in a double-quoted string as an escape** (`` `r `` is a carriage return) and
|
||||
`"$name: text"` as a scoped variable: in a gate's messages, quote names with apostrophes and write `${name}:`.
|
||||
|
||||
**Owner-only:** item 38 — beta.40 on real games: the update and the Privacy Policy 2.16, a game that was running
|
||||
across the update, an FSR 3.1+ title and a DLSS title with the option on, the same with it off, a second session of
|
||||
a game that kept running, a game under the user-mode anti-cheat exception, and what the Agent costs.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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).
|
||||
@@ -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).
|
||||
@@ -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.
|
||||
@@ -63,6 +63,75 @@ 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.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
|
||||
for the train's three releases). §1's item on Advanced metrics gains what a session stores **for a game FrameLedger
|
||||
injects into, only while the option is on**: what the game passed to its upscaler in the calls FrameLedger
|
||||
intercepts — the output size, presets and exposure values it gave DLSS, whether it said its colour buffers are HDR,
|
||||
auto-exposure and alpha upscaling; the sharpening, the jitter's size, the exposure, the depth range, the lowest and
|
||||
highest field of view and the flags it gave FSR, the frame time it reported, FSR's own memory when the game asked —
|
||||
and what is never read: where the camera is, which way it looks, its matrices. It also says that switching the option
|
||||
off stops the reading inside a game as well. §4 had always named "the parameters your games pass to the graphics APIs
|
||||
it intercepts"; it now says that with the option on more of the upscaling calls' parameters are read **and stored**,
|
||||
which is what is new. The accuracy block gains an item: these are the game's words to the upscaler, not a check of
|
||||
what the upscaler did, and many games show none. The Disclaimer stays 2.15, as the accuracy statement's additions
|
||||
have not moved it before (beta.19, beta.20, beta.25). §2 is unchanged: nothing is sent.
|
||||
|
||||
### What version 2.15 of the Privacy Policy and of the Disclaimer changed (0.1.0-beta.39)
|
||||
|
||||
**Advanced metrics** (owner decisions D101–D108; the Privacy Policy's content approved with the plan, the Disclaimer's
|
||||
|
||||
@@ -53,3 +53,4 @@ 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) |
|
||||
@@ -99,7 +99,7 @@ The last thing P1 owes (§R4 moved it here because it needs P2's drain and recor
|
||||
| 2 | OFF | | | |
|
||||
| 3 | OFF | | | |
|
||||
|
||||
Gates: FPS delta ≤ 0.5 %, Agent CPU ≤ 1 % of a core, Agent RSS ≤ 150 MB. **Overlay resident ≤ 8 MB is
|
||||
Gates: FPS delta ≤ 0.5 %, Agent CPU ≤ 1 % of a core *(≤ 2.5 % since 2026-11-11, D117)*, Agent RSS ≤ 150 MB. **Overlay resident ≤ 8 MB is
|
||||
not measured by the runbook** and is left blank rather than guessed: it is a module inside the game
|
||||
process, and reading the target's memory is what CLAUDE.md rule 4 forbids — an external tool that
|
||||
inspects module sizes is the way to fill it.
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
## 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, written after 0.1.0-beta.46 is tagged.
|
||||
@@ -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). |
|
||||
|
||||
@@ -35,6 +35,69 @@ alone — whether variable refresh was in use on the display the game ran on, th
|
||||
the driver's settings for that game — the lowest, average and highest of every reading, and a chart over the
|
||||
session's length.
|
||||
|
||||
### What the game told its upscaler
|
||||
|
||||
For a game FrameLedger measures **from inside** (hooking is on for it), a session recorded with Advanced metrics on
|
||||
also keeps what the game itself handed to DLSS and FSR:
|
||||
|
||||
- **DLSS** — the output size, the model preset for each quality mode, whether the game said its colour buffers are
|
||||
HDR, auto-exposure, alpha upscaling, and the exposure values.
|
||||
- **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.
|
||||
|
||||
**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*.
|
||||
It never means the game uses no upscaler; the session's summary still names the upscaler as before.
|
||||
|
||||
**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
|
||||
@@ -46,7 +109,10 @@ comes from, and whether it is read. Where it is not, the reason is written out:
|
||||
memory's and the motherboard's sensors need both ([Every setting](08-settings.md), *Run the agent as
|
||||
administrator*);
|
||||
- **not present on this PC** — the driver's own figures exist on NVIDIA cards only;
|
||||
- **inside the game — comes with a later release**;
|
||||
- **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**;
|
||||
- **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.
|
||||
|
||||
|
||||
+21
-1
@@ -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.38`** (2026-11-11), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.45`** (2026-11-12), 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
|
||||
@@ -108,6 +108,26 @@
|
||||
> been checked against another tool. The processor's, the memory's and the motherboard's need the Agent as
|
||||
> administrator with PawnIO and have never been read on real hardware; a drive's temperature is not read. The
|
||||
> Advanced page shows them as they were stored, and what the PC reads at the moment only while that page is open.
|
||||
> - **What a game tells its upscaler (since beta.40; only with Advanced metrics on, only for a game measured from
|
||||
> inside):** the output size, presets and exposure a game hands DLSS, and the sharpening, jitter, exposure, depth
|
||||
> 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. 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
|
||||
|
||||
+21
-1
@@ -121,7 +121,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.38`** (2026-11-11), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.45`** (2026-11-12), 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
|
||||
@@ -217,6 +217,26 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
> been checked against another tool. The processor's, the memory's and the motherboard's need the Agent as
|
||||
> administrator with PawnIO and have never been read on real hardware; a drive's temperature is not read. The
|
||||
> Advanced page shows them as they were stored, and what the PC reads at the moment only while that page is open.
|
||||
> - **What a game tells its upscaler (since beta.40; only with Advanced metrics on, only for a game measured from
|
||||
> inside):** the output size, presets and exposure a game hands DLSS, and the sharpening, jitter, exposure, depth
|
||||
> 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. 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# FrameLedger — Privacy Policy
|
||||
|
||||
**Version:** 2.15 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 2.19 · **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). 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; 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. 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); 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; 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 areLine 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.
|
||||
|
||||
|
||||
Generated
+78
@@ -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,6 +262,10 @@ public static class Strings
|
||||
nameof(Advanced_Elevation_Hint),
|
||||
nameof(Advanced_Facts_Header),
|
||||
nameof(Advanced_Header),
|
||||
nameof(Advanced_InGameCallsLine),
|
||||
nameof(Advanced_InGameFeatureCallsLine),
|
||||
nameof(Advanced_InGameLine),
|
||||
nameof(Advanced_InGameMoreCallsLine),
|
||||
nameof(Advanced_Machine_Intro),
|
||||
nameof(Advanced_Max),
|
||||
nameof(Advanced_Mean),
|
||||
@@ -279,6 +285,7 @@ public static class Strings
|
||||
nameof(Advanced_State_OlderAgent),
|
||||
nameof(Advanced_State_Viewer),
|
||||
nameof(Advanced_State_Waiting),
|
||||
nameof(Advanced_Status_InGame),
|
||||
nameof(Advanced_Status_Read),
|
||||
nameof(Advanced_Status_Readable),
|
||||
nameof(Advanced_Status_SourceSilent),
|
||||
@@ -296,7 +303,18 @@ public static class Strings
|
||||
nameof(AdvGroup_Memory),
|
||||
nameof(AdvGroup_Storage),
|
||||
nameof(AdvGroup_Upscaling),
|
||||
nameof(AdvInGame_NothingSeen),
|
||||
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),
|
||||
nameof(AdvReach_Identifier),
|
||||
nameof(AdvReach_Licence),
|
||||
@@ -321,6 +339,7 @@ public static class Strings
|
||||
nameof(AdvToken_desktop),
|
||||
nameof(AdvToken_discrete),
|
||||
nameof(AdvToken_dolby_vision),
|
||||
nameof(AdvToken_draw_debug_view),
|
||||
nameof(AdvToken_driver_default),
|
||||
nameof(AdvToken_edr),
|
||||
nameof(AdvToken_fpci),
|
||||
@@ -332,8 +351,15 @@ public static class Strings
|
||||
nameof(AdvToken_integrated),
|
||||
nameof(AdvToken_laptop),
|
||||
nameof(AdvToken_no_profile_for_game),
|
||||
nameof(AdvToken_non_linear_color_pq),
|
||||
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_pci),
|
||||
nameof(AdvToken_pci_express),
|
||||
nameof(AdvToken_rtx_new_feature),
|
||||
@@ -1924,8 +1950,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);
|
||||
@@ -1974,6 +2004,14 @@ 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_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);
|
||||
@@ -2012,6 +2050,8 @@ public static class Strings
|
||||
|
||||
public static string Advanced_State_Waiting => ResourceManager.GetString(nameof(Advanced_State_Waiting), Culture) ?? nameof(Advanced_State_Waiting);
|
||||
|
||||
public static string Advanced_Status_InGame => ResourceManager.GetString(nameof(Advanced_Status_InGame), Culture) ?? nameof(Advanced_Status_InGame);
|
||||
|
||||
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);
|
||||
@@ -2046,8 +2086,30 @@ public static class Strings
|
||||
|
||||
public static string AdvGroup_Upscaling => ResourceManager.GetString(nameof(AdvGroup_Upscaling), Culture) ?? nameof(AdvGroup_Upscaling);
|
||||
|
||||
public static string AdvInGame_NothingSeen => ResourceManager.GetString(nameof(AdvInGame_NothingSeen), Culture) ?? nameof(AdvInGame_NothingSeen);
|
||||
|
||||
public static string AdvInGame_NotHooked => ResourceManager.GetString(nameof(AdvInGame_NotHooked), Culture) ?? nameof(AdvInGame_NotHooked);
|
||||
|
||||
public static string AdvInGame_Reading => ResourceManager.GetString(nameof(AdvInGame_Reading), Culture) ?? nameof(AdvInGame_Reading);
|
||||
|
||||
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);
|
||||
|
||||
public static string AdvReach_HookedCall => ResourceManager.GetString(nameof(AdvReach_HookedCall), Culture) ?? nameof(AdvReach_HookedCall);
|
||||
|
||||
public static string AdvReach_Identifier => ResourceManager.GetString(nameof(AdvReach_Identifier), Culture) ?? nameof(AdvReach_Identifier);
|
||||
@@ -2096,6 +2158,8 @@ public static class Strings
|
||||
|
||||
public static string AdvToken_dolby_vision => ResourceManager.GetString(nameof(AdvToken_dolby_vision), Culture) ?? nameof(AdvToken_dolby_vision);
|
||||
|
||||
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_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);
|
||||
@@ -2118,10 +2182,24 @@ public static class Strings
|
||||
|
||||
public static string AdvToken_no_profile_for_game => ResourceManager.GetString(nameof(AdvToken_no_profile_for_game), Culture) ?? nameof(AdvToken_no_profile_for_game);
|
||||
|
||||
public static string AdvToken_non_linear_color_pq => ResourceManager.GetString(nameof(AdvToken_non_linear_color_pq), Culture) ?? nameof(AdvToken_non_linear_color_pq);
|
||||
|
||||
public static string AdvToken_non_linear_color_srgb => ResourceManager.GetString(nameof(AdvToken_non_linear_color_srgb), Culture) ?? nameof(AdvToken_non_linear_color_srgb);
|
||||
|
||||
public static string AdvToken_none => ResourceManager.GetString(nameof(AdvToken_none), Culture) ?? nameof(AdvToken_none);
|
||||
|
||||
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);
|
||||
|
||||
public static string AdvToken_on => ResourceManager.GetString(nameof(AdvToken_on), Culture) ?? nameof(AdvToken_on);
|
||||
|
||||
public static string AdvToken_on_and_off => ResourceManager.GetString(nameof(AdvToken_on_and_off), Culture) ?? nameof(AdvToken_on_and_off);
|
||||
|
||||
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);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_depth" xml:space="preserve">
|
||||
<value>FSR に渡されたニア/ファー平面と視野角</value>
|
||||
<value>FSR に渡されたニア/ファー平面と視野角の範囲</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_exposure" xml:space="preserve">
|
||||
@@ -62,7 +62,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_jitter" xml:space="preserve">
|
||||
<value>ゲームが FSR に渡したジッター オフセット</value>
|
||||
<value>ゲームが FSR に渡したジッター オフセットの最大値</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_sharpening" xml:space="preserve">
|
||||
@@ -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_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>
|
||||
</data>
|
||||
<data name="Advanced_Machine_Intro" xml:space="preserve">
|
||||
<value>グラフィックス ドライバーとハードウェア センサーが、この PC について現在示している内容です。このページを開いている間、またはゲームを記録している間だけ読み取られ、ここに表示されるものは保存されません。</value>
|
||||
<comment>review</comment>
|
||||
@@ -729,6 +753,10 @@
|
||||
<value>キャプチャ エージェントがソースを開いています…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Advanced_Status_InGame" xml:space="preserve">
|
||||
<value>FrameLedger が計測するゲーム内で、ゲームがその呼び出しを行ったときに読み取り</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Advanced_Status_Read" xml:space="preserve">
|
||||
<value>読み取り中</value>
|
||||
<comment>review</comment>
|
||||
@@ -797,10 +825,50 @@
|
||||
<value>アップスケーリング</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_NotHooked" xml:space="preserve">
|
||||
<value>このセッションはゲーム内で計測されていません</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_NothingSeen" xml:space="preserve">
|
||||
<value>これらを読み取れる呼び出しをゲームが行いませんでした</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_Reading" xml:space="preserve">
|
||||
<value>ゲーム自身の呼び出しから読み取りました</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvInGame_Unknown" xml:space="preserve">
|
||||
<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>
|
||||
</data>
|
||||
<data name="AdvReach_Game" xml:space="preserve">
|
||||
<value>FrameLedger が計測するゲーム内</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvReach_HookedCall" xml:space="preserve">
|
||||
<value>ゲーム内 - 今後のリリースで対応</value>
|
||||
<comment>review</comment>
|
||||
@@ -817,6 +885,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>
|
||||
@@ -901,6 +973,10 @@
|
||||
<value>ドライバーの既定値</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_draw_debug_view" xml:space="preserve">
|
||||
<value>デバッグ ビュー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_edr" xml:space="preserve">
|
||||
<value>EDR</value>
|
||||
<comment>review</comment>
|
||||
@@ -941,14 +1017,42 @@
|
||||
<value>ドライバーにこのゲームのプロファイルがない</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_pq" xml:space="preserve">
|
||||
<value>非線形カラー (PQ)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_srgb" xml:space="preserve">
|
||||
<value>非線形カラー (sRGB)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_none" xml:space="preserve">
|
||||
<value>なし</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_not_a_number" xml:space="preserve">
|
||||
<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>
|
||||
</data>
|
||||
<data name="AdvToken_off" xml:space="preserve">
|
||||
<value>オフ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_on" xml:space="preserve">
|
||||
<value>オン</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_on_and_off" xml:space="preserve">
|
||||
<value>オンのときとオフのときがあります</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="AdvToken_pci" xml:space="preserve">
|
||||
<value>PCI</value>
|
||||
<comment>review</comment>
|
||||
@@ -1382,7 +1486,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Body" xml:space="preserve">
|
||||
<value>セッション中にグラフィックス ドライバーとハードウェア センサーからさらに多くを読み取り、セッションと一緒に保存します - グラフィックス カードのメモリと負荷の詳細、各ファンと電圧、ディスプレイの対応機能、ゲームに対するドライバーの設定など。オフ: 追加の読み取りも保存も行いません。次のセッションから適用され、オフの間に記録したセッションが後から補われることはありません。</value>
|
||||
<value>セッション中にグラフィックス ドライバーとハードウェア センサーからさらに多くを読み取り、セッションと一緒に保存します - グラフィックス カードのメモリと負荷の詳細、各ファンと電圧、ディスプレイの対応機能、ゲームに対するドライバーの設定など。FrameLedger が内部から計測するゲームでは、ゲームが DLSS、Streamline、FSR に渡す内容 (サイズ、プリセット、シャープニング、露出、深度範囲、フレーム生成の設定) も読み取ります - カメラの位置は決して読み取りません。オフ: ゲーム内も含め、追加の読み取りも保存も行いません。次のセッションから適用され、オフの間に記録したセッションが後から補われることはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Advanced_Label" xml:space="preserve">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<value>FSR's own video memory, when the game asks it</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_depth" xml:space="preserve">
|
||||
<value>Near and far planes and field of view given to FSR</value>
|
||||
<value>Near and far planes and the range of the field of view given to FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_exposure" xml:space="preserve">
|
||||
<value>Pre-exposure given to FSR</value>
|
||||
@@ -52,7 +52,7 @@
|
||||
<value>The frame time the game reported to FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_jitter" xml:space="preserve">
|
||||
<value>The jitter offsets the game gave FSR</value>
|
||||
<value>The largest jitter offset the game gave FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_sharpening" xml:space="preserve">
|
||||
<value>FSR sharpening: on or off, and its strength</value>
|
||||
@@ -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_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>
|
||||
<data name="Advanced_Machine_Intro" xml:space="preserve">
|
||||
<value>What the graphics driver and the hardware sensors say about this PC right now. It is read only while this page is open or a game is being recorded, and nothing shown here is stored.</value>
|
||||
</data>
|
||||
@@ -552,6 +570,9 @@
|
||||
<data name="Advanced_State_Waiting" xml:space="preserve">
|
||||
<value>The capture agent is opening its sources…</value>
|
||||
</data>
|
||||
<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_Read" xml:space="preserve">
|
||||
<value>Read</value>
|
||||
</data>
|
||||
@@ -603,9 +624,39 @@
|
||||
<data name="AdvGroup_Upscaling" xml:space="preserve">
|
||||
<value>Upscaling</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NotHooked" xml:space="preserve">
|
||||
<value>the session was not measured inside the game</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NothingSeen" xml:space="preserve">
|
||||
<value>the game made none of the calls these are read from</value>
|
||||
</data>
|
||||
<data name="AdvInGame_Reading" xml:space="preserve">
|
||||
<value>read from the game's own calls</value>
|
||||
</data>
|
||||
<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>
|
||||
<data name="AdvReach_Game" xml:space="preserve">
|
||||
<value>Inside a game FrameLedger measures</value>
|
||||
</data>
|
||||
<data name="AdvReach_HookedCall" xml:space="preserve">
|
||||
<value>Inside the game - comes with a later release</value>
|
||||
</data>
|
||||
@@ -618,6 +669,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>
|
||||
@@ -681,6 +735,9 @@
|
||||
<data name="AdvToken_driver_default" xml:space="preserve">
|
||||
<value>Driver default</value>
|
||||
</data>
|
||||
<data name="AdvToken_draw_debug_view" xml:space="preserve">
|
||||
<value>Debug view</value>
|
||||
</data>
|
||||
<data name="AdvToken_edr" xml:space="preserve">
|
||||
<value>EDR</value>
|
||||
</data>
|
||||
@@ -711,12 +768,33 @@
|
||||
<data name="AdvToken_no_profile_for_game" xml:space="preserve">
|
||||
<value>The driver has no profile for this game</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_pq" xml:space="preserve">
|
||||
<value>Non-linear colour, PQ</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_srgb" xml:space="preserve">
|
||||
<value>Non-linear colour, sRGB</value>
|
||||
</data>
|
||||
<data name="AdvToken_none" xml:space="preserve">
|
||||
<value>None</value>
|
||||
</data>
|
||||
<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>
|
||||
<data name="AdvToken_off" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
<data name="AdvToken_on" xml:space="preserve">
|
||||
<value>On</value>
|
||||
</data>
|
||||
<data name="AdvToken_on_and_off" xml:space="preserve">
|
||||
<value>On at times, off at others</value>
|
||||
</data>
|
||||
<data name="AdvToken_pci" xml:space="preserve">
|
||||
<value>PCI</value>
|
||||
</data>
|
||||
@@ -1042,7 +1120,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 store it with the session. Off: nothing more is read or stored. 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). 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>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<value>Bộ nhớ video của riêng FSR, khi game hỏi</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_depth" xml:space="preserve">
|
||||
<value>Mặt phẳng gần, xa và góc nhìn đưa cho FSR</value>
|
||||
<value>Mặt phẳng gần, xa và khoảng góc nhìn đưa cho FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_exposure" xml:space="preserve">
|
||||
<value>Tiền phơi sáng đưa cho FSR</value>
|
||||
@@ -47,7 +47,7 @@
|
||||
<value>Thời gian khung hình game báo cho FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_jitter" xml:space="preserve">
|
||||
<value>Độ lệch jitter game đưa cho FSR</value>
|
||||
<value>Độ lệch jitter lớn nhất game đưa cho FSR</value>
|
||||
</data>
|
||||
<data name="Adv_ffx_upscale_sharpening" xml:space="preserve">
|
||||
<value>Làm nét của FSR: bật hay tắt, và cường độ</value>
|
||||
@@ -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_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>
|
||||
<data name="Advanced_Machine_Intro" xml:space="preserve">
|
||||
<value>Những gì driver đồ hoạ và các cảm biến phần cứng cho biết về máy này lúc này. Chỉ được đọc khi trang này đang mở hoặc đang ghi một game, và những gì hiện ở đây không được lưu.</value>
|
||||
</data>
|
||||
@@ -547,6 +565,9 @@
|
||||
<data name="Advanced_State_Waiting" xml:space="preserve">
|
||||
<value>Capture agent đang mở các nguồn đọc…</value>
|
||||
</data>
|
||||
<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_Read" xml:space="preserve">
|
||||
<value>Đang đọc</value>
|
||||
</data>
|
||||
@@ -598,9 +619,39 @@
|
||||
<data name="AdvGroup_Upscaling" xml:space="preserve">
|
||||
<value>Nâng cấp hình ảnh</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NotHooked" xml:space="preserve">
|
||||
<value>phiên này không được đo bên trong game</value>
|
||||
</data>
|
||||
<data name="AdvInGame_NothingSeen" xml:space="preserve">
|
||||
<value>game không thực hiện lời gọi nào để đọc các mục này</value>
|
||||
</data>
|
||||
<data name="AdvInGame_Reading" xml:space="preserve">
|
||||
<value>đã đọc từ chính các lời gọi của game</value>
|
||||
</data>
|
||||
<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>
|
||||
<data name="AdvReach_Game" xml:space="preserve">
|
||||
<value>Bên trong game mà FrameLedger đo</value>
|
||||
</data>
|
||||
<data name="AdvReach_HookedCall" xml:space="preserve">
|
||||
<value>Bên trong game - sẽ có ở bản phát hành sau</value>
|
||||
</data>
|
||||
@@ -613,6 +664,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>
|
||||
@@ -676,6 +730,9 @@
|
||||
<data name="AdvToken_driver_default" xml:space="preserve">
|
||||
<value>Mặc định của driver</value>
|
||||
</data>
|
||||
<data name="AdvToken_draw_debug_view" xml:space="preserve">
|
||||
<value>Chế độ xem gỡ lỗi</value>
|
||||
</data>
|
||||
<data name="AdvToken_edr" xml:space="preserve">
|
||||
<value>EDR</value>
|
||||
</data>
|
||||
@@ -706,12 +763,33 @@
|
||||
<data name="AdvToken_no_profile_for_game" xml:space="preserve">
|
||||
<value>Driver không có profile cho game này</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_pq" xml:space="preserve">
|
||||
<value>Màu phi tuyến, PQ</value>
|
||||
</data>
|
||||
<data name="AdvToken_non_linear_color_srgb" xml:space="preserve">
|
||||
<value>Màu phi tuyến, sRGB</value>
|
||||
</data>
|
||||
<data name="AdvToken_none" xml:space="preserve">
|
||||
<value>Không có</value>
|
||||
</data>
|
||||
<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>
|
||||
<data name="AdvToken_off" xml:space="preserve">
|
||||
<value>Tắt</value>
|
||||
</data>
|
||||
<data name="AdvToken_on" xml:space="preserve">
|
||||
<value>Bật</value>
|
||||
</data>
|
||||
<data name="AdvToken_on_and_off" xml:space="preserve">
|
||||
<value>Lúc bật, lúc tắt</value>
|
||||
</data>
|
||||
<data name="AdvToken_pci" xml:space="preserve">
|
||||
<value>PCI</value>
|
||||
</data>
|
||||
@@ -1037,7 +1115,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à lưu cùng phiên. Tắt: không đọc và không lưu thêm gì. Á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). 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>
|
||||
|
||||
@@ -47,6 +47,19 @@ public static class AdvancedLabels
|
||||
|
||||
public static string Status(AdvancedSourceStatus status) => Lookup("AdvSource_" + status) ?? status.ToString();
|
||||
|
||||
/// <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;
|
||||
|
||||
|
||||
@@ -179,12 +179,81 @@ public static class AdvancedPresenter
|
||||
public static string SourcesLine(AdvancedSources sources)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(sources);
|
||||
return string.Format(
|
||||
string line = string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
Strings.Advanced_SourcesLine,
|
||||
AdvancedLabels.Status(sources.Nvapi),
|
||||
AdvancedLabels.Status(sources.Sensors),
|
||||
AdvancedLabels.Status(sources.ElevatedSensors));
|
||||
|
||||
// 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.
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -194,6 +263,12 @@ public static class AdvancedPresenter
|
||||
return AdvancedLabels.Reach(metric.Reach);
|
||||
}
|
||||
|
||||
if (metric.Reach == AdvancedReach.Game)
|
||||
{
|
||||
// Not a state of the PC: it is read inside a game being measured, when that game makes the call.
|
||||
return Strings.Advanced_Status_InGame;
|
||||
}
|
||||
|
||||
AdvancedSourceStatus? state = now is null ? null : (metric.Source, metric.Reach) switch
|
||||
{
|
||||
(AdvancedSource.Nvapi, _) => now.Nvapi,
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// 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 of the entries read inside the game (<see cref="AdvancedReach.Game"/>) in one session — the third
|
||||
/// answer beside a value and "not read": why there is none (Advanced metrics train B, owner decision D111).
|
||||
/// </summary>
|
||||
public enum AdvancedInGameStatus
|
||||
{
|
||||
/// <summary>Not stated: a row stored before 0.1.0-beta.40, or a state nobody set.</summary>
|
||||
Unknown = 0,
|
||||
|
||||
/// <summary>The game made at least one of the calls these entries are read from, and what it passed was read.</summary>
|
||||
Reading = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The session was measured inside the game and the game made none of those calls where they can be seen — it
|
||||
/// uses neither upscaler through the interfaces FrameLedger intercepts, or it sets its options through a call
|
||||
/// that cannot be intercepted (<c>slDLSSSetOptions</c>). Not "the game uses none of it".
|
||||
/// </summary>
|
||||
NothingSeen = 2,
|
||||
|
||||
/// <summary>The session was not measured inside the game (Tier 2): there was no call to 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;
|
||||
public bool IsRead => Reach is AdvancedReach.Agent or AdvancedReach.AgentElevated or AdvancedReach.Game;
|
||||
|
||||
/// <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;
|
||||
|
||||
@@ -147,31 +147,39 @@ public static class AdvancedMetricCatalog
|
||||
Sampled("nvapi.gpu.voltage", Nvapi, NotInHeaders, Volts, Gpu, "Card voltage through NVAPI (LibreHardwareMonitor reads it)"),
|
||||
Machine("nvapi.gpu.ram_type", Nvapi, NotInHeaders, Text, GpuMemory, "The card's memory type"),
|
||||
|
||||
// ---- Inside the game: calls the Overlay already hooks ---------------------------------------------------
|
||||
Session("sl.dlss.output_size", Streamline, HookedCall, Text, Upscaling, "The output size the game gave DLSS"),
|
||||
Session("sl.dlss.presets", Streamline, HookedCall, Text, Upscaling, "The DLSS model preset per quality mode"),
|
||||
Session("sl.dlss.hdr_input", Streamline, HookedCall, Flag, Upscaling, "The game told DLSS its colour buffers are HDR"),
|
||||
Session("sl.dlss.auto_exposure", Streamline, HookedCall, Flag, Upscaling, "DLSS auto-exposure"),
|
||||
Session("sl.dlss.alpha_upscaling", Streamline, HookedCall, Flag, Upscaling, "DLSS upscales the alpha channel"),
|
||||
Session("sl.dlss.exposure", Streamline, HookedCall, Text, Upscaling, "Pre-exposure and exposure scale given to DLSS"),
|
||||
Session("ffx.upscale.sharpening", FidelityFx, HookedCall, Text, Upscaling, "FSR sharpening: on or off, and its strength"),
|
||||
Session("ffx.upscale.jitter", FidelityFx, HookedCall, Text, Upscaling, "The jitter offsets the game gave FSR"),
|
||||
Session("ffx.upscale.exposure", FidelityFx, HookedCall, Text, Upscaling, "Pre-exposure given to FSR"),
|
||||
Session("ffx.upscale.depth", FidelityFx, HookedCall, Text, Upscaling, "Near and far planes and field of view given to FSR"),
|
||||
Session("ffx.upscale.flags", FidelityFx, HookedCall, Text, Upscaling, "The flags of the game's FSR dispatch"),
|
||||
Sampled("ffx.upscale.frame_time_delta", FidelityFx, HookedCall, Milliseconds, Upscaling, "The frame time the game reported to FSR"),
|
||||
Sampled("ffx.memory_usage", FidelityFx, HookedCall, Mebibytes, Upscaling, "FSR's own video memory, when the game asks it"),
|
||||
// ---- Inside the game: calls the Overlay already hooks (read since 0.1.0-beta.40, train B) ----------------
|
||||
Session("sl.dlss.output_size", Streamline, Game, Text, Upscaling, "The output size the game gave DLSS"),
|
||||
Session("sl.dlss.presets", Streamline, Game, Table, Upscaling, "The DLSS model preset per quality mode"),
|
||||
Session("sl.dlss.hdr_input", Streamline, Game, Flag, Upscaling, "The game told DLSS its colour buffers are HDR"),
|
||||
Session("sl.dlss.auto_exposure", Streamline, Game, Flag, Upscaling, "DLSS auto-exposure"),
|
||||
Session("sl.dlss.alpha_upscaling", Streamline, Game, Flag, Upscaling, "DLSS upscales the alpha channel"),
|
||||
Session("sl.dlss.exposure", Streamline, Game, Table, Upscaling, "Pre-exposure and exposure scale given to DLSS"),
|
||||
Session("ffx.upscale.sharpening", FidelityFx, Game, Table, Upscaling, "FSR sharpening: on or off, and its strength"),
|
||||
Session("ffx.upscale.jitter", FidelityFx, Game, Table, Upscaling, "The largest jitter offset the game gave FSR"),
|
||||
Session("ffx.upscale.exposure", FidelityFx, Game, Text, Upscaling, "Pre-exposure given to FSR"),
|
||||
Session("ffx.upscale.depth", FidelityFx, Game, Table, Upscaling, "Near and far planes and the range of the field of view given to FSR"),
|
||||
Session("ffx.upscale.flags", FidelityFx, Game, Text, Upscaling, "The flags of the game's FSR dispatch"),
|
||||
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: routes a spike decides ------------------------------------------------------------
|
||||
|
||||
@@ -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>
|
||||
@@ -45,4 +45,16 @@ public enum AdvancedReach
|
||||
|
||||
/// <summary>The vendor's public headers do not declare it.</summary>
|
||||
NotInHeaders = 11,
|
||||
|
||||
/// <summary>
|
||||
/// Read inside a game FrameLedger measures, from the arguments of a call the Overlay hooks, while the session
|
||||
/// 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,
|
||||
}
|
||||
@@ -16,6 +16,49 @@ public sealed record AdvancedSources(
|
||||
AdvancedSourceStatus Sensors,
|
||||
AdvancedSourceStatus ElevatedSensors)
|
||||
{
|
||||
/// <summary>
|
||||
/// What became of the entries read inside the game in the session this describes (0.1.0-beta.40); null where
|
||||
/// that is not a question — the machine's live state — and in every row stored before it existed.
|
||||
/// </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>Nothing asked yet.</summary>
|
||||
public static AdvancedSources Unknown { get; } = new(AdvancedSourceStatus.Unknown, NvapiCode: null, AdvancedSourceStatus.Unknown, AdvancedSourceStatus.Unknown);
|
||||
}
|
||||
@@ -37,6 +37,13 @@ public sealed record CaptureProgress
|
||||
/// </summary>
|
||||
public ulong AdapterLuid { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// What the hooked game told its upscaler, as the Overlay last published it for this session's request (region 5;
|
||||
/// train B) - the same instance until a new publication arrives. Null when the session did not ask
|
||||
/// (<see cref="ICaptureObserver.WantsInGameAdvanced"/>), before the first publication, and on every Tier-2 tick.
|
||||
/// </summary>
|
||||
public InGameAdvanced? InGameAdvanced { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// On a held session's tick (2026-09-23): the refusal it is held under — its reason, and the guard's verdict when the
|
||||
/// guard spoke — so the pipe can say, while the game runs, why nothing is measured. Null on every hooked tick.
|
||||
|
||||
@@ -436,7 +436,7 @@ public sealed class CaptureSession(
|
||||
{
|
||||
// D33: every re-scan names the family the injection named, and nothing else.
|
||||
var supervisor = new GuardSupervisor(guard, toleratedFamily);
|
||||
var state = new DrainState(new ModuleTally(modules, ngx), new DisplaySampler(display));
|
||||
var state = new DrainState(new ModuleTally(modules, ngx), new DisplaySampler(display)) { InGameAsked = AskInGameAdvanced(sink) };
|
||||
SessionEndReason end = await SuperviseAsync(pid, alive, sink, supervisor, state, ct, stop).ConfigureAwait(false);
|
||||
|
||||
// On a safety unhook the verdict that matters is the one that FIRED mid-session, not the pass that
|
||||
@@ -561,7 +561,7 @@ public sealed class CaptureSession(
|
||||
// still named; on TargetExited it reads nothing, which the tally counts rather than hides. The last
|
||||
// display sample stands until here (beta.10). The driver is not asked once the game has gone (Take, beta.27).
|
||||
state.Loaded.Take(pid, askDriver: !(alive.HasExited || end == SessionEndReason.TargetExited));
|
||||
state.Display.Finish(state.Paused);
|
||||
state.FinishSampling(sink);
|
||||
|
||||
// ONE LAST DRAIN ON EVERY PATH, including the faulted one — that is the whole point of catching
|
||||
// the mid-loop throw rather than letting it leave the method. Then let go promptly: holding the
|
||||
@@ -583,6 +583,19 @@ public sealed class CaptureSession(
|
||||
{
|
||||
state.Focus.Sample(alive.IsForeground);
|
||||
state.Display.Sample([pid], sink.DisplayState, state.Paused);
|
||||
state.SampleInGame(sink);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ADVANCED METRICS INSIDE THE GAME (train B, D111): the session's word, written EITHER WAY and before the first
|
||||
/// guard result - the control block outlives a session, and a request the session before left standing would be
|
||||
/// one nobody made. With it off the Overlay reads and hooks exactly what it did before the option existed.
|
||||
/// </summary>
|
||||
private bool AskInGameAdvanced(ICaptureSink sink)
|
||||
{
|
||||
bool asked = observer?.WantsInGameAdvanced ?? false;
|
||||
sink.SetAdvancedRequested(asked);
|
||||
return asked;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -736,6 +749,31 @@ public sealed class CaptureSession(
|
||||
|
||||
public ModuleTally Loaded { get; } = loaded;
|
||||
|
||||
/// <summary>Whether this session asked the Overlay for what the game tells its upscaler (train B, D111).</summary>
|
||||
public bool InGameAsked { get; init; }
|
||||
|
||||
/// <summary>The last publication of region 5 taken for this session; null until there is one (train B).</summary>
|
||||
public InGameAdvanced? InGame { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Region 5, when the session asked for it: a new <see cref="InGameAdvanced"/> only when the Overlay published
|
||||
/// again - once a second - so the ticks between two publications carry the same instance and copy nothing.
|
||||
/// </summary>
|
||||
public void SampleInGame(ICaptureSink sink)
|
||||
{
|
||||
if (InGameAsked && sink.AdvancedState is { } published && (InGame is null || InGame.State.Samples != published.Samples))
|
||||
{
|
||||
InGame = new InGameAdvanced(published);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The last display sample stands until here, and region 5 is read once more before the last tick.</summary>
|
||||
public void FinishSampling(ICaptureSink sink)
|
||||
{
|
||||
Display.Finish(Paused);
|
||||
SampleInGame(sink);
|
||||
}
|
||||
|
||||
public CaptureProgress Progress(ICaptureSink sink, GuardSupervisor supervisor) => new()
|
||||
{
|
||||
Records = Records,
|
||||
@@ -750,6 +788,7 @@ public sealed class CaptureSession(
|
||||
RuntimeModules = Loaded.Set,
|
||||
NgxDriver = Loaded.Ngx,
|
||||
AdapterLuid = sink.Handshake.AdapterLuid,
|
||||
InGameAdvanced = InGame,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -32,4 +32,11 @@ public interface ICaptureObserver
|
||||
void Measuring(GameProcess target)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether this session records Advanced metrics, and so asks the Overlay to read what the game tells its
|
||||
/// upscaler (train B, owner decision D111). Asked once, as the ring is attached; false for every observer that
|
||||
/// does not say otherwise - and then the Overlay reads and hooks exactly what it did before the option existed.
|
||||
/// </summary>
|
||||
bool WantsInGameAdvanced => false;
|
||||
}
|
||||
@@ -29,6 +29,21 @@ public interface ICaptureSink : IDisposable
|
||||
/// </summary>
|
||||
FlDisplayState? DisplayState { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Region 5 (layout 5, Advanced metrics train B): what the hooked game told its upscaler, as the Overlay last
|
||||
/// published it - null while it has published nothing, which is every session that does not record Advanced
|
||||
/// metrics, every Vulkan title (the layer never writes it), and a sink that has no such region.
|
||||
/// </summary>
|
||||
FlAdvancedState? AdvancedState => null;
|
||||
|
||||
/// <summary>
|
||||
/// Says whether this session records Advanced metrics (owner decision D111): the one word that lets the Overlay
|
||||
/// read more inside the game. Written either way at attach; a sink with no control block ignores it.
|
||||
/// </summary>
|
||||
void SetAdvancedRequested(bool requested)
|
||||
{
|
||||
}
|
||||
|
||||
long TotalDropped { get; }
|
||||
|
||||
long TotalGaps { get; }
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Capture;
|
||||
|
||||
/// <summary>
|
||||
/// One publication of the shared memory's region 5 — what the hooked game told its upscaler, as the Overlay's watchdog
|
||||
/// last published it for this session's request (<c>07_IPC</c> §Region 5; Advanced metrics train B).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A class around the struct, made once a publication and not once a tick: the region is 1472 bytes and published once
|
||||
/// a second, the loop ticks ten times as often, and <see cref="CaptureProgress"/> is a new record every tick. The same
|
||||
/// instance on two ticks is the same publication, which is how a consumer tells "nothing new" without comparing.
|
||||
/// </remarks>
|
||||
public sealed class InGameAdvanced
|
||||
{
|
||||
private readonly FlAdvancedState _state;
|
||||
|
||||
public InGameAdvanced(FlAdvancedState state) => _state = state;
|
||||
|
||||
/// <summary>The publication, by reference: it is never copied to be read.</summary>
|
||||
public ref readonly FlAdvancedState State => ref _state;
|
||||
}
|
||||
@@ -0,0 +1,794 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// 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.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Capture;
|
||||
|
||||
/// <summary>
|
||||
/// Turns what the Overlay published in region 5 into what a session stores: the session facts of the entries whose
|
||||
/// reach is <see cref="AdvancedReach.Game"/>, and the readings of its two series (Advanced metrics train B, 0.1.0-beta.40).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>What is stored is what the game SAID</b> — to DLSS with an evaluation, to FSR with a dispatch, and what FSR
|
||||
/// answered when the game asked it for its memory. Nothing here checks that the upscaler used it, and nothing is
|
||||
/// derived: a size is the size, a preset the vendor's letter, a member the vendor's own name for it.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Zero is "not read", never a value</b> (<c>07_IPC</c> §Region 5). A Boolean and a preset arrive as the vendor's
|
||||
/// value plus one, a float as its bits with <see cref="FlAdvancedState.FloatNone"/> for "none seen", a size of 0 as "not
|
||||
/// given" — and each of those is a fact that is absent here, not a fact that says no.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>The facts are the same list until something in them changes.</b> The recorder writes its context when a
|
||||
/// reference changes, and a publication arrives every second: the list is rebuilt only when a field a fact is made of
|
||||
/// moved — a field of view that widened, a flag seen for the first time.
|
||||
/// </para>
|
||||
/// <para>Not for two threads: the capture loop's task is its one caller.</para>
|
||||
/// </remarks>
|
||||
public sealed class InGameAdvancedSampler
|
||||
{
|
||||
/// <summary>The frame time the game reported to FSR: the mean of the dispatches of one second, in milliseconds.</summary>
|
||||
public const string FrameTimeSeries = AdvancedMetric.SeriesPrefix + "ffx.upscale.frame_time_delta";
|
||||
|
||||
/// <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";
|
||||
|
||||
private const double _mebibyte = 1024.0 * 1024.0;
|
||||
|
||||
// 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, "none", and what a field of view
|
||||
/// that cannot be radians is said to be (D128). A flag bit nobody named is <c>bit_N</c> and is shown as it is.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", _notRadians, .. _flagTokens];
|
||||
|
||||
private InGameAdvanced? _last;
|
||||
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; } = [];
|
||||
|
||||
/// <summary>True once a publication carried anything the game said.</summary>
|
||||
public bool SawAnything { get; private set; }
|
||||
|
||||
/// <summary>What a session stores as its in-game state: <paramref name="hooked"/> is whether it was measured inside the game.</summary>
|
||||
public AdvancedInGameStatus Status(bool hooked) =>
|
||||
!hooked ? AdvancedInGameStatus.NotHooked : SawAnything ? AdvancedInGameStatus.Reading : AdvancedInGameStatus.NothingSeen;
|
||||
|
||||
/// <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
|
||||
/// dispatched nor asked.
|
||||
/// </summary>
|
||||
public IReadOnlyList<AdvancedReading>? Take(InGameAdvanced? published)
|
||||
{
|
||||
if (published is null || ReferenceEquals(published, _last))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_last = published;
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
if (s.ValidMask == FlAdvancedValid.None)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
SawAnything = true;
|
||||
_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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
// 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)
|
||||
{
|
||||
readings.Add(new AdvancedReading(FrameTimeSeries, s.FfxFrameTimeSumUs / (double)s.FfxFrameTimeCount / 1000.0));
|
||||
}
|
||||
|
||||
// A point where the game asked, not a value held between two questions: the answer is of that moment.
|
||||
if (s.ValidMask.HasFlag(FlAdvancedValid.FfxMemory) && s.FfxMemoryQueries != _memoryQueries)
|
||||
{
|
||||
_memoryQueries = s.FfxMemoryQueries;
|
||||
readings.Add(new AdvancedReading(MemorySeries, s.FfxMemoryTotalBytes / _mebibyte));
|
||||
}
|
||||
|
||||
return readings.Count == 0 ? null : readings;
|
||||
}
|
||||
|
||||
private static List<AdvancedFact> Build(InGameAdvanced published)
|
||||
{
|
||||
var facts = new List<AdvancedFact>(11);
|
||||
if (published.State.ValidMask.HasFlag(FlAdvancedValid.DlssOptions))
|
||||
{
|
||||
AddDlss(published, facts);
|
||||
}
|
||||
|
||||
if (published.State.ValidMask.HasFlag(FlAdvancedValid.FfxUpscale))
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
return facts;
|
||||
}
|
||||
|
||||
// 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;
|
||||
if (s.DlssOutputWidth != 0 && s.DlssOutputHeight != 0)
|
||||
{
|
||||
facts.Add(Fact("sl.dlss.output_size", AdvancedValue.OfText(string.Create(CultureInfo.InvariantCulture, $"{s.DlssOutputWidth} × {s.DlssOutputHeight}"))));
|
||||
}
|
||||
|
||||
var presets = new List<AdvancedRow>(_presetModes.Length);
|
||||
for (int mode = 0; mode < _presetModes.Length; mode++)
|
||||
{
|
||||
if (s.DlssPresetAt(mode) is byte plusOne and not 0)
|
||||
{
|
||||
presets.Add(new AdvancedRow(_presetModes[mode], PresetName(plusOne - 1)));
|
||||
}
|
||||
}
|
||||
|
||||
if (presets.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("sl.dlss.presets", AdvancedValue.OfRows(presets)));
|
||||
}
|
||||
|
||||
AddFlag(facts, "sl.dlss.hdr_input", s.DlssColorBuffersHdr);
|
||||
AddFlag(facts, "sl.dlss.auto_exposure", s.DlssAutoExposure);
|
||||
AddFlag(facts, "sl.dlss.alpha_upscaling", s.DlssAlphaUpscaling);
|
||||
|
||||
var exposure = new List<AdvancedRow>(2);
|
||||
AddNumber(exposure, "preExposure", s.DlssPreExposureBits);
|
||||
AddNumber(exposure, "exposureScale", s.DlssExposureScaleBits);
|
||||
if (exposure.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("sl.dlss.exposure", AdvancedValue.OfRows(exposure)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddFfx(InGameAdvanced published, List<AdvancedFact> facts)
|
||||
{
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
var sharpening = new List<AdvancedRow>(2);
|
||||
string? seen = (s.FfxSharpenSeen & 3u) switch { 1u => "off", 2u => "on", 3u => "on_and_off", _ => null };
|
||||
if (seen is not null)
|
||||
{
|
||||
sharpening.Add(new AdvancedRow("enableSharpening", seen, seen));
|
||||
}
|
||||
|
||||
AddRange(sharpening, "sharpness", s.FfxSharpnessMinBits, s.FfxSharpnessMaxBits);
|
||||
if (sharpening.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.sharpening", AdvancedValue.OfRows(sharpening)));
|
||||
}
|
||||
|
||||
// The largest magnitude on each axis: a jitter changes every frame, and its size is what a session can say of it.
|
||||
var jitter = new List<AdvancedRow>(2);
|
||||
AddUpTo(jitter, "jitterOffset.x", s.FfxJitterMaxXBits);
|
||||
AddUpTo(jitter, "jitterOffset.y", s.FfxJitterMaxYBits);
|
||||
if (jitter.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.jitter", AdvancedValue.OfRows(jitter)));
|
||||
}
|
||||
|
||||
if (Range(s.FfxPreExposureMinBits, s.FfxPreExposureMaxBits) is string preExposure)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.exposure", AdvancedValue.OfText(preExposure)));
|
||||
}
|
||||
|
||||
var depth = new List<AdvancedRow>(3);
|
||||
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)));
|
||||
}
|
||||
|
||||
var flags = new List<string>(4);
|
||||
for (int bit = 0; bit < 32; bit++)
|
||||
{
|
||||
if ((s.FfxFlagsSeen & (1u << bit)) != 0)
|
||||
{
|
||||
flags.Add(bit < _flagTokens.Length ? _flagTokens[bit] : string.Create(CultureInfo.InvariantCulture, $"bit_{bit}"));
|
||||
}
|
||||
}
|
||||
|
||||
facts.Add(Fact("ffx.upscale.flags", AdvancedValue.OfTokens(flags.Count == 0 ? ["none"] : flags)));
|
||||
}
|
||||
|
||||
private static AdvancedFact Fact(string id, AdvancedValue value) => new(id, Instance: null, value);
|
||||
|
||||
private static void AddFlag(List<AdvancedFact> facts, string id, byte plusOne)
|
||||
{
|
||||
// The vendor's Boolean plus one: 1 is its false, 2 its true; anything else was not read.
|
||||
if (plusOne is 1 or 2)
|
||||
{
|
||||
facts.Add(Fact(id, AdvancedValue.Of(plusOne == 2)));
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, Text(value)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddUpTo(List<AdvancedRow> rows, string member, uint bits)
|
||||
{
|
||||
if (Number(bits) is double value)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, "≤ " + Text(value)));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddRange(List<AdvancedRow> rows, string member, uint minBits, uint maxBits)
|
||||
{
|
||||
if (Range(minBits, maxBits) is string range)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, range));
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
: null;
|
||||
|
||||
private static double? Number(uint bits)
|
||||
{
|
||||
if (bits == FlAdvancedState.FloatNone)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
float value = BitConverter.UInt32BitsToSingle(bits);
|
||||
return float.IsFinite(value) ? value : null;
|
||||
}
|
||||
|
||||
// As short as tells the value: a float's 0.35 is 0.3499999940395355 as a double.
|
||||
private static string Text(double value) => ((float)value).ToString("0.####", CultureInfo.InvariantCulture);
|
||||
|
||||
private static double Degrees(double radians) => radians * 180.0 / Math.PI;
|
||||
|
||||
// sl::DLSSPreset: 0 is the vendor's "default"; the letters start at 1.
|
||||
private static string PresetName(int preset) => preset switch
|
||||
{
|
||||
0 => "Default",
|
||||
>= 1 and <= 26 => ((char)('A' + preset - 1)).ToString(),
|
||||
_ => preset.ToString(CultureInfo.InvariantCulture),
|
||||
};
|
||||
|
||||
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,
|
||||
uint OutputWidth,
|
||||
uint OutputHeight,
|
||||
uint DlssPreExposure,
|
||||
uint DlssExposureScale,
|
||||
ulong Presets,
|
||||
uint Booleans,
|
||||
uint SharpenSeen,
|
||||
uint SharpnessMin,
|
||||
uint SharpnessMax,
|
||||
uint JitterX,
|
||||
uint JitterY,
|
||||
uint PreExposureMin,
|
||||
uint PreExposureMax,
|
||||
uint Near,
|
||||
uint Far,
|
||||
uint FovMin,
|
||||
uint FovMax,
|
||||
uint Flags,
|
||||
ulong FrameGenerationSwitches,
|
||||
uint FrameGenerationFlags,
|
||||
ulong FrameGenerationRectLow,
|
||||
ulong FrameGenerationRectHigh,
|
||||
ulong SlJitter,
|
||||
ulong SlMvecScale,
|
||||
ulong SlDepth,
|
||||
ulong SlFov,
|
||||
uint SlAspect,
|
||||
ulong SlFlags,
|
||||
ulong SlFeatures)
|
||||
{
|
||||
public static FactKey Of(InGameAdvanced published)
|
||||
{
|
||||
ref readonly FlAdvancedState s = ref published.State;
|
||||
ulong presets = 0;
|
||||
for (int mode = 0; mode < 6; mode++)
|
||||
{
|
||||
presets |= (ulong)s.DlssPresetAt(mode) << (8 * mode);
|
||||
}
|
||||
|
||||
return new FactKey(
|
||||
s.ValidMask & (FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale | FlAdvancedValid.FfxFgConfig | FlAdvancedValid.SlConstants | FlAdvancedValid.SlFeatures | FlAdvancedValid.SlShutdown),
|
||||
s.DlssOutputWidth,
|
||||
s.DlssOutputHeight,
|
||||
s.DlssPreExposureBits,
|
||||
s.DlssExposureScaleBits,
|
||||
presets,
|
||||
s.DlssColorBuffersHdr | ((uint)s.DlssAutoExposure << 8) | ((uint)s.DlssAlphaUpscaling << 16),
|
||||
s.FfxSharpenSeen,
|
||||
s.FfxSharpnessMinBits,
|
||||
s.FfxSharpnessMaxBits,
|
||||
s.FfxJitterMaxXBits,
|
||||
s.FfxJitterMaxYBits,
|
||||
s.FfxPreExposureMinBits,
|
||||
s.FfxPreExposureMaxBits,
|
||||
s.FfxNearBits,
|
||||
s.FfxFarBits,
|
||||
s.FfxFovMinBits,
|
||||
s.FfxFovMaxBits,
|
||||
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 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;
|
||||
}
|
||||
@@ -370,6 +371,17 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
private volatile IReadOnlyList<AdvancedFact>? _sessionFacts;
|
||||
private (IReadOnlyList<AdvancedFact>? Machine, IReadOnlyList<AdvancedSeriesInfo>? Series, AdvancedSources? Sources, IReadOnlyList<AdvancedFact>? Session) _context;
|
||||
|
||||
// What the game told its upscaler (train B): read inside the game by the Overlay, only for a session that
|
||||
// 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, 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>
|
||||
public bool WantsInGameAdvanced => advanced is not null;
|
||||
|
||||
public DateTimeOffset? AttachedAt { get; private set; }
|
||||
|
||||
public void Attached(int pid, FlShmHandshake handshake)
|
||||
@@ -403,6 +415,12 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
{
|
||||
_last = progress;
|
||||
FollowAdapter(progress.AdapterLuid);
|
||||
if (_inGame?.Take(progress.InGameAdvanced) is { } fresh)
|
||||
{
|
||||
// The newest stands until a telemetry sample carries it: both arrive once a second, out of step.
|
||||
_inGamePending = fresh;
|
||||
}
|
||||
|
||||
DrainTelemetry();
|
||||
UpdateAdvancedContext(atEnd: false);
|
||||
writer.OnTick(progress);
|
||||
@@ -437,7 +455,7 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
UpdateAdvancedContext(atEnd: true);
|
||||
if (writer.Advanced is null)
|
||||
{
|
||||
writer.SetAdvancedContext(new AdvancedSessionData([], [], [], AdvancedSources.Unknown));
|
||||
writer.SetAdvancedContext(new AdvancedSessionData([], [], [], AdvancedSources.Unknown with { InGame = InGameStatus() }));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,19 +477,100 @@ 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);
|
||||
if ((snapshot is null && session is null)
|
||||
|| (ReferenceEquals(now.Item1, _context.Machine) && ReferenceEquals(now.Item2, _context.Series) && Equals(now.Item3, _context.Sources) && ReferenceEquals(now.Item4, _context.Session)))
|
||||
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)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ReferenceEquals(now.Item4, _context.Session) || !ReferenceEquals(game, _inGameContext.Facts))
|
||||
{
|
||||
// The driver's facts of the session, then what the game said: one list, rebuilt when either moved.
|
||||
_sessionWithGame = game.Count == 0 ? session ?? [] : [.. session ?? [], .. game];
|
||||
}
|
||||
|
||||
_context = now;
|
||||
writer.SetAdvancedContext(new AdvancedSessionData(snapshot?.MachineFacts ?? [], session ?? [], snapshot?.Series ?? [], snapshot?.Sources ?? AdvancedSources.Unknown));
|
||||
_inGameContext = (game, status, calls);
|
||||
writer.SetAdvancedContext(new AdvancedSessionData(
|
||||
snapshot?.MachineFacts ?? [],
|
||||
_sessionWithGame,
|
||||
snapshot?.Series ?? [],
|
||||
(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,
|
||||
}));
|
||||
}
|
||||
|
||||
/// <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)));
|
||||
}
|
||||
|
||||
/// <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);
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
private AdvancedInGameStatus InGameStatus() => _inGame?.Status(hooked: AttachedAt is not null) ?? AdvancedInGameStatus.Unknown;
|
||||
|
||||
private static IReadOnlyList<AdvancedFact> ReadSessionFacts(IAdvancedHardware advanced, AdvancedSessionTarget target)
|
||||
{
|
||||
try
|
||||
@@ -526,6 +625,15 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
|
||||
_drained.Clear();
|
||||
poller.Drain(_drained);
|
||||
if (_inGamePending is { } pending && _drained.Count > 0)
|
||||
{
|
||||
// What the game said rides the newest sample of this drain, beside whatever the Agent's own reader
|
||||
// gave it: one tick, one set of readings.
|
||||
TelemetrySample newest = _drained[^1];
|
||||
_drained[^1] = newest with { Advanced = newest.Advanced is { Count: > 0 } own ? [.. own, .. pending] : pending };
|
||||
_inGamePending = null;
|
||||
}
|
||||
|
||||
writer.AddSensors(_drained);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)]);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,10 @@ public sealed class ShmCaptureSink(ShmRingReader reader) : ICaptureSink
|
||||
|
||||
public FlDisplayState? DisplayState => _reader.DisplayState;
|
||||
|
||||
public FlAdvancedState? AdvancedState => _reader.AdvancedState;
|
||||
|
||||
public void SetAdvancedRequested(bool requested) => _reader.SetAdvancedRequested(requested);
|
||||
|
||||
public long TotalDropped => _reader.TotalDropped;
|
||||
|
||||
public long TotalGaps => _reader.TotalGaps;
|
||||
|
||||
@@ -92,30 +92,56 @@ public static class ParentDump
|
||||
return parentStarted <= helperStarted && string.Equals(imageDirectory, ours, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// How many times a dump is tried. The process being dumped is alive and is not suspended: a thread that ends or a
|
||||
/// module that unloads while dbghelp walks it fails that walk, and the next one finds the process as it then is.
|
||||
/// </summary>
|
||||
public const int Attempts = 3;
|
||||
|
||||
/// <summary>Writes a minidump of <paramref name="target"/> — another process — into <paramref name="file"/>.</summary>
|
||||
/// <remarks>
|
||||
/// <b>Tried again, a bounded number of times</b> (2026-11-12). The dump is of a RUNNING process - the Agent or the
|
||||
/// App on its way down, its other threads still at work - and <c>MiniDumpWriteDump</c> fails when the process
|
||||
/// changes under it. One failure used to cost the only dump a crash would ever have; the test that dumps a busy test
|
||||
/// host failed that way three times in two days (the helper exited 9), always under the full gate's load and never
|
||||
/// alone. Each attempt starts from an empty file; only the last failure is reported, with how often it was tried.
|
||||
/// </remarks>
|
||||
public static bool WriteDump(Process target, string file, Action<string> problem)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(target);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(file);
|
||||
ArgumentNullException.ThrowIfNull(problem);
|
||||
|
||||
bool written;
|
||||
int error;
|
||||
using (var stream = new FileStream(file, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
|
||||
int error = 0;
|
||||
for (int attempt = 1; attempt <= Attempts; attempt++)
|
||||
{
|
||||
written = PInvoke.MiniDumpWriteDump(new HANDLE(target.Handle), (uint)target.Id, new HANDLE(stream.SafeFileHandle.DangerousGetHandle()), _kind, null, null, null);
|
||||
// At once, and the SYSTEM error: CsWin32 0.3.298 declares MiniDumpWriteDump without SetLastError, so
|
||||
// GetLastPInvokeError() is whatever an earlier call left (0 when measured on CreateNamedPipeW, 2026-09-17). The
|
||||
// value is an HRESULT, which is how dbghelp reports this function's failures.
|
||||
error = Marshal.GetLastSystemError();
|
||||
if (attempt > 1)
|
||||
{
|
||||
Thread.Sleep(150 * (attempt - 1));
|
||||
}
|
||||
|
||||
if (TryWriteOnce(target, file, out error))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!written)
|
||||
{
|
||||
problem($"crash dump: MiniDumpWriteDump failed (0x{error:X8})");
|
||||
File.Delete(file);
|
||||
}
|
||||
problem($"crash dump: MiniDumpWriteDump failed (0x{error:X8}) on each of {Attempts} attempts");
|
||||
File.Delete(file);
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool TryWriteOnce(Process target, string file, out int error)
|
||||
{
|
||||
using var stream = new FileStream(file, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
|
||||
// The file's raw handle, inside the `using` that owns the stream and on the same thread, so it cannot be
|
||||
// released during the call. CsWin32 generates no SafeHandle overload here (NativeMethods.json:
|
||||
// useSafeHandles false) - csharpsquid:S3869 is accepted for this one call (13_CI_CD §SonarCloud).
|
||||
bool written = PInvoke.MiniDumpWriteDump(new HANDLE(target.Handle), (uint)target.Id, new HANDLE(stream.SafeFileHandle.DangerousGetHandle()), _kind, null, null, null);
|
||||
// At once, and the SYSTEM error: CsWin32 0.3.298 declares MiniDumpWriteDump without SetLastError, so
|
||||
// GetLastPInvokeError() is whatever an earlier call left (0 when measured on CreateNamedPipeW, 2026-09-17). The
|
||||
// value is an HRESULT, which is how dbghelp reports this function's failures.
|
||||
error = Marshal.GetLastSystemError();
|
||||
return written;
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,9 @@ public sealed unsafe class ShmRingReader : IDisposable
|
||||
private ulong _readIndex;
|
||||
private bool _pointerHeld;
|
||||
private bool _disposed;
|
||||
private FlAdvancedState? _advanced;
|
||||
private uint _advancedSeq;
|
||||
private uint _advancedRequest;
|
||||
|
||||
private ShmRingReader(MemoryMappedFile mmf, MemoryMappedViewAccessor view, byte* basePtr, uint capacity)
|
||||
{
|
||||
@@ -330,6 +333,92 @@ public sealed unsafe class ShmRingReader : IDisposable
|
||||
Volatile.Write(ref control->PauseRequested, paused ? 1u : 0u);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Says whether the session this ring belongs to records Advanced metrics (owner decision D111; layout 5). Written
|
||||
/// either way: the control block outlives a session, so "off" is a 0 that is stored, never a word that is left
|
||||
/// alone - a request from the session before would be one nobody made. While it is 0 the Overlay reads and hooks
|
||||
/// exactly what it did before the option existed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <b>"On" is a request of this session's own, not a 1.</b> A game outlives a session, and so do the summaries the
|
||||
/// Overlay keeps inside it - a range, a count, a mask of what was ever seen. The value written is one no session of
|
||||
/// this ring used: above the word as it stands and above the request the region last answered. The Overlay starts
|
||||
/// its summaries afresh at a value it has not seen, and <see cref="AdvancedState"/> returns only a publication that
|
||||
/// names this value - so a second session of the same game never reads the first one's field of view.
|
||||
/// </remarks>
|
||||
public void SetAdvancedRequested(bool requested)
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(_disposed, this);
|
||||
var control = (FlControlBlock*)(_base + ShmLayout.ControlOffset);
|
||||
var region = (FlAdvancedState*)(_base + ShmLayout.AdvancedOffset);
|
||||
uint request = 0u;
|
||||
if (requested)
|
||||
{
|
||||
// The region's word is read without its lock: any value it ever held is one to stay clear of, and the
|
||||
// watchdog only ever stores values this word held.
|
||||
uint used = Math.Max(Volatile.Read(ref control->AdvancedRequested), Volatile.Read(ref region->Request));
|
||||
request = used == uint.MaxValue ? 1u : used + 1u;
|
||||
}
|
||||
|
||||
_advancedRequest = request;
|
||||
_advanced = null;
|
||||
_advancedSeq = 0u;
|
||||
Volatile.Write(ref control->AdvancedRequested, request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Region 5 (layout 5, Advanced metrics train B): what the hooked game told its upscaler, as the Overlay's
|
||||
/// watchdog last published it <b>for this reader's request</b> - or null while it has published nothing for it, which
|
||||
/// is every ring whose session does not record Advanced metrics, and the first second of one that does.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The last consistent copy, kept.</b> The watchdog writes once a second and this is read at the session's own
|
||||
/// pace, so most reads find the same <c>Seq</c> as the copy already held and return it without copying 1472 bytes
|
||||
/// again. A read that finds the writer inside on every attempt returns that copy too, rather than nothing: a
|
||||
/// watchdog that died with its process leaves <c>Seq</c> odd for good, and what it published before is still what
|
||||
/// the game said.
|
||||
/// </para>
|
||||
/// <para>Not for two threads at once: the copy is this instance's, and a session's loop is its one reader.</para>
|
||||
/// </remarks>
|
||||
public FlAdvancedState? AdvancedState
|
||||
{
|
||||
get
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(_disposed, this);
|
||||
var region = (FlAdvancedState*)(_base + ShmLayout.AdvancedOffset);
|
||||
for (int attempt = 0; attempt < DisplayStateAttempts; attempt++)
|
||||
{
|
||||
uint before = Volatile.Read(ref region->Seq);
|
||||
if (_advancedRequest == 0u || before == 0u || (_advanced is not null && before == _advancedSeq))
|
||||
{
|
||||
return _advanced; // never asked, never published, or nothing newer than the copy held
|
||||
}
|
||||
|
||||
if ((before & 1u) != 0u)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
FlAdvancedState copy = *region;
|
||||
Interlocked.MemoryBarrier();
|
||||
if (Volatile.Read(ref region->Seq) == before)
|
||||
{
|
||||
if (copy.Request != _advancedRequest)
|
||||
{
|
||||
return _advanced; // the session before's, in a game that kept running: not this one's
|
||||
}
|
||||
|
||||
_advanced = copy;
|
||||
_advancedSeq = before;
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
||||
return _advanced;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ask the capture side to flush its native event ring to <c>logs\overlay-<pid>-*.log</c> now
|
||||
/// (<c>17_HOOK_ENGINE</c> §Native logging). A counter: the watchdog acts on a change within one tick,
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -24,6 +24,12 @@ namespace FrameLedger.Infrastructure.Telemetry;
|
||||
/// reader that opens them counts faults per device and reads on a thread of its own.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Amended 2026-11-12: a user of <see cref="LhmLibrary"/>, not the owner of a <c>Computer</c>.</b> The library keeps
|
||||
/// part of its state per process, and closing one <c>Computer</c> took it from under the others — found in the first
|
||||
/// sessions recorded as administrator with PawnIO. Opening and closing now go through the process's one
|
||||
/// <see cref="LhmLibrary"/>, which serialises them and parks a closed <c>Computer</c> while another is in use.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Consumed <b>unmodified</b>, as an ordinary NuGet package reference. MPL-2.0 §3.3 is what
|
||||
/// makes that combinable with GPLv3; modifying a file of it would change the obligation
|
||||
/// (<c>legal/THIRD_PARTY_NOTICES.md</c> §GPL-3.0 compatibility).
|
||||
@@ -31,35 +37,43 @@ namespace FrameLedger.Infrastructure.Telemetry;
|
||||
/// </remarks>
|
||||
public sealed class LhmComputerAdapter : ILhmComputer
|
||||
{
|
||||
private readonly Computer _computer;
|
||||
private readonly LhmLibrary _library;
|
||||
private readonly LhmGroups _groups;
|
||||
private ILhmComputer? _computer;
|
||||
|
||||
public LhmComputerAdapter(bool enableCpuAndMemory, bool enableGpu = true)
|
||||
: this((enableGpu ? LhmGroups.Gpu : LhmGroups.None) | (enableCpuAndMemory ? LhmGroups.Cpu | LhmGroups.Memory : LhmGroups.None))
|
||||
{
|
||||
_computer = new Computer
|
||||
{
|
||||
IsGpuEnabled = enableGpu,
|
||||
IsCpuEnabled = enableCpuAndMemory,
|
||||
IsMemoryEnabled = enableCpuAndMemory,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>The groups <paramref name="groups"/> names, and no other (D103).</summary>
|
||||
public LhmComputerAdapter(LhmGroups groups)
|
||||
: this(groups, LhmLibrary.Process)
|
||||
{
|
||||
_computer = new Computer
|
||||
{
|
||||
IsGpuEnabled = groups.HasFlag(LhmGroups.Gpu),
|
||||
IsCpuEnabled = groups.HasFlag(LhmGroups.Cpu),
|
||||
IsMemoryEnabled = groups.HasFlag(LhmGroups.Memory),
|
||||
IsMotherboardEnabled = groups.HasFlag(LhmGroups.Motherboard),
|
||||
};
|
||||
}
|
||||
|
||||
public IReadOnlyList<IHardware> Hardware => [.. _computer.Hardware];
|
||||
/// <summary>The same, over a library of the caller's: the tests', which opens no driver.</summary>
|
||||
public LhmComputerAdapter(LhmGroups groups, LhmLibrary library)
|
||||
{
|
||||
_groups = groups;
|
||||
_library = library ?? throw new ArgumentNullException(nameof(library));
|
||||
}
|
||||
|
||||
public void Open() => _computer.Open();
|
||||
/// <summary>The tree of the open <c>Computer</c>; empty before <see cref="Open"/> and after <see cref="Close"/>.</summary>
|
||||
public IReadOnlyList<IHardware> Hardware => _computer?.Hardware ?? [];
|
||||
|
||||
public void Update() => _computer.Accept(new UpdateVisitor());
|
||||
/// <summary>Opens once: a second call while open changes nothing.</summary>
|
||||
public void Open() => _computer ??= _library.Open(_groups);
|
||||
|
||||
public void Close() => _computer.Close();
|
||||
public void Update() => _computer?.Update();
|
||||
|
||||
/// <summary>Lets go once: the library decides whether the <c>Computer</c> is closed now or parked.</summary>
|
||||
public void Close()
|
||||
{
|
||||
if (_computer is { } computer)
|
||||
{
|
||||
_computer = null;
|
||||
_library.Close(_groups, computer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Runtime.ExceptionServices;
|
||||
using LibreHardwareMonitor.Hardware;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Telemetry;
|
||||
|
||||
/// <summary>
|
||||
/// The one LibreHardwareMonitor a process has: every <c>Computer</c> this product opens is opened and closed
|
||||
/// through here, one at a time, and none is really closed while another is still in use.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>WHY (2026-11-12, the first sessions recorded as administrator with PawnIO).</b> The Agent holds up to three
|
||||
/// <c>Computer</c>s at once — a session's L2 source, its CPU-temperature reader, and the shared reader of Advanced
|
||||
/// metrics — each opened and closed on its own schedule, from its own thread. LibreHardwareMonitorLib keeps part of
|
||||
/// its state per process, not per <c>Computer</c>: the driver it reads the processor through and the mutexes it
|
||||
/// guards the buses with. <c>Computer.Close()</c> lets go of that shared part whoever else still has a
|
||||
/// <c>Computer</c> open. On the owner's PC, with an i7-14700KF:
|
||||
/// </para>
|
||||
/// <list type="bullet">
|
||||
/// <item>after seven sessions of ten, some seconds after the session's own sources closed, the Advanced reader's
|
||||
/// processor device threw <c>NullReferenceException</c> on two updates running and was left alone — the page lost
|
||||
/// the processor's sensors until the reader was opened again;</item>
|
||||
/// <item>once, a session's start and another instance's close met: the Advanced reader's <c>Open</c> threw
|
||||
/// <c>ObjectDisposedException</c> on a wait handle, and that session stored the NVIDIA driver's seventeen series
|
||||
/// and none of the sensor library's hundred and ninety-five.</item>
|
||||
/// </list>
|
||||
/// <para>
|
||||
/// Neither can be seen unelevated — without PawnIO the processor group reads nothing through a driver — which is why
|
||||
/// no test met it before a real run did. The cause is read from the timing in the Agent's log, not reproduced: the
|
||||
/// tests here hold the two rules below, and whether they end the faults is the owner's next sessions to show.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>THE TWO RULES.</b> (1) <c>Open</c> and <c>Close</c> are serialised: no two run at once. (2) A <c>Computer</c>
|
||||
/// closed by its user while another is open is <b>parked</b> — left open, read by nobody — and handed to the next user
|
||||
/// who asks for the same groups; the library is closed for real when its last user lets go, and then every parked
|
||||
/// one is closed with it. So the shared part goes only when nobody is reading.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>WHAT IS NOT SERIALISED: the reads.</b> A reader updates its devices on its own thread, as before. A lock around
|
||||
/// every read would put the session's once-a-second L2 poll behind the Advanced reader's — the two were put on
|
||||
/// separate threads so that a sensor that hangs in one holds up neither the other nor the pipe
|
||||
/// (<c>18_GPU_VENDOR_APIS</c> §Advanced metrics). Two <c>Computer</c>s reading side by side is what ten real sessions
|
||||
/// did without a fault; it is one closing under the other that failed.
|
||||
/// </para>
|
||||
/// <para>Parked instances are bounded by how many users were ever open at once — three in the Agent.</para>
|
||||
/// </remarks>
|
||||
public sealed class LhmLibrary
|
||||
{
|
||||
private readonly Func<LhmGroups, ILhmComputer> _create;
|
||||
private readonly Lock _gate = new();
|
||||
private readonly List<(LhmGroups Groups, ILhmComputer Computer)> _parked = [];
|
||||
private int _users;
|
||||
|
||||
/// <summary>A library over <paramref name="create"/>; the process has one (<see cref="Process"/>), a test makes its own.</summary>
|
||||
/// <param name="create">Makes a <c>Computer</c> with exactly these groups, not yet opened.</param>
|
||||
public LhmLibrary(Func<LhmGroups, ILhmComputer> create) => _create = create ?? throw new ArgumentNullException(nameof(create));
|
||||
|
||||
/// <summary>The process's own: every <see cref="LhmComputerAdapter"/> goes through it.</summary>
|
||||
public static LhmLibrary Process { get; } = new(static groups => new RealComputer(groups));
|
||||
|
||||
/// <summary>How many users hold a <c>Computer</c> now.</summary>
|
||||
public int Users
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
return _users;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>How many <c>Computer</c>s are open with no user, waiting for the next one or for the last close.</summary>
|
||||
public int Parked
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
return _parked.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An open <c>Computer</c> with these groups: a parked one where there is one, else a new one, opened here. An
|
||||
/// open that throws leaves nothing behind and counts no user.
|
||||
/// </summary>
|
||||
public ILhmComputer Open(LhmGroups groups)
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
int at = _parked.FindIndex(p => p.Groups == groups);
|
||||
ILhmComputer computer;
|
||||
if (at >= 0)
|
||||
{
|
||||
computer = _parked[at].Computer;
|
||||
_parked.RemoveAt(at);
|
||||
}
|
||||
else
|
||||
{
|
||||
computer = _create(groups);
|
||||
computer.Open();
|
||||
}
|
||||
|
||||
_users++;
|
||||
return computer;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lets go of a <c>Computer</c> that <see cref="Open"/> returned. While another user remains it is parked, still
|
||||
/// open; the last user's close closes it and every parked one — all of them, even when one throws, and then the
|
||||
/// first exception is thrown on.
|
||||
/// </summary>
|
||||
public void Close(LhmGroups groups, ILhmComputer computer)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(computer);
|
||||
lock (_gate)
|
||||
{
|
||||
if (_users > 0)
|
||||
{
|
||||
_users--;
|
||||
}
|
||||
|
||||
if (_users > 0)
|
||||
{
|
||||
_parked.Add((groups, computer));
|
||||
return;
|
||||
}
|
||||
|
||||
// Every one is closed whatever the one before it did: `first ??= TryClose(...)` would stop closing at the
|
||||
// first throw, which is the one outcome this method exists to rule out.
|
||||
ExceptionDispatchInfo? first = null;
|
||||
foreach ((LhmGroups _, ILhmComputer parked) in _parked)
|
||||
{
|
||||
ExceptionDispatchInfo? thrown = TryClose(parked);
|
||||
first ??= thrown;
|
||||
}
|
||||
|
||||
_parked.Clear();
|
||||
ExceptionDispatchInfo? last = TryClose(computer);
|
||||
(first ?? last)?.Throw();
|
||||
}
|
||||
}
|
||||
|
||||
private static ExceptionDispatchInfo? TryClose(ILhmComputer computer)
|
||||
{
|
||||
try
|
||||
{
|
||||
computer.Close();
|
||||
return null;
|
||||
}
|
||||
catch (Exception e) when (e is not OperationCanceledException)
|
||||
{
|
||||
// Kept, not thrown here: the others are still to be closed, and the shared part of the library with them.
|
||||
return ExceptionDispatchInfo.Capture(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The real <c>Computer</c>, with the groups asked for and no other (D103).</summary>
|
||||
private sealed class RealComputer(LhmGroups groups) : ILhmComputer
|
||||
{
|
||||
private readonly Computer _computer = new()
|
||||
{
|
||||
IsGpuEnabled = groups.HasFlag(LhmGroups.Gpu),
|
||||
IsCpuEnabled = groups.HasFlag(LhmGroups.Cpu),
|
||||
IsMemoryEnabled = groups.HasFlag(LhmGroups.Memory),
|
||||
IsMotherboardEnabled = groups.HasFlag(LhmGroups.Motherboard),
|
||||
};
|
||||
|
||||
public IReadOnlyList<IHardware> Hardware => [.. _computer.Hardware];
|
||||
|
||||
public void Open() => _computer.Open();
|
||||
|
||||
public void Update() => _computer.Accept(new UpdateVisitor());
|
||||
|
||||
public void Close() => _computer.Close();
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public static class ShmLayout
|
||||
/// user to restart the game — the DLL lives inside a running process, so the two sides cannot be
|
||||
/// assumed to update in lockstep.
|
||||
/// </summary>
|
||||
public const uint LayoutVersion = 4u;
|
||||
public const uint LayoutVersion = 5u;
|
||||
|
||||
public const uint HandshakeOffset = 0x00u;
|
||||
public const uint WriterOffset = 0x40u;
|
||||
@@ -46,7 +46,13 @@ public static class ShmLayout
|
||||
/// <summary>Region 4, <see cref="FlDisplayState"/> (layout 4, beta.10): the ring moved from 0xC0 to make room for it.</summary>
|
||||
public const uint DisplayOffset = 0xC0u;
|
||||
|
||||
public const uint RingOffset = 0x100u;
|
||||
/// <summary>
|
||||
/// Region 5, <see cref="FlAdvancedState"/> (layout 5, Advanced metrics train B, owner decisions D111 and D113): what a
|
||||
/// hooked game told its upscaler. The ring moved from 0x100 to make room for it.
|
||||
/// </summary>
|
||||
public const uint AdvancedOffset = 0x100u;
|
||||
|
||||
public const uint RingOffset = 0x6C0u;
|
||||
|
||||
/// <summary>8192 × 64 B = 512 KiB, ≈16 s at 500 fps.</summary>
|
||||
public const uint DefaultCapacity = 8192u;
|
||||
@@ -274,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>
|
||||
@@ -657,8 +706,17 @@ public unsafe struct FlControlBlock
|
||||
/// </summary>
|
||||
public uint LogFlushRequested;
|
||||
|
||||
/// <summary>
|
||||
/// 0 while the session this ring belongs to does not record Advanced metrics; otherwise that session's request, a
|
||||
/// non-zero value no session of this ring used before (owner decision D111). Written unconditionally at attach - the
|
||||
/// block outlives a session. While it is 0 the Overlay reads and hooks exactly what it did before the option
|
||||
/// existed and writes nothing to region 5; a value it has not seen starts its summaries afresh, and every
|
||||
/// publication names the request it answers (<see cref="FlAdvancedState.Request"/>).
|
||||
/// </summary>
|
||||
public uint AdvancedRequested;
|
||||
|
||||
/// <summary>Must be zero.</summary>
|
||||
public fixed uint Reserved[11];
|
||||
public fixed uint Reserved[10];
|
||||
}
|
||||
|
||||
/// <summary><see cref="FlDisplayState.Flags"/> bits (layout 4, beta.10). A reader ignores a bit it does not know.</summary>
|
||||
@@ -725,7 +783,281 @@ public unsafe struct FlDisplayState
|
||||
public fixed uint Reserved[4];
|
||||
}
|
||||
|
||||
/// <summary>Region 5 — the ring. Exactly 64 bytes, no implicit padding.</summary>
|
||||
/// <summary><see cref="FlAdvancedState.ValidMask"/> bits (layout 5). A reader ignores a bit it does not know.</summary>
|
||||
[Flags]
|
||||
public enum FlAdvancedValid : uint
|
||||
{
|
||||
None = 0,
|
||||
|
||||
/// <summary><c>sl::DLSSOptions</c> was seen chained into <c>slEvaluateFeature</c>'s inputs.</summary>
|
||||
DlssOptions = 1u << 0,
|
||||
|
||||
/// <summary>An ffx upscale dispatch's extra fields were read.</summary>
|
||||
FfxUpscale = 1u << 1,
|
||||
|
||||
/// <summary>The game asked <c>ffxQuery</c> for the upscaler's memory, and it answered.</summary>
|
||||
FfxMemory = 1u << 2,
|
||||
|
||||
/// <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.43 (D118, D122): <c>slSetConstants</c> was seen.</summary>
|
||||
SlConstants = 1u << 4,
|
||||
|
||||
/// <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>
|
||||
/// Region 5 — Overlay-written by its watchdog, once a second, <b>only while <see cref="FlControlBlock.AdvancedRequested"/>
|
||||
/// is not 0</b> (layout 5, 2026-11-11, Advanced metrics train B): what a hooked game told its upscaler, read from the arguments
|
||||
/// of calls the Overlay hooks. Sized once for the three releases of the train: a member a later release fills is here
|
||||
/// and stays zero until then.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>Zero is "not read", never a value.</b> <see cref="ValidMask"/> says which groups were ever read. Inside a group a
|
||||
/// Streamline Boolean or a DLSS preset is the vendor's value PLUS ONE, a float is its bits with
|
||||
/// <see cref="FloatNone"/> for "no value seen", and a size of 0 is "not given".
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>A seqlock with one writer.</b> <see cref="Seq"/> is odd while the watchdog is inside; a copy taken between two reads
|
||||
/// of an even, unchanged value is consistent (<c>ShmRingReader.AdvancedState</c>).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[StructLayout(LayoutKind.Sequential, Size = 1472)]
|
||||
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>How many feature slots <see cref="Features"/> holds.</summary>
|
||||
public const int FeatureSlots = 12;
|
||||
|
||||
/// <summary>How many words one feature slot is (<c>fl_shm.h</c> lists them).</summary>
|
||||
public const int FeatureWords = 24;
|
||||
|
||||
/// <summary>Odd while the watchdog is inside; +2 per publication.</summary>
|
||||
public uint Seq;
|
||||
|
||||
public FlAdvancedValid ValidMask;
|
||||
|
||||
/// <summary>Publications (wraps).</summary>
|
||||
public uint Samples;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="FlControlBlock.AdvancedRequested"/> this publication answers. A reader keeps a publication only
|
||||
/// when this is the value it wrote: anything else is what the session before left in a game that kept running.
|
||||
/// </summary>
|
||||
public uint Request;
|
||||
|
||||
/// <summary>QueryPerformanceCounter at the last publication.</summary>
|
||||
public ulong SampleQpc;
|
||||
|
||||
/// <summary>Must be zero.</summary>
|
||||
public fixed uint ReservedHeader[10];
|
||||
|
||||
/// <summary>The <c>structVersion</c> the game's <c>sl::DLSSOptions</c> declared; 0 = none seen.</summary>
|
||||
public uint DlssStructVersion;
|
||||
|
||||
/// <summary>Evaluates that chained a <c>DLSSOptions</c> (wraps).</summary>
|
||||
public uint DlssOptionsSeen;
|
||||
|
||||
/// <summary>0 = not given.</summary>
|
||||
public uint DlssOutputWidth;
|
||||
|
||||
public uint DlssOutputHeight;
|
||||
|
||||
/// <summary>Float bits, or <see cref="FloatNone"/>.</summary>
|
||||
public uint DlssPreExposureBits;
|
||||
|
||||
public uint DlssExposureScaleBits;
|
||||
|
||||
/// <summary><c>sl::DLSSPreset</c> PLUS ONE: DLAA, quality, balanced, performance, ultra performance, ultra quality.</summary>
|
||||
public fixed byte DlssPresets[6];
|
||||
|
||||
/// <summary>
|
||||
/// The preset of one quality mode — 0 DLAA, 1 Quality, 2 Balanced, 3 Performance, 4 Ultra Performance, 5 Ultra
|
||||
/// Quality — as the vendor's <c>sl::DLSSPreset</c> plus one; 0 for a mode that was not read, or out of range.
|
||||
/// </summary>
|
||||
public readonly byte DlssPresetAt(int mode) => (uint)mode < 6u ? DlssPresets[mode] : (byte)0;
|
||||
|
||||
/// <summary><c>sl::Boolean</c> PLUS ONE; 0 = not read.</summary>
|
||||
public byte DlssColorBuffersHdr;
|
||||
|
||||
public byte DlssAutoExposure;
|
||||
|
||||
public byte DlssAlphaUpscaling;
|
||||
|
||||
/// <summary>Must be zero.</summary>
|
||||
public fixed byte DlssPad[3];
|
||||
|
||||
/// <summary>Must be zero.</summary>
|
||||
public fixed uint ReservedDlss[7];
|
||||
|
||||
/// <summary>Upscale dispatches whose extras were read (wraps).</summary>
|
||||
public uint FfxDispatches;
|
||||
|
||||
/// <summary>Bit 0: sharpening seen off; bit 1: seen on.</summary>
|
||||
public uint FfxSharpenSeen;
|
||||
|
||||
public uint FfxSharpnessMinBits;
|
||||
|
||||
public uint FfxSharpnessMaxBits;
|
||||
|
||||
/// <summary>The largest |jitterOffset.x| seen.</summary>
|
||||
public uint FfxJitterMaxXBits;
|
||||
|
||||
public uint FfxJitterMaxYBits;
|
||||
|
||||
public uint FfxPreExposureMinBits;
|
||||
|
||||
public uint FfxPreExposureMaxBits;
|
||||
|
||||
public uint FfxNearBits;
|
||||
|
||||
public uint FfxFarBits;
|
||||
|
||||
/// <summary>Radians: the lowest and the highest of the session (owner decision D114).</summary>
|
||||
public uint FfxFovMinBits;
|
||||
|
||||
public uint FfxFovMaxBits;
|
||||
|
||||
/// <summary>Every <c>FFX_UPSCALE_FLAG</c> bit any dispatch carried.</summary>
|
||||
public uint FfxFlagsSeen;
|
||||
|
||||
public uint FfxResets;
|
||||
|
||||
/// <summary>Dispatches since the last publication, and the sum of their <c>frameTimeDelta</c> in microseconds.</summary>
|
||||
public uint FfxFrameTimeCount;
|
||||
|
||||
public uint FfxFrameTimeSumUs;
|
||||
|
||||
public ulong FfxMemoryTotalBytes;
|
||||
|
||||
public ulong FfxMemoryAliasableBytes;
|
||||
|
||||
public uint FfxMemoryQueries;
|
||||
|
||||
public uint FfxFgConfigures;
|
||||
|
||||
public uint FfxFgEnabledSeen;
|
||||
|
||||
public uint FfxFgAsyncSeen;
|
||||
|
||||
public uint FfxFgOnlyGeneratedSeen;
|
||||
|
||||
public uint FfxFgFlagsSeen;
|
||||
|
||||
/// <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];
|
||||
|
||||
public uint SlConstantsCalls;
|
||||
|
||||
public uint SlResets;
|
||||
|
||||
public uint SlJitterMaxXBits;
|
||||
|
||||
public uint SlJitterMaxYBits;
|
||||
|
||||
public uint SlMvecScaleXBits;
|
||||
|
||||
public uint SlMvecScaleYBits;
|
||||
|
||||
public uint SlNearBits;
|
||||
|
||||
public uint SlFarBits;
|
||||
|
||||
public uint SlFovMinBits;
|
||||
|
||||
public uint SlFovMaxBits;
|
||||
|
||||
public uint SlAspectBits;
|
||||
|
||||
/// <summary>One bit per <c>sl::Constants</c> Boolean seen true, in the header's order.</summary>
|
||||
public uint SlFlagsSeenTrue;
|
||||
|
||||
public uint SlFlagsSeenFalse;
|
||||
|
||||
/// <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>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>
|
||||
[StructLayout(LayoutKind.Sequential, Size = 64)]
|
||||
public unsafe struct FlFrameRecord
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,819 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
// What a hooked game told its upscaler, beyond what the frame record carries
|
||||
// (Advanced metrics, train B; 18_GPU_VENDOR_APIS §Train B; fl_shm.h region 5).
|
||||
//
|
||||
// THE ONE PLACE A VENDOR STRUCT'S EXTRA MEMBERS ARE READ (owner decision D116).
|
||||
// Every member this file reads is named in tools/overlay-allowed-fields.txt, and
|
||||
// tools/overlay-fields-check.ps1 fails the build when a member is read here that
|
||||
// is not on that list, or is on it and not read. The reads go through three
|
||||
// parameters with fixed names, which is what makes that checkable:
|
||||
//
|
||||
// o const sl::DLSSOptions& chained into slEvaluateFeature's inputs
|
||||
// d const ffxDispatchDescUpscale& the descriptor of an ffx upscale dispatch
|
||||
// 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)
|
||||
//
|
||||
// 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
|
||||
// matrices (the gate refuses those names anywhere in the Overlay).
|
||||
//
|
||||
// WHICH VERSION CARRIES WHICH MEMBER (owner decision D115; 17_HOOK_ENGINE §Which
|
||||
// struct version carries which field). sl::DLSSOptions grew twice; a member is
|
||||
// read only at the struct version that introduced it, because the game's struct
|
||||
// ends where ITS version ends. ffxDispatchDescUpscale has had one declaration in
|
||||
// every ffx-api release, so all of it may be read - on the ffx-api route only,
|
||||
// never on the FSR 3.0 host's legacy descriptor.
|
||||
//
|
||||
// RULE 5. Everything a detour calls here is a handful of relaxed atomic
|
||||
// operations on one process-local, cache-aligned struct: no allocation, no lock,
|
||||
// no call out. Publish() runs on the watchdog, never on a game thread.
|
||||
//
|
||||
// SENTINELS AND VENDOR ZEROS never leave this file as values: Streamline's
|
||||
// INVALID_FLOAT is FLT_MAX and its INVALID_UINT all-ones, a Boolean has a third
|
||||
// state, and preset 0 is "default". See the encoding notes on FlAdvancedState.
|
||||
|
||||
#ifndef FRAMELEDGER_FL_ADV_FIELDS_H
|
||||
#define FRAMELEDGER_FL_ADV_FIELDS_H
|
||||
|
||||
#include <atomic>
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#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>
|
||||
|
||||
namespace fl::adv {
|
||||
|
||||
// A float a detour may keep: finite, and not a vendor's "nobody set this". The
|
||||
// test is on the magnitude's bits: everything below FLT_MAX passes, and FLT_MAX
|
||||
// itself (Streamline's INVALID_FLOAT), both infinities and every NaN do not.
|
||||
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);
|
||||
}
|
||||
|
||||
// The highest / lowest value seen, kept as float bits. A compare-exchange only
|
||||
// when the value is a new extreme, which after the first frames is almost never.
|
||||
inline void KeepMax(std::atomic<uint32_t>& slot, float v) noexcept {
|
||||
const uint32_t bits = std::bit_cast<uint32_t>(v);
|
||||
uint32_t seen = slot.load(std::memory_order_relaxed);
|
||||
while (seen == FL_ADV_FLOAT_NONE || std::bit_cast<float>(seen) < v) {
|
||||
if (slot.compare_exchange_weak(seen, bits, std::memory_order_relaxed)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void KeepMin(std::atomic<uint32_t>& slot, float v) noexcept {
|
||||
const uint32_t bits = std::bit_cast<uint32_t>(v);
|
||||
uint32_t seen = slot.load(std::memory_order_relaxed);
|
||||
while (seen == FL_ADV_FLOAT_NONE || std::bit_cast<float>(seen) > v) {
|
||||
if (slot.compare_exchange_weak(seen, bits, std::memory_order_relaxed)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OR bits into a word only when one of them is new: a flag every frame carries
|
||||
// costs a load, not a locked instruction.
|
||||
inline void NoteBits(std::atomic<uint32_t>& slot, uint32_t bits) noexcept {
|
||||
if ((slot.load(std::memory_order_relaxed) & bits) != bits) {
|
||||
slot.fetch_or(bits, std::memory_order_relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
// sl::Boolean PLUS ONE, or 0 for its third state ("invalid": the game set nothing).
|
||||
inline uint8_t BooleanPlusOne(sl::Boolean b) noexcept {
|
||||
return (b == sl::Boolean::eFalse || b == sl::Boolean::eTrue) ? static_cast<uint8_t>(static_cast<uint8_t>(b) + 1u)
|
||||
: uint8_t{0};
|
||||
}
|
||||
|
||||
// sl::DLSSPreset PLUS ONE, or 0 for a value a byte cannot carry.
|
||||
inline uint8_t PresetPlusOne(sl::DLSSPreset p) noexcept {
|
||||
const auto v = static_cast<uint32_t>(p);
|
||||
return v < 0xFFu ? static_cast<uint8_t>(v + 1u) : uint8_t{0};
|
||||
}
|
||||
|
||||
// A bool as the vendor's C struct stores it, read as the byte it is: any other
|
||||
// read of a byte that is neither 0 nor 1 is undefined.
|
||||
inline bool ByteIsSet(const bool& field) noexcept {
|
||||
return *reinterpret_cast<const unsigned char*>(&field) != 0u;
|
||||
}
|
||||
|
||||
// What the detours accumulate between two publications. Process-local; one
|
||||
// instance, in the Overlay, which aligns it to a cache line of its own (on the
|
||||
// variable, not here: an aligned struct is a padded struct, and /W4 says so).
|
||||
// Counts wrap, as the region's do.
|
||||
struct Accumulators {
|
||||
std::atomic<uint32_t> validMask{0u}; // FlAdvancedValid
|
||||
|
||||
// sl::DLSSOptions, as last seen
|
||||
std::atomic<uint32_t> dlssStructVersion{0u};
|
||||
std::atomic<uint32_t> dlssOptionsSeen{0u};
|
||||
std::atomic<uint32_t> dlssOutputWidth{0u};
|
||||
std::atomic<uint32_t> dlssOutputHeight{0u};
|
||||
std::atomic<uint32_t> dlssPreExposureBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> dlssExposureScaleBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint64_t> dlssPresets{0u}; // six bytes, DLAA in the lowest
|
||||
std::atomic<uint32_t> dlssBooleans{0u}; // three bytes: HDR input, auto-exposure, alpha upscaling
|
||||
|
||||
// the ffx upscale dispatch
|
||||
std::atomic<uint32_t> ffxOwner{0u}; // leaf + 1 of the module whose dispatches are counted
|
||||
std::atomic<uint32_t> ffxDispatches{0u};
|
||||
std::atomic<uint32_t> ffxSharpenSeen{0u};
|
||||
std::atomic<uint32_t> ffxSharpnessMinBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxSharpnessMaxBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxJitterMaxXBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxJitterMaxYBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxPreExposureMinBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxPreExposureMaxBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxNearBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxFarBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxFovMinBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxFovMaxBits{FL_ADV_FLOAT_NONE};
|
||||
std::atomic<uint32_t> ffxFlagsSeen{0u};
|
||||
std::atomic<uint32_t> ffxResets{0u};
|
||||
std::atomic<uint32_t> ffxFrameTimeCount{0u}; // drained by Publish
|
||||
std::atomic<uint64_t> ffxFrameTimeSumUs{0u}; // drained by Publish
|
||||
|
||||
// the ffx upscaler's own memory, as the last answered query gave it
|
||||
std::atomic<uint64_t> ffxMemoryTotalBytes{0u};
|
||||
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.
|
||||
inline bool Owns(std::atomic<uint32_t>& ownerSlot, uint32_t leaf) noexcept {
|
||||
const uint32_t me = leaf + 1u;
|
||||
uint32_t owner = ownerSlot.load(std::memory_order_relaxed);
|
||||
if (owner == 0u && ownerSlot.compare_exchange_strong(owner, me, std::memory_order_relaxed)) {
|
||||
owner = me;
|
||||
}
|
||||
return owner == me;
|
||||
}
|
||||
|
||||
// sl::DLSSOptions, chained into slEvaluateFeature's inputs. The caller has already
|
||||
// matched the struct's GUID and found its version at least 1 (fl_sl_inputs.h).
|
||||
inline void ObserveDlssOptions(const sl::DLSSOptions& o, Accumulators& a) noexcept {
|
||||
const size_t version = o.structVersion;
|
||||
if (version < sl::kStructVersion1) {
|
||||
return;
|
||||
}
|
||||
|
||||
a.dlssStructVersion.store(version > 0xFFFFu ? 0xFFFFu : static_cast<uint32_t>(version), std::memory_order_relaxed);
|
||||
a.dlssOptionsSeen.fetch_add(1u, std::memory_order_relaxed);
|
||||
|
||||
// Version 1's members. A size the game left at INVALID_UINT, or one no display has, is "not given".
|
||||
const uint32_t w = o.outputWidth;
|
||||
const uint32_t h = o.outputHeight;
|
||||
const bool sized = w != 0u && h != 0u && w <= 0xFFFFu && h <= 0xFFFFu;
|
||||
a.dlssOutputWidth.store(sized ? w : 0u, std::memory_order_relaxed);
|
||||
a.dlssOutputHeight.store(sized ? h : 0u, std::memory_order_relaxed);
|
||||
a.dlssPreExposureBits.store(Usable(o.preExposure) ? std::bit_cast<uint32_t>(o.preExposure) : FL_ADV_FLOAT_NONE,
|
||||
std::memory_order_relaxed);
|
||||
a.dlssExposureScaleBits.store(Usable(o.exposureScale) ? std::bit_cast<uint32_t>(o.exposureScale)
|
||||
: FL_ADV_FLOAT_NONE,
|
||||
std::memory_order_relaxed);
|
||||
|
||||
uint64_t presets = static_cast<uint64_t>(PresetPlusOne(o.dlaaPreset)) |
|
||||
(static_cast<uint64_t>(PresetPlusOne(o.qualityPreset)) << 8) |
|
||||
(static_cast<uint64_t>(PresetPlusOne(o.balancedPreset)) << 16) |
|
||||
(static_cast<uint64_t>(PresetPlusOne(o.performancePreset)) << 24) |
|
||||
(static_cast<uint64_t>(PresetPlusOne(o.ultraPerformancePreset)) << 32);
|
||||
uint32_t booleans = BooleanPlusOne(o.colorBuffersHDR);
|
||||
|
||||
// Version 2 added two members; a version-1 struct ends before them.
|
||||
if (version >= sl::kStructVersion2) {
|
||||
presets |= static_cast<uint64_t>(PresetPlusOne(o.ultraQualityPreset)) << 40;
|
||||
booleans |= static_cast<uint32_t>(BooleanPlusOne(o.useAutoExposure)) << 8;
|
||||
}
|
||||
// Version 3 added one.
|
||||
if (version >= sl::kStructVersion3) {
|
||||
booleans |= static_cast<uint32_t>(BooleanPlusOne(o.alphaUpscalingEnabled)) << 16;
|
||||
}
|
||||
|
||||
a.dlssPresets.store(presets, std::memory_order_relaxed);
|
||||
a.dlssBooleans.store(booleans, std::memory_order_relaxed);
|
||||
NoteBits(a.validMask, FL_ADV_VALID_DLSS_OPTIONS);
|
||||
}
|
||||
|
||||
// The ffx upscale dispatch, beyond the two sizes the frame record already has.
|
||||
//
|
||||
// ONE MODULE'S DISPATCHES ARE COUNTED (Owns): the first module seen owns the
|
||||
// accumulators and the other's calls are passed over.
|
||||
inline void ObserveFfxUpscale(uint32_t leaf, const ffxDispatchDescUpscale& d, Accumulators& a) noexcept {
|
||||
if (!Owns(a.ffxOwner, leaf)) {
|
||||
return;
|
||||
}
|
||||
|
||||
a.ffxDispatches.fetch_add(1u, std::memory_order_relaxed);
|
||||
|
||||
const bool sharpening = ByteIsSet(d.enableSharpening);
|
||||
NoteBits(a.ffxSharpenSeen, sharpening ? 2u : 1u);
|
||||
if (sharpening && Usable(d.sharpness)) {
|
||||
KeepMin(a.ffxSharpnessMinBits, d.sharpness);
|
||||
KeepMax(a.ffxSharpnessMaxBits, d.sharpness);
|
||||
}
|
||||
|
||||
if (Usable(d.jitterOffset.x) && Usable(d.jitterOffset.y)) {
|
||||
KeepMax(a.ffxJitterMaxXBits, Magnitude(d.jitterOffset.x));
|
||||
KeepMax(a.ffxJitterMaxYBits, Magnitude(d.jitterOffset.y));
|
||||
}
|
||||
|
||||
if (Usable(d.preExposure)) {
|
||||
KeepMin(a.ffxPreExposureMinBits, d.preExposure);
|
||||
KeepMax(a.ffxPreExposureMaxBits, d.preExposure);
|
||||
}
|
||||
|
||||
// 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 (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) {
|
||||
KeepMin(a.ffxFovMinBits, d.cameraFovAngleVertical);
|
||||
KeepMax(a.ffxFovMaxBits, d.cameraFovAngleVertical);
|
||||
}
|
||||
|
||||
if (d.flags != 0u) {
|
||||
NoteBits(a.ffxFlagsSeen, d.flags);
|
||||
}
|
||||
if (ByteIsSet(d.reset)) {
|
||||
a.ffxResets.fetch_add(1u, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
// Milliseconds, as the game reports them. A value outside (0, 10 s) is not a frame time.
|
||||
if (Usable(d.frameTimeDelta) && d.frameTimeDelta > 0.0f && d.frameTimeDelta < 10000.0f) {
|
||||
a.ffxFrameTimeCount.fetch_add(1u, std::memory_order_relaxed);
|
||||
a.ffxFrameTimeSumUs.fetch_add(static_cast<uint64_t>(d.frameTimeDelta * 1000.0f), std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
NoteBits(a.validMask, FL_ADV_VALID_FFX_UPSCALE);
|
||||
}
|
||||
|
||||
// The upscaler's own memory, from the struct an answered ffxQuery wrote.
|
||||
inline void ObserveFfxMemory(const FfxApiEffectMemoryUsage& m, Accumulators& a) noexcept {
|
||||
a.ffxMemoryTotalBytes.store(m.totalUsageInBytes, std::memory_order_relaxed);
|
||||
a.ffxMemoryAliasableBytes.store(m.aliasableUsageInBytes, std::memory_order_relaxed);
|
||||
a.ffxMemoryQueries.fetch_add(1u, std::memory_order_relaxed);
|
||||
NoteBits(a.validMask, FL_ADV_VALID_FFX_MEMORY);
|
||||
}
|
||||
|
||||
// An ffxQuery the vendor answered OK: when it is the upscaler's memory query, either
|
||||
// version, what it wrote through the game's own out-pointer is kept. Every other
|
||||
// query type is passed over with only its header's type read. One module's
|
||||
// queries are counted, as one module's dispatches are.
|
||||
inline void ObserveFfxMemoryQuery(uint32_t leaf, const ffxQueryDescHeader* desc, Accumulators& a) noexcept {
|
||||
if (desc == nullptr) {
|
||||
return;
|
||||
}
|
||||
const FfxApiEffectMemoryUsage* usage = nullptr;
|
||||
if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE) {
|
||||
const auto& q = *reinterpret_cast<const ffxQueryDescUpscaleGetGPUMemoryUsage*>(desc);
|
||||
usage = q.gpuMemoryUsageUpscaler;
|
||||
} else if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE_V2) {
|
||||
const auto& q = *reinterpret_cast<const ffxQueryDescUpscaleGetGPUMemoryUsageV2*>(desc);
|
||||
usage = q.gpuMemoryUsageUpscaler;
|
||||
}
|
||||
if (usage != nullptr && Owns(a.ffxMemoryOwner, leaf)) {
|
||||
ObserveFfxMemory(*usage, a);
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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. 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(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);
|
||||
a.dlssOutputHeight.store(0u, relaxed);
|
||||
a.dlssPreExposureBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.dlssExposureScaleBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.dlssPresets.store(0u, relaxed);
|
||||
a.dlssBooleans.store(0u, relaxed);
|
||||
a.ffxDispatches.store(0u, relaxed);
|
||||
a.ffxSharpenSeen.store(0u, relaxed);
|
||||
a.ffxSharpnessMinBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxSharpnessMaxBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxJitterMaxXBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxJitterMaxYBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxPreExposureMinBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxPreExposureMaxBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxNearBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxFarBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxFovMinBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxFovMaxBits.store(FL_ADV_FLOAT_NONE, relaxed);
|
||||
a.ffxFlagsSeen.store(0u, relaxed);
|
||||
a.ffxResets.store(0u, relaxed);
|
||||
a.ffxFrameTimeCount.store(0u, relaxed);
|
||||
a.ffxFrameTimeSumUs.store(0u, relaxed);
|
||||
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 {
|
||||
if (region == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto put32 = [](uint32_t& field, uint32_t value) noexcept {
|
||||
std::atomic_ref<uint32_t>{field}.store(value, std::memory_order_relaxed);
|
||||
};
|
||||
const auto put64 = [](uint64_t& field, uint64_t value) noexcept {
|
||||
std::atomic_ref<uint64_t>{field}.store(value, std::memory_order_relaxed);
|
||||
};
|
||||
const auto put8 = [](uint8_t& field, uint8_t value) noexcept {
|
||||
std::atomic_ref<uint8_t>{field}.store(value, std::memory_order_relaxed);
|
||||
};
|
||||
const auto relaxed = std::memory_order_relaxed;
|
||||
|
||||
std::atomic_ref<uint32_t> seq{region->seq};
|
||||
const uint32_t odd = seq.load(relaxed) | 1u;
|
||||
seq.store(odd, std::memory_order_release);
|
||||
|
||||
put32(region->validMask, a.validMask.load(relaxed));
|
||||
put32(region->request, request);
|
||||
put64(region->sampleQpc, qpc);
|
||||
|
||||
put32(region->dlssStructVersion, a.dlssStructVersion.load(relaxed));
|
||||
put32(region->dlssOptionsSeen, a.dlssOptionsSeen.load(relaxed));
|
||||
put32(region->dlssOutputWidth, a.dlssOutputWidth.load(relaxed));
|
||||
put32(region->dlssOutputHeight, a.dlssOutputHeight.load(relaxed));
|
||||
put32(region->dlssPreExposureBits, a.dlssPreExposureBits.load(relaxed));
|
||||
put32(region->dlssExposureScaleBits, a.dlssExposureScaleBits.load(relaxed));
|
||||
const uint64_t presets = a.dlssPresets.load(relaxed);
|
||||
for (uint32_t i = 0; i < 6u; ++i) {
|
||||
put8(region->dlssPresets[i], static_cast<uint8_t>(presets >> (8u * i)));
|
||||
}
|
||||
const uint32_t booleans = a.dlssBooleans.load(relaxed);
|
||||
put8(region->dlssColorBuffersHdr, static_cast<uint8_t>(booleans));
|
||||
put8(region->dlssAutoExposure, static_cast<uint8_t>(booleans >> 8));
|
||||
put8(region->dlssAlphaUpscaling, static_cast<uint8_t>(booleans >> 16));
|
||||
|
||||
put32(region->ffxDispatches, a.ffxDispatches.load(relaxed));
|
||||
put32(region->ffxSharpenSeen, a.ffxSharpenSeen.load(relaxed));
|
||||
put32(region->ffxSharpnessMinBits, a.ffxSharpnessMinBits.load(relaxed));
|
||||
put32(region->ffxSharpnessMaxBits, a.ffxSharpnessMaxBits.load(relaxed));
|
||||
put32(region->ffxJitterMaxXBits, a.ffxJitterMaxXBits.load(relaxed));
|
||||
put32(region->ffxJitterMaxYBits, a.ffxJitterMaxYBits.load(relaxed));
|
||||
put32(region->ffxPreExposureMinBits, a.ffxPreExposureMinBits.load(relaxed));
|
||||
put32(region->ffxPreExposureMaxBits, a.ffxPreExposureMaxBits.load(relaxed));
|
||||
put32(region->ffxNearBits, a.ffxNearBits.load(relaxed));
|
||||
put32(region->ffxFarBits, a.ffxFarBits.load(relaxed));
|
||||
put32(region->ffxFovMinBits, a.ffxFovMinBits.load(relaxed));
|
||||
put32(region->ffxFovMaxBits, a.ffxFovMaxBits.load(relaxed));
|
||||
put32(region->ffxFlagsSeen, a.ffxFlagsSeen.load(relaxed));
|
||||
put32(region->ffxResets, a.ffxResets.load(relaxed));
|
||||
const uint64_t sumUs = a.ffxFrameTimeSumUs.exchange(0u, relaxed);
|
||||
put32(region->ffxFrameTimeCount, a.ffxFrameTimeCount.exchange(0u, relaxed));
|
||||
put32(region->ffxFrameTimeSumUs, sumUs > 0xFFFFFFFFull ? 0xFFFFFFFFu : static_cast<uint32_t>(sumUs));
|
||||
|
||||
put64(region->ffxMemoryTotalBytes, a.ffxMemoryTotalBytes.load(relaxed));
|
||||
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);
|
||||
}
|
||||
|
||||
} // namespace fl::adv
|
||||
|
||||
#endif // FRAMELEDGER_FL_ADV_FIELDS_H
|
||||
@@ -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,398 @@
|
||||
// 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().
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// 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>
|
||||
void 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();
|
||||
for (std::uint32_t i = 0; i < count; ++i) {
|
||||
Entry& e = entries[i];
|
||||
if (!e.marked) {
|
||||
continue;
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
template <class Hooker, class Ours>
|
||||
void Commit(Registry<Capacity>& registry, const std::atomic<std::uint32_t>& observing, Hooker&& hooker,
|
||||
Ours&& ours) noexcept {
|
||||
if (count_ == 0u) {
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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();
|
||||
for (std::uint32_t i = 0; i < count_; ++i) {
|
||||
Item& item = items_[i];
|
||||
if (item.result != InstallResult::Pending) {
|
||||
continue;
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
// 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();
|
||||
}
|
||||
|
||||
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
|
||||
@@ -99,6 +99,10 @@ struct ScanResult {
|
||||
// was eMaxPerformance; that is 1 in the numbering this byte carries.)
|
||||
uint8_t quality = 0xFFu;
|
||||
bool qualityFound = false;
|
||||
|
||||
// The first readable sl::DLSSOptions of the walk - the struct `quality` came from - or null. Advanced metrics
|
||||
// (fl_adv_fields.h) reads the rest of it, and only while the Agent asked; this walk reads `mode` and nothing more.
|
||||
const sl::DLSSOptions* options = nullptr;
|
||||
};
|
||||
|
||||
// DLSSMode -> the byte fl_shm.h carries. Never 0, for any input.
|
||||
@@ -234,7 +238,8 @@ inline ScanResult FindScalingInputExtent(const sl::BaseStructure** inputs, uint3
|
||||
// the one these headers describe -- which is what makes matching
|
||||
// on `>=` correct here rather than optimistic. The struct is
|
||||
// kStructVersion3 today and grew by appending.
|
||||
out.quality = QualityFromMode(static_cast<const sl::DLSSOptions*>(s)->mode);
|
||||
out.options = static_cast<const sl::DLSSOptions*>(s);
|
||||
out.quality = QualityFromMode(out.options->mode);
|
||||
out.qualityFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -29,7 +29,9 @@
|
||||
// [0x0040] FlWriterState 64 B Overlay-written (writeIndex every present)
|
||||
// [0x0080] FlControlBlock 64 B Agent-written
|
||||
// [0x00C0] FlDisplayState 64 B Overlay-written, at most every 500 ms (layout 4, beta.10)
|
||||
// [0x0100] FlFrameRecord[capacity]
|
||||
// [0x0100] FlAdvancedState 1472 B Overlay-written by its watchdog, once a second, only while the Agent asks
|
||||
// (layout 5, Advanced metrics train B)
|
||||
// [0x06C0] FlFrameRecord[capacity]
|
||||
//
|
||||
// The header regions are separate cache lines on purpose. The Overlay
|
||||
// writes region 2 every frame while the Agent writes region 3 every second;
|
||||
@@ -62,13 +64,19 @@
|
||||
// 0xC0 to 0x100 to make room for it. FlWriterState had no slack left
|
||||
// (dxgiPresentsBeforeHook took its last word), and the display facts are not
|
||||
// frame facts, so neither the writer state nor the record was the place.
|
||||
#define FL_SHM_LAYOUT_VERSION 4u
|
||||
//
|
||||
// 5 (2026-11-11, Advanced metrics train B, owner decisions D111 and D113): region 5, FlAdvancedState, and the ring
|
||||
// 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.
|
||||
#define FL_SHM_LAYOUT_VERSION 5u
|
||||
|
||||
#define FL_SHM_HANDSHAKE_OFFSET 0x00u
|
||||
#define FL_SHM_WRITER_OFFSET 0x40u
|
||||
#define FL_SHM_CONTROL_OFFSET 0x80u
|
||||
#define FL_SHM_DISPLAY_OFFSET 0xC0u
|
||||
#define FL_SHM_RING_OFFSET 0x100u
|
||||
#define FL_SHM_ADVANCED_OFFSET 0x100u
|
||||
#define FL_SHM_RING_OFFSET 0x6C0u
|
||||
|
||||
#define FL_SHM_DEFAULT_CAPACITY 8192u // 8192 * 64 B = 512 KiB, ~16 s at 500 fps
|
||||
|
||||
@@ -397,6 +405,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
|
||||
@@ -821,7 +856,17 @@ struct alignas(64) FlControlBlock {
|
||||
// last acted on, so the Agent never has to clear anything in a block it is the
|
||||
// sole writer of. Took reserved[0]; additive, no layout bump.
|
||||
uint32_t logFlushRequested; // @16
|
||||
uint32_t reserved[11]; // @20..63 must be zero
|
||||
// ADVANCED METRICS REQUESTED (2026-11-11, owner decision D111). 0 while the session this ring belongs to does not
|
||||
// record Advanced metrics; otherwise THAT SESSION'S REQUEST, a non-zero value no session of this ring used before
|
||||
// - and the Agent writes it UNCONDITIONALLY at attach, before its first guard result, because this block outlives
|
||||
// a session and a value left by the last one would be a request nobody made. While it is 0 the Overlay reads no
|
||||
// field and installs no hook beyond what it did before the option existed, and writes nothing to region 5. A
|
||||
// value the watchdog has not seen before is a NEW request: the summaries start afresh, so a session's ranges and
|
||||
// counts are its own, and every publication names the request it answers (FlAdvancedState::request) - which is
|
||||
// how a reader tells its session's region from the one the session before left. Took reserved[0]; additive
|
||||
// within the block.
|
||||
uint32_t advancedRequested; // @20
|
||||
uint32_t reserved[10]; // @24..63 must be zero
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -878,6 +923,164 @@ struct alignas(64) FlDisplayState {
|
||||
uint32_t reserved[4]; // @48..63 must be zero
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Region 5 — Overlay-written: what a hooked game told its upscaler (layout 5, 2026-11-11, Advanced metrics train B).
|
||||
// ---------------------------------------------------------------------------
|
||||
// The owner's "Advanced metrics" (18_GPU_VENDOR_APIS §Advanced metrics): the options a game hands DLSS and FSR, FSR's
|
||||
// own memory, and - in the two releases after this layout - the constants it hands Streamline, its frame-generation
|
||||
// configuration and the versions Streamline reports. All of it is read from the ARGUMENTS of calls the Overlay hooks
|
||||
// (CLAUDE.md rule 4), by the rule of 17_HOOK_ENGINE §Which struct version carries which field: a member is read only
|
||||
// where the upstream tags prove the game's struct has it.
|
||||
//
|
||||
// OFF MEANS OFF (D111). Nothing here is written, and nothing more is read in any hook, while
|
||||
// FlControlBlock.advancedRequested is 0. A ring nobody ever asked has this region zero from end to end, and
|
||||
// `validMask` zero says "nothing was read" - never "the game used none of it".
|
||||
//
|
||||
// A PUBLICATION ANSWERS ONE REQUEST (2026-11-12). The game outlives a session, and so would a range or a count kept
|
||||
// inside it: the watchdog starts its summaries afresh at a request it has not seen, and `request` names the one a
|
||||
// publication answers. After an "off" the region keeps its last publication, untouched - a reader that asks again
|
||||
// reads nothing until one names ITS request.
|
||||
//
|
||||
// ONE WRITER, ONCE A SECOND. The detours keep process-local accumulators (relaxed atomics); the WATCHDOG copies them
|
||||
// here at its 1 Hz tick. No game thread writes this region, so the seqlock has a single writer and needs no
|
||||
// compare-exchange: `seq` goes odd, the fields are stored, `seq` goes even. A reader copies the region between two
|
||||
// reads of an even, unchanged `seq`. A watchdog killed with its process can leave `seq` odd for good - a reader that
|
||||
// keeps the last good copy loses nothing.
|
||||
//
|
||||
// VENDOR ZEROS AND SENTINELS (the trap HANDOFF records for rtTier, upscalerQuality and swapEffect). A Streamline
|
||||
// Boolean and a DLSS preset are stored as the vendor value PLUS ONE, so 0 is "not read" and never "false" or "the
|
||||
// default preset". A float is stored as its bits; FL_ADV_FLOAT_NONE means no value was seen - the vendors' own
|
||||
// sentinels (Streamline's INVALID_FLOAT is FLT_MAX) are refused in the detour and never reach here. A width or
|
||||
// height of 0 is "not given" (Streamline's INVALID_UINT is refused the same way).
|
||||
//
|
||||
// PER-FRAME VALUES ARE SUMMARISED WHERE THEY ARE SEEN, not sampled once a second: a flag is an "ever seen" mask, a
|
||||
// jitter is the largest magnitude seen, a field of view is its lowest and highest (D114: a session's range, never a
|
||||
// series), and the frame time the game reports is a count and a sum over the second, which the watchdog drains.
|
||||
|
||||
// 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
|
||||
// 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
|
||||
};
|
||||
|
||||
// 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
|
||||
|
||||
// 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
|
||||
// [12..14] osVersionDetected [15..17] osVersionRequired
|
||||
// [18..20] driverVersionDetected [21..23] driverVersionRequired
|
||||
#define FL_ADV_FEATURE_SLOTS 12u
|
||||
#define FL_ADV_FEATURE_WORDS 24u
|
||||
|
||||
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
|
||||
|
||||
// ---- 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
|
||||
uint32_t dlssOptionsSeen; // @68 evaluates that chained a DLSSOptions (wraps)
|
||||
uint32_t dlssOutputWidth; // @72 0 = not given
|
||||
uint32_t dlssOutputHeight; // @76
|
||||
uint32_t dlssPreExposureBits; // @80 float bits, or FL_ADV_FLOAT_NONE
|
||||
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
|
||||
|
||||
// ---- line 2: the ffx upscale dispatch, beyond its two sizes ---------------------------------------------------
|
||||
uint32_t ffxDispatches; // @128 upscale dispatches whose extras were read (wraps)
|
||||
uint32_t ffxSharpenSeen; // @132 bit 0: seen off; bit 1: seen on
|
||||
uint32_t ffxSharpnessMinBits; // @136 over the dispatches with sharpening on; float bits or NONE
|
||||
uint32_t ffxSharpnessMaxBits; // @140
|
||||
uint32_t ffxJitterMaxXBits; // @144 the largest |jitterOffset.x| seen
|
||||
uint32_t ffxJitterMaxYBits; // @148
|
||||
uint32_t ffxPreExposureMinBits; // @152
|
||||
uint32_t ffxPreExposureMaxBits; // @156
|
||||
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
|
||||
uint32_t ffxFlagsSeen; // @176 every FFX_UPSCALE_FLAG bit any dispatch carried
|
||||
uint32_t ffxResets; // @180 dispatches with `reset` set (wraps)
|
||||
uint32_t ffxFrameTimeCount; // @184 dispatches since the last publication...
|
||||
uint32_t ffxFrameTimeSumUs; // @188 ...and the sum of their frameTimeDelta, in microseconds
|
||||
|
||||
// ---- line 3: the ffx upscaler's memory, and its frame-generation configuration --------------------------------
|
||||
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.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.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
|
||||
uint32_t slJitterMaxYBits; // @268
|
||||
uint32_t slMvecScaleXBits; // @272 the last one seen
|
||||
uint32_t slMvecScaleYBits; // @276
|
||||
uint32_t slNearBits; // @280
|
||||
uint32_t slFarBits; // @284
|
||||
uint32_t slFovMinBits; // @288 radians: the lowest and the highest (D114)
|
||||
uint32_t slFovMaxBits; // @292
|
||||
uint32_t slAspectBits; // @296
|
||||
// One bit per sl::Constants Boolean, in the header's order: depthInverted, cameraMotionIncluded, motionVectors3D,
|
||||
// reset, orthographicProjection, motionVectorsDilated, motionVectorsJittered.
|
||||
uint32_t slFlagsSeenTrue; // @300
|
||||
uint32_t slFlagsSeenFalse; // @304
|
||||
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.44) --------------------------------------------------------------
|
||||
uint32_t features[FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS]; // @320..1471
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Region 5 — the ring. 64 bytes exactly, no implicit padding.
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -1065,6 +1268,8 @@ static_assert(offsetof(FlControlBlock, unhookRequested) == 4);
|
||||
static_assert(offsetof(FlControlBlock, overlayEnabled) == 8);
|
||||
static_assert(offsetof(FlControlBlock, guardTicks) == 12);
|
||||
static_assert(offsetof(FlControlBlock, logFlushRequested) == 16);
|
||||
static_assert(offsetof(FlControlBlock, advancedRequested) == 20);
|
||||
static_assert(offsetof(FlControlBlock, reserved) == 24);
|
||||
|
||||
static_assert(offsetof(FlFrameRecord, qpc) == 0);
|
||||
static_assert(offsetof(FlFrameRecord, frameIndex) == 8);
|
||||
@@ -1123,12 +1328,42 @@ static_assert(offsetof(FlDisplayState, sampleQpc) == 40);
|
||||
static_assert(offsetof(FlDisplayState, reserved) == 48);
|
||||
static_assert(offsetof(FlDisplayState, hwnd) % 8 == 0 && offsetof(FlDisplayState, sampleQpc) % 8 == 0);
|
||||
|
||||
// Region 5 (layout 5): twenty-three cache lines, each group on its own line, every field naturally aligned.
|
||||
static_assert(sizeof(FlAdvancedState) == 1472);
|
||||
static_assert(sizeof(FlAdvancedState) % 64 == 0);
|
||||
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, 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, ffxDispatches) == 128);
|
||||
static_assert(offsetof(FlAdvancedState, ffxFrameTimeSumUs) == 188);
|
||||
static_assert(offsetof(FlAdvancedState, ffxMemoryTotalBytes) == 192);
|
||||
static_assert(offsetof(FlAdvancedState, ffxMemoryQueries) == 208);
|
||||
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, 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);
|
||||
|
||||
// The regions must not overlap, and the ring must stay 64-aligned.
|
||||
static_assert(FL_SHM_HANDSHAKE_OFFSET + sizeof(FlShmHandshake) <= FL_SHM_WRITER_OFFSET);
|
||||
static_assert(FL_SHM_WRITER_OFFSET + sizeof(FlWriterState) <= FL_SHM_CONTROL_OFFSET);
|
||||
static_assert(FL_SHM_CONTROL_OFFSET + sizeof(FlControlBlock) <= FL_SHM_DISPLAY_OFFSET);
|
||||
static_assert(FL_SHM_DISPLAY_OFFSET + sizeof(FlDisplayState) <= FL_SHM_RING_OFFSET);
|
||||
static_assert(FL_SHM_DISPLAY_OFFSET + sizeof(FlDisplayState) <= FL_SHM_ADVANCED_OFFSET);
|
||||
static_assert(FL_SHM_ADVANCED_OFFSET + sizeof(FlAdvancedState) <= FL_SHM_RING_OFFSET);
|
||||
static_assert(FL_SHM_DISPLAY_OFFSET % 64 == 0);
|
||||
static_assert(FL_SHM_ADVANCED_OFFSET % 64 == 0);
|
||||
static_assert(FL_SHM_RING_OFFSET % 64 == 0);
|
||||
|
||||
constexpr size_t FlShmSizeForCapacity(uint32_t capacity) noexcept {
|
||||
|
||||
@@ -137,6 +137,8 @@ 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>"
|
||||
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.
|
||||
@@ -178,6 +180,15 @@ 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_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)
|
||||
|
||||
add_test(NAME fl_vklayer COMMAND fl_vklayer_test "[vklayer]")
|
||||
add_test(NAME fl_vklayer_supervision COMMAND fl_vklayer_test "[vklayer-deadline]")
|
||||
# The real-loader leg SKIPS (Catch2 exit 4) where there is no Vulkan loader or no
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
+1010
-1
File diff suppressed because it is too large.
Load diff
@@ -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,571 @@ 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);
|
||||
|
||||
batch.Commit(registry, observing, RealQueue{}, RealOurs);
|
||||
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;
|
||||
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 == 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
|
||||
batch.Commit(registry, observing, engine, ModelOurs{&model});
|
||||
|
||||
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);
|
||||
batch.Commit(registry, observing, engine, ModelOurs{&model});
|
||||
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;
|
||||
fl::patch::RestoreAll(
|
||||
registry, engine, ModelOurs{&model},
|
||||
[&restored](const char*, void*, bool wasOurs, bool ok) noexcept { restored += (wasOurs && ok) ? 1 : 0; });
|
||||
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);
|
||||
batch.Commit(registry, observing, engine, ModelOurs{&model});
|
||||
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, ¬Ours](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);
|
||||
}
|
||||
@@ -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 "?";
|
||||
}
|
||||
|
||||
@@ -39,9 +39,10 @@ int main() {
|
||||
std::printf("{\n");
|
||||
std::printf(" \"layoutVersion\": %u,\n", FL_SHM_LAYOUT_VERSION);
|
||||
std::printf(
|
||||
" \"regions\": { \"handshake\": %u, \"writer\": %u, \"control\": %u, \"display\": %u, \"ring\": %u },\n",
|
||||
" \"regions\": { \"handshake\": %u, \"writer\": %u, \"control\": %u, \"display\": %u, \"advanced\": %u, "
|
||||
"\"ring\": %u },\n",
|
||||
FL_SHM_HANDSHAKE_OFFSET, FL_SHM_WRITER_OFFSET, FL_SHM_CONTROL_OFFSET, FL_SHM_DISPLAY_OFFSET,
|
||||
FL_SHM_RING_OFFSET);
|
||||
FL_SHM_ADVANCED_OFFSET, FL_SHM_RING_OFFSET);
|
||||
// D33: the tolerance mapping (fl_tolerance.h) the Agent writes before an injection under a user-mode exception.
|
||||
std::printf(" \"tolerance\": { \"magic\": %u, \"version\": %u, \"maxFamilies\": %u, \"nameLen\": %u },\n",
|
||||
FL_TOLERANCE_MAGIC, FL_TOLERANCE_VERSION, FL_TOLERANCE_MAX_FAMILIES, FL_TOLERANCE_NAME_LEN);
|
||||
@@ -86,7 +87,8 @@ int main() {
|
||||
Field("overlayEnabled", offsetof(FlControlBlock, overlayEnabled), sizeof(uint32_t));
|
||||
Field("guardTicks", offsetof(FlControlBlock, guardTicks), sizeof(uint32_t));
|
||||
Field("logFlushRequested", offsetof(FlControlBlock, logFlushRequested), sizeof(uint32_t));
|
||||
Field("reserved", offsetof(FlControlBlock, reserved), sizeof(uint32_t) * 11, true);
|
||||
Field("advancedRequested", offsetof(FlControlBlock, advancedRequested), sizeof(uint32_t));
|
||||
Field("reserved", offsetof(FlControlBlock, reserved), sizeof(uint32_t) * 10, true);
|
||||
std::printf(" ] },\n");
|
||||
|
||||
// Layout 4 (beta.10): region 4, the presenting swap chain's display facts.
|
||||
@@ -104,6 +106,73 @@ int main() {
|
||||
Field("reserved", offsetof(FlDisplayState, reserved), sizeof(uint32_t) * 4, true);
|
||||
std::printf(" ] },\n");
|
||||
|
||||
// Layout 5 (Advanced metrics train B): region 5, what a hooked game told its upscaler. EVERY member, the ones a
|
||||
// later release fills included - the mirror is checked whole or it is not checked.
|
||||
#define FL_ADV_FIELD(name) Field(#name, offsetof(FlAdvancedState, name), sizeof(FlAdvancedState::name))
|
||||
std::printf(" \"FlAdvancedState\": { \"size\": %zu, \"fields\": [\n", sizeof(FlAdvancedState));
|
||||
FL_ADV_FIELD(seq);
|
||||
FL_ADV_FIELD(validMask);
|
||||
FL_ADV_FIELD(samples);
|
||||
FL_ADV_FIELD(request);
|
||||
FL_ADV_FIELD(sampleQpc);
|
||||
FL_ADV_FIELD(reservedHeader);
|
||||
FL_ADV_FIELD(dlssStructVersion);
|
||||
FL_ADV_FIELD(dlssOptionsSeen);
|
||||
FL_ADV_FIELD(dlssOutputWidth);
|
||||
FL_ADV_FIELD(dlssOutputHeight);
|
||||
FL_ADV_FIELD(dlssPreExposureBits);
|
||||
FL_ADV_FIELD(dlssExposureScaleBits);
|
||||
FL_ADV_FIELD(dlssPresets);
|
||||
FL_ADV_FIELD(dlssColorBuffersHdr);
|
||||
FL_ADV_FIELD(dlssAutoExposure);
|
||||
FL_ADV_FIELD(dlssAlphaUpscaling);
|
||||
FL_ADV_FIELD(dlssPad);
|
||||
FL_ADV_FIELD(reservedDlss);
|
||||
FL_ADV_FIELD(ffxDispatches);
|
||||
FL_ADV_FIELD(ffxSharpenSeen);
|
||||
FL_ADV_FIELD(ffxSharpnessMinBits);
|
||||
FL_ADV_FIELD(ffxSharpnessMaxBits);
|
||||
FL_ADV_FIELD(ffxJitterMaxXBits);
|
||||
FL_ADV_FIELD(ffxJitterMaxYBits);
|
||||
FL_ADV_FIELD(ffxPreExposureMinBits);
|
||||
FL_ADV_FIELD(ffxPreExposureMaxBits);
|
||||
FL_ADV_FIELD(ffxNearBits);
|
||||
FL_ADV_FIELD(ffxFarBits);
|
||||
FL_ADV_FIELD(ffxFovMinBits);
|
||||
FL_ADV_FIELD(ffxFovMaxBits);
|
||||
FL_ADV_FIELD(ffxFlagsSeen);
|
||||
FL_ADV_FIELD(ffxResets);
|
||||
FL_ADV_FIELD(ffxFrameTimeCount);
|
||||
FL_ADV_FIELD(ffxFrameTimeSumUs);
|
||||
FL_ADV_FIELD(ffxMemoryTotalBytes);
|
||||
FL_ADV_FIELD(ffxMemoryAliasableBytes);
|
||||
FL_ADV_FIELD(ffxMemoryQueries);
|
||||
FL_ADV_FIELD(ffxFgConfigures);
|
||||
FL_ADV_FIELD(ffxFgEnabledSeen);
|
||||
FL_ADV_FIELD(ffxFgAsyncSeen);
|
||||
FL_ADV_FIELD(ffxFgOnlyGeneratedSeen);
|
||||
FL_ADV_FIELD(ffxFgFlagsSeen);
|
||||
FL_ADV_FIELD(ffxFgRect);
|
||||
FL_ADV_FIELD(reservedFfx);
|
||||
FL_ADV_FIELD(slConstantsCalls);
|
||||
FL_ADV_FIELD(slResets);
|
||||
FL_ADV_FIELD(slJitterMaxXBits);
|
||||
FL_ADV_FIELD(slJitterMaxYBits);
|
||||
FL_ADV_FIELD(slMvecScaleXBits);
|
||||
FL_ADV_FIELD(slMvecScaleYBits);
|
||||
FL_ADV_FIELD(slNearBits);
|
||||
FL_ADV_FIELD(slFarBits);
|
||||
FL_ADV_FIELD(slFovMinBits);
|
||||
FL_ADV_FIELD(slFovMaxBits);
|
||||
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
|
||||
std::printf(" ] },\n");
|
||||
|
||||
std::printf(" \"FlFrameRecord\": { \"size\": %zu, \"fields\": [\n", sizeof(FlFrameRecord));
|
||||
Field("qpc", offsetof(FlFrameRecord, qpc), sizeof(uint64_t));
|
||||
Field("frameIndex", offsetof(FlFrameRecord, frameIndex), sizeof(uint32_t));
|
||||
|
||||
@@ -140,6 +140,12 @@ add_test(NAME fl_ffx_resolve COMMAND hook-harness --probe-ffx-resolve)
|
||||
# could only approximate these shapes. Here they are exact and cost microseconds.
|
||||
add_test(NAME fl_sl_inputs COMMAND hook-harness --probe-sl-inputs)
|
||||
|
||||
# fl_adv_fields.h (Advanced metrics, train B): the members a hooked call's struct carries beyond what the frame
|
||||
# record holds. A unit probe for the same reason as fl_sl_inputs, and one more: the property that matters most -
|
||||
# a struct of an OLDER version than the vendored header declares must not have its tail read (owner decision D115,
|
||||
# 17_HOOK_ENGINE §Which struct version carries which field) - needs a struct no fixture title can be made to send.
|
||||
add_test(NAME fl_adv_fields COMMAND hook-harness --probe-adv-fields)
|
||||
|
||||
# The word RecordPresent drains. Its FIELD BOUNDARIES are static_asserts inside
|
||||
# fl_sl_seen.h -- integer algebra, checked in every TU that includes the header, so
|
||||
# no test can forget them and a 16-million-iteration loop proving a carry cannot go
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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));
|
||||
}
|
||||
|
||||
@@ -148,6 +148,22 @@ FFX_API_ENTRY ffxReturnCode_t ffxQuery(ffxContext* context, ffxQueryDescHeader*
|
||||
*q->pOutUpscaleRatio = kRatios[q->qualityMode];
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
// THE UPSCALER'S MEMORY (Advanced metrics, train B), in both descriptors: two fixed numbers no real context
|
||||
// would report, written through the caller's own pointer - which is where the Overlay reads them after this
|
||||
// returns, and only while the Agent asked. guard_test.cpp states the same two.
|
||||
if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE ||
|
||||
desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE_V2) {
|
||||
FfxApiEffectMemoryUsage* usage =
|
||||
desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GPU_MEMORY_USAGE
|
||||
? reinterpret_cast<ffxQueryDescUpscaleGetGPUMemoryUsage*>(desc)->gpuMemoryUsageUpscaler
|
||||
: reinterpret_cast<ffxQueryDescUpscaleGetGPUMemoryUsageV2*>(desc)->gpuMemoryUsageUpscaler;
|
||||
if (usage == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
usage->totalUsageInBytes = 123456789ull;
|
||||
usage->aliasableUsageInBytes = 23456789ull;
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,20 @@ StubFrameToken g_tokenPool[8];
|
||||
static_assert(fl::stub::InventoryHas("slGetNewFrameToken"),
|
||||
"fl_hook_inventory.h no longer contains \"slGetNewFrameToken\", so the frame-token fixture would "
|
||||
"exercise a row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slGetFeatureVersion") && fl::stub::InventoryHas("slGetFeatureRequirements"),
|
||||
"fl_hook_inventory.h no longer contains \"slGetFeatureVersion\" or \"slGetFeatureRequirements\", so the "
|
||||
"feature fixture would exercise a row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slIsFeatureSupported") && fl::stub::InventoryHas("slIsFeatureLoaded") &&
|
||||
fl::stub::InventoryHas("slSetFeatureLoaded"),
|
||||
"fl_hook_inventory.h no longer contains one of the three feature-state rows of 0.1.0-beta.45, so the "
|
||||
"fixture would exercise a row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slAllocateResources") && fl::stub::InventoryHas("slFreeResources") &&
|
||||
fl::stub::InventoryHas("slShutdown"),
|
||||
"fl_hook_inventory.h no longer contains one of the three counted rows of 0.1.0-beta.45, so the fixture "
|
||||
"would exercise a row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slSetConstants"),
|
||||
"fl_hook_inventory.h no longer contains \"slSetConstants\", so the constants fixture would exercise a "
|
||||
"row the Overlay does not install.");
|
||||
static_assert(fl::stub::InventoryHas("slSetTagForFrame"),
|
||||
"fl_hook_inventory.h no longer contains \"slSetTagForFrame\", so the frame-based tag fixture would "
|
||||
"exercise a row the Overlay does not install.");
|
||||
@@ -138,12 +152,131 @@ SL_API sl::Result slSetD3DDevice(void* d3dDevice) {
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
// An ABI marker, and since 0.1.0-beta.45 a hooked row: DLSS and everything else are loaded, PCL is not, and NIS is
|
||||
// REFUSED after the bool was written true -- a refused answer the Overlay must not keep.
|
||||
SL_API sl::Result slIsFeatureLoaded(sl::Feature feature, bool& loaded) {
|
||||
loaded = feature != sl::kFeaturePCL;
|
||||
return feature == sl::kFeatureNIS ? sl::Result::eErrorFeatureMissing : sl::Result::eOk;
|
||||
}
|
||||
|
||||
// The two other rows of 0.1.0-beta.45. The numbers of the two refusals are what the injected case mirrors
|
||||
// (guard_test.cpp): a code that moved in the vendor's header would otherwise pass here and be mislabelled there.
|
||||
static_assert(static_cast<int>(sl::Result::eErrorFeatureMissing) == 31 &&
|
||||
static_cast<int>(sl::Result::eErrorFeatureNotSupported) == 32,
|
||||
"sl::Result's numbering moved; guard_test.cpp states these two as 31 and 32");
|
||||
|
||||
// DLSS and DLSS frame generation are supported, NIS is not, anything else is missing. The adapter is not looked at
|
||||
// here either; the harness hands one whose LUID pointer is wild.
|
||||
SL_API sl::Result slIsFeatureSupported(sl::Feature feature, const sl::AdapterInfo& adapterInfo) {
|
||||
(void)adapterInfo;
|
||||
if (feature == sl::kFeatureDLSS || feature == sl::kFeatureDLSS_G) {
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
return feature == sl::kFeatureNIS ? sl::Result::eErrorFeatureNotSupported : sl::Result::eErrorFeatureMissing;
|
||||
}
|
||||
|
||||
SL_API sl::Result slSetFeatureLoaded(sl::Feature feature, bool loaded) {
|
||||
(void)feature;
|
||||
loaded = true;
|
||||
(void)loaded;
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
// The last three rows of 0.1.0-beta.45. They keep nothing and do nothing: the Overlay counts the calls, and the
|
||||
// harness goes on using the stub after slShutdown, as a game that starts Streamline again would.
|
||||
SL_API sl::Result slAllocateResources(sl::CommandBuffer* cmdBuffer, sl::Feature feature,
|
||||
const sl::ViewportHandle& viewport) {
|
||||
(void)cmdBuffer;
|
||||
(void)feature;
|
||||
(void)viewport;
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
SL_API sl::Result slFreeResources(sl::Feature feature, const sl::ViewportHandle& viewport) {
|
||||
(void)feature;
|
||||
(void)viewport;
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
SL_API sl::Result slShutdown() {
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
// The per-frame constants (0.1.0-beta.43). Signature from the vendored header, like the others. The stub keeps
|
||||
// nothing: the harness hands it known values and the injected cases assert what the Overlay read of them.
|
||||
SL_API sl::Result slSetConstants(const sl::Constants& values, const sl::FrameToken& frame,
|
||||
const sl::ViewportHandle& viewport) {
|
||||
(void)values;
|
||||
(void)frame;
|
||||
(void)viewport;
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
// The two questions a game asks about a feature (0.1.0-beta.44). Signatures from the vendored header. The stub
|
||||
// ANSWERS for DLSS and for DLSS frame generation with fixed numbers the injected case mirrors (guard_test.cpp
|
||||
// kAdvFeature*), answers for PCL too -- the harness asks about that one with a struct whose GUID it has broken, which
|
||||
// the Overlay must not keep -- and REFUSES every other feature after writing loud numbers into the struct, as a
|
||||
// refusal that leaves rubbish behind: a detour that kept a refused answer would publish 99s.
|
||||
SL_API sl::Result slGetFeatureVersion(sl::Feature feature, sl::FeatureVersion& version) {
|
||||
if (feature == sl::kFeatureDLSS) {
|
||||
version.versionSL = sl::Version(2, 14, 1);
|
||||
version.versionNGX = sl::Version(310, 4, 0);
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
if (feature == sl::kFeatureDLSS_G) {
|
||||
version.versionSL = sl::Version(2, 14, 1);
|
||||
version.versionNGX = sl::Version(310, 4, 1);
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
if (feature == sl::kFeaturePCL) {
|
||||
version.versionSL = sl::Version(7, 7, 7);
|
||||
version.versionNGX = sl::Version(7, 7, 7);
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
version.versionSL = sl::Version(99, 99, 99);
|
||||
version.versionNGX = sl::Version(99, 99, 99);
|
||||
return sl::Result::eErrorFeatureMissing;
|
||||
}
|
||||
|
||||
// THE POINTERS ARE WILD ON PURPOSE: the Overlay keeps the count of required tags and never the list, and nothing of
|
||||
// the Vulkan members. An address of 1 is not readable in any process; a detour that followed either would fault, and
|
||||
// the injected case asserts that none was counted.
|
||||
SL_API sl::Result slGetFeatureRequirements(sl::Feature feature, sl::FeatureRequirements& requirements) {
|
||||
requirements.requiredTags = reinterpret_cast<const sl::BufferType*>(static_cast<uintptr_t>(1));
|
||||
requirements.vkNumDeviceExtensions = 3;
|
||||
requirements.vkDeviceExtensions = reinterpret_cast<const char**>(static_cast<uintptr_t>(1));
|
||||
requirements.vkNumInstanceExtensions = 2;
|
||||
requirements.vkInstanceExtensions = reinterpret_cast<const char**>(static_cast<uintptr_t>(1));
|
||||
requirements.osVersionDetected = sl::Version(10, 0, 26100);
|
||||
requirements.osVersionRequired = sl::Version(10, 0, 19041);
|
||||
requirements.driverVersionDetected = sl::Version(591, 44, 0);
|
||||
if (feature == sl::kFeatureDLSS) {
|
||||
requirements.flags = sl::FeatureRequirementFlags::eD3D11Supported |
|
||||
sl::FeatureRequirementFlags::eD3D12Supported |
|
||||
sl::FeatureRequirementFlags::eVulkanSupported;
|
||||
requirements.maxNumCPUThreads = 2;
|
||||
requirements.maxNumViewports = 32;
|
||||
requirements.numRequiredTags = 3;
|
||||
requirements.driverVersionRequired = sl::Version(512, 15, 0);
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
if (feature == sl::kFeatureDLSS_G) {
|
||||
requirements.flags = sl::FeatureRequirementFlags::eD3D12Supported |
|
||||
sl::FeatureRequirementFlags::eVSyncOffRequired |
|
||||
sl::FeatureRequirementFlags::eHardwareSchedulingRequired;
|
||||
requirements.maxNumCPUThreads = 1;
|
||||
requirements.maxNumViewports = 1;
|
||||
requirements.numRequiredTags = 4;
|
||||
requirements.driverVersionRequired = sl::Version(551, 23, 0);
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
requirements.flags = sl::FeatureRequirementFlags::eAll;
|
||||
requirements.maxNumCPUThreads = 99;
|
||||
requirements.maxNumViewports = 99;
|
||||
requirements.numRequiredTags = 99;
|
||||
requirements.driverVersionRequired = sl::Version(99, 99, 99);
|
||||
return sl::Result::eErrorFeatureMissing;
|
||||
}
|
||||
|
||||
SL_API sl::Result slGetNewFrameToken(sl::FrameToken*& token, const uint32_t* frameIndex) {
|
||||
// The vendor's contract in miniature: an explicit index returns THAT frame's
|
||||
// token (the same object on a re-request), no index advances to a new one.
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO.MemoryMappedFiles;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Application.Advanced;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Consent;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Settings;
|
||||
using FrameLedger.Domain.Consent;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
using FrameLedger.Infrastructure.Persistence;
|
||||
@@ -117,6 +119,16 @@ public sealed class AgentEndToEndTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetAdvancedMetricsAsync(bool on)
|
||||
{
|
||||
Directory.CreateDirectory(_dataDir);
|
||||
LedgerDatabase db = await LedgerDatabase.OpenAsync(Ledger, ct: TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
await using (db.ConfigureAwait(false))
|
||||
{
|
||||
await new RegisteredSettings(new SqliteSettingsStore(db)).SetAsync(SettingsRegistry.TelemetryAdvanced, on, TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetKillSwitchAsync(bool engaged)
|
||||
{
|
||||
Directory.CreateDirectory(_dataDir);
|
||||
@@ -223,6 +235,208 @@ public sealed class AgentEndToEndTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WhatTheGameTellsFsrIsStoredOnlyByASessionThatRecordsAdvancedMetrics()
|
||||
{
|
||||
// ADVANCED METRICS INSIDE THE GAME, end to end (train B, 0.1.0-beta.40): the shipped Agent, the real Overlay,
|
||||
// and a target that hands FSR everything on every frame and asks it for its memory. ONE target, TWO sessions,
|
||||
// which is the order that matters: the first does not record Advanced metrics and must store nothing of it
|
||||
// though the game says it all; the second asks - in a game that kept running - and stores what the game said.
|
||||
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
|
||||
|
||||
Process harness = await StartHarnessAsync("--real --ffx-topology 2x --advanced --ffx-memory-query v2 --hold-presenting-ffx 90");
|
||||
try
|
||||
{
|
||||
using (Process off = StartAgent("capture", "--exe", ConsentedExecutable, "--seconds", "6"))
|
||||
{
|
||||
(string output, int exit) = await FinishAsync(off);
|
||||
exit.Should().Be(0, output);
|
||||
}
|
||||
|
||||
await SetAdvancedMetricsAsync(on: true);
|
||||
using (Process on = StartAgent("capture", "--exe", ConsentedExecutable, "--seconds", "10"))
|
||||
{
|
||||
(string output, int exit) = await FinishAsync(on);
|
||||
exit.Should().Be(0, output);
|
||||
}
|
||||
|
||||
LedgerDatabase db = await LedgerDatabase.OpenAsync(Ledger, ct: TestContext.Current.CancellationToken).ConfigureAwait(true);
|
||||
await using (db.ConfigureAwait(true))
|
||||
{
|
||||
var sessions = new SqliteSessionRepository(db);
|
||||
IReadOnlyList<SessionRow> rows = await sessions.ListRecentAsync(2, TestContext.Current.CancellationToken).ConfigureAwait(true);
|
||||
rows.Should().HaveCount(2);
|
||||
SessionRow second = rows[0];
|
||||
SessionRow first = rows[1];
|
||||
first.Tier.Should().Be(CaptureTier.Hooked);
|
||||
second.Tier.Should().Be(CaptureTier.Hooked);
|
||||
|
||||
// OFF: no row, and no series under the advanced prefix - the game said it all, and none of it was kept.
|
||||
(await sessions.FindAdvancedAsync(first.Id, TestContext.Current.CancellationToken).ConfigureAwait(true)).Should().BeNull();
|
||||
(await sessions.FindAdvancedSensorsAsync(first.Id, TestContext.Current.CancellationToken).ConfigureAwait(true))
|
||||
.Should().NotContain(static b => b.Series.StartsWith(AdvancedMetric.SeriesPrefix, StringComparison.Ordinal));
|
||||
|
||||
// ON: the values hook-harness --advanced sends (main.cpp, kAdv*), as fl_guard asserts them natively.
|
||||
AdvancedSessionRow row = (await sessions.FindAdvancedAsync(second.Id, TestContext.Current.CancellationToken).ConfigureAwait(true)).Should().BeOfType<AdvancedSessionRow>().Subject;
|
||||
AssertWhatTheHarnessToldFsr(row);
|
||||
(await sessions.FindAdvancedSensorsAsync(second.Id, TestContext.Current.CancellationToken).ConfigureAwait(true))
|
||||
.Select(static b => b.Series).Should().Contain([InGameAdvancedSampler.FrameTimeSeries, InGameAdvancedSampler.MemorySeries]);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Kill(harness);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WhatTheGameTellsStreamlineAndIsAnsweredAboutAFeatureIsStoredByASessionThatRecordsAdvancedMetrics()
|
||||
{
|
||||
// The Streamline side of the same road, end to end (0.1.0-beta.44; until then no Agent test ran a Streamline
|
||||
// target): the shipped Agent, the real Overlay, and a target that chains its DLSS options into every
|
||||
// evaluation, calls slSetConstants every frame and asks the stub interposer about a feature every sixteenth -
|
||||
// which is what lets a session that attached after the game's start still see an answer. Three calls hooked
|
||||
// only because this session asked.
|
||||
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
|
||||
|
||||
Process harness = await StartHarnessAsync("--real --advanced --hold-presenting-upscaled 90");
|
||||
try
|
||||
{
|
||||
await SetAdvancedMetricsAsync(on: true);
|
||||
using (Process on = StartAgent("capture", "--exe", ConsentedExecutable, "--seconds", "10"))
|
||||
{
|
||||
(string output, int exit) = await FinishAsync(on);
|
||||
exit.Should().Be(0, output);
|
||||
}
|
||||
|
||||
LedgerDatabase db = await LedgerDatabase.OpenAsync(Ledger, ct: TestContext.Current.CancellationToken).ConfigureAwait(true);
|
||||
await using (db.ConfigureAwait(true))
|
||||
{
|
||||
var sessions = new SqliteSessionRepository(db);
|
||||
SessionRow session = (await sessions.ListRecentAsync(1, TestContext.Current.CancellationToken).ConfigureAwait(true)).Should().ContainSingle().Subject;
|
||||
session.Tier.Should().Be(CaptureTier.Hooked);
|
||||
AdvancedSessionRow row = (await sessions.FindAdvancedAsync(session.Id, TestContext.Current.CancellationToken).ConfigureAwait(true)).Should().BeOfType<AdvancedSessionRow>().Subject;
|
||||
AssertWhatTheHarnessToldStreamline(row);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Kill(harness);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The stored row of a session that asked, against what <c>hook-harness --advanced</c> tells Streamline and the stub interposer answers.</summary>
|
||||
private static void AssertWhatTheHarnessToldStreamline(AdvancedSessionRow row)
|
||||
{
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
string[] Rows(string id) => [.. facts.Single(f => string.Equals(f.Id, id, StringComparison.Ordinal)).Value.Rows!.Select(static r => r.Name + "=" + r.Value)];
|
||||
|
||||
// What the harness tells slSetConstants for its first viewport (main.cpp, kAdvSl*).
|
||||
Rows("sl.constants.jitter").Should().Equal("jitterOffset.x=≤ 0.3125", "jitterOffset.y=≤ 0.4375");
|
||||
Rows("sl.constants.depth").Should().Equal("cameraNear=0.25", "cameraFar=4000", "depthInverted=on");
|
||||
Rows("sl.constants.projection").Should().Equal("cameraFOV=0.8 – 1.2 rad (45.8° – 68.8°)", "cameraAspectRatio=1.75", "orthographicProjection=off");
|
||||
|
||||
// What the stub interposer answers about the two features it knows (stub_sl_interposer.cpp), and
|
||||
// nothing of the one it refuses or of the one asked about with a struct that is not the headers'.
|
||||
Rows("sl.feature.versions").Should().Equal(
|
||||
"kFeatureDLSS · versionSL=2.14.1",
|
||||
"kFeatureDLSS · versionNGX=310.4.0",
|
||||
"kFeatureDLSS_G · versionSL=2.14.1",
|
||||
"kFeatureDLSS_G · versionNGX=310.4.1");
|
||||
Rows("sl.feature.requirements").Should().Equal(
|
||||
"kFeatureDLSS · flags=eD3D11Supported, eD3D12Supported, eVulkanSupported",
|
||||
"kFeatureDLSS · maxNumCPUThreads=2",
|
||||
"kFeatureDLSS · maxNumViewports=32",
|
||||
"kFeatureDLSS · numRequiredTags=3",
|
||||
"kFeatureDLSS · osVersionDetected=10.0.26100",
|
||||
"kFeatureDLSS · osVersionRequired=10.0.19041",
|
||||
"kFeatureDLSS · driverVersionDetected=591.44.0",
|
||||
"kFeatureDLSS · driverVersionRequired=512.15.0",
|
||||
"kFeatureDLSS_G · flags=eD3D12Supported, eVSyncOffRequired, eHardwareSchedulingRequired",
|
||||
"kFeatureDLSS_G · maxNumCPUThreads=1",
|
||||
"kFeatureDLSS_G · maxNumViewports=1",
|
||||
"kFeatureDLSS_G · numRequiredTags=4",
|
||||
"kFeatureDLSS_G · osVersionDetected=10.0.26100",
|
||||
"kFeatureDLSS_G · osVersionRequired=10.0.19041",
|
||||
"kFeatureDLSS_G · driverVersionDetected=591.44.0",
|
||||
"kFeatureDLSS_G · driverVersionRequired=551.23.0");
|
||||
|
||||
sources.InGame.Should().Be(AdvancedInGameStatus.Reading, row.FactsJson);
|
||||
sources.StreamlineConstants.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineFeatureVersion.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineFeatureRequirements.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.FsrFrameGeneration.Should().Be(AdvancedInGameCall.NotHooked, "this target loads no FidelityFX library: " + row.FactsJson);
|
||||
AssertWhatTheHarnessDidWithStreamlinesFeatures(row);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 0.1.0-beta.45: whether each feature is supported and loaded, as the stub says - a refusal is the answer and is
|
||||
/// named - and what the harness does with two of them every sixteenth frame. The counts depend on how long the
|
||||
/// session ran; that they are there, and for the right feature, does not.
|
||||
/// </summary>
|
||||
private static void AssertWhatTheHarnessDidWithStreamlinesFeatures(AdvancedSessionRow row)
|
||||
{
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
string[] Rows(string id) => [.. facts.Single(f => string.Equals(f.Id, id, StringComparison.Ordinal)).Value.Rows!.Select(static r => r.Name + "=" + r.Value)];
|
||||
|
||||
Rows("sl.feature.support").Should().Equal(
|
||||
"kFeatureDLSS · slIsFeatureSupported=eOk",
|
||||
"kFeatureDLSS · slIsFeatureLoaded=on",
|
||||
"kFeatureDLSS_G · slIsFeatureSupported=eOk",
|
||||
"kFeatureNIS · slIsFeatureSupported=eErrorFeatureNotSupported",
|
||||
"kFeatureReflex · slIsFeatureSupported=eErrorFeatureMissing",
|
||||
"kFeaturePCL · slIsFeatureLoaded=off");
|
||||
string[] lifecycle = Rows("sl.feature.lifecycle");
|
||||
lifecycle.Should().Contain("kFeatureDLSS · slSetFeatureLoaded=on").And.Contain("kFeatureDLSS_G · slSetFeatureLoaded=on_and_off");
|
||||
lifecycle.Should().Contain(static r => r.StartsWith("kFeatureDLSS · slAllocateResources=", StringComparison.Ordinal))
|
||||
.And.Contain(static r => r.StartsWith("kFeatureDLSS_G · slFreeResources=", StringComparison.Ordinal))
|
||||
.And.Contain(static r => r.StartsWith("slShutdown=", StringComparison.Ordinal))
|
||||
.And.NotContain(static r => r.StartsWith("kFeatureDLSS_G · slAllocateResources=", StringComparison.Ordinal));
|
||||
sources.StreamlineFeatureSupported.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineFeatureLoaded.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineSetFeatureLoaded.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineAllocateResources.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineFreeResources.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineShutdown.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
}
|
||||
|
||||
/// <summary>The stored row of a session that asked, against what <c>hook-harness --advanced --ffx-memory-query</c> sends and the FSR stub answers.</summary>
|
||||
private static void AssertWhatTheHarnessToldFsr(AdvancedSessionRow row)
|
||||
{
|
||||
(IReadOnlyList<AdvancedFact> facts, AdvancedSources sources) = AdvancedJson.ParseSession(row.FactsJson);
|
||||
sources.InGame.Should().Be(AdvancedInGameStatus.Reading, row.FactsJson);
|
||||
string[] Rows(string id) => [.. facts.Single(f => string.Equals(f.Id, id, StringComparison.Ordinal)).Value.Rows!.Select(static r => r.Name + "=" + r.Value)];
|
||||
Rows("ffx.upscale.sharpening").Should().Equal("enableSharpening=on", "sharpness=0.35");
|
||||
Rows("ffx.upscale.jitter").Should().Equal("jitterOffset.x=≤ 0.3", "jitterOffset.y=≤ 0.4");
|
||||
Rows("ffx.upscale.depth").Should().Equal("cameraNear=0.1", "cameraFar=1000", "cameraFovAngleVertical=0.9 – 1.1 rad (51.6° – 63°)");
|
||||
facts.Single(static f => string.Equals(f.Id, "ffx.upscale.exposure", StringComparison.Ordinal)).Value.Text.Should().Be("1.25");
|
||||
facts.Single(static f => string.Equals(f.Id, "ffx.upscale.flags", StringComparison.Ordinal)).Value.Tokens.Should().Equal("non_linear_color_pq");
|
||||
facts.Should().NotContain(static f => f.Id.StartsWith("sl.", StringComparison.Ordinal), "this target chains no DLSS options");
|
||||
|
||||
// 0.1.0-beta.43: the frame-generation configuration the harness sends through ffxConfigure before each frame
|
||||
// (kAdvFfxFg*), read by a hook that was not in the game during the first session - nothing had asked - and
|
||||
// was installed when this one did. Streamline's library is not in this target at all, and the row says that
|
||||
// rather than "the game never called".
|
||||
Rows("ffx.framegen.config").Should().Equal(
|
||||
"frameGenerationEnabled=on",
|
||||
"allowAsyncWorkloads=off",
|
||||
"onlyPresentGenerated=off",
|
||||
"flags=DRAW_DEBUG_PACING_LINES",
|
||||
"generationRect=1920 × 1080 at 0, 0");
|
||||
sources.FsrFrameGeneration.Should().Be(AdvancedInGameCall.Read, row.FactsJson);
|
||||
sources.StreamlineConstants.Should().Be(AdvancedInGameCall.NotHooked, row.FactsJson);
|
||||
sources.StreamlineFeatureVersion.Should().Be(AdvancedInGameCall.NotHooked, row.FactsJson);
|
||||
sources.StreamlineFeatureRequirements.Should().Be(AdvancedInGameCall.NotHooked, row.FactsJson);
|
||||
sources.StreamlineFeatureSupported.Should().Be(AdvancedInGameCall.NotHooked, row.FactsJson);
|
||||
sources.StreamlineShutdown.Should().Be(AdvancedInGameCall.NotHooked, row.FactsJson);
|
||||
|
||||
IReadOnlyDictionary<string, Application.Recording.SensorSeriesStats> stats = AdvancedJson.ParseStats(row.StatsJson);
|
||||
stats.Should().ContainKey(InGameAdvancedSampler.FrameTimeSeries, row.StatsJson);
|
||||
stats[InGameAdvancedSampler.FrameTimeSeries].Mean.Should().BeApproximately(16.0, 0.01, "every dispatch states 16 ms");
|
||||
stats.Should().ContainKey(InGameAdvancedSampler.MemorySeries, row.StatsJson);
|
||||
stats[InGameAdvancedSampler.MemorySeries].Max.Should().BeApproximately(123456789 / (1024.0 * 1024.0), 0.01, "what the FSR stub answers the memory query with");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WithTheKillSwitchOnAConsentedGameIsRefusedAndNothingIsEverInjected()
|
||||
{
|
||||
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user