Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1578dde38b |
No files matched your search
+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.45. In the app: Help ▸ Accessibility.*
|
||||
*Beta software: this page describes version 0.1.0-beta.43. In the app: Help ▸ Accessibility.*
|
||||
|
||||
## What FrameLedger aims for
|
||||
|
||||
|
||||
@@ -35,31 +35,12 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- **Hooks go into a game together, and come out together** (owner decision D134). Putting a hook in or taking it
|
||||
out stops every thread of the game for a moment, and until now that happened once for every hook: the thirteen
|
||||
Streamline hooks took 0.7 to 2.8 seconds of a game's start in real sessions (2026-11-13), and stopping a session
|
||||
took about a sixth of a second for each hook — two to three seconds, sometimes on the thread that draws. The
|
||||
hooks a moment finds are now put in under **one** stop of the threads, and a stop takes all of them out under
|
||||
one. On FrameLedger's own test program: nine hooks in 78–90 ms where they took 0.6–0.7 s; eighteen out in
|
||||
76–90 ms where they took 1.4–1.6 s. What a hook reads and when it is installed are unchanged, and no hook's own
|
||||
code changed. The log of the part inside the game has a new line for each such moment (`PATCH_BATCH`, with the
|
||||
time it took and the number of hooks). **Not run in a real game yet.**
|
||||
|
||||
- **The limitations, the accuracy statement and the user guide say what the first real sessions on 0.1.0-beta.45
|
||||
showed** (2026-11-13, six games): five of its six new readings were read in real games — every Streamline game
|
||||
asked whether its features are supported — and no game allocated a feature's resources after FrameLedger was in
|
||||
it, so that row has not been seen. No code changes.
|
||||
|
||||
## Releases
|
||||
|
||||
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) |
|
||||
|
||||
@@ -20,8 +20,6 @@ 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`.
|
||||
|
||||
@@ -127,14 +125,6 @@ src/
|
||||
# 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,
|
||||
|
||||
+3
-46
@@ -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.45.*
|
||||
*Beta software: this page describes version 0.1.0-beta.43.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -51,11 +51,6 @@ 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
|
||||
|
||||
@@ -199,43 +194,7 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
|
||||
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.
|
||||
Streamline 1.x is not read. **Neither has been confirmed on a real game yet.**
|
||||
- **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
|
||||
@@ -314,9 +273,7 @@ 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 — 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
|
||||
measured session early, which the crash safety counts: two turn hooking off for the game. 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.45`** (2026-11-12), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.43`** (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
|
||||
@@ -117,18 +117,8 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
|
||||
> 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.
|
||||
> for, not whether frames were generated). FSR's upscaling values have been read from real games; the DLSS options,
|
||||
> Streamline's constants and the frame-generation configuration have not been confirmed on one yet.
|
||||
> - **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
|
||||
@@ -205,7 +195,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **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`.
|
||||
> **The latest beta is `v0.1.0-beta.43` (2026-11-12); before it `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,14 +25,8 @@
|
||||
-->
|
||||
<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.
|
||||
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>
|
||||
<!-- Tests repeat their arrange steps on purpose; duplication there is not a defect. -->
|
||||
<Property Name="sonar.cpd.exclusions">tests/**,src/native/tests/**</Property>
|
||||
|
||||
<Property Name="sonar.sourceEncoding">UTF-8</Property>
|
||||
|
||||
|
||||
@@ -764,15 +764,7 @@ Sequential embedded SQL (`Migrations/0001_init.sql`, `0002_*.sql`, …), applied
|
||||
> `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
|
||||
> and in a session not measured inside the game. 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;
|
||||
|
||||
@@ -145,26 +145,6 @@ What the region is, as a contract between the two sides:
|
||||
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.
|
||||
|
||||
|
||||
@@ -877,16 +877,6 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
> (`Advanced_InGameCallsLine` with `AdvInGameCall_*`): for what the game tells Streamline each frame and for how it
|
||||
> configures FSR frame generation, each *read*, *hooked - the game did not make the call*, or *not hooked - the
|
||||
> game did not load the library that has the call*. "Nothing here" then says which of the two it is.
|
||||
> **Since 0.1.0-beta.44** one more (`Advanced_InGameFeatureCallsLine`): for which version each Streamline feature
|
||||
> is and for what each requires, the same three — except that hooked and not seen reads *hooked - the game asks
|
||||
> this while it starts, and did not ask again after FrameLedger attached* (`AdvInGameCall_NotAskedAgain`,
|
||||
> `AdvancedLabels.InGameStartupCall`): the usual case, and not a finding about the game.
|
||||
> **Since 0.1.0-beta.45** one more, and one only for six calls (`Advanced_InGameMoreCallsLine`,
|
||||
> `AdvancedPresenter.MoreCalls`): *Streamline's other calls - read: …; hooked, the game did not make the call: …;
|
||||
> not hooked: …*, each call under its own name (`slIsFeatureSupported`, a function's name and so not translated)
|
||||
> in the group that is true of it, and the word for "none" where a group is empty. A session stored before has
|
||||
> none of the six and no such sentence. The catalog's `sl.init.preferences` carries a reason of its own
|
||||
> (`AdvReach_BeforeAttach`): *Not read: the game makes this call once, before FrameLedger is inside it*.
|
||||
>
|
||||
> **Words.** Every catalog entry, group, reason, source state and driver token is a `Strings.resx` key made from its own
|
||||
> name (`Adv_<id>`, `AdvGroup_*`, `AdvReach_*`, `AdvSource_*`, `AdvToken_*`) in `en`, `vi`, `ja`; the English label of
|
||||
|
||||
+1
-4
@@ -357,10 +357,7 @@ 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 *(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;
|
||||
duplication exclusions; 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`
|
||||
|
||||
@@ -158,13 +158,6 @@ 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.~~
|
||||
|
||||
+5
-76
@@ -194,11 +194,8 @@ 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`~~ *(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: `slEvaluateFeature` · ⏳ `slInit`, `slSetFeatureLoaded`, ~~`slSetConstants`~~ *(its own row below since beta.43)*, `slGetFeatureRequirements` | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`; since beta.34 `kFeatureDLSS_NR` — DLSS 5's neural rendering, its own fact bit and family `FL_HOOK_SL_NEURAL_RENDERING`, D84; rule 4: the `feature` argument of the API hooked, nothing else). **Built 2026-08-09**, identity only: one MinHook detour on `sl.interposer.dll!slEvaluateFeature`, resolved **module-scoped** and installed lazily by the watchdog. Sets `FL_MEASURED_UPSCALER` + `FL_HOOK_UPSCALER_IDENTITY`; decodes `kFeatureDLSS`/`kFeatureNIS` and reports `FL_UPSCALER_UNKNOWN` for anything else. **Never `FL_UPSCALER_NONE`** — a Streamline-only writer cannot see FFX, XeSS or NGX-direct, and `NONE` is the only one of the three states that may be aggregated as a negative. **Since 0.1.0-beta.40 (Advanced metrics train B, D111), and only while the Agent asks** (`FlControlBlock.advancedRequested`): the `sl::DLSSOptions` a title chains into `inputs` — the struct the quality mode is read from — is read further: `outputWidth`/`outputHeight`, `preExposure`, `exposureScale`, `colorBuffersHDR`, the five presets of version 1, and where the struct's own `structVersion` proves them present `ultraQualityPreset` and `useAutoExposure` (≥ 2) and `alphaUpscalingEnabled` (≥ 3) — §Which struct version carries which field. Rule 4: more members of the same argument of the same call; `fl_adv_fields.h` is the one place, `tools/overlay-fields-check.ps1` holds it. No new patch site. **Measured** (the header's own functions, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3): +9.5–11.7 ns per evaluation that chains the options while asked; with the word at 0, one relaxed load and a branch not taken — below what the bench resolves. Most titles set these through `slDLSSSetOptions`, which is not an export, and read N/A (train D) |
|
||||
| ✅ Streamline: `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 *(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
|
||||
@@ -328,9 +325,6 @@ v2.8.0, v2.9.0, v2.10.0, v2.10.3, v2.11.1, v2.12.0, v2.14.1, v2.14.16):
|
||||
| | 3 | v2.4.0 (`27d352db364f`) | `alphaUpscalingEnabled` |
|
||||
| `sl::Constants` (`include/sl_consts.h`) | 1 | v2.0.0 (`db6f37adcf66`) | every member through `motionVectorsJittered` — the matrices, `jitterOffset`, `mvecScale`, `cameraPinholeOffset`, the camera's position and axes, `cameraNear`, `cameraFar`, `cameraFOV`, `cameraAspectRatio`, `motionVectorsInvalidValue`, the seven `Boolean`s |
|
||||
| | 2 | v2.4.0 (`bba15338a623`) | `minRelativeLinearDepthObjectSeparation` |
|
||||
| `sl::FeatureVersion` (`include/sl.h`; `include/sl_core_types.h` from v2.7.2) | 1 | v2.0.0 (`fc2d6ee39fea`) | `versionSL`, `versionNGX` |
|
||||
| `sl::FeatureRequirements` (the same headers) | 1 | v2.0.0 (`fc2d6ee39fea`) | `flags`, `maxNumCPUThreads`, `maxNumViewports`, `numRequiredTags`, `requiredTags`, `osVersionDetected`, `osVersionRequired`, `driverVersionDetected`, `driverVersionRequired`, then ten Vulkan members from `vkNumComputeQueuesRequired` to `vkFeatures13` |
|
||||
| | 2 | v2.1.0 (`79037e0974d2`) | `vkNumOpticalFlowQueuesRequired` |
|
||||
|
||||
`sl::DLSSOptions` keeps those seventeen declarations, same types and order, through v2.14.16 (`9a875bd4f843`); v2.8.0
|
||||
only re-spelled the deprecated `sharpness`. `sl::Constants` is unchanged from v2.4.0 through v2.14.16
|
||||
@@ -339,15 +333,6 @@ Overlay reads `sl::Constants`, and only members of version 1** — nothing of ve
|
||||
"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:
|
||||
@@ -405,7 +390,7 @@ or version, so the question is whether the declaration ever changed:
|
||||
| Hook / call | Yields |
|
||||
|---|---|
|
||||
| ~~`IDXGIAdapter3::QueryVideoMemoryInfo` (we **call** it, not hook it, once per second from our own thread)~~ | ~~**Per-process VRAM** `CurrentUsage` + `Budget` — previously impossible; now exact~~ **Never built; superseded 2026-10-03 (D43):** the game's memory is read from OUTSIDE the game by the Agent (`18_GPU_VENDOR_APIS` §The game process's memory), so nothing in the Overlay calls it. Only the budget would need it, and that stays open (`20_OPEN_QUESTIONS` §M11) |
|
||||
| NVAPI Reflex: ~~hook `NvAPI_D3D_SetSleepMode`, `NvAPI_D3D_SetLatencyMarker`~~; call `NvAPI_D3D_GetLatency` *(**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 |
|
||||
| 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 |
|
||||
|
||||
### 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.
|
||||
@@ -714,7 +699,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; 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`.
|
||||
- 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`.
|
||||
- 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.
|
||||
|
||||
@@ -761,55 +746,6 @@ Every hook body is wrapped:
|
||||
> 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.
|
||||
|
||||
@@ -838,12 +774,6 @@ 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
|
||||
@@ -865,8 +795,7 @@ No logging in hook bodies. A small fixed-size in-memory ring of structured event
|
||||
> 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).
|
||||
> `ffxConfigure` is hooked at all (one asked for Advanced metrics).
|
||||
> **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),
|
||||
@@ -878,7 +807,7 @@ 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 *(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
|
||||
> wakes the watchdog; the final flush waits for that, bounded at 2 s, 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 `#`
|
||||
|
||||
@@ -716,9 +716,8 @@ every `nvapi.` row; nothing is estimated in its place (FR-4.9).
|
||||
|---|---|---|---|
|
||||
| A | 0.1.0-beta.39 | read by the Agent only — NVAPI and LibreHardwareMonitor — storage, the page. **Nothing changes in code loaded into a game** | this section |
|
||||
| B | 0.1.0-beta.40, ~~.41, .42~~ ~~.42, .43~~ .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 |
|
||||
| C | ~~0.1.0-beta.41~~ ~~0.1.0-beta.43~~ ~~0.1.0-beta.44~~ 0.1.0-beta.45 *(D118, D122)* | Reflex latency per frame | a spike, then the owner's go or no |
|
||||
| D | ~~0.1.0-beta.42~~ ~~0.1.0-beta.44~~ ~~0.1.0-beta.45~~ 0.1.0-beta.46 *(D118, D122)* | 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
|
||||
@@ -753,7 +752,7 @@ planning, the design reviewed against the code before it was approved.
|
||||
`ICaptureObserver.WantsInGameAdvanced`; `CaptureSession` writes the word either way as the ring is attached, before
|
||||
its first guard result, and from then on carries each publication of region 5 on `CaptureProgress.InGameAdvanced`
|
||||
— one instance a publication, the same one on the ten ticks between two. `Application.Capture.InGameAdvancedSampler`
|
||||
turns a publication into what a session stores: the session facts of the thirteen `Game` entries below (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
|
||||
turns a publication into what a session stores: the session facts of the thirteen `Game` entries below (nineteen since 0.1.0-beta.43), 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
|
||||
@@ -771,11 +770,6 @@ planning, the design reviewed against the code before it was approved.
|
||||
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`
|
||||
@@ -784,37 +778,6 @@ planning, the design reviewed against the code before it was approved.
|
||||
(`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
|
||||
@@ -839,20 +802,6 @@ planning, the design reviewed against the code before it was approved.
|
||||
into a game stayed 0.1.0-beta.40's, line for line, in a release that fixes something else).
|
||||
- **D112 — `slInit` is not hooked in train B.** A game calls it before FrameLedger attaches, so its preferences
|
||||
would almost never be seen. If it is ever hooked: `applicationId`, `projectId` and the paths are never read.
|
||||
- **D129 — `slInit` is not hooked at all** (owner decision 2026-11-12, asked to reopen D112 and shown what was
|
||||
found). No mode of the shipped product is in the game in time: *Play ▸ Start directly* does not create the game
|
||||
suspended — it waits for the presentation runtime, runs the guard, then injects; nothing is ever patched on a
|
||||
game's thread, so a hook lands some hundred milliseconds after its module appears (`17_HOOK_ENGINE`, the loader
|
||||
lock); and a hook that exists only for Advanced metrics waits for the Agent's request, which comes after the
|
||||
attach. A hook on it would be a patch that reads nothing. `sl.init.preferences` says so in the catalog. Most of
|
||||
what it would have told is read another way: which features are loaded (`slIsFeatureLoaded`), and whether a
|
||||
newer plugin than the game's own is in use (the versions of 0.1.0-beta.44).
|
||||
- **D130 — six more core calls in one release, 0.1.0-beta.45**: `slIsFeatureSupported`, `slIsFeatureLoaded`,
|
||||
`slSetFeatureLoaded`, `slAllocateResources`, `slFreeResources`, `slShutdown`. Trains C and D come after it; train
|
||||
C's spike is written beside it, as a document.
|
||||
- **D131 — the adapter a game asks `slIsFeatureSupported` about is never read**: `sl::AdapterInfo` holds its LUID
|
||||
or a Vulkan physical device. The feature's id and the result are all that is kept, and a build check refuses the
|
||||
names of the struct's members in the code loaded into a game.
|
||||
- **D114 — the field of view is a session's range**, lowest to highest, never a series: a series would say when the
|
||||
player aimed.
|
||||
- **D115 — a tail member is read only where it is proven to be there** (`17_HOOK_ENGINE` §Which struct version
|
||||
@@ -860,18 +809,10 @@ planning, the design reviewed against the code before it was approved.
|
||||
- **D116 — "never the camera" is a build check**, as "never a setter" is (D108): `tools/overlay-fields-check.ps1` —
|
||||
every read of a vendor struct in one header, each allowed member named and used, the camera's names refused
|
||||
anywhere in the Overlay and the Vulkan layer, no copy of `sl::Constants` by value. *(Built 2026-11-12:
|
||||
twenty-eight members on `tools/overlay-allowed-fields.txt`; `12_BUILD` gate 14f. Fifty-six since 0.1.0-beta.44,
|
||||
with the two answers about a feature.)*
|
||||
twenty-eight members on `tools/overlay-allowed-fields.txt`; `12_BUILD` gate 14f.)*
|
||||
- **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
|
||||
@@ -898,8 +839,7 @@ the catalog differ in either direction. **Reach** is where a value can be read f
|
||||
(the Agent's own process), `AgentElevated` (the same, as administrator with PawnIO), `Game` (read inside a game
|
||||
FrameLedger measures, from the arguments of a call the Overlay hooks, while the session records Advanced metrics —
|
||||
since 0.1.0-beta.40), `HookedCall` (an argument of a call the Overlay already hooks, not read yet), `NewHook` (a hook
|
||||
that is not built — Train B; 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`
|
||||
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 first three are read
|
||||
(`AdvancedMetric.IsRead`).
|
||||
|
||||
@@ -1068,11 +1008,9 @@ before FrameLedger is inside it, so no hook could read it — D129), `Spike` (Tr
|
||||
| `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.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 |
|
||||
| `sl.constants.camera` | Camera position, axes and matrices | SessionFact | Streamline | PlayerState | Text |
|
||||
|
||||
**Inside the game: routes a spike decides**
|
||||
|
||||
@@ -1234,20 +1234,6 @@ 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,13 +1549,6 @@ 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**
|
||||
|
||||
@@ -1870,7 +1863,7 @@ Moved verbatim, in this order.
|
||||
| M12 ❓ | **Advanced metrics — which NVAPI rows answer on real hardware (D101, 2026-11-11).** `18_GPU_VENDOR_APIS` §The inventory lists sixty `nvapi.` rows whose reach is `Agent`. They are declared in the vendored headers; **none has been called on a GPU**, and CI has no driver, so it never takes that branch. Unknown per row: whether the RTX 5080 on the current driver answers or returns `NVAPI_NOT_SUPPORTED` (the memory-temperature target already does not exist on that card). | **The measurement is the bridge's probe on the owner's PC**, then the page itself (the release's owner-only item). Pre-committed: a call that does not answer → that row is N/A with NVAPI's own status as the reason, and nothing is put in its place; a call that hangs or faults twice → the row is off for the session (§Runtime policy); a value that contradicts the vendor's own tool → the row is withheld until it is explained. **Half answered the same day, by the bridge's own test on the dev box** (ctest `fl_nvapi_bridge`, AVAILABLE branch; RTX 5080): every fact answers (`present = 0xFFFFF`), eight of ten live groups answer (`0x33F` — no board and no power-supply temperature sensor on this card: N/A, by the first pre-committed outcome), the display answers its four groups, the global profile lists 24 settings; figures in `18_GPU_VENDOR_APIS` §L3. **Still open**: the same values on the page beside the vendor's own tool, and the session rows (`nvapi.session.*`), which need a game. **And one thing seen once and not explained**: in one test run of about a dozen that day, `FlNvReadLive` came back with no field at all although `FlNvReadFacts`, a moment earlier in the same process, had answered everything; nine further runs did not show it. A handle the driver invalidated is the usual cause of that shape, and nothing here re-enumerates after `FlNvInit`. Pre-committed for the reader that owns the thread: two readings in a row with no field → release and initialise the bridge again, once, and say so in the log; if that does not bring the fields back the layer is off for the session, as any layer that fails twice is. |
|
||||
| M13 ❓ | **Advanced metrics — LibreHardwareMonitor's CPU, memory, motherboard and storage groups, elevated, with PawnIO (D103, 2026-11-11).** Never opened by any build: §M10's elevated run has not been taken either, and this is a larger surface — a sensor chip on the LPC bus, the embedded controller, SPD over SMBus, SMART. Unknown: whether each group opens on the owner's board, what a refresh costs, whether opening the storage group touches removable drives (this PC once had a failing USB drive), and whether any group enables a privilege (`PrivilegeFootprintTests`). | **One elevated run with the probe verb, before the option exists.** Pre-committed: the storage group cannot be opened without touching removable drives → `lhm.storage.*` stays N/A in beta.39 and its reach reads `Deferred`; a node that throws twice → skipped for the session; the Agent above 1% of one core or 150 MB with the option on (NFR-2) → the slow groups are read less often or dropped before the release; a privilege enabled by a group → that group is not opened, and the owner is asked. **Two of the four answered 2026-11-11, before the option exists.** (1) **Storage: not opened, by the first outcome.** LibreHardwareMonitor 0.9.6's `StorageGroup` lists every drive through DiskInfoToolkit's `ReloadStorages` with no filter by bus and follows drives plugged in later — it cannot be opened without touching removable drives. `lhm.storage.*` reads `Deferred`, and `LhmGroups` has no member for it. (2) **Cost, unelevated, measured with `probe-advanced`** on the dev box: one refresh of the graphics-card group alone is 14 ms of processor time (62 ms elapsed) — 1.4% of one core at one a second, above NFR-2 — and one NVAPI read 0.4 ms. By the third outcome the sensor library is read every fifth tick (0.28%). **Still open, and the owner's**: the same probe as administrator with PawnIO — whether the processor, memory and motherboard groups open on this board, what they cost, and `PrivilegeFootprintTests`' new case on a token that holds the privileges (CI's does; the dev box's unelevated run passes by construction). **The first run was taken on 2026-11-12, by the owner, in ordinary use** (0.1.0-beta.40, the Agent as administrator with PawnIO, an i7-14700KF on a board with an IT8689E chip, an RTX 5080), and read here from a copy of the ledger and the Agent's log, not from a probe. **The groups open and read**: nine of ten sessions stored 119 processor series (a clock and a load per thread, temperatures, powers, voltages), 14 memory series and 21 motherboard series (six fans, six temperatures, nine voltages) beside the card's 41 — 195 from the sensor library in all. **No value was compared with another tool**; that is still the owner's. **Two faults, one cause** (`Infrastructure.Telemetry.LhmLibrary`): the Agent held up to three `Computer`s at once, and the library keeps the driver it reads the processor through and its bus mutexes per process — closing one `Computer` let go of them under the others. After seven sessions the Advanced reader's processor device threw `NullReferenceException` twice and was left alone (the page lost the processor until the reader reopened); once a session's start met another instance's close, the reader's `Open` threw `ObjectDisposedException`, and that session stored 17 series instead of 212. **Fixed 2026-11-12**: opens and closes are serialised and a `Computer` is parked, not closed, while another is in use. The cause is read from the log's timing and was not reproduced — it needs this elevation — so **whether the faults are gone is the owner's next sessions to show**: no `advanced: a device is left alone` and no `did not open` in the Agent's log. **First evidence, 2026-11-12, 0.1.0-beta.41, the same PC:** seven sessions between 06:38 and 07:01 with no `advanced:` line at all, each with the option on storing 212 or 213 series; on beta.40 that morning the processor device faulted out after each of six sessions (04:34–05:07) — thirteen of sixteen over the night. The reader failing to open was seen once in sixteen, so this is not yet enough to call that one gone. Still open: any value beside another tool. |
|
||||
| M16 ✅ | **The L2 telemetry layer's cost — the first number, and it is above NFR-2 (found 2026-11-11, measuring something else).** `LhmTelemetrySource` refreshes LibreHardwareMonitor's graphics-card group once a second in every recorded session. `probe-advanced` measured that refresh, through the same library and the same group, at **14 ms of processor time** on the dev box (RTX 5080, 41 mapped sensors, about twenty of them the Direct3D engine nodes the library enumerates per card) — 1.4% of one core, where NFR-2 allows the whole Agent 1% during capture and `14_TESTING` §Hook overhead's Agent figure has never been measured. This is a measurement of the call, not yet of a session: L2's own poller was not instrumented. | **Measure L2 in a session** (the Agent's processor time over a ten-minute capture, telemetry at 1000 ms and at 2000 ms). Pre-committed: at or under 1% → this row closes with the number; above → the owner chooses between a slower default for `telemetry.interval_ms`, reading the sensors the layer keeps from NVAPI on NVIDIA cards (L3 already has most, at 0.4 ms), or amending NFR-2 to what is measured. Not decided here, and nothing about L2 changes in the Advanced-metrics train. **Measured in a real Agent, 2026-11-11 (owner decision D110), and answered (D117).** `tools/agent-cost.ps1` runs the shipped `FrameLedger.Agent.exe --console capture` against a copy of hook-harness in a scratch data folder — a session that is not hooked, so the telemetry poller runs as in every session and nothing drains frames — and reads the Agent process's own processor time at exit; the cost per second is the slope between a 45 s and a 165 s session, two runs of each. Dev box (RTX 5080, not elevated, layers `l1+lhm+nvapi`): **19.3 ms of processor time per second of session = 1.93 % of one core with Advanced metrics off** (2,312 and 2,312 ms over 45 s; 4,594 and 4,656 ms over 165 s), **20.4 ms = 2.04 % with it on** (2,984 and 3,000; 5,547 and 5,344); peak working set 113 MiB and 119 MiB. A first pass with 30 s and 90 s sessions gave 1.56 % and 2.21 % — its two short runs differed by 670 ms, which is why the lengths were raised. So the probe's number holds in a session: the Agent's steady cost is about twice NFR-2's 1 %, nearly all of it the layer every session has always used, and the new option adds about a tenth of a percent. **The owner's answer: NFR-2 is amended to ≤ 2.5 % of one core** — the limit had never been measured, the sensors keep their one reading a second, and nothing in the code changes. Not measured: a hooked session (the drain's cost on top), a session with the Agent elevated and PawnIO's groups open, another PC. |
|
||||
| M14 ❓ | **Reflex latency per frame — is there a route within rules 4 and 5? (Train C, 2026-11-11.)** `17_HOOK_ENGINE` §Memory / latency names hooks on `NvAPI_D3D_SetSleepMode` / `SetLatencyMarker` and a call to `NvAPI_D3D_GetLatency`. NVAPI resolves all three through `nvapi_QueryInterface` by id — they are not exports, so a hook on them is a patch at an address learned at run time, the class refused on 2026-08-09. The route to try first needs no hook: the Overlay's own background thread **calls** `GetLatency` with the device of the swap chain it already hooks, once a second (the call returns the last 64 frames' reports). Unknown: whether calling into the driver from that thread is safe on every device kind, what it costs, what it returns when the game never enabled Reflex, and what it means for the Disclaimer's sentence about that thread. | **A spike on `hook-harness` and a stub first, then one real title.** Pre-committed: no route without a patch at a run-time address or a loader-lock call on the game's thread → Reflex stays N/A and the page says why; overhead above NFR-1 → the same. The owner says go or no on the spike's result. **2026-11-12 — the reading that comes before that spike is `spike-notes` §30** (owner decision D130: a document first, beside 0.1.0-beta.45; nothing was run). It finds: a hook on NVAPI's latency functions is the refused class, and a hook on Streamline's Reflex and PCL functions is train D's wrapper (§M15) — and would miss a game that fetched them before the attach, as `slInit` is missed (D129); the Overlay calling `slReflexGetState` itself breaks the thread contract the vendor's header states; **what remains is the route named in this row**, the Overlay calling two driver getters with the game's device, and a no-injection ETW route that gives the game-side markers only and makes the game post messages to its own window. Corrected there: `nvapi64.dll` exports **two** functions on the dev box (`nvapi_Direct_GetMethod` beside `nvapi_QueryInterface`), not one. The go or no is the owner's, and a go needs the owner's ruling that calling a driver getter with the game's device is inside rule 4. **2026-11-13 — the owner answered (D132, D133).** Route D goes to the spike this row names, on `hook-harness` and a stub `nvapi64.dll`, with the ruling: a driver's read-only getter called with the device of the swap chain the Overlay hooks is inside rule 4 (`CLAUDE.md`, the rule's note of that day). No real game before the owner has seen the result, and nothing shipped changes for the spike (`spike-notes` §31, written after 0.1.0-beta.46). Route C is **refused**; the ETW route **stays closed**, and §G is not reopened. |
|
||||
| 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. |
|
||||
| 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 |
|
||||
|
||||
|
||||
+67
-272
@@ -82,8 +82,6 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
| `§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, 38, 39) | [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) |
|
||||
| `§Traps`, `§Two corrections carried forward` | [`handoff/traps.md`](handoff/traps.md) |
|
||||
@@ -91,177 +89,88 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
|
||||
---
|
||||
|
||||
## **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
|
||||
## **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.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).
|
||||
*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 D129–D131
|
||||
### What this release decided, beyond D123–D125
|
||||
|
||||
- **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.
|
||||
- **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
|
||||
|
||||
- **The catalog table of `18_GPU_VENDOR_APIS` is compared with the catalog row for row by a test**: a catalog
|
||||
entry and its row go in the same commit, or the Application tests are red.
|
||||
- **Qodana's native report again found an index into the feature slots computed as a 32-bit product** (#427, the
|
||||
harness's probe): write `size_t{2} * FL_ADV_FEATURE_WORDS`. It is advisory and auto-merge does not wait for it;
|
||||
both reports were read before each merge.
|
||||
- **A second `region` inside the probe's block is C4456**, and warnings are errors: name the inner one otherwise.
|
||||
- **A test method over sixty lines is MA0051** in the test projects too; split the assertions by what they cover.
|
||||
- **The injected test waits for the stop**: with eighteen patches a stop takes about three seconds, so its wait is
|
||||
200 iterations.
|
||||
- **The shell tool refuses `sleep N; command`**: wait in a background `until` loop.
|
||||
- **After a lower pull request is squashed**, `git diff <old tip> origin/main` empty proves the squash is the
|
||||
branch; then `git rebase --onto origin/main <old tip> <next branch>` and a forced push with lease.
|
||||
|
||||
### What the owner's seven sessions on beta.45 showed (2026-11-13)
|
||||
|
||||
The owner ran seven sessions on six games the day after the release and said: check the logs and go on. Read from
|
||||
a copy of the ledger (sessions 190–196), the seven overlay logs, the Agent's log and Windows' application log —
|
||||
no FrameLedger binary was run against the owner's data. **Every session is hooked, `normal`, with no fault
|
||||
counted, no dropped record and no `PATCH_FAILED`; the count of early ends is 0 on all six games.** The update
|
||||
showed the terms once: Privacy Policy 2.19 was accepted at 07:23:36.
|
||||
|
||||
| Game (session, length) | Interposer | `slIsFeatureSupported` | `slIsFeatureLoaded` | `slSetFeatureLoaded` | allocate | free | shutdown |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| Phantom Blade Zero (190, 2 h 48 min; 191, 1 h 32 min) | 2.14.1 | **read** — Reflex, DLSS frame generation, PCL `eOk`; ImGUI and DeepDVC `eErrorFeatureMissing` | **read** — Reflex, frame generation *on* | not called | not called | **read** — frame generation, 1 | not called |
|
||||
| Cyberpunk 2077 (193, 7 min) | 2.14.1 | **read** — frame generation, DLSS, ray reconstruction, Reflex `eOk`; NIS `eErrorFeatureMissing` | **read** — the four *on* | **read** — the four, *on and off* | not called | not called | not called |
|
||||
| Dying Light: The Beast (194, 4 min) | 2.8.0 | **read** — DLSS, frame generation, PCL, Reflex, NIS `eOk` | not called | **read** — all five, *on and off* | not called | not called | **read** — 1 |
|
||||
| Hogwarts Legacy (195, 4 min) | 2.14.16 | **read** — frame generation, Reflex, DeepDVC, DLSS 5's `kFeatureDLSS_NR`, PCL `eOk`; ImGUI `eErrorFeatureMissing` | **read** — the first four *on* | not called | not called | not called | not called |
|
||||
| Black Myth: Wukong (196, 3 min) | 2.7.4 | **read** — frame generation, Reflex, PCL `eOk` | not called | not called | not called | not called | not called |
|
||||
| Kingdom Come: Deliverance II (192, 4 min) | none | not hooked | not hooked | not hooked | not hooked | not hooked | not hooked |
|
||||
|
||||
- **`slIsFeatureSupported` was read in every Streamline session, and `slAllocateResources` in none.** Item 43
|
||||
wrote the meaning of that before the run: a call no game makes after the attach gives nothing in attach mode, and
|
||||
whether it keeps its patch is the owner's to say. `slFreeResources` and `slShutdown` were each read once, in one
|
||||
game each; `slIsFeatureLoaded` in three games, `slSetFeatureLoaded` in two.
|
||||
- **A refusal reads as one.** Phantom Blade Zero and Hogwarts Legacy ask about `kFeatureImGUI`, Streamline's
|
||||
debug overlay, and are told it is missing; Cyberpunk 2077 is told the same of NIS, which Dying Light is told is
|
||||
supported. Phantom Blade Zero is told DeepDVC is missing although Streamline answered its requirements.
|
||||
- **The count says how often, not when.** Dying Light's one shutdown and Phantom Blade Zero's one freeing of frame
|
||||
generation's resources may each be the game closing; nothing in a session says. Dying Light switched all five
|
||||
features off and on.
|
||||
- **The way out is as it was.** Hogwarts Legacy faulted at its exit in `_nvngx.dll`, `0xc0000005` at offset
|
||||
`0x6aa85` — the offset of its six before, since 2026-11-06, hooked or not — and Black Myth: Wukong in
|
||||
Steam's `crashhandler64.dll`, `0xc0000409` at `0x39b49`, the offset of its three before (Steam's file is now
|
||||
11.23.65.88). Windows' log has no fault for the other four games; the two hooks on a game's way out were in all
|
||||
five Streamline games.
|
||||
- **Rates are where they were**, for what a comparison without the same scene is worth: Phantom Blade Zero ×4 at
|
||||
64 → 255 (beta.44: 63 → 251), Wukong 85 → 341 (90 → 361), Cyberpunk 2077 164 → 327 (137 → 275), Dying Light ×4
|
||||
at 48 → 194 (beta.42: 54 → 216), Kingdom Come 58.8 presented (59.3).
|
||||
- **An install stops the game's threads once a patch, as a restore does.** The thirteen interposer patches took
|
||||
0.74 s on Phantom Blade Zero, 1.2 s on Cyberpunk 2077, 1.7 s on Dying Light and Wukong (twelve there) and
|
||||
**2.8 s on Hogwarts Legacy** — 57 to 215 ms a patch, while the game starts. That is the cost the proposal to
|
||||
queue patches (§What this release decided) would cut, measured on real games.
|
||||
- **No stop was exercised.** Every session ended with the game closing, so no log has an `UNHOOK_RESTORED` line.
|
||||
Item 43 (g) said a log "ends with an `UNHOOK_RESTORED` line for each patch": that is true only of a session
|
||||
stopped while its game runs, and the item was worded wrongly.
|
||||
- **Not exercised: off means off** — Advanced metrics was on in every session. **Not visible in the data**: (c), whether *loaded* agrees with the game's own menu, and (h), the
|
||||
catalog's wording on the page — both are what the owner sees.
|
||||
- **For train C's spike**: Streamline says Reflex is supported in all five games and loaded in the three that
|
||||
ask; Cyberpunk 2077 and Dying Light switch it off and on (`spike-notes` §30 has the note).
|
||||
- **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.
|
||||
|
||||
### 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.
|
||||
1. **The owner runs item 41** — the first time either new hook is in a real game. Not first on a game under the
|
||||
user-mode exception's trial (D38: a crash there ends the exception for good).
|
||||
2. **0.1.0-beta.44** — `slGetFeatureVersion` and `slGetFeatureRequirements` — when the owner says beta.43 passed.
|
||||
Both are calls a game makes while starting, so most sessions will have missed them: plan what "not seen" says.
|
||||
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.~~ **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).
|
||||
- **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).
|
||||
- **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.
|
||||
- **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:** 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:** item 41; item 40 (d).
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
@@ -611,110 +520,6 @@ Myth: Wukong with hooking off; what item 41 left unexercised; item 40 (d).
|
||||
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
|
||||
@@ -854,16 +659,6 @@ Where each owner decision is recorded — the file and its section, and a label
|
||||
| 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`) |
|
||||
|
||||
---
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
<!-- 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).
|
||||
@@ -1,80 +0,0 @@
|
||||
<!-- 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.
|
||||
@@ -1,154 +0,0 @@
|
||||
# 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).
|
||||
@@ -1,182 +0,0 @@
|
||||
# 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).
|
||||
@@ -63,42 +63,6 @@ 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
|
||||
|
||||
@@ -53,4 +53,3 @@ 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) |
|
||||
@@ -1,176 +0,0 @@
|
||||
## 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. The count starts again when you do (since 0.1.0-beta.44). |
|
||||
| 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 **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). |
|
||||
|
||||
@@ -55,33 +55,13 @@ also keeps what the game itself handed to DLSS and FSR:
|
||||
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.
|
||||
The last two are read from calls FrameLedger hooks **only for Advanced metrics**: in a game where no session has
|
||||
been recorded with the option on since it started, those two hooks are not there. The line under the session says,
|
||||
for each of the two, 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*.
|
||||
|
||||
**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
|
||||
@@ -91,13 +71,6 @@ It never means the game uses no upscaler; the session's summary still names the
|
||||
**Where the camera is, which way it looks and its matrices are never read.** The field of view is kept as a lowest
|
||||
and a highest value, never as a line over time.
|
||||
|
||||
**A game may use a unit of its own.** NVIDIA's and AMD's libraries expect the field of view in radians, and
|
||||
FrameLedger shows it that way with the degrees beside it. Some games give degrees instead (Cyberpunk 2077 does, to
|
||||
Streamline): a value too large to be radians is shown as the game gave it, with a line that says *Not radians*, and
|
||||
is not converted — FrameLedger shows what the game said, not what it may have meant. The number of **resets** is
|
||||
the number of calls in which the game told the upscaler to drop its history; menus and loading screens raise it. A
|
||||
frame-generation configuration with no flag set says *None*.
|
||||
|
||||
A session's summary has an **Advanced metrics…** button that opens that session here.
|
||||
|
||||
## Sources
|
||||
@@ -111,8 +84,6 @@ comes from, and whether it is read. Where it is not, the reason is written out:
|
||||
- **not present on this PC** — the driver's own figures exist on NVIDIA cards only;
|
||||
- **read inside a game FrameLedger measures, when the game makes the call** — what the game tells DLSS and FSR
|
||||
(above). Some further readings inside the game **come with a later release**;
|
||||
- **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.
|
||||
|
||||
|
||||
+3
-13
@@ -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.45`** (2026-11-12), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.43`** (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
|
||||
@@ -116,18 +116,8 @@
|
||||
> 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.
|
||||
> for, not whether frames were generated). FSR's upscaling values have been read from real games; the DLSS options,
|
||||
> Streamline's constants and the frame-generation configuration have not been confirmed on one yet.
|
||||
> - **Safety:** every pre-injection check runs before injection, including the signed-by-a-known-vendor
|
||||
> half of the suspicious-module rule. During every capture the Agent re-runs the checks every 30 s and
|
||||
> stops capturing on a refusal: a Direct3D or OpenGL game's hooks are removed, and the Vulkan layer
|
||||
|
||||
+3
-13
@@ -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.45`** (2026-11-12), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.43`** (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
|
||||
@@ -225,18 +225,8 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
> 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.
|
||||
> for, not whether frames were generated). FSR's upscaling values have been read from real games; the DLSS options,
|
||||
> Streamline's constants and the frame-generation configuration have not been confirmed on one yet.
|
||||
> - **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.19 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 2.17 · **Effective:** {{RELEASE_DATE}}
|
||||
|
||||
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
|
||||
|
||||
@@ -11,7 +11,7 @@ Stored in `%LOCALAPPDATA%\FrameLedger` on your device:
|
||||
- Your game library entries (names, executable paths, metadata you or the app filled in, and whether each one is recorded).
|
||||
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC, or a game ships in its own folder, is shown from where it is and not copied.
|
||||
- Performance sessions: frame timing series, computed statistics, hardware sensor series (temperatures, load, power, memory usage, and the graphics card's clock speeds, fan speed, memory temperature and whether its power limit or heat held it back), the game's own memory use (its dedicated and shared video memory, private working set, working set and commit, once a second), session duration, crash flags, the graphics driver's settings the game ran under (NVIDIA only), how the game's window was shown (full-screen, borderless or windowed, for how long, its size and the monitor's), tags and notes you write.
|
||||
- **Only while Settings ▸ Advanced metrics is on** (it is off unless you switch it on), with each session: more hardware sensor series — the graphics card's memory use in detail, its load by part, its clocks, voltages, currents, power, each fan and its video encoder's use; and, when the capture agent runs as administrator with PawnIO installed, the processor's temperatures, load, clocks, power and voltages by core, the memory in use and its modules' temperatures, and the motherboard's temperatures, fans and voltages — and a description of the hardware: the graphics card's firmware version, architecture, bus and memory sizes, the graphics driver's package and the chipset it names, the motherboard's and the memory modules' model names, what each connected display can do (the HDR formats it accepts, its brightness range, variable refresh), whether variable refresh was in use on the display the game ran on and the colour space the game presented in, and the graphics driver's settings — its global ones and the ones it holds for the game (NVIDIA only). For a game FrameLedger injects into, a session then also stores what the game itself passed to its upscaler in the calls FrameLedger intercepts: the output size, the model presets and the exposure values it gave DLSS, whether it said its colour buffers are HDR, auto-exposure and alpha upscaling; and the sharpening, the size of the jitter, the exposure, the depth range, the lowest and highest field of view and the flags it gave FSR, the frame time it reported to FSR, and FSR's own video memory when the game asked for it; what the game told NVIDIA Streamline about each frame — the size of the jitter, the motion-vector scale, the depth range and whether depth is inverted, the lowest and highest field of view, the aspect ratio, whether the projection is orthographic, how its motion vectors are stored and how often it reset the upscaler's history; and how it configured FSR frame generation — on or off, whether it may run asynchronously, its flags, whether only generated frames are presented, and the rectangle it generates in; and what NVIDIA Streamline answered when the game asked it about a feature — which features the game asked about, the version of each and of its NGX model, and what each requires: the graphics APIs it supports, whether V-Sync must be off and hardware-accelerated GPU scheduling on, how many processor threads, viewports and buffers, and the versions of Windows and of the graphics driver that Streamline found beside the ones the feature needs ; and, for each Streamline feature the game asks about or controls: whether Streamline answers that it is supported, whether it is loaded, whether the game switched it on or off while it ran, and how many times its resources were allocated and freed; and whether the game shut Streamline down, and how many times — never the lists Streamline's answer points to (the buffers' names, the names of Vulkan extensions and features), never what identifies the graphics card that the game hands over with its question, never the content of a graphics resource, and never where the game's camera is, which way it looks, or its matrices. No serial number, no display identification data (EDID) and no list of other programs is read or stored. Switching the option off stops the reading, inside a game as well; what earlier sessions stored stays with them until you delete those sessions.
|
||||
- **Only while Settings ▸ Advanced metrics is on** (it is off unless you switch it on), with each session: more hardware sensor series — the graphics card's memory use in detail, its load by part, its clocks, voltages, currents, power, each fan and its video encoder's use; and, when the capture agent runs as administrator with PawnIO installed, the processor's temperatures, load, clocks, power and voltages by core, the memory in use and its modules' temperatures, and the motherboard's temperatures, fans and voltages — and a description of the hardware: the graphics card's firmware version, architecture, bus and memory sizes, the graphics driver's package and the chipset it names, the motherboard's and the memory modules' model names, what each connected display can do (the HDR formats it accepts, its brightness range, variable refresh), whether variable refresh was in use on the display the game ran on and the colour space the game presented in, and the graphics driver's settings — its global ones and the ones it holds for the game (NVIDIA only). For a game FrameLedger injects into, a session then also stores what the game itself passed to its upscaler in the calls FrameLedger intercepts: the output size, the model presets and the exposure values it gave DLSS, whether it said its colour buffers are HDR, auto-exposure and alpha upscaling; and the sharpening, the size of the jitter, the exposure, the depth range, the lowest and highest field of view and the flags it gave FSR, the frame time it reported to FSR, and FSR's own video memory when the game asked for it; what the game told NVIDIA Streamline about each frame — the size of the jitter, the motion-vector scale, the depth range and whether depth is inverted, the lowest and highest field of view, the aspect ratio, whether the projection is orthographic, how its motion vectors are stored and how often it reset the upscaler's history; and how it configured FSR frame generation — on or off, whether it may run asynchronously, its flags, whether only generated frames are presented, and the rectangle it generates in — 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) — 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
|
||||
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 two 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, and the game's configuration of FSR frame generation), 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), never the camera's position, direction or matrices; the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphics card and of each connected display, what it reports about the display a tracked game's window is on, its settings for a tracked game and its global ones (read only), and, when the capture agent runs as administrator with PawnIO installed, the sensors and model names of the processor, the memory and the motherboard (never a drive's), all of which are also read with no game running while the Advanced page is open, to show them there, and are not stored then; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
|
||||
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
-21
@@ -235,9 +235,7 @@ 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),
|
||||
@@ -263,9 +261,7 @@ public static class Strings
|
||||
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),
|
||||
@@ -308,11 +304,9 @@ public static class Strings
|
||||
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),
|
||||
@@ -355,7 +349,6 @@ public static class Strings
|
||||
nameof(AdvToken_non_linear_color_srgb),
|
||||
nameof(AdvToken_none),
|
||||
nameof(AdvToken_not_a_number),
|
||||
nameof(AdvToken_not_radians),
|
||||
nameof(AdvToken_not_supported),
|
||||
nameof(AdvToken_off),
|
||||
nameof(AdvToken_on),
|
||||
@@ -1950,12 +1943,8 @@ 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);
|
||||
@@ -2006,12 +1995,8 @@ public static class Strings
|
||||
|
||||
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);
|
||||
@@ -2096,16 +2081,12 @@ public static class Strings
|
||||
|
||||
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);
|
||||
@@ -2190,8 +2171,6 @@ public static class Strings
|
||||
|
||||
public static string AdvToken_not_a_number => ResourceManager.GetString(nameof(AdvToken_not_a_number), Culture) ?? nameof(AdvToken_not_a_number);
|
||||
|
||||
public static string AdvToken_not_radians => ResourceManager.GetString(nameof(AdvToken_not_radians), Culture) ?? nameof(AdvToken_not_radians);
|
||||
|
||||
public static string AdvToken_not_supported => ResourceManager.GetString(nameof(AdvToken_not_supported), Culture) ?? nameof(AdvToken_not_supported);
|
||||
|
||||
public static string AdvToken_off => ResourceManager.GetString(nameof(AdvToken_off), Culture) ?? nameof(AdvToken_off);
|
||||
|
||||
@@ -557,14 +557,6 @@
|
||||
<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>
|
||||
@@ -665,14 +657,6 @@
|
||||
<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>
|
||||
@@ -845,10 +829,6 @@
|
||||
<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>
|
||||
@@ -885,10 +865,6 @@
|
||||
<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>
|
||||
@@ -1033,10 +1009,6 @@
|
||||
<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>
|
||||
|
||||
@@ -423,12 +423,6 @@
|
||||
<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>
|
||||
@@ -504,12 +498,6 @@
|
||||
<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>
|
||||
@@ -639,9 +627,6 @@
|
||||
<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>
|
||||
@@ -669,9 +654,6 @@
|
||||
<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>
|
||||
@@ -780,9 +762,6 @@
|
||||
<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>
|
||||
|
||||
@@ -418,12 +418,6 @@
|
||||
<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>
|
||||
@@ -499,12 +493,6 @@
|
||||
<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>
|
||||
@@ -634,9 +622,6 @@
|
||||
<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>
|
||||
@@ -664,9 +649,6 @@
|
||||
<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>
|
||||
@@ -775,9 +757,6 @@
|
||||
<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>
|
||||
|
||||
@@ -53,13 +53,6 @@ public static class AdvancedLabels
|
||||
/// <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;
|
||||
|
||||
|
||||
@@ -205,57 +205,9 @@ public static class AdvancedPresenter
|
||||
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)
|
||||
{
|
||||
if (!metric.IsRead)
|
||||
|
||||
@@ -170,16 +170,10 @@ public static class AdvancedMetricCatalog
|
||||
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"),
|
||||
// ---- Inside the game: hooks that are not built ----------------------------------------------------------
|
||||
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("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. No entry carries it since 0.1.0-beta.45.</summary>
|
||||
/// <summary>Needs a hook on a function its module exports; the hook is not built.</summary>
|
||||
NewHook = 4,
|
||||
|
||||
/// <summary>A route nobody has proven safe: a spike decides, and the owner says go or no.</summary>
|
||||
@@ -51,10 +51,4 @@ public enum AdvancedReach
|
||||
/// records Advanced metrics (train B, owner decision D111) — and only when the game makes that call.
|
||||
/// </summary>
|
||||
Game = 12,
|
||||
|
||||
/// <summary>
|
||||
/// The game makes the call once, before FrameLedger is inside it: no shipped mode injects before a game's first
|
||||
/// instruction, and no hook is ever installed on a game's thread. Never read (owner decision D129).
|
||||
/// </summary>
|
||||
BeforeAttach = 13,
|
||||
}
|
||||
@@ -32,33 +32,6 @@ public sealed record AdvancedSources(
|
||||
/// <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);
|
||||
}
|
||||
@@ -40,34 +40,11 @@ public sealed class InGameAdvancedSampler
|
||||
|
||||
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 =
|
||||
[
|
||||
@@ -76,17 +53,16 @@ public sealed class InGameAdvancedSampler
|
||||
|
||||
/// <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.
|
||||
/// switch seen over a session, the flags of the dispatch that have a name, and "none". A flag bit nobody named
|
||||
/// is <c>bit_N</c> and is shown as it is.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", _notRadians, .. _flagTokens];
|
||||
public static IReadOnlyList<string> Tokens { get; } = ["on", "off", "on_and_off", "none", .. _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; } = [];
|
||||
@@ -106,27 +82,6 @@ public sealed class InGameAdvancedSampler
|
||||
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
|
||||
@@ -163,14 +118,6 @@ public sealed class InGameAdvancedSampler
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -220,181 +167,9 @@ public sealed class InGameAdvancedSampler
|
||||
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)
|
||||
@@ -404,18 +179,19 @@ public sealed class InGameAdvancedSampler
|
||||
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 != 0)
|
||||
{
|
||||
if ((s.FfxFgFlagsSeen & (1u << bit)) != 0)
|
||||
var names = new List<string>(4);
|
||||
for (int bit = 0; bit < 32; bit++)
|
||||
{
|
||||
names.Add(bit < _frameGenerationFlags.Length ? _frameGenerationFlags[bit] : string.Create(CultureInfo.InvariantCulture, $"bit {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)));
|
||||
rows.Add(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).
|
||||
@@ -470,8 +246,15 @@ public sealed class InGameAdvancedSampler
|
||||
facts.Add(Fact("sl.constants.depth", AdvancedValue.OfRows(depth)));
|
||||
}
|
||||
|
||||
var projection = new List<AdvancedRow>(4);
|
||||
AddFieldOfView(projection, "cameraFOV", s.SlFovMinBits, s.SlFovMaxBits);
|
||||
var projection = new List<AdvancedRow>(3);
|
||||
// A range, lowest to highest - never a series, which would say when the player aimed (D114).
|
||||
if (Number(s.SlFovMinBits) is double low && Number(s.SlFovMaxBits) is double high)
|
||||
{
|
||||
projection.Add(new AdvancedRow("cameraFOV", s.SlFovMinBits == s.SlFovMaxBits
|
||||
? 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.#}°)")));
|
||||
}
|
||||
|
||||
AddNumber(projection, "cameraAspectRatio", s.SlAspectBits);
|
||||
AddSwitch(projection, "orthographicProjection", SwitchOf(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse, 4));
|
||||
if (projection.Count > 0)
|
||||
@@ -564,7 +347,15 @@ public sealed class InGameAdvancedSampler
|
||||
var depth = new List<AdvancedRow>(3);
|
||||
AddDepthPlane(depth, "cameraNear", s.FfxNearBits);
|
||||
AddDepthPlane(depth, "cameraFar", s.FfxFarBits);
|
||||
AddFieldOfView(depth, "cameraFovAngleVertical", s.FfxFovMinBits, s.FfxFovMaxBits);
|
||||
// A range, lowest to highest - never a series, which would say when the player aimed (D114).
|
||||
if (Number(s.FfxFovMinBits) is double low && Number(s.FfxFovMaxBits) is double high)
|
||||
{
|
||||
// One value or two: told by the bits, which is what "the same float" means (and what csharpsquid:S1244 asks).
|
||||
depth.Add(new AdvancedRow("cameraFovAngleVertical", s.FfxFovMinBits == s.FfxFovMaxBits
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{low:0.####} rad ({Degrees(low):0.#}°)")
|
||||
: string.Create(CultureInfo.InvariantCulture, $"{low:0.####} – {high:0.####} rad ({Degrees(low):0.#}° – {Degrees(high):0.#}°)")));
|
||||
}
|
||||
|
||||
if (depth.Count > 0)
|
||||
{
|
||||
facts.Add(Fact("ffx.upscale.depth", AdvancedValue.OfRows(depth)));
|
||||
@@ -630,32 +421,6 @@ public sealed class InGameAdvancedSampler
|
||||
}
|
||||
}
|
||||
|
||||
// A field of view as the game gave it: a range, lowest to highest - never a series, which would say when the
|
||||
// player aimed (D114). Both vendors' headers say radians, and a value over pi cannot be one: Cyberpunk 2077 gives
|
||||
// Streamline 51 to 90 (the owner's sessions of 2026-11-12, where this printed "51.0055 - 90 rad (2922.4 deg ...)").
|
||||
// Such a value is said as it was given, and a second row says what it is not. It is never converted: which unit
|
||||
// the game meant is this project's guess, and the row would then carry the guess as the game's word (D128).
|
||||
private static void AddFieldOfView(List<AdvancedRow> rows, string member, uint minBits, uint maxBits)
|
||||
{
|
||||
if (Number(minBits) is not double low || Number(maxBits) is not double high)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// One value or two: told by the bits, which is what "the same float" means (and what csharpsquid:S1244 asks).
|
||||
bool one = minBits == maxBits;
|
||||
if (high > Math.PI)
|
||||
{
|
||||
rows.Add(new AdvancedRow(member, one ? Text(low) : Text(low) + " – " + Text(high)));
|
||||
rows.Add(new AdvancedRow(member + " unit", _notRadians, _notRadians));
|
||||
return;
|
||||
}
|
||||
|
||||
rows.Add(new AdvancedRow(member, one
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{low:0.####} rad ({Degrees(low):0.#}°)")
|
||||
: string.Create(CultureInfo.InvariantCulture, $"{low:0.####} – {high:0.####} rad ({Degrees(low):0.#}° – {Degrees(high):0.#}°)")));
|
||||
}
|
||||
|
||||
private static string? Range(uint minBits, uint maxBits) =>
|
||||
Number(minBits) is double low && Number(maxBits) is double high
|
||||
? minBits == maxBits ? Text(low) : Text(low) + " – " + Text(high)
|
||||
@@ -723,8 +488,7 @@ public sealed class InGameAdvancedSampler
|
||||
ulong SlDepth,
|
||||
ulong SlFov,
|
||||
uint SlAspect,
|
||||
ulong SlFlags,
|
||||
ulong SlFeatures)
|
||||
ulong SlFlags)
|
||||
{
|
||||
public static FactKey Of(InGameAdvanced published)
|
||||
{
|
||||
@@ -736,7 +500,7 @@ public sealed class InGameAdvancedSampler
|
||||
}
|
||||
|
||||
return new FactKey(
|
||||
s.ValidMask & (FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale | FlAdvancedValid.FfxFgConfig | FlAdvancedValid.SlConstants | FlAdvancedValid.SlFeatures | FlAdvancedValid.SlShutdown),
|
||||
s.ValidMask & (FlAdvancedValid.DlssOptions | FlAdvancedValid.FfxUpscale | FlAdvancedValid.FfxFgConfig | FlAdvancedValid.SlConstants),
|
||||
s.DlssOutputWidth,
|
||||
s.DlssOutputHeight,
|
||||
s.DlssPreExposureBits,
|
||||
@@ -764,31 +528,7 @@ public sealed class InGameAdvancedSampler
|
||||
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;
|
||||
Pair(s.SlFlagsSeenTrue, s.SlFlagsSeenFalse));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,11 +22,6 @@ 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
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// 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;
|
||||
@@ -192,8 +191,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 ExternalException or DllNotFoundException or EntryPointNotFoundException
|
||||
or BadImageFormatException or MarshalDirectiveException)
|
||||
or System.Runtime.InteropServices.ExternalException or DllNotFoundException or EntryPointNotFoundException
|
||||
or BadImageFormatException or System.Runtime.InteropServices.MarshalDirectiveException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -375,8 +374,8 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
// records Advanced metrics - the same condition the shared reader is held under.
|
||||
private readonly InGameAdvancedSampler? _inGame = advanced is null ? null : new InGameAdvancedSampler();
|
||||
private IReadOnlyList<AdvancedReading>? _inGamePending;
|
||||
private (IReadOnlyList<AdvancedFact> Facts, AdvancedInGameStatus Status, InGameCallStates Calls) _inGameContext =
|
||||
([], AdvancedInGameStatus.Unknown, default);
|
||||
private (IReadOnlyList<AdvancedFact> Facts, AdvancedInGameStatus Status, AdvancedInGameCall? Streamline, AdvancedInGameCall? FrameGeneration) _inGameContext =
|
||||
([], AdvancedInGameStatus.Unknown, null, null);
|
||||
private IReadOnlyList<AdvancedFact> _sessionWithGame = [];
|
||||
|
||||
/// <summary>A session that records Advanced metrics asks the Overlay for what the game tells its upscaler (D111).</summary>
|
||||
@@ -487,9 +486,10 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
IReadOnlyList<AdvancedFact>? session = _sessionFacts;
|
||||
IReadOnlyList<AdvancedFact> game = _inGame?.Facts ?? [];
|
||||
AdvancedInGameStatus status = InGameStatus();
|
||||
InGameCallStates calls = InGameCalls();
|
||||
(AdvancedInGameCall? streamline, AdvancedInGameCall? frameGeneration) = InGameCalls();
|
||||
(IReadOnlyList<AdvancedFact>?, IReadOnlyList<AdvancedSeriesInfo>?, AdvancedSources?, IReadOnlyList<AdvancedFact>?) now = (snapshot?.MachineFacts, snapshot?.Series, snapshot?.Sources, session);
|
||||
bool sameGame = ReferenceEquals(game, _inGameContext.Facts) && status == _inGameContext.Status && calls == _inGameContext.Calls;
|
||||
bool sameGame = ReferenceEquals(game, _inGameContext.Facts) && status == _inGameContext.Status
|
||||
&& streamline == _inGameContext.Streamline && frameGeneration == _inGameContext.FrameGeneration;
|
||||
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)))
|
||||
{
|
||||
@@ -503,68 +503,33 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
}
|
||||
|
||||
_context = now;
|
||||
_inGameContext = (game, status, calls);
|
||||
_inGameContext = (game, status, streamline, frameGeneration);
|
||||
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,
|
||||
}));
|
||||
(snapshot?.Sources ?? AdvancedSources.Unknown) with { InGame = status, StreamlineConstants = streamline, FsrFrameGeneration = frameGeneration }));
|
||||
}
|
||||
|
||||
/// <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.
|
||||
/// What became of the two calls hooked only for Advanced metrics (0.1.0-beta.43), 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. Null for a session not measured inside the game:
|
||||
/// <see cref="AdvancedInGameStatus.NotHooked"/> already says so.
|
||||
/// </summary>
|
||||
private InGameCallStates InGameCalls()
|
||||
private (AdvancedInGameCall? Streamline, AdvancedInGameCall? FrameGeneration) InGameCalls()
|
||||
{
|
||||
if (_inGame is null || AttachedAt is null)
|
||||
{
|
||||
return default;
|
||||
return (null, null);
|
||||
}
|
||||
|
||||
var hooks = (FlHookFamily)(_last?.WriterState.HooksInstalledMask ?? 0u);
|
||||
return new InGameCallStates(
|
||||
return (
|
||||
_inGame.Call(FlAdvancedValid.SlConstants, hooks.HasFlag(FlHookFamily.SlConstants)),
|
||||
_inGame.Call(FlAdvancedValid.FfxFgConfig, hooks.HasFlag(FlHookFamily.FfxConfigure)),
|
||||
_inGame.FeatureCall(FlAdvancedState.FeatureVersionAnswered, hooks.HasFlag(FlHookFamily.SlFeatureVersion)),
|
||||
_inGame.FeatureCall(FlAdvancedState.FeatureRequirementsAnswered, hooks.HasFlag(FlHookFamily.SlFeatureRequirements)),
|
||||
_inGame.FeatureCall(FlAdvancedState.FeatureSupportAnswered, hooks.HasFlag(FlHookFamily.SlFeatureSupported)),
|
||||
_inGame.FeatureCall(FlAdvancedState.FeatureLoadedAnswered, hooks.HasFlag(FlHookFamily.SlFeatureLoaded)),
|
||||
_inGame.FeatureCall(InGameAdvancedSampler.FeatureSwitched, hooks.HasFlag(FlHookFamily.SlSetFeatureLoaded)),
|
||||
_inGame.FeatureCall(InGameAdvancedSampler.FeatureAllocated, hooks.HasFlag(FlHookFamily.SlAllocateResources)),
|
||||
_inGame.FeatureCall(InGameAdvancedSampler.FeatureFreed, hooks.HasFlag(FlHookFamily.SlFreeResources)),
|
||||
_inGame.Call(FlAdvancedValid.SlShutdown, hooks.HasFlag(FlHookFamily.SlShutdown)));
|
||||
_inGame.Call(FlAdvancedValid.FfxFgConfig, hooks.HasFlag(FlHookFamily.FfxConfigure)));
|
||||
}
|
||||
|
||||
/// <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.
|
||||
|
||||
@@ -35,28 +35,4 @@ public enum HookFamilies
|
||||
|
||||
/// <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,
|
||||
}
|
||||
@@ -51,14 +51,9 @@ 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, hook_crash_count = 0, updated_at = @at "
|
||||
+ "hook_consent_provenance = @provenance, hook_consent_disclosure_version = @disclosure, updated_at = @at "
|
||||
+ "WHERE exe_path = @path";
|
||||
|
||||
private const string _revoke =
|
||||
|
||||
@@ -292,37 +292,6 @@ public enum FlHookFamily : uint
|
||||
/// 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>
|
||||
@@ -806,9 +775,6 @@ public enum FlAdvancedValid : uint
|
||||
|
||||
/// <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>
|
||||
@@ -1001,60 +967,11 @@ public unsafe struct FlAdvancedState
|
||||
|
||||
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];
|
||||
public fixed uint ReservedSl[3];
|
||||
|
||||
/// <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>
|
||||
|
||||
@@ -188,37 +188,8 @@ struct Accumulators {
|
||||
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.
|
||||
@@ -490,170 +461,15 @@ inline void ObserveSlConstants(const sl::Constants& k, uint32_t viewport, Accumu
|
||||
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.
|
||||
// process, not about a session.
|
||||
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.validMask.store(0u, relaxed);
|
||||
a.dlssStructVersion.store(0u, relaxed);
|
||||
a.dlssOptionsSeen.store(0u, relaxed);
|
||||
a.dlssOutputWidth.store(0u, relaxed);
|
||||
@@ -701,17 +517,6 @@ inline void Reset(Accumulators& a) noexcept {
|
||||
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
|
||||
@@ -803,11 +608,6 @@ inline void Publish(Accumulators& a, FlAdvancedState* region, uint32_t request,
|
||||
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);
|
||||
|
||||
@@ -125,12 +125,7 @@ inline constexpr uint32_t kFamiliesEvaluateFeatureDoesNotImplement =
|
||||
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_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_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE);
|
||||
|
||||
static_assert((kFamilyEvaluateFeature & kFamiliesEvaluateFeatureDoesNotImplement) == 0u,
|
||||
"the slEvaluateFeature row claims a family its detour does not implement -- hookinventory-check "
|
||||
@@ -214,12 +209,7 @@ inline constexpr uint32_t kFamiliesFfxDispatchDoesNotImplement =
|
||||
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_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_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS) | static_cast<uint32_t>(fl::FL_HOOK_FFX_CONFIGURE);
|
||||
|
||||
static_assert((kFamilyFfxDispatch & kFamiliesFfxDispatchDoesNotImplement) == 0u,
|
||||
"the ffxDispatch rows claim a family their detour does not implement -- hookinventory-check reads "
|
||||
@@ -313,83 +303,6 @@ static_assert(kFamilySlConstants != kFamilyEvaluateFeature && kFamilySlConstants
|
||||
"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
|
||||
@@ -406,9 +319,6 @@ static_assert(((kFamilyEvaluateFeature | kFamilyFfxDispatch | kFamilyFfxQuery |
|
||||
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 "
|
||||
@@ -505,19 +415,11 @@ 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) \
|
||||
@@ -537,7 +439,7 @@ inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
|
||||
#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");
|
||||
static_assert(kRowCount == 18u, "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
|
||||
|
||||
@@ -57,8 +57,7 @@ enum class InstallResult : std::uint32_t {
|
||||
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
|
||||
StoppedDuring = 6, // the stop ran while this patch went in; the installer took it out again
|
||||
};
|
||||
|
||||
template <std::uint32_t Capacity>
|
||||
@@ -177,222 +176,6 @@ InstallResult Install(Registry<Capacity>& registry, const std::atomic<std::uint3
|
||||
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
|
||||
@@ -164,7 +164,6 @@ enum FlLogCode : uint32_t {
|
||||
kLogUpscaleRoute,
|
||||
kLogRuntimeCensus,
|
||||
kLogFfxConfigureType,
|
||||
kLogPatchBatch,
|
||||
};
|
||||
|
||||
const char* LogCodeName(uint32_t code) noexcept {
|
||||
@@ -205,8 +204,6 @@ const char* LogCodeName(uint32_t code) noexcept {
|
||||
return "RUNTIME_CENSUS";
|
||||
case kLogFfxConfigureType:
|
||||
return "FFX_CONFIGURE";
|
||||
case kLogPatchBatch:
|
||||
return "PATCH_BATCH";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
@@ -398,77 +395,15 @@ static_assert(fl::inventory::kRowCount + kPatchSitesOutsideTheInventory <= kMaxP
|
||||
"the patch registry cannot hold every patch this DLL may install -- raise kMaxPatches with the table");
|
||||
fl::patch::Registry<kMaxPatches> g_patches;
|
||||
|
||||
// THE GATE around MinHook's queue (fl_patch_registry.h, BATCHES; 0.1.0-beta.46). MH_ApplyQueued applies every mark
|
||||
// in the process's one table, so the watchdog's "mark, apply, commit" and the stop's "mark, apply" must not
|
||||
// interleave. A slim reader/writer lock, taken exclusively: no allocation, no handle, nothing to initialise or tear
|
||||
// down. Held for one apply -- one stop of the threads -- and never across a symbol lookup (the loader's lock).
|
||||
//
|
||||
// NOT IN ANY HOOK BODY. The one path from a hook to here is the stop itself -- MayObserve reading the Agent's request,
|
||||
// or the third fault -- which already blocked for MinHook's own lock and a stop of the threads for every patch it
|
||||
// restored. It waits here for at most the watchdog's one apply, once in a process's life.
|
||||
//
|
||||
// RE-ENTERED BY ITS OWNER WITHOUT WAITING: a slim lock taken twice by one thread never returns. The only way there is
|
||||
// a stop that begins on the thread that is inside a batch -- a third fault in the LoadLibrary detour, if the engine
|
||||
// loaded a module under the gate. That stop then runs with the marks the batch has made; the batch's own re-read of
|
||||
// the flag takes out what it put in (fl_patch_registry.h, Batch::Commit).
|
||||
SRWLOCK g_patchGate = SRWLOCK_INIT;
|
||||
std::atomic<DWORD> g_patchGateOwner{0};
|
||||
uint32_t g_patchGateDepth = 0; // the owner's alone
|
||||
|
||||
// MinHook, as the engine fl::patch::Install, Batch and RestoreAll drive.
|
||||
// MinHook, as the engine fl::patch::Install drives.
|
||||
struct MinHookEngine {
|
||||
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); }
|
||||
|
||||
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 {
|
||||
const DWORD self = GetCurrentThreadId();
|
||||
if (g_patchGateOwner.load(std::memory_order_acquire) == self) {
|
||||
++g_patchGateDepth;
|
||||
return;
|
||||
}
|
||||
AcquireSRWLockExclusive(&g_patchGate);
|
||||
g_patchGateOwner.store(self, std::memory_order_release);
|
||||
}
|
||||
static void EndQueue() noexcept {
|
||||
if (g_patchGateDepth != 0u) {
|
||||
--g_patchGateDepth;
|
||||
return;
|
||||
}
|
||||
g_patchGateOwner.store(0, std::memory_order_release);
|
||||
ReleaseSRWLockExclusive(&g_patchGate);
|
||||
}
|
||||
};
|
||||
|
||||
// The performance counter, as a number. QuadPart is named in the initialiser so that it is the member the union
|
||||
// holds when it is read back (SonarCloud's cpp:S6232 on a `{}` that initialises the other half).
|
||||
int64_t QpcNow() noexcept {
|
||||
LARGE_INTEGER now{.QuadPart = 0};
|
||||
QueryPerformanceCounter(&now);
|
||||
return now.QuadPart;
|
||||
}
|
||||
|
||||
// Microseconds since `fromTicks` (QpcNow), for a PATCH_BATCH line; saturating, because the line's field is 32 bits.
|
||||
uint32_t MicrosSince(int64_t fromTicks) noexcept {
|
||||
const int64_t now = QpcNow();
|
||||
const uint64_t ticks = now > fromTicks ? static_cast<uint64_t>(now - fromTicks) : 0u;
|
||||
const uint64_t micros = g_logQpcFreq != 0u ? ticks * 1000000ull / g_logQpcFreq : 0u;
|
||||
return micros > 0xFFFFFFFFull ? 0xFFFFFFFFu : static_cast<uint32_t>(micros);
|
||||
}
|
||||
|
||||
// A patch that did not go in, said ONCE per target and reason: the lazy installers retry every second, and a line a
|
||||
// second would push everything else out of a 256-event ring. Init and watchdog threads only, which never install at
|
||||
// the same time (the watchdog starts after the init thread's last install), so a plain table.
|
||||
@@ -984,7 +919,7 @@ void WakeWatchdog() noexcept;
|
||||
|
||||
void StopObserving(uint32_t reason) noexcept {
|
||||
// Compare-exchange, not a plain check-then-set: the watchdog and a game
|
||||
// thread inside a hook body can both arrive here, and the restore must run
|
||||
// thread inside a hook body can both arrive here, and MH_DisableHook must run
|
||||
// exactly once. The loser returns without touching status, so the FIRST
|
||||
// reason wins -- a self-disable already in flight is not overwritten by a
|
||||
// safety stop that arrives a millisecond later, or the record of WHY we
|
||||
@@ -1004,27 +939,14 @@ void StopObserving(uint32_t reason) noexcept {
|
||||
// is restored only while the bytes at its target are still the jump MinHook
|
||||
// wrote for us; otherwise it is left in place and our detour stays in the
|
||||
// other overlay's chain doing nothing -- g_observing is 0, every body forwards.
|
||||
//
|
||||
// ONE STOP OF THE GAME'S THREADS FOR ALL OF THEM (0.1.0-beta.46, owner decision D134). Each patch was restored by
|
||||
// its own MH_DisableHook -- a snapshot of the system's threads and a suspend of every one of this process's, per
|
||||
// patch: about 160 ms each, two to three seconds for a Streamline title, possibly on the thread that presents.
|
||||
// RestoreAll marks the patches that are still ours and applies the marks together (fl_patch_registry.h says what
|
||||
// may and may not be marked, and why). The lines below are written after the gate is released.
|
||||
const int64_t began = QpcNow();
|
||||
uint32_t restored = 0;
|
||||
fl::patch::RestoreAll(
|
||||
g_patches, MinHookEngine{},
|
||||
[](const void* target, const void* detour) noexcept { return fl::patch::StillOurs(target, detour); },
|
||||
[&restored](const char* name, void* target, bool wasOurs, bool ok) noexcept {
|
||||
if (wasOurs) {
|
||||
LogNote(kLogUnhookRestored, name, ok ? 1u : 0u, reinterpret_cast<uint64_t>(target));
|
||||
restored += ok ? 1u : 0u;
|
||||
} else {
|
||||
LogNote(kLogUnhookDeclined, name, 0u, reinterpret_cast<uint64_t>(target));
|
||||
}
|
||||
});
|
||||
// a = the microseconds the walk and its one apply took, b = how many patches it restored.
|
||||
LogNote(kLogPatchBatch, "restore", MicrosSince(began), restored);
|
||||
g_patches.ForEachLive([](void* target, void* detour, const char* name) noexcept {
|
||||
if (fl::patch::StillOurs(target, detour)) {
|
||||
const bool ok = MH_DisableHook(target) == MH_OK;
|
||||
LogNote(kLogUnhookRestored, name, ok ? 1u : 0u, reinterpret_cast<uint64_t>(target));
|
||||
} else {
|
||||
LogNote(kLogUnhookDeclined, name, 0u, reinterpret_cast<uint64_t>(target));
|
||||
}
|
||||
});
|
||||
if (g_state != nullptr) {
|
||||
std::atomic_ref<uint32_t> status{g_state->status};
|
||||
status.store(reason, std::memory_order_release);
|
||||
@@ -1064,63 +986,6 @@ bool PatchTarget(void* target, void* detour, void** original, const char* name)
|
||||
return false;
|
||||
}
|
||||
|
||||
// SEVERAL PATCHES FOR ONE STOP OF THE GAME'S THREADS (0.1.0-beta.46, owner decision D134). The lazy installers put a
|
||||
// row's patch into the watchdog's batch instead of making it at once, and the batch goes in when the walk is done:
|
||||
// thirteen Streamline rows were thirteen stops of every thread of the game, 0.7 s to 2.8 s of its start in the
|
||||
// owner's logs of 2026-11-13. fl_patch_registry.h holds the sequence and what it must never do.
|
||||
//
|
||||
// WATCHDOG THREAD ONLY, and empty between two installers: each commits what it queued before it returns.
|
||||
fl::patch::Batch<kMaxPatches> g_batch;
|
||||
|
||||
// What PatchTarget does, deferred: the slot is claimed and the hook created now; the patch, its HOOK_INSTALLED line,
|
||||
// its family bit and its latch come at CommitPatchBatch -- in that order, and only if the patch went in. `family` is
|
||||
// 0 for a row whose family is published elsewhere, once every row of it is in; `latch` is the row's "patched" word.
|
||||
bool QueuePatch(void* target, void* detour, void** original, const char* name, uint32_t family,
|
||||
std::atomic<uint32_t>* latch) noexcept {
|
||||
const fl::patch::InstallResult result =
|
||||
g_batch.Add(g_patches, g_observing, MinHookEngine{}, target, detour, original, name, latch, family);
|
||||
if (result == fl::patch::InstallResult::Pending) {
|
||||
return true;
|
||||
}
|
||||
if (result != fl::patch::InstallResult::NoTarget) {
|
||||
NotePatchFailedOnce(target, result, name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CommitPatchBatch() noexcept {
|
||||
const uint32_t count = g_batch.Count();
|
||||
if (count == 0u) {
|
||||
return;
|
||||
}
|
||||
const int64_t began = QpcNow();
|
||||
g_batch.Commit(g_patches, g_observing, MinHookEngine{}, [](const void* target, const void* detour) noexcept {
|
||||
return fl::patch::StillOurs(target, detour);
|
||||
});
|
||||
const uint32_t micros = MicrosSince(began);
|
||||
uint32_t installed = 0;
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
const auto& item = g_batch.At(i);
|
||||
if (item.result != fl::patch::InstallResult::Installed) {
|
||||
NotePatchFailedOnce(item.target, item.result, item.name);
|
||||
continue;
|
||||
}
|
||||
LogNote(kLogHookInstalled, item.name, 0, reinterpret_cast<uint64_t>(item.target));
|
||||
// The family, then the latch: PublishHookFamily's order, for a row that has both.
|
||||
if (item.word != 0u && g_state != nullptr) {
|
||||
std::atomic_ref<uint32_t> hooks{g_state->hooksInstalledMask};
|
||||
hooks.fetch_or(item.word, std::memory_order_relaxed);
|
||||
}
|
||||
if (item.context != nullptr) {
|
||||
static_cast<std::atomic<uint32_t>*>(item.context)->store(1u, std::memory_order_release);
|
||||
}
|
||||
++installed;
|
||||
}
|
||||
// a = the microseconds the one apply took, b = how many patches it put in.
|
||||
LogNote(kLogPatchBatch, "install", micros, installed);
|
||||
g_batch.Clear();
|
||||
}
|
||||
|
||||
// Returns false when we must not record this present.
|
||||
//
|
||||
// The supervision deadline is NOT here any more -- it is the watchdog's, which
|
||||
@@ -1310,38 +1175,7 @@ std::atomic<uint32_t> g_frameTokensLive{0};
|
||||
using PFN_SlSetConstants = ::PFun_slSetConstants*;
|
||||
PFN_SlSetConstants g_origSlSetConstants = nullptr;
|
||||
std::atomic<uint32_t> g_slConstantsLive{0};
|
||||
|
||||
// slGetFeatureVersion and slGetFeatureRequirements (0.1.0-beta.44, Advanced metrics): patched only in a process that
|
||||
// was asked for Advanced metrics at least once, as slSetConstants is. A patch, a trampoline and a latch each.
|
||||
using PFN_SlGetFeatureVersion = ::PFun_slGetFeatureVersion*;
|
||||
using PFN_SlGetFeatureRequirements = ::PFun_slGetFeatureRequirements*;
|
||||
PFN_SlGetFeatureVersion g_origSlGetFeatureVersion = nullptr;
|
||||
PFN_SlGetFeatureRequirements g_origSlGetFeatureRequirements = nullptr;
|
||||
std::atomic<uint32_t> g_slFeatureVersionLive{0};
|
||||
std::atomic<uint32_t> g_slFeatureRequirementsLive{0};
|
||||
|
||||
// slIsFeatureSupported, slIsFeatureLoaded, slSetFeatureLoaded (0.1.0-beta.45, Advanced metrics): the same terms.
|
||||
using PFN_SlIsFeatureSupported = ::PFun_slIsFeatureSupported*;
|
||||
using PFN_SlIsFeatureLoaded = ::PFun_slIsFeatureLoaded*;
|
||||
using PFN_SlSetFeatureLoaded = ::PFun_slSetFeatureLoaded*;
|
||||
PFN_SlIsFeatureSupported g_origSlIsFeatureSupported = nullptr;
|
||||
PFN_SlIsFeatureLoaded g_origSlIsFeatureLoaded = nullptr;
|
||||
PFN_SlSetFeatureLoaded g_origSlSetFeatureLoaded = nullptr;
|
||||
std::atomic<uint32_t> g_slFeatureSupportedLive{0};
|
||||
std::atomic<uint32_t> g_slFeatureLoadedLive{0};
|
||||
std::atomic<uint32_t> g_slSetFeatureLoadedLive{0};
|
||||
|
||||
// slAllocateResources, slFreeResources, slShutdown (0.1.0-beta.45): the same terms.
|
||||
using PFN_SlAllocateResources = ::PFun_slAllocateResources*;
|
||||
using PFN_SlFreeResources = ::PFun_slFreeResources*;
|
||||
using PFN_SlShutdown = ::PFun_slShutdown*;
|
||||
PFN_SlAllocateResources g_origSlAllocateResources = nullptr;
|
||||
PFN_SlFreeResources g_origSlFreeResources = nullptr;
|
||||
PFN_SlShutdown g_origSlShutdown = nullptr;
|
||||
std::atomic<uint32_t> g_slAllocateResourcesLive{0};
|
||||
std::atomic<uint32_t> g_slFreeResourcesLive{0};
|
||||
std::atomic<uint32_t> g_slShutdownLive{0};
|
||||
std::atomic<uint32_t> g_frameTokens{0};
|
||||
std::atomic<uint32_t> g_frameTokens{0};
|
||||
// The HIGHEST frame index seen so far, tagged in bit 32 so that index 0 is
|
||||
// distinct from "no frame yet". Measured 2026-09-03 on Cyberpunk 2077
|
||||
// (20_OPEN_QUESTIONS §S31, row P4): the title asks for a token 3 to 4.6 times per
|
||||
@@ -1926,107 +1760,6 @@ sl::Result STDMETHODCALLTYPE Hook_SlSetConstants(const sl::Constants& values, co
|
||||
return g_origSlSetConstants(values, frame, viewport);
|
||||
}
|
||||
|
||||
// What Streamline answers when the game asks which version a feature is (0.1.0-beta.44). THE ORIGINAL RUNS FIRST,
|
||||
// exactly once, on every path, with both arguments forwarded untouched: what is read is its ANSWER, in the struct the
|
||||
// game passed, and only when it said OK -- a refusal leaves the struct as the game made it, which is not an answer.
|
||||
// Then the same three conditions as slSetConstants: the Agent is asking, observing has not stopped, and the struct is
|
||||
// the one these headers describe (its GUID and a version of at least 1, checked on this call). The read itself is in
|
||||
// fl_adv_fields.h.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlGetFeatureVersion(sl::Feature feature, sl::FeatureVersion& version) {
|
||||
const sl::Result result = g_origSlGetFeatureVersion(feature, version);
|
||||
FL_HOOK_GUARD({
|
||||
if (result == sl::Result::eOk && g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve() &&
|
||||
fl::slinputs::IsReadable<sl::FeatureVersion>(&version)) {
|
||||
fl::adv::ObserveSlFeatureVersion(static_cast<uint32_t>(feature), version, g_adv);
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// What Streamline answers when the game asks what a feature requires (0.1.0-beta.44): the same shape. The answer
|
||||
// carries pointers -- the required buffer tags, the names of Vulkan extensions and features -- and fl_adv_fields.h
|
||||
// follows none of them.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlGetFeatureRequirements(sl::Feature feature, sl::FeatureRequirements& requirements) {
|
||||
const sl::Result result = g_origSlGetFeatureRequirements(feature, requirements);
|
||||
FL_HOOK_GUARD({
|
||||
if (result == sl::Result::eOk && g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve() &&
|
||||
fl::slinputs::IsReadable<sl::FeatureRequirements>(&requirements)) {
|
||||
fl::adv::ObserveSlFeatureRequirements(static_cast<uint32_t>(feature), requirements, g_adv);
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// Whether Streamline says a feature is supported (0.1.0-beta.45). THE ORIGINAL RUNS FIRST, exactly once, with both
|
||||
// arguments forwarded untouched; what is kept is its RESULT -- every result, since "not supported" is an answer to
|
||||
// this question -- and the feature's id. THE ADAPTER IS FORWARDED AND NEVER LOOKED AT (owner decision D131): it
|
||||
// holds the adapter's LUID or a Vulkan physical device, and no member of it is named anywhere in this DLL.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlIsFeatureSupported(sl::Feature feature, const sl::AdapterInfo& adapterInfo) {
|
||||
const sl::Result result = g_origSlIsFeatureSupported(feature, adapterInfo);
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlFeatureSupported(static_cast<uint32_t>(feature), static_cast<uint32_t>(result), g_adv);
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// Whether Streamline says a feature is loaded (0.1.0-beta.45): the bool it wrote, read as the byte it is, and only
|
||||
// when it said OK -- a refusal leaves the bool as the game made it.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlIsFeatureLoaded(sl::Feature feature, bool& loaded) {
|
||||
const sl::Result result = g_origSlIsFeatureLoaded(feature, loaded);
|
||||
FL_HOOK_GUARD({
|
||||
if (result == sl::Result::eOk && g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlFeatureLoaded(static_cast<uint32_t>(feature), fl::adv::ByteIsSet(loaded), g_adv);
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// The game switching a feature off or on while it runs (0.1.0-beta.45): what it asked for, noted before the call.
|
||||
// Both arguments forwarded untouched, the original called exactly once on every path.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlSetFeatureLoaded(sl::Feature feature, bool loaded) {
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlSetFeatureLoaded(static_cast<uint32_t>(feature), loaded, g_adv);
|
||||
}
|
||||
})
|
||||
return g_origSlSetFeatureLoaded(feature, loaded);
|
||||
}
|
||||
|
||||
// The game allocating a feature's resources (0.1.0-beta.45): counted for the feature. The command buffer and the
|
||||
// viewport are forwarded and not looked at. The original is called exactly once, on every path.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlAllocateResources(sl::CommandBuffer* cmdBuffer, sl::Feature feature,
|
||||
const sl::ViewportHandle& viewport) {
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlAllocateResources(static_cast<uint32_t>(feature), g_adv);
|
||||
}
|
||||
})
|
||||
return g_origSlAllocateResources(cmdBuffer, feature, viewport);
|
||||
}
|
||||
|
||||
// The game freeing them (0.1.0-beta.45). ON A GAME'S WAY OUT, as slShutdown below is: the call is noted BEFORE the
|
||||
// original, and nothing of ours runs after it returns.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlFreeResources(sl::Feature feature, const sl::ViewportHandle& viewport) {
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlFreeResources(static_cast<uint32_t>(feature), g_adv);
|
||||
}
|
||||
})
|
||||
return g_origSlFreeResources(feature, viewport);
|
||||
}
|
||||
|
||||
// The game shutting Streamline down (0.1.0-beta.45): a count, taken before the original runs.
|
||||
sl::Result STDMETHODCALLTYPE Hook_SlShutdown() {
|
||||
FL_HOOK_GUARD({
|
||||
if (g_advancedRequested.load(std::memory_order_relaxed) != 0u && MayObserve()) {
|
||||
fl::adv::ObserveSlShutdown(g_adv);
|
||||
}
|
||||
})
|
||||
return g_origSlShutdown();
|
||||
}
|
||||
|
||||
// slSetTagForFrame: the FrameToken first, then the same list slSetTag takes. The
|
||||
// token is not read -- the frame count comes from slGetNewFrameToken -- and the tag
|
||||
// list is handed to the same NoteTags, because a per-frame tag and a viewport tag
|
||||
@@ -2746,8 +2479,12 @@ bool InstallRow(const wchar_t* moduleName, const char* symbol, uint32_t family,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Queued, not patched: the family is published and the latch set when the batch commits (CommitPatchBatch).
|
||||
return QueuePatch(target, detour, original, name, family, &live);
|
||||
if (!PatchTarget(target, detour, original, name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PublishHookFamily(family, live);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Bind a row's family bit to the detour that implements it.
|
||||
@@ -2777,62 +2514,6 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlSetConstants),
|
||||
reinterpret_cast<void**>(&g_origSlSetConstants), g_slConstantsLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFeatureVersion) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlGetFeatureVersion),
|
||||
reinterpret_cast<void**>(&g_origSlGetFeatureVersion), g_slFeatureVersionLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFeatureRequirements) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlGetFeatureRequirements),
|
||||
reinterpret_cast<void**>(&g_origSlGetFeatureRequirements), g_slFeatureRequirementsLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFeatureSupported) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlIsFeatureSupported),
|
||||
reinterpret_cast<void**>(&g_origSlIsFeatureSupported), g_slFeatureSupportedLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFeatureLoaded) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlIsFeatureLoaded),
|
||||
reinterpret_cast<void**>(&g_origSlIsFeatureLoaded), g_slFeatureLoadedLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlSetFeatureLoaded) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlSetFeatureLoaded),
|
||||
reinterpret_cast<void**>(&g_origSlSetFeatureLoaded), g_slSetFeatureLoadedLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlAllocateResources) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlAllocateResources),
|
||||
reinterpret_cast<void**>(&g_origSlAllocateResources), g_slAllocateResourcesLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlFreeResources) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlFreeResources),
|
||||
reinterpret_cast<void**>(&g_origSlFreeResources), g_slFreeResourcesLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilySlShutdown) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
}
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlShutdown),
|
||||
reinterpret_cast<void**>(&g_origSlShutdown), g_slShutdownLive, name);
|
||||
}
|
||||
if (family == fl::inventory::kFamilyFfxConfigure) {
|
||||
if (g_advancedSeen == 0u) {
|
||||
return false;
|
||||
@@ -2851,8 +2532,11 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak ffx-api
|
||||
}
|
||||
return QueuePatch(target, FfxConfigureDetour(slot), reinterpret_cast<void**>(&g_origFfxConfigure[slot]), name,
|
||||
0u, &g_ffxConfigurePatched[slot]);
|
||||
if (!PatchTarget(target, FfxConfigureDetour(slot), reinterpret_cast<void**>(&g_origFfxConfigure[slot]), name)) {
|
||||
return false;
|
||||
}
|
||||
g_ffxConfigurePatched[slot].store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
if (family == fl::inventory::kFamilyEvaluateFeature) {
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlEvaluateFeature),
|
||||
@@ -2881,7 +2565,11 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
frameRow ? reinterpret_cast<void*>(&Hook_SlSetTagForFrame) : reinterpret_cast<void*>(&Hook_SlSetTag);
|
||||
void** original =
|
||||
frameRow ? reinterpret_cast<void**>(&g_origSlSetTagForFrame) : reinterpret_cast<void**>(&g_origSlSetTag);
|
||||
return QueuePatch(target, detour, original, name, 0u, &patched);
|
||||
if (!PatchTarget(target, detour, original, name)) {
|
||||
return false;
|
||||
}
|
||||
patched.store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
if (family == static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS)) {
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlGetNewFrameToken),
|
||||
@@ -2917,8 +2605,12 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak the 3.0 host ABI
|
||||
}
|
||||
return QueuePatch(target, reinterpret_cast<void*>(&Hook_FfxFsr3ContextDispatchUpscale),
|
||||
reinterpret_cast<void**>(&g_origFfxFsr3DispatchUpscale), name, 0u, &g_fsr3HostPatched);
|
||||
if (!PatchTarget(target, reinterpret_cast<void*>(&Hook_FfxFsr3ContextDispatchUpscale),
|
||||
reinterpret_cast<void**>(&g_origFfxFsr3DispatchUpscale), name)) {
|
||||
return false;
|
||||
}
|
||||
g_fsr3HostPatched.store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
const auto slot = static_cast<uint32_t>(leaf);
|
||||
if (g_ffxPatched[slot].load(std::memory_order_acquire) != 0) {
|
||||
@@ -2928,8 +2620,11 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak ffx-api
|
||||
}
|
||||
return QueuePatch(target, FfxDispatchDetour(slot), reinterpret_cast<void**>(&g_origFfxDispatch[slot]), name, 0u,
|
||||
&g_ffxPatched[slot]);
|
||||
if (!PatchTarget(target, FfxDispatchDetour(slot), reinterpret_cast<void**>(&g_origFfxDispatch[slot]), name)) {
|
||||
return false;
|
||||
}
|
||||
g_ffxPatched[slot].store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
if (family == fl::inventory::kFamilyFfxQuery) {
|
||||
// FOUR ROWS, ONE ARM, the dispatch arm's shape: the row's MODULE picks the trampoline and the latch slot.
|
||||
@@ -2946,8 +2641,11 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak ffx-api
|
||||
}
|
||||
return QueuePatch(target, FfxQueryDetour(slot), reinterpret_cast<void**>(&g_origFfxQuery[slot]), name, 0u,
|
||||
&g_ffxQueryPatched[slot]);
|
||||
if (!PatchTarget(target, FfxQueryDetour(slot), reinterpret_cast<void**>(&g_origFfxQuery[slot]), name)) {
|
||||
return false;
|
||||
}
|
||||
g_ffxQueryPatched[slot].store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -3071,9 +2769,6 @@ bool InstallUpscalerHooks() noexcept {
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_INSTALL_ROW)
|
||||
#undef FL_INSTALL_ROW
|
||||
// Every row this tick found something to patch for goes in now, together -- and before the families that are
|
||||
// published "when whole", which read the latches the commit sets.
|
||||
CommitPatchBatch();
|
||||
PublishParamsFamilyIfWhole();
|
||||
PublishFfxFamilyIfWhole();
|
||||
PublishFfxQueryFamilyIfWhole();
|
||||
@@ -3205,21 +2900,20 @@ bool InstallRtHooks() noexcept {
|
||||
const bool buildAgrees = directVtbl[fl::d3d12::kBuildRaytracingAccelerationStructureIndex] ==
|
||||
computeVtbl[fl::d3d12::kBuildRaytracingAccelerationStructureIndex];
|
||||
|
||||
// The two go in together (0.1.0-beta.46): one stop of the game's threads, not two.
|
||||
if (dispatchAgrees && g_rtDispatchLive.load(std::memory_order_acquire) == 0 &&
|
||||
QueuePatch(directVtbl[fl::d3d12::kDispatchRaysIndex], reinterpret_cast<void*>(&Hook_DispatchRays),
|
||||
reinterpret_cast<void**>(&g_origDispatchRays), "d3d12!ID3D12GraphicsCommandList4::DispatchRays",
|
||||
static_cast<uint32_t>(fl::FL_HOOK_RT_DISPATCH), &g_rtDispatchLive)) {
|
||||
PatchTarget(directVtbl[fl::d3d12::kDispatchRaysIndex], reinterpret_cast<void*>(&Hook_DispatchRays),
|
||||
reinterpret_cast<void**>(&g_origDispatchRays),
|
||||
"d3d12!ID3D12GraphicsCommandList4::DispatchRays")) {
|
||||
PublishHookFamily(static_cast<uint32_t>(fl::FL_HOOK_RT_DISPATCH), g_rtDispatchLive);
|
||||
installed = true;
|
||||
}
|
||||
if (buildAgrees && g_rtAsBuildLive.load(std::memory_order_acquire) == 0 &&
|
||||
QueuePatch(directVtbl[fl::d3d12::kBuildRaytracingAccelerationStructureIndex],
|
||||
reinterpret_cast<void*>(&Hook_BuildRtAs), reinterpret_cast<void**>(&g_origBuildRtAs),
|
||||
"d3d12!ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure",
|
||||
static_cast<uint32_t>(fl::FL_HOOK_RT_AS_BUILD), &g_rtAsBuildLive)) {
|
||||
PatchTarget(directVtbl[fl::d3d12::kBuildRaytracingAccelerationStructureIndex],
|
||||
reinterpret_cast<void*>(&Hook_BuildRtAs), reinterpret_cast<void**>(&g_origBuildRtAs),
|
||||
"d3d12!ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure")) {
|
||||
PublishHookFamily(static_cast<uint32_t>(fl::FL_HOOK_RT_AS_BUILD), g_rtAsBuildLive);
|
||||
installed = true;
|
||||
}
|
||||
CommitPatchBatch();
|
||||
}
|
||||
|
||||
// Closed before release: a command list left recording holds its allocator.
|
||||
@@ -3378,17 +3072,7 @@ DWORD WatchdogLoop() noexcept {
|
||||
// safety stop), that thread can still be in its loop when this one flushes: fl_guard's native-log case read the file
|
||||
// with the dxgi line in it and the kernelbase line -- the last patch -- missing for good, under load. So the flush
|
||||
// waits for the stop to say it is done, bounded, and writes STOP_FLUSHED (a = 1 when the stop finished) last.
|
||||
//
|
||||
// THE BOUND IS A QUARTER OF A SECOND FOR EVERY PATCH THE REGISTRY CAN HOLD (0.1.0-beta.45). It was 2000 ms. A stop
|
||||
// restores its patches one at a time -- each compared before it is restored (§H7) -- and every MH_DisableHook takes a
|
||||
// snapshot of the system's threads before it suspends this process's: about 160 ms a patch on the development PC.
|
||||
// Twelve patches (the Streamline fixture until then) took 1.9 s and fitted; with three more rows the stop took 2.4 s,
|
||||
// the flush gave up first, and the log ended "the stop was still writing" with the last three UNHOOK_RESTORED lines
|
||||
// missing -- the patches were restored, the log did not say so. The wait ends the moment the stop is logged, so the
|
||||
// longer bound costs nothing where the stop is quick. Since 0.1.0-beta.46 the stop restores its patches under one
|
||||
// stop of the threads and is quick; the bound stays for the case it was sized for -- an apply that fails and falls
|
||||
// back to one restore a patch.
|
||||
constexpr ULONGLONG kStopLogWaitMs = 250ull * kMaxPatches;
|
||||
constexpr ULONGLONG kStopLogWaitMs = 2000;
|
||||
|
||||
DWORD WINAPI WatchdogThread(LPVOID) noexcept {
|
||||
const DWORD r = WatchdogLoop();
|
||||
|
||||
@@ -415,23 +415,6 @@ enum FlHookFamily : uint32_t {
|
||||
// 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
|
||||
@@ -967,7 +950,6 @@ enum FlAdvancedValid : uint32_t {
|
||||
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
|
||||
@@ -984,17 +966,8 @@ enum FlAdvancedValid : uint32_t {
|
||||
#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
|
||||
@@ -1074,8 +1047,7 @@ struct alignas(64) FlAdvancedState {
|
||||
// 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
|
||||
uint32_t reservedSl[3]; // @308..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
|
||||
@@ -1350,8 +1322,7 @@ 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, reservedSl) == 308);
|
||||
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);
|
||||
|
||||
+19
-229
@@ -32,7 +32,6 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -6970,27 +6969,6 @@ constexpr float kAdvSlFar = 4000.0f;
|
||||
constexpr float kAdvSlFovLow = 0.8f;
|
||||
constexpr float kAdvSlFovHigh = 1.2f;
|
||||
constexpr float kAdvSlAspect = 1.75f;
|
||||
// ...and asks the stub interposer about DLSS and DLSS frame generation every sixteenth frame (0.1.0-beta.44). What
|
||||
// the stub answers (stub_sl_interposer.cpp), as a slot's words 2..23: the two versions, the flags, three counts,
|
||||
// Windows found and required, the driver found and required.
|
||||
constexpr uint32_t kAdvFeatureDlss[22] = {2u, 14u, 1u, 310u, 4u, 0u, 7u, 2u, 32u, 3u, 10u,
|
||||
0u, 26100u, 10u, 0u, 19041u, 591u, 44u, 0u, 512u, 15u, 0u};
|
||||
constexpr uint32_t kAdvFeatureDlssG[22] = {2u, 14u, 1u, 310u, 4u, 1u, 26u, 1u, 1u, 4u, 10u,
|
||||
0u, 26100u, 10u, 0u, 19041u, 591u, 44u, 0u, 551u, 23u, 0u};
|
||||
constexpr uint32_t kFeatureIdDlss = 0u;
|
||||
constexpr uint32_t kFeatureIdNis = 2u;
|
||||
constexpr uint32_t kFeatureIdPcl = 4u;
|
||||
constexpr uint32_t kFeatureIdDlssG = 1000u;
|
||||
constexpr uint32_t kFeatureIdReflex = 3u;
|
||||
// Word 1 of a slot as the harness and the stub leave it since 0.1.0-beta.45 (fl_shm.h lists the bits): DLSS - both
|
||||
// questions of beta.44 answered (3), supported with eOk (4), loaded and yes (8 + 16), switched on (64); DLSS frame
|
||||
// generation - the same three, never asked whether loaded, switched off and on (32 + 64); NIS - not supported, the
|
||||
// vendor's code 32 in bits 8..15; Reflex - missing, code 31; PCL - asked only whether loaded, and it is not (8).
|
||||
constexpr uint32_t kAdvFeatureWord1Dlss = 3u | 4u | 8u | 16u | 64u;
|
||||
constexpr uint32_t kAdvFeatureWord1DlssG = 3u | 4u | 32u | 64u;
|
||||
constexpr uint32_t kAdvFeatureWord1Nis = 4u | (32u << 8);
|
||||
constexpr uint32_t kAdvFeatureWord1Reflex = 4u | (31u << 8);
|
||||
constexpr uint32_t kAdvFeatureWord1Pcl = 8u;
|
||||
// ...and hands ffxConfigure a frame-generation configuration before each frame's dispatches (0.1.0-beta.43).
|
||||
constexpr uint32_t kAdvFfxFgFlags = 1u << 4; // FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_PACING_LINES
|
||||
constexpr int32_t kAdvFfxFgRectWidth = 1920;
|
||||
@@ -7053,52 +7031,16 @@ uint32_t BitsOf(float v) {
|
||||
return std::bit_cast<uint32_t>(v);
|
||||
}
|
||||
|
||||
// The feature slots of a target that asks Streamline nothing about a feature: every word zero, and no bit of the
|
||||
// mask. (Filled since 0.1.0-beta.44 by a target that asks; until then this was "what later releases fill".)
|
||||
bool FeatureSlotsAreEmpty(const fl::FlAdvancedState& a) {
|
||||
bool zero = (a.validMask & fl::FL_ADV_VALID_SL_FEATURES) == 0u;
|
||||
// What later releases fill: declared, written by nothing yet. (The sl::Constants and the ffxConfigure groups left
|
||||
// this list with 0.1.0-beta.43, which fills them; the two helpers below are for a target that makes neither call.)
|
||||
bool LaterGroupsAreZero(const fl::FlAdvancedState& a) {
|
||||
bool zero = true;
|
||||
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS; ++i) {
|
||||
zero = zero && a.features[i] == 0u;
|
||||
}
|
||||
return zero;
|
||||
}
|
||||
|
||||
// The slot region 5 holds for `feature` (the id plus one in its first word), or nullptr.
|
||||
const uint32_t* FeatureSlotOf(const fl::FlAdvancedState& a, uint32_t feature) {
|
||||
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS; ++i) {
|
||||
const uint32_t* slot = &a.features[static_cast<size_t>(i) * FL_ADV_FEATURE_WORDS];
|
||||
if (slot[0] == feature + 1u) {
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// The ANSWERS in word 1 of the slot region 5 holds for `feature` -- its low sixteen bits; 0 where it holds none.
|
||||
// The two four-bit counts above them (allocations in bits 16..19, frees in 20..23) grow while the target runs.
|
||||
uint32_t FeatureWord1(const fl::FlAdvancedState& a, uint32_t feature) {
|
||||
const uint32_t* slot = FeatureSlotOf(a, feature);
|
||||
return slot == nullptr ? 0u : slot[1] & 0xFFFFu;
|
||||
}
|
||||
|
||||
uint32_t FeatureAllocations(const fl::FlAdvancedState& a, uint32_t feature) {
|
||||
const uint32_t* slot = FeatureSlotOf(a, feature);
|
||||
return slot == nullptr ? 0u : (slot[1] >> 16) & 0xFu;
|
||||
}
|
||||
|
||||
uint32_t FeatureFrees(const fl::FlAdvancedState& a, uint32_t feature) {
|
||||
const uint32_t* slot = FeatureSlotOf(a, feature);
|
||||
return slot == nullptr ? 0u : (slot[1] >> 20) & 0xFu;
|
||||
}
|
||||
|
||||
// A slot's words 1..23 against "both questions of beta.44 answered" and the stub's numbers.
|
||||
bool FeatureSlotIs(const uint32_t* slot, const uint32_t (&expected)[22]) {
|
||||
if (slot == nullptr || (slot[1] & 3u) != 3u) {
|
||||
return false;
|
||||
}
|
||||
return std::memcmp(slot + 2, expected, sizeof(expected)) == 0;
|
||||
}
|
||||
|
||||
bool FfxFgConfigIsUnread(const fl::FlAdvancedState& a) {
|
||||
return a.ffxFgConfigures == 0u && a.ffxFgEnabledSeen == 0u && a.ffxFgAsyncSeen == 0u &&
|
||||
a.ffxFgOnlyGeneratedSeen == 0u && a.ffxFgFlagsSeen == 0u && a.ffxFgRect[2] == 0 && a.ffxFgRect[3] == 0 &&
|
||||
@@ -7251,7 +7193,7 @@ TEST_CASE("region 5 stays empty until the Agent asks, then carries what an FSR t
|
||||
CHECK(SlConstantsAreUnread(a)); // an FSR title with no Streamline: nothing calls slSetConstants
|
||||
CHECK(a.ffxMemoryQueries != 0u);
|
||||
CHECK(a.ffxMemoryQueries <= a.ffxDispatches + 2u);
|
||||
CHECK(FeatureSlotsAreEmpty(a));
|
||||
CHECK(LaterGroupsAreZero(a));
|
||||
// How the target configures frame generation: one configure a frame, counted ONCE though the loader hands it on
|
||||
// to the leaf's export and both are hooked (twice would be past the dispatches), and the key-value configure
|
||||
// beside it not at all. On, never asynchronous, never generated-only, one flag, the whole 1920x1080.
|
||||
@@ -7355,13 +7297,12 @@ TEST_CASE("FSR's plane at infinity (beta.42, D119): a far plane of FLT_MAX reach
|
||||
CHECK(r.st->status == fl::FL_STATUS_READY);
|
||||
}
|
||||
|
||||
TEST_CASE("region 5 carries what a Streamline title chains into its evaluation, tells slSetConstants and is "
|
||||
"answered about a feature, and the three calls are patched only once the Agent has asked",
|
||||
TEST_CASE("region 5 carries what a Streamline title chains into its evaluation and tells slSetConstants, and "
|
||||
"slSetConstants is patched only once the Agent has asked",
|
||||
"[guard][inject][shm][advanced]") {
|
||||
// ONE TARGET, FOUR STRETCHES: never asked -> asked -> no longer asked -> stopped. The target does the same thing
|
||||
// throughout: it chains an sl::DLSSOptions into every evaluation and calls slSetConstants for two viewports every
|
||||
// frame, with the matrices and the camera's position and axes set to loud, changing values; and every sixteenth
|
||||
// frame it asks Streamline which version four features are and what three of them require (0.1.0-beta.44).
|
||||
// frame, with the matrices and the camera's position and axes set to loud, changing values.
|
||||
Child child;
|
||||
REQUIRE(StartHarness(child, L"--real --advanced --hold-presenting-upscaled 60"));
|
||||
|
||||
@@ -7376,21 +7317,7 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
return; // not reached after the REQUIRE; said in the form a static analyser follows (cpp:S2259)
|
||||
}
|
||||
REQUIRE(WaitForIdentityHook(r.st));
|
||||
const auto slConstants = static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS);
|
||||
const auto slFeatures = static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS);
|
||||
const auto slFeatureState = 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);
|
||||
const auto slCounted = 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);
|
||||
constexpr int kFeatureExports = 8;
|
||||
const char* const featureExports[kFeatureExports] = {
|
||||
"slGetFeatureVersion", "slGetFeatureRequirements", "slIsFeatureSupported", "slIsFeatureLoaded",
|
||||
"slSetFeatureLoaded", "slAllocateResources", "slFreeResources", "slShutdown"};
|
||||
unsigned char featurePristine[kFeatureExports][16]{};
|
||||
unsigned char featureNow[16]{};
|
||||
const auto slConstants = static_cast<uint32_t>(fl::FL_HOOK_SL_CONSTANTS);
|
||||
|
||||
// ---- 1. NEVER ASKED (owner decision D111): the evaluation is hooked, the game calls slSetConstants every frame,
|
||||
// and that export is not patched -- its first bytes in the target are the file's -- nor is anything kept.
|
||||
@@ -7404,97 +7331,26 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
REQUIRE(r.st->writeIndex > atHooks + 30u);
|
||||
CHECK(RegionFiveIsZero(r));
|
||||
CHECK((r.st->hooksInstalledMask & slConstants) == 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatures) == 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatureState) == 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slCounted) == 0u);
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, "slSetConstants", now));
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) == 0);
|
||||
for (int i = 0; i < kFeatureExports; ++i) {
|
||||
unsigned char featureInFile[16]{};
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, featureExports[i],
|
||||
featurePristine[i], featureInFile));
|
||||
CHECK(std::memcmp(featurePristine[i], featureInFile, sizeof(featureInFile)) == 0); // the file's bytes
|
||||
}
|
||||
|
||||
// ---- 2. ASKED: the patches go in on the tick that sees the request, and the next publications carry the groups.
|
||||
const ULONGLONG askedAt = GetTickCount64();
|
||||
// ---- 2. ASKED: the patch goes in on the tick that sees the request, and the next publications carry both groups.
|
||||
SetAdvancedRequest(r, 1u);
|
||||
REQUIRE(WaitForHookFamily(r.st, slConstants));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_VERSION)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_REQUIREMENTS)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_SUPPORTED)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FEATURE_LOADED)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_SET_FEATURE_LOADED)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_ALLOCATE_RESOURCES)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_FREE_RESOURCES)));
|
||||
REQUIRE(WaitForHookFamily(r.st, static_cast<uint32_t>(fl::FL_HOOK_SL_SHUTDOWN)));
|
||||
// Measured, not asserted: a tick's wait (up to a second) and then the nine patches. Printed so that a pull request
|
||||
// which changes how patches go in can say what it did to this (0.1.0-beta.46).
|
||||
WARN("asked -> the nine Advanced-only families published: " << (GetTickCount64() - askedAt) << " ms");
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, "slSetConstants", now));
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) != 0); // patched now
|
||||
for (int i = 0; i < kFeatureExports; ++i) {
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, featureExports[i], featureNow));
|
||||
CHECK(std::memcmp(featurePristine[i], featureNow, sizeof(featureNow)) != 0);
|
||||
}
|
||||
|
||||
const auto wanted = fl::FL_ADV_VALID_DLSS_OPTIONS | fl::FL_ADV_VALID_SL_CONSTANTS | fl::FL_ADV_VALID_SL_FEATURES;
|
||||
fl::FlAdvancedState a{};
|
||||
REQUIRE(ReadAdvanced(r, 1u, a, 0u, wanted));
|
||||
// A reset arrives on one frame in sixty-four, both halves of each alternation within two, and the questions about
|
||||
// a feature on one frame in sixteen: read on until the summaries hold all of them (bounded by ReadAdvanced's own
|
||||
// wait, a few publications).
|
||||
for (int i = 0; i < 8 && (a.slResets == 0u || a.slFovMinBits == a.slFovMaxBits ||
|
||||
!FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlssG), kAdvFeatureDlssG) ||
|
||||
FeatureWord1(a, kFeatureIdDlssG) != kAdvFeatureWord1DlssG ||
|
||||
FeatureWord1(a, kFeatureIdDlss) != kAdvFeatureWord1Dlss ||
|
||||
FeatureWord1(a, kFeatureIdPcl) != kAdvFeatureWord1Pcl || a.slShutdowns == 0u ||
|
||||
FeatureAllocations(a, kFeatureIdDlss) == 0u || FeatureFrees(a, kFeatureIdDlssG) == 0u);
|
||||
++i) {
|
||||
REQUIRE(ReadAdvanced(r, 1u, a, a.samples, wanted));
|
||||
REQUIRE(ReadAdvanced(r, 1u, a, 0u, fl::FL_ADV_VALID_DLSS_OPTIONS | fl::FL_ADV_VALID_SL_CONSTANTS));
|
||||
// A reset arrives on one frame in sixty-four and both halves of each alternation within two: read on until the
|
||||
// summaries hold all of them (bounded by ReadAdvanced's own wait, a few publications).
|
||||
for (int i = 0; i < 8 && (a.slResets == 0u || a.slFovMinBits == a.slFovMaxBits); ++i) {
|
||||
REQUIRE(ReadAdvanced(r, 1u, a, a.samples, fl::FL_ADV_VALID_DLSS_OPTIONS | fl::FL_ADV_VALID_SL_CONSTANTS));
|
||||
}
|
||||
INFO("mask 0x" << std::hex << a.validMask << " true 0x" << a.slFlagsSeenTrue << " false 0x" << a.slFlagsSeenFalse
|
||||
<< std::dec << " calls " << a.slConstantsCalls << " resets " << a.slResets << " version "
|
||||
<< a.dlssStructVersion << " output " << a.dlssOutputWidth << "x" << a.dlssOutputHeight);
|
||||
CHECK(a.validMask == static_cast<uint32_t>(wanted | fl::FL_ADV_VALID_SL_SHUTDOWN));
|
||||
|
||||
// What Streamline answered about a feature: a slot for each of the two it answered for, in the order asked, with
|
||||
// exactly the stub's numbers and both questions marked as answered. NOT the one it refused -- its struct came
|
||||
// back full of 99s -- and NOT the one asked about with a struct whose GUID was broken, which it did answer.
|
||||
CHECK(FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlss), kAdvFeatureDlss));
|
||||
CHECK(FeatureSlotIs(FeatureSlotOf(a, kFeatureIdDlssG), kAdvFeatureDlssG));
|
||||
CHECK(a.features[0] == kFeatureIdDlss + 1u);
|
||||
CHECK(a.features[FL_ADV_FEATURE_WORDS] == kFeatureIdDlssG + 1u);
|
||||
|
||||
// 0.1.0-beta.45: whether each is supported, whether it is loaded, and the game switching it. NIS and Reflex have
|
||||
// a slot now -- a refusal is the answer to "is it supported", kept with its code -- and still none of the version
|
||||
// and requirements the stub refused or of the answer that came with a broken struct: every other word of their
|
||||
// slots is zero. PCL was asked only whether it is loaded; NIS's refused "loaded" (the bool left true) is not kept.
|
||||
CHECK(FeatureWord1(a, kFeatureIdDlss) == kAdvFeatureWord1Dlss);
|
||||
CHECK(FeatureWord1(a, kFeatureIdDlssG) == kAdvFeatureWord1DlssG);
|
||||
CHECK(FeatureWord1(a, kFeatureIdNis) == kAdvFeatureWord1Nis);
|
||||
CHECK(FeatureWord1(a, kFeatureIdReflex) == kAdvFeatureWord1Reflex);
|
||||
CHECK(FeatureWord1(a, kFeatureIdPcl) == kAdvFeatureWord1Pcl);
|
||||
for (const uint32_t refused : {kFeatureIdNis, kFeatureIdReflex, kFeatureIdPcl}) {
|
||||
const uint32_t* slot = FeatureSlotOf(a, refused);
|
||||
REQUIRE(slot != nullptr);
|
||||
bool restIsZero = true;
|
||||
for (uint32_t i = 2; i < FL_ADV_FEATURE_WORDS; ++i) {
|
||||
restIsZero = restIsZero && slot[i] == 0u;
|
||||
}
|
||||
CHECK(restIsZero);
|
||||
}
|
||||
CHECK(a.features[size_t{5} * FL_ADV_FEATURE_WORDS] == 0u); // five features, five slots
|
||||
|
||||
// The counted three: DLSS's resources allocated and frame generation's freed on every sixteenth frame, Streamline
|
||||
// shut down on every sixty-fourth -- and the target went on calling the stub after it, through every detour.
|
||||
CHECK(FeatureAllocations(a, kFeatureIdDlss) >= 1u);
|
||||
CHECK(FeatureFrees(a, kFeatureIdDlss) == 0u);
|
||||
CHECK(FeatureFrees(a, kFeatureIdDlssG) >= 1u);
|
||||
CHECK(FeatureAllocations(a, kFeatureIdDlssG) == 0u);
|
||||
CHECK(a.slShutdowns >= 1u);
|
||||
CHECK(a.reservedSl[0] == 0u);
|
||||
CHECK(a.reservedSl[1] == 0u);
|
||||
CHECK(a.validMask == static_cast<uint32_t>(fl::FL_ADV_VALID_DLSS_OPTIONS | fl::FL_ADV_VALID_SL_CONSTANTS));
|
||||
|
||||
// The options chained into the evaluation, as before.
|
||||
CHECK(a.dlssStructVersion == 3u); // the version these headers declare, which is what entitles the tail
|
||||
@@ -7539,6 +7395,7 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
CHECK(a.ffxSharpnessMinBits == FL_ADV_FLOAT_NONE); // a float nobody saw is "none", never 0.0
|
||||
CHECK(a.ffxMemoryQueries == 0u);
|
||||
CHECK(FfxFgConfigIsUnread(a)); // a Streamline title with no FidelityFX: nothing calls ffxConfigure
|
||||
CHECK(LaterGroupsAreZero(a));
|
||||
|
||||
// ---- 3. NO LONGER ASKED: the detour forwards without looking, the region is as it was left, and the patch stays
|
||||
// (it is never taken out mid-session).
|
||||
@@ -7549,28 +7406,19 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
TickFor(r, 2500);
|
||||
CHECK(std::memcmp(&held, RegionFive(r), sizeof(held)) == 0);
|
||||
CHECK((r.st->hooksInstalledMask & slConstants) != 0u);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatures) == slFeatures);
|
||||
CHECK((r.st->hooksInstalledMask & slFeatureState) == slFeatureState);
|
||||
CHECK((r.st->hooksInstalledMask & slCounted) == slCounted);
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, "slSetConstants", now));
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) != 0);
|
||||
|
||||
// The stub's answers carry wild pointers (the tag list, the Vulkan extension names): followed, they would fault.
|
||||
CHECK(r.st->faultCount == 0u);
|
||||
CHECK(r.st->status == fl::FL_STATUS_READY);
|
||||
|
||||
// ---- 4. STOPPED: the export's first bytes are the file's again, and the log says which patch was restored.
|
||||
// The status is written after the last patch is restored, and a restore is some 160 ms: fifteen patches in this
|
||||
// target since 0.1.0-beta.45, so the wait is ten seconds where three were enough for twelve.
|
||||
const ULONGLONG stopAt = GetTickCount64();
|
||||
r.ctl->unhookRequested = 1;
|
||||
for (int i = 0; i < 1000 && r.st->status != fl::FL_STATUS_UNHOOKED; ++i) {
|
||||
for (int i = 0; i < 60 && r.st->status != fl::FL_STATUS_UNHOOKED; ++i) {
|
||||
++r.ctl->guardTicks;
|
||||
Sleep(10);
|
||||
Sleep(50);
|
||||
}
|
||||
REQUIRE(r.st->status == fl::FL_STATUS_UNHOOKED);
|
||||
// Measured, not asserted: the request is read within a frame, then every patch is restored.
|
||||
WARN("unhook requested -> UNHOOKED: " << (GetTickCount64() - stopAt) << " ms");
|
||||
std::wstring log;
|
||||
std::string text;
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
@@ -7587,64 +7435,6 @@ TEST_CASE("region 5 carries what a Streamline title chains into its evaluation,
|
||||
CHECK(std::memcmp(pristine, now, sizeof(now)) == 0);
|
||||
CHECK(text.find("HOOK_INSTALLED sl.interposer.dll!slSetConstants") != std::string::npos);
|
||||
CHECK(text.find("UNHOOK_RESTORED sl.interposer.dll!slSetConstants") != std::string::npos);
|
||||
for (int i = 0; i < kFeatureExports; ++i) {
|
||||
REQUIRE(ReadTargetExportBytes(child.pi.dwProcessId, FL_STUB_SL_INTERPOSER, featureExports[i], featureNow));
|
||||
CHECK(std::memcmp(featurePristine[i], featureNow, sizeof(featureNow)) == 0);
|
||||
CHECK(text.find(std::string("HOOK_INSTALLED sl.interposer.dll!") + featureExports[i]) != std::string::npos);
|
||||
CHECK(text.find(std::string("UNHOOK_RESTORED sl.interposer.dll!") + featureExports[i]) != std::string::npos);
|
||||
}
|
||||
CHECK(text.find("UNHOOK_DECLINED") == std::string::npos);
|
||||
CHECK(text.find("PATCH_FAILED") == std::string::npos);
|
||||
|
||||
// 0.1.0-beta.46 (owner decision D134): the rows go in by the batch -- one stop of the target's threads for the rows
|
||||
// a tick found, not one a row -- and the stop takes every patch out under one. The log says so: a PATCH_BATCH line
|
||||
// an apply, `b` the number of patches it covered. Counted from the log, not written here as numbers: the rows
|
||||
// that install unasked go in on an earlier tick than the nine that wait for the request, so there are at least two
|
||||
// install lines, and every HOOK_INSTALLED that is not one of init's own (DXGI, the loader, OpenGL) is under one.
|
||||
const auto eachLine = [&text](const char* needle, const auto& visit) {
|
||||
std::size_t at = 0;
|
||||
while ((at = text.find(needle, at)) != std::string::npos) {
|
||||
const std::size_t end = text.find('\n', at);
|
||||
visit(text.substr(at, end == std::string::npos ? std::string::npos : end - at));
|
||||
at = end == std::string::npos ? text.size() : end;
|
||||
}
|
||||
};
|
||||
const auto field = [](const std::string& line, std::string_view key, int base) {
|
||||
const std::size_t at = line.find(key);
|
||||
return at == std::string::npos ? 0ull : std::strtoull(line.c_str() + at + key.size(), nullptr, base);
|
||||
};
|
||||
unsigned long long installBatches = 0;
|
||||
unsigned long long installedByBatch = 0;
|
||||
unsigned long long restoreBatches = 0;
|
||||
unsigned long long restoredByBatch = 0;
|
||||
unsigned long long restoreMicros = 0;
|
||||
unsigned long long installedLazily = 0;
|
||||
unsigned long long restoredLines = 0;
|
||||
eachLine("PATCH_BATCH install", [&](const std::string& line) {
|
||||
++installBatches;
|
||||
installedByBatch += field(line, " b=0x", 16);
|
||||
WARN("an install batch put " << field(line, " b=0x", 16) << " patches in, in " << field(line, " a=", 10)
|
||||
<< " us");
|
||||
});
|
||||
eachLine("PATCH_BATCH restore", [&](const std::string& line) {
|
||||
++restoreBatches;
|
||||
restoredByBatch += field(line, " b=0x", 16);
|
||||
restoreMicros += field(line, " a=", 10);
|
||||
});
|
||||
eachLine("HOOK_INSTALLED ", [&](const std::string& line) {
|
||||
if (line.find("dxgi!") == std::string::npos && line.find("kernelbase!") == std::string::npos &&
|
||||
line.find("opengl32!") == std::string::npos) {
|
||||
++installedLazily;
|
||||
}
|
||||
});
|
||||
eachLine("UNHOOK_RESTORED ", [&](const std::string&) { ++restoredLines; });
|
||||
CHECK(installBatches >= 2u);
|
||||
CHECK(installedByBatch == installedLazily);
|
||||
CHECK(installedLazily >= 10u); // slSetConstants and the eight feature exports among them
|
||||
CHECK(restoreBatches == 1u);
|
||||
CHECK(restoredByBatch == restoredLines);
|
||||
// One stop of the threads, not one a patch: restoring these one by one took 1.3 s to 1.5 s on the development PC
|
||||
// (0.1.0-beta.45, eighteen patches). A bound a slow runner still meets, and the old way did not.
|
||||
WARN("the stop's one apply restored " << restoredByBatch << " patches in " << restoreMicros << " us");
|
||||
CHECK(restoreMicros < 1000000ull);
|
||||
}
|
||||
@@ -367,452 +367,3 @@ TEST_CASE("a patch that failed gives its slot back, and a slot is not seen by th
|
||||
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);
|
||||
}
|
||||
@@ -167,7 +167,6 @@ int main() {
|
||||
FL_ADV_FIELD(slAspectBits);
|
||||
FL_ADV_FIELD(slFlagsSeenTrue);
|
||||
FL_ADV_FIELD(slFlagsSeenFalse);
|
||||
FL_ADV_FIELD(slShutdowns);
|
||||
FL_ADV_FIELD(reservedSl);
|
||||
Field("features", offsetof(FlAdvancedState, features), sizeof(FlAdvancedState::features), true);
|
||||
#undef FL_ADV_FIELD
|
||||
|
||||
@@ -121,18 +121,7 @@
|
||||
// the camera's position and axes - which the Overlay never reads - set to loud, changing values;
|
||||
// and the ffx hold calls ffxConfigure every frame with a frame-generation configuration
|
||||
// (kAdvFfxFg*) and with a key-value one, the swapchain, the contexts, the HUD-less resource and
|
||||
// the frame id - never read either - loud and changing.
|
||||
// Since 0.1.0-beta.44 the upscaled hold also asks the stub slGetFeatureVersion and
|
||||
// slGetFeatureRequirements every sixteenth frame - a real game asks while it starts; this one asks
|
||||
// again so that a hook installed later sees an answer - about DLSS and DLSS frame generation
|
||||
// (answered), NIS (refused, with loud numbers left in the struct) and PCL with a struct whose GUID
|
||||
// is broken (answered, and not to be kept).
|
||||
// Since 0.1.0-beta.45, on the same frames, it asks slIsFeatureSupported about DLSS, DLSS frame
|
||||
// generation, NIS (refused: not supported) and Reflex (refused: missing) with an adapter whose
|
||||
// LUID pointer is wild; asks slIsFeatureLoaded about DLSS (yes), PCL (no) and NIS (refused);
|
||||
// and switches DLSS on and DLSS frame generation on and off through slSetFeatureLoaded;
|
||||
// allocates DLSS's resources and frees frame generation's on each of those frames, and calls
|
||||
// slShutdown on every fourth of them - then goes on using the stub
|
||||
// the frame id - never read either - loud and changing
|
||||
// --churn-module <dll>
|
||||
// load and free the module in a loop on a thread of its own, for the life of the process: a
|
||||
// module list that keeps changing under whoever reads it (the guard's D123, 2026-11-12)
|
||||
@@ -2030,26 +2019,6 @@ bool ObserveSlConstantsFaults(const void* constants, fl::adv::Accumulators& a) {
|
||||
}
|
||||
}
|
||||
|
||||
// The same for the two answers about a feature (0.1.0-beta.44).
|
||||
bool ObserveSlFeatureRequirementsFaults(const void* requirements, fl::adv::Accumulators& a) {
|
||||
__try {
|
||||
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS,
|
||||
*static_cast<const sl::FeatureRequirements*>(requirements), a);
|
||||
return false;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool ObserveSlFeatureVersionFaults(const void* version, fl::adv::Accumulators& a) {
|
||||
__try {
|
||||
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, *static_cast<const sl::FeatureVersion*>(version), a);
|
||||
return false;
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool ProbeAdvFields() {
|
||||
g_failures = 0;
|
||||
const auto bitsOf = [](float v) { return std::bit_cast<uint32_t>(v); };
|
||||
@@ -2346,7 +2315,7 @@ bool ProbeAdvFields() {
|
||||
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS * FL_ADV_FEATURE_WORDS; ++i) {
|
||||
untouched = untouched && region->features[i] == 0u;
|
||||
}
|
||||
Check(untouched, "what no call wrote stays zero: the configure, the constants, every feature slot");
|
||||
Check(untouched, "what a later release fills stays zero");
|
||||
|
||||
// A NEW REQUEST: a second session of a game that kept running. Its summaries are its own.
|
||||
fl::adv::Reset(a);
|
||||
@@ -2494,206 +2463,6 @@ bool ProbeAdvFields() {
|
||||
}
|
||||
}
|
||||
|
||||
// --- slGetFeatureVersion and slGetFeatureRequirements: Streamline's answers about a feature (0.1.0-beta.44) -----
|
||||
{
|
||||
fl::adv::Accumulators a;
|
||||
sl::FeatureVersion v;
|
||||
v.versionSL = sl::Version(2, 14, 1);
|
||||
v.versionNGX = sl::Version(310, 4, 0);
|
||||
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, a);
|
||||
sl::FeatureRequirements r;
|
||||
r.flags = sl::FeatureRequirementFlags::eD3D12Supported | sl::FeatureRequirementFlags::eVSyncOffRequired;
|
||||
r.maxNumCPUThreads = 2;
|
||||
r.maxNumViewports = 32;
|
||||
r.numRequiredTags = 3;
|
||||
r.osVersionDetected = sl::Version(10, 0, 26100);
|
||||
r.osVersionRequired = sl::Version(10, 0, 19041);
|
||||
r.driverVersionDetected = sl::Version(591, 44, 0);
|
||||
r.driverVersionRequired = sl::Version(512, 15, 0);
|
||||
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS_G, r, a);
|
||||
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS, r, a);
|
||||
|
||||
const auto word = [&a](uint32_t slot, uint32_t i) {
|
||||
return a.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + i].load();
|
||||
};
|
||||
Check(word(0, 0) == sl::kFeatureDLSS + 1u && word(1, 0) == sl::kFeatureDLSS_G + 1u && word(2, 0) == 0u,
|
||||
"a slot per feature, in the order first asked about, the id plus one; the next slot is empty");
|
||||
Check(word(0, 1) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureRequirementsAnswered) &&
|
||||
word(1, 1) == fl::adv::kFeatureRequirementsAnswered,
|
||||
"word 1 says which question has an answer: both for DLSS, the requirements alone for frame generation");
|
||||
Check(word(0, 2) == 2u && word(0, 3) == 14u && word(0, 4) == 1u && word(0, 5) == 310u && word(0, 6) == 4u &&
|
||||
word(0, 7) == 0u,
|
||||
"the two versions: major, minor, build");
|
||||
Check(word(1, 2) == 0u && word(1, 5) == 0u, "a version nobody asked for is not there");
|
||||
Check(word(1, 8) == 10u && word(1, 9) == 2u && word(1, 10) == 32u && word(1, 11) == 3u,
|
||||
"the flags (D3D12 | V-Sync off required), the threads, the viewports, the number of required tags");
|
||||
Check(word(1, 12) == 10u && word(1, 14) == 26100u && word(1, 15) == 10u && word(1, 17) == 19041u &&
|
||||
word(1, 18) == 591u && word(1, 19) == 44u && word(1, 21) == 512u && word(1, 22) == 15u,
|
||||
"Windows and the driver: what was found, then what is required");
|
||||
Check((a.validMask.load() & fl::FL_ADV_VALID_SL_FEATURES) != 0u, "and the group is marked as read");
|
||||
|
||||
// The last answer about a feature is the one kept, in the slot it already has.
|
||||
v.versionNGX = sl::Version(310, 5, 2);
|
||||
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, a);
|
||||
Check(word(0, 6) == 5u && word(0, 7) == 2u && word(2, 0) == 0u, "asked again: the same slot, the newer answer");
|
||||
|
||||
// A NEW REQUEST KEEPS THEM: a fact about the process, and a game asks once.
|
||||
fl::adv::Reset(a);
|
||||
auto* region = new fl::FlAdvancedState{};
|
||||
fl::adv::Publish(a, region, 9u, 1u);
|
||||
Check(region->features[0] == sl::kFeatureDLSS + 1u && region->features[FL_ADV_FEATURE_WORDS + 8u] == 10u &&
|
||||
region->validMask == static_cast<uint32_t>(fl::FL_ADV_VALID_SL_FEATURES),
|
||||
"a new request publishes the slots as they were, and their bit of the mask with them - alone");
|
||||
delete region;
|
||||
|
||||
// TWELVE SLOTS: a thirteenth feature is not kept, and the id that cannot be stored plus one is refused.
|
||||
fl::adv::Accumulators full;
|
||||
for (uint32_t f = 0; f < FL_ADV_FEATURE_SLOTS + 1u; ++f) {
|
||||
fl::adv::ObserveSlFeatureVersion(100u + f, v, full);
|
||||
}
|
||||
fl::adv::ObserveSlFeatureVersion(0xFFFFFFFFu, v, full);
|
||||
bool twelve = true;
|
||||
for (uint32_t i = 0; i < FL_ADV_FEATURE_SLOTS; ++i) {
|
||||
twelve = twelve && full.features[static_cast<size_t>(i) * FL_ADV_FEATURE_WORDS].load() == 101u + i;
|
||||
}
|
||||
Check(twelve,
|
||||
"twelve features fill the twelve slots in order; the thirteenth and feature 0xFFFFFFFF are dropped");
|
||||
|
||||
// 0.1.0-beta.45: WORD 1 OF A SLOT holds more than which question was answered.
|
||||
{
|
||||
fl::adv::Accumulators s;
|
||||
const auto word1 = [&s](uint32_t slot) {
|
||||
return s.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + 1u].load();
|
||||
};
|
||||
fl::adv::ObserveSlFeatureVersion(sl::kFeatureDLSS, v, s);
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureDLSS, 0u, s);
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureNIS, 32u, s);
|
||||
fl::adv::ObserveSlFeatureLoaded(sl::kFeatureDLSS, true, s);
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS, true, s);
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS_G, true, s);
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS_G, false, s);
|
||||
Check(word1(0) ==
|
||||
(fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
|
||||
fl::adv::kFeatureLoadedAnswered | fl::adv::kFeatureLoadedValue | fl::adv::kFeatureSwitchedOn),
|
||||
"one feature: its version, supported with eOk, loaded and yes, switched on - each its own bits");
|
||||
Check(word1(1) == (fl::adv::kFeatureSupportAnswered | (32u << fl::adv::kFeatureSupportResultShift)),
|
||||
"a refusal IS the answer to 'is it supported': the code is kept in bits 8..15");
|
||||
Check(word1(2) == (fl::adv::kFeatureSwitchedOn | fl::adv::kFeatureSwitchedOff) &&
|
||||
s.features[size_t{2} * FL_ADV_FEATURE_WORDS].load() == sl::kFeatureDLSS_G + 1u,
|
||||
"switched on and then off: both bits, in a slot the switch itself claimed");
|
||||
|
||||
// The last answer replaces the one before, and leaves the neighbouring fields of the word alone.
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureNIS, 0u, s);
|
||||
fl::adv::ObserveSlFeatureLoaded(sl::kFeatureDLSS, false, s);
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureDLSS, 31u, s);
|
||||
Check(word1(1) == fl::adv::kFeatureSupportAnswered, "asked again and now supported: the code is 0 again");
|
||||
Check(word1(0) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
|
||||
(31u << fl::adv::kFeatureSupportResultShift) | fl::adv::kFeatureLoadedAnswered |
|
||||
fl::adv::kFeatureSwitchedOn),
|
||||
"a new answer to one question changes its own bits and no other's");
|
||||
fl::adv::ObserveSlFeatureSupported(sl::kFeatureReflex, 4000u, s);
|
||||
Check((word1(3) >> fl::adv::kFeatureSupportResultShift) == 0xFFu,
|
||||
"a code a byte cannot carry is 0xFF, never another code's number");
|
||||
|
||||
// A NEW REQUEST clears what the game DID while it was watched and keeps what Streamline SAID.
|
||||
fl::adv::Reset(s);
|
||||
Check(word1(0) == (fl::adv::kFeatureVersionAnswered | fl::adv::kFeatureSupportAnswered |
|
||||
(31u << fl::adv::kFeatureSupportResultShift) | fl::adv::kFeatureLoadedAnswered) &&
|
||||
word1(2) == 0u && s.features[size_t{2} * FL_ADV_FEATURE_WORDS].load() == sl::kFeatureDLSS_G + 1u,
|
||||
"a new request clears the switches seen and keeps the answers; the slot itself stays claimed");
|
||||
}
|
||||
|
||||
// 0.1.0-beta.45, the counted three: a feature's resources allocated and freed, and Streamline shut down.
|
||||
{
|
||||
fl::adv::Accumulators s;
|
||||
const auto word1 = [&s](uint32_t slot) {
|
||||
return s.features[static_cast<size_t>(slot) * FL_ADV_FEATURE_WORDS + 1u].load();
|
||||
};
|
||||
fl::adv::ObserveSlSetFeatureLoaded(sl::kFeatureDLSS, true, s);
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
fl::adv::ObserveSlAllocateResources(sl::kFeatureDLSS, s);
|
||||
}
|
||||
fl::adv::ObserveSlFreeResources(sl::kFeatureDLSS, s);
|
||||
Check(word1(0) == (fl::adv::kFeatureSwitchedOn | (3u << fl::adv::kFeatureAllocShift) |
|
||||
(1u << fl::adv::kFeatureFreeShift)),
|
||||
"three allocations and one free of one feature: two four-bit counts beside the bits already there");
|
||||
for (int i = 0; i < 40; ++i) {
|
||||
fl::adv::ObserveSlAllocateResources(sl::kFeatureDLSS, s);
|
||||
fl::adv::ObserveSlFreeResources(sl::kFeatureDLSS_G, s);
|
||||
}
|
||||
Check(word1(0) == (fl::adv::kFeatureSwitchedOn | (15u << fl::adv::kFeatureAllocShift) |
|
||||
(1u << fl::adv::kFeatureFreeShift)) &&
|
||||
word1(1) == (15u << fl::adv::kFeatureFreeShift),
|
||||
"a count stops at 15 and never carries into the count beside it");
|
||||
fl::adv::ObserveSlShutdown(s);
|
||||
fl::adv::ObserveSlShutdown(s);
|
||||
auto* counted = new fl::FlAdvancedState{};
|
||||
fl::adv::Publish(s, counted, 3u, 1u);
|
||||
Check(counted->slShutdowns == 2u && (counted->validMask & fl::FL_ADV_VALID_SL_SHUTDOWN) != 0u &&
|
||||
counted->reservedSl[0] == 0u && counted->reservedSl[1] == 0u,
|
||||
"two shutdowns: the count in its own word, its bit of the mask, the two words left reserved zero");
|
||||
fl::adv::Reset(s);
|
||||
fl::adv::Publish(s, counted, 4u, 2u);
|
||||
Check(counted->slShutdowns == 0u && (counted->validMask & fl::FL_ADV_VALID_SL_SHUTDOWN) == 0u &&
|
||||
word1(0) == 0u && word1(1) == 0u && counted->features[0] == sl::kFeatureDLSS + 1u,
|
||||
"a new request: the counts and the shutdowns are the last session's and go; the slots stay claimed");
|
||||
delete counted;
|
||||
}
|
||||
|
||||
// WHERE THE MEMBERS ARE, by this build's own struct: everything read lies before the Vulkan members, and the
|
||||
// pointer to the tag list sits between two members that are read.
|
||||
const auto at = [&r](const void* member) {
|
||||
return static_cast<size_t>(static_cast<const unsigned char*>(member) -
|
||||
reinterpret_cast<const unsigned char*>(&r));
|
||||
};
|
||||
Check(at(&r.flags) == 32u && at(&r.numRequiredTags) == 44u && at(&r.requiredTags) == 48u &&
|
||||
at(&r.osVersionDetected) == 56u && at(&r.driverVersionRequired) == 92u &&
|
||||
at(&r.vkNumComputeQueuesRequired) == 104u,
|
||||
"the flags at 32, the tag count at 44, its pointer at 48, the four versions at 56..103, Vulkan from 104");
|
||||
|
||||
// NOTHING OF THE POINTERS OR THE VULKAN MEMBERS REACHES WHAT IS PUBLISHED: two structs alike in what is read
|
||||
// and different in every byte that is not come out the same.
|
||||
sl::FeatureRequirements p = r;
|
||||
sl::FeatureRequirements q = r;
|
||||
std::memset(reinterpret_cast<unsigned char*>(&p) + 48u, 0x11, 8u);
|
||||
std::memset(reinterpret_cast<unsigned char*>(&q) + 48u, 0xEE, 8u);
|
||||
std::memset(reinterpret_cast<unsigned char*>(&p) + 104u, 0x11, sizeof(p) - 104u);
|
||||
std::memset(reinterpret_cast<unsigned char*>(&q) + 104u, 0xEE, sizeof(q) - 104u);
|
||||
auto* regionP = new fl::FlAdvancedState{};
|
||||
auto* regionQ = new fl::FlAdvancedState{};
|
||||
fl::adv::Accumulators ap;
|
||||
fl::adv::Accumulators aq;
|
||||
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS, p, ap);
|
||||
fl::adv::ObserveSlFeatureRequirements(sl::kFeatureDLSS, q, aq);
|
||||
fl::adv::Publish(ap, regionP, 5u, 1u);
|
||||
fl::adv::Publish(aq, regionQ, 5u, 1u);
|
||||
Check(std::memcmp(regionP, regionQ, sizeof(fl::FlAdvancedState)) == 0 && regionP->features[11] == 3u,
|
||||
"two answers that differ only in the pointers and the Vulkan members publish the same bytes");
|
||||
delete regionP;
|
||||
delete regionQ;
|
||||
|
||||
// A STRUCT CUT OFF RIGHT AFTER THE LAST MEMBER READ, against a page that cannot be read: read whole, no fault.
|
||||
auto* pages =
|
||||
static_cast<unsigned char*>(VirtualAlloc(nullptr, 8192, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE));
|
||||
DWORD old = 0;
|
||||
if (pages == nullptr || !VirtualProtect(pages + 4096, 4096, PAGE_NOACCESS, &old)) {
|
||||
Check(false, "two pages, the second unreadable, for the cut-off answers");
|
||||
} else {
|
||||
unsigned char* cut = pages + 4096 - 104u;
|
||||
std::memcpy(cut, &r, 104u);
|
||||
fl::adv::Accumulators edge;
|
||||
Check(!ObserveSlFeatureRequirementsFaults(cut, edge) && edge.features[21].load() == 512u,
|
||||
"requirements that end where the Vulkan members begin are read without a fault, to the last member");
|
||||
const size_t versionSize = sizeof(sl::FeatureVersion);
|
||||
unsigned char* whole = pages + 4096 - versionSize;
|
||||
std::memcpy(whole, &v, versionSize);
|
||||
fl::adv::Accumulators edgeVersion;
|
||||
Check(!ObserveSlFeatureVersionFaults(whole, edgeVersion) && edgeVersion.features[2].load() == 2u,
|
||||
"a version answer at the end of readable memory is read without a fault");
|
||||
VirtualFree(pages, 0, MEM_RELEASE);
|
||||
}
|
||||
}
|
||||
|
||||
// --- ffxConfigure with a frame-generation descriptor (0.1.0-beta.43) -------------------------------------------
|
||||
{
|
||||
fl::adv::Accumulators a;
|
||||
@@ -3364,44 +3133,6 @@ int HoldPresentingUpscaled(Gfx& g, int seconds, bool real, sl::Feature feature,
|
||||
Check(false, "the stub exports slSetConstants");
|
||||
return 1;
|
||||
}
|
||||
// --advanced, 0.1.0-beta.44: the two questions about a feature, through the stub's exports.
|
||||
using StubGetFeatureVersionFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, sl::FeatureVersion&);
|
||||
using StubGetFeatureRequirementsFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, sl::FeatureRequirements&);
|
||||
auto getFeatureVersion =
|
||||
reinterpret_cast<StubGetFeatureVersionFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slGetFeatureVersion")));
|
||||
auto getFeatureRequirements = reinterpret_cast<StubGetFeatureRequirementsFn>(
|
||||
reinterpret_cast<void*>(GetProcAddress(stub, "slGetFeatureRequirements")));
|
||||
if (advanced && (getFeatureVersion == nullptr || getFeatureRequirements == nullptr)) {
|
||||
Check(false, "the stub exports slGetFeatureVersion and slGetFeatureRequirements");
|
||||
return 1;
|
||||
}
|
||||
// --advanced, 0.1.0-beta.45: whether a feature is supported, whether it is loaded, and switching one.
|
||||
using StubIsFeatureSupportedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, const sl::AdapterInfo&);
|
||||
using StubIsFeatureLoadedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, bool&);
|
||||
using StubSetFeatureLoadedFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, bool);
|
||||
auto isFeatureSupported = reinterpret_cast<StubIsFeatureSupportedFn>(
|
||||
reinterpret_cast<void*>(GetProcAddress(stub, "slIsFeatureSupported")));
|
||||
auto isFeatureLoaded =
|
||||
reinterpret_cast<StubIsFeatureLoadedFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slIsFeatureLoaded")));
|
||||
auto setFeatureLoaded =
|
||||
reinterpret_cast<StubSetFeatureLoadedFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slSetFeatureLoaded")));
|
||||
if (advanced && (isFeatureSupported == nullptr || isFeatureLoaded == nullptr || setFeatureLoaded == nullptr)) {
|
||||
Check(false, "the stub exports slIsFeatureSupported, slIsFeatureLoaded and slSetFeatureLoaded");
|
||||
return 1;
|
||||
}
|
||||
using StubAllocateResourcesFn = sl::Result(STDMETHODCALLTYPE*)(void*, sl::Feature, const sl::ViewportHandle&);
|
||||
using StubFreeResourcesFn = sl::Result(STDMETHODCALLTYPE*)(sl::Feature, const sl::ViewportHandle&);
|
||||
using StubShutdownFn = sl::Result(STDMETHODCALLTYPE*)();
|
||||
auto allocateResources =
|
||||
reinterpret_cast<StubAllocateResourcesFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slAllocateResources")));
|
||||
auto freeResources =
|
||||
reinterpret_cast<StubFreeResourcesFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slFreeResources")));
|
||||
auto shutdownStreamline =
|
||||
reinterpret_cast<StubShutdownFn>(reinterpret_cast<void*>(GetProcAddress(stub, "slShutdown")));
|
||||
if (advanced && (allocateResources == nullptr || freeResources == nullptr || shutdownStreamline == nullptr)) {
|
||||
Check(false, "the stub exports slAllocateResources, slFreeResources and slShutdown");
|
||||
return 1;
|
||||
}
|
||||
sl::Constants constants;
|
||||
sl::Constants otherConstants;
|
||||
sl::ViewportHandle otherViewport{kAdvSlOtherViewport};
|
||||
@@ -3457,38 +3188,6 @@ int HoldPresentingUpscaled(Gfx& g, int seconds, bool real, sl::Feature feature,
|
||||
constants.cameraFwd = {loud + 19.0f, loud + 20.0f, loud + 21.0f};
|
||||
setConstants(constants, g_dummyFrameToken, viewport);
|
||||
setConstants(otherConstants, g_dummyFrameToken, otherViewport);
|
||||
if ((evaluated % 16) == 3) {
|
||||
for (const sl::Feature asked : {sl::kFeatureDLSS, sl::kFeatureDLSS_G, sl::kFeatureNIS}) {
|
||||
sl::FeatureVersion version;
|
||||
sl::FeatureRequirements requirements;
|
||||
getFeatureVersion(asked, version);
|
||||
getFeatureRequirements(asked, requirements);
|
||||
}
|
||||
// A struct that is not the one the headers describe: the stub answers, and nothing may be kept.
|
||||
sl::FeatureVersion broken;
|
||||
broken.structType = sl::StructType{};
|
||||
getFeatureVersion(sl::kFeaturePCL, broken);
|
||||
// 0.1.0-beta.45. The adapter carries a wild pointer where its LUID would be: followed, it faults.
|
||||
sl::AdapterInfo adapter;
|
||||
adapter.deviceLUID = reinterpret_cast<uint8_t*>(static_cast<uintptr_t>(1));
|
||||
adapter.deviceLUIDSizeInBytes = 8;
|
||||
for (const sl::Feature asked :
|
||||
{sl::kFeatureDLSS, sl::kFeatureDLSS_G, sl::kFeatureNIS, sl::kFeatureReflex}) {
|
||||
isFeatureSupported(asked, adapter);
|
||||
}
|
||||
bool loaded = false;
|
||||
isFeatureLoaded(sl::kFeatureDLSS, loaded);
|
||||
isFeatureLoaded(sl::kFeaturePCL, loaded);
|
||||
isFeatureLoaded(sl::kFeatureNIS, loaded);
|
||||
setFeatureLoaded(sl::kFeatureDLSS, true);
|
||||
setFeatureLoaded(sl::kFeatureDLSS_G, (evaluated & 16) != 0);
|
||||
// The command buffer is a wild pointer here too: counted, never looked at.
|
||||
allocateResources(reinterpret_cast<void*>(static_cast<uintptr_t>(1)), sl::kFeatureDLSS, viewport);
|
||||
freeResources(sl::kFeatureDLSS_G, viewport);
|
||||
if ((evaluated % 64) == 3) {
|
||||
shutdownStreamline();
|
||||
}
|
||||
}
|
||||
}
|
||||
// ONE EVALUATION PER PRESENT, which is what a real upscaled title does
|
||||
// and what makes the drained record's identity checkable frame by frame.
|
||||
|
||||
@@ -62,17 +62,6 @@ 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.");
|
||||
@@ -152,52 +141,9 @@ 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;
|
||||
(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() {
|
||||
loaded = true;
|
||||
return sl::Result::eOk;
|
||||
}
|
||||
|
||||
@@ -211,72 +157,6 @@ SL_API sl::Result slSetConstants(const sl::Constants& values, const sl::FrameTok
|
||||
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.
|
||||
|
||||
@@ -289,117 +289,6 @@ public sealed class AgentEndToEndTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
[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)
|
||||
{
|
||||
@@ -425,10 +314,6 @@ public sealed class AgentEndToEndTests : IDisposable
|
||||
"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);
|
||||
|
||||
@@ -241,8 +241,7 @@ public sealed class AdvancedPresenterTests
|
||||
At(live, id).Status.Should().Be(Strings.Advanced_Status_InGame);
|
||||
}
|
||||
|
||||
At(live, "sl.init.preferences").Status.Should().Be(AdvancedLabels.Reach(AdvancedReach.BeforeAttach), "a call made before FrameLedger is in the game is never read, and the page says why (D129)");
|
||||
AdvancedLabels.Reach(AdvancedReach.BeforeAttach).Should().NotBe(nameof(AdvancedReach.BeforeAttach), "the reason has words of its own in every language");
|
||||
At(live, "sl.feature.versions").Status.Should().Be(AdvancedLabels.Reach(AdvancedReach.NewHook), "a hook that is not built is still a later release");
|
||||
live.Where(static r => r.IsRead).Should().HaveCount(AdvancedMetricCatalog.All.Count(static m => m.IsRead));
|
||||
}
|
||||
|
||||
@@ -312,77 +311,6 @@ public sealed class AdvancedPresenterTests
|
||||
AdvancedLabels.InGameCall(AdvancedInGameCall.NeverCalled).Should().NotBe(AdvancedLabels.InGameCall(AdvancedInGameCall.NotHooked), "the two reasons a value is absent are not one");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ASessionsSourcesLineNamesTheSixCallsOfBeta45UnderWhatBecameOfEach()
|
||||
{
|
||||
// 0.1.0-beta.45: six calls would be six sentences; they are one, each call by its own name under which of the
|
||||
// three things happened to it, and "none" where a group is empty. A row stored before has none of the six.
|
||||
AdvancedSources beta44 = AdvancedFixtures.Sources with
|
||||
{
|
||||
InGame = AdvancedInGameStatus.Reading,
|
||||
StreamlineConstants = AdvancedInGameCall.Read,
|
||||
FsrFrameGeneration = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFeatureVersion = AdvancedInGameCall.Read,
|
||||
StreamlineFeatureRequirements = AdvancedInGameCall.Read,
|
||||
};
|
||||
string before = AdvancedPresenter.SourcesLine(beta44);
|
||||
before.Should().NotContain("slIsFeatureSupported");
|
||||
|
||||
AdvancedSources all = beta44 with
|
||||
{
|
||||
StreamlineFeatureSupported = AdvancedInGameCall.Read,
|
||||
StreamlineFeatureLoaded = AdvancedInGameCall.Read,
|
||||
StreamlineSetFeatureLoaded = AdvancedInGameCall.NeverCalled,
|
||||
StreamlineAllocateResources = AdvancedInGameCall.Read,
|
||||
StreamlineFreeResources = AdvancedInGameCall.NeverCalled,
|
||||
StreamlineShutdown = AdvancedInGameCall.NeverCalled,
|
||||
};
|
||||
string line = AdvancedPresenter.SourcesLine(all);
|
||||
line.Should().StartWith(before, "what was said before is said as before");
|
||||
line.Should().EndWith(string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
Strings.Advanced_InGameMoreCallsLine,
|
||||
"slIsFeatureSupported, slIsFeatureLoaded, slAllocateResources",
|
||||
"slSetFeatureLoaded, slFreeResources, slShutdown",
|
||||
AdvancedLabels.Token("none")));
|
||||
|
||||
// One of the six missing - a row no build writes - and the sentence is not there at all.
|
||||
AdvancedPresenter.SourcesLine(all with { StreamlineShutdown = null }).Should().Be(before);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ASessionsSourcesLineSaysOfTheTwoQuestionsAboutAFeatureThatAGameAsksThemWhileItStarts()
|
||||
{
|
||||
// 0.1.0-beta.44. A game asks which version a feature is and what it requires while it starts; a session that
|
||||
// attached later finds the hook in and the call not made. That is said in words of its own - "did not ask
|
||||
// again" - and not as the finding "the game did not make the call" is for a call made every frame.
|
||||
AdvancedSources beta43 = AdvancedFixtures.Sources with
|
||||
{
|
||||
InGame = AdvancedInGameStatus.Reading,
|
||||
StreamlineConstants = AdvancedInGameCall.Read,
|
||||
FsrFrameGeneration = AdvancedInGameCall.NotHooked,
|
||||
};
|
||||
string before = AdvancedPresenter.SourcesLine(beta43);
|
||||
before.Should().NotContain(Strings.AdvInGameCall_NotAskedAgain, "a row stored before says nothing of the two");
|
||||
|
||||
string line = AdvancedPresenter.SourcesLine(beta43 with
|
||||
{
|
||||
StreamlineFeatureVersion = AdvancedInGameCall.Read,
|
||||
StreamlineFeatureRequirements = AdvancedInGameCall.NeverCalled,
|
||||
});
|
||||
|
||||
line.Should().StartWith(before, "what was said before is said as before");
|
||||
line.Should().EndWith(string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
Strings.Advanced_InGameFeatureCallsLine,
|
||||
AdvancedLabels.InGameCall(AdvancedInGameCall.Read),
|
||||
Strings.AdvInGameCall_NotAskedAgain));
|
||||
|
||||
AdvancedLabels.InGameStartupCall(AdvancedInGameCall.NeverCalled).Should().NotBe(AdvancedLabels.InGameCall(AdvancedInGameCall.NeverCalled));
|
||||
AdvancedLabels.InGameStartupCall(AdvancedInGameCall.NotHooked).Should().Be(AdvancedLabels.InGameCall(AdvancedInGameCall.NotHooked), "not hooked is not hooked, whenever the call is made");
|
||||
AdvancedLabels.InGameStartupCall(AdvancedInGameCall.Read).Should().Be(AdvancedLabels.InGameCall(AdvancedInGameCall.Read));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AValueIsShownInItsUnitAndAFlagAsYesOrNo()
|
||||
{
|
||||
|
||||
@@ -145,7 +145,7 @@ public sealed class AdvancedJsonTests
|
||||
new("nvapi.gpu.board_serial", Instance: null, AdvancedValue.OfText("0123456789")),
|
||||
new("nvapi.display.edid", "1", AdvancedValue.OfText("00ffffffffffff00")),
|
||||
new("sl.constants.camera", Instance: null, AdvancedValue.OfText("1.0 2.0 3.0")),
|
||||
new("sl.init.preferences", Instance: null, AdvancedValue.OfText("eDisableCLStateTracking")),
|
||||
new("sl.feature.versions", Instance: null, AdvancedValue.OfText("DLSS 3.7.0")),
|
||||
new("sl.dlss.presets", Instance: null, AdvancedValue.OfRows([new AdvancedRow("DLAA", "K")])),
|
||||
new("no.such.metric", Instance: null, AdvancedValue.Of(1)),
|
||||
new("lhm.board.model", Instance: null, AdvancedValue.OfText("ASUS ROG STRIX Z790-E")),
|
||||
@@ -195,61 +195,6 @@ public sealed class AdvancedJsonTests
|
||||
older.FsrFrameGeneration.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhatBecameOfTheTwoQuestionsAboutAFeatureSurvivesTheLedgerAndAnOlderRowSaysNothingOfThem()
|
||||
{
|
||||
AdvancedSources written = AdvancedSources.Unknown with
|
||||
{
|
||||
InGame = AdvancedInGameStatus.Reading,
|
||||
StreamlineConstants = AdvancedInGameCall.Read,
|
||||
FsrFrameGeneration = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFeatureVersion = AdvancedInGameCall.Read,
|
||||
StreamlineFeatureRequirements = AdvancedInGameCall.NeverCalled,
|
||||
};
|
||||
|
||||
string json = AdvancedJson.OfSession([], written);
|
||||
(_, AdvancedSources read) = AdvancedJson.ParseSession(json);
|
||||
|
||||
json.Should().Contain("\"streamlineFeatureVersion\":\"Read\"").And.Contain("\"streamlineFeatureRequirements\":\"NeverCalled\"");
|
||||
read.Should().Be(written);
|
||||
|
||||
// 0.1.0-beta.43 wrote exactly this: the two calls of that release and neither of these.
|
||||
const string beta43 = """{"facts":[],"sources":{"nvapi":"Reading","sensors":"Reading","elevatedSensors":"Reading","inGame":"Reading","streamlineConstants":"Read","fsrFrameGeneration":"NeverCalled"}}""";
|
||||
(_, AdvancedSources older) = AdvancedJson.ParseSession(beta43);
|
||||
older.StreamlineConstants.Should().Be(AdvancedInGameCall.Read);
|
||||
older.StreamlineFeatureVersion.Should().BeNull("a row that never said is not a row that said the hook was not in");
|
||||
older.StreamlineFeatureRequirements.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhatBecameOfTheSixCallsOfBeta45SurvivesTheLedgerAndAnOlderRowSaysNothingOfThem()
|
||||
{
|
||||
AdvancedSources written = AdvancedSources.Unknown with
|
||||
{
|
||||
InGame = AdvancedInGameStatus.Reading,
|
||||
StreamlineFeatureSupported = AdvancedInGameCall.Read,
|
||||
StreamlineFeatureLoaded = AdvancedInGameCall.NeverCalled,
|
||||
StreamlineSetFeatureLoaded = AdvancedInGameCall.NeverCalled,
|
||||
StreamlineAllocateResources = AdvancedInGameCall.Read,
|
||||
StreamlineFreeResources = AdvancedInGameCall.NotHooked,
|
||||
StreamlineShutdown = AdvancedInGameCall.NeverCalled,
|
||||
};
|
||||
|
||||
string json = AdvancedJson.OfSession([], written);
|
||||
(_, AdvancedSources read) = AdvancedJson.ParseSession(json);
|
||||
|
||||
json.Should().Contain("\"streamlineFeatureSupported\":\"Read\"").And.Contain("\"streamlineFreeResources\":\"NotHooked\"")
|
||||
.And.Contain("\"streamlineShutdown\":\"NeverCalled\"");
|
||||
read.Should().Be(written);
|
||||
|
||||
// 0.1.0-beta.44 wrote exactly this: the four calls of the two releases before and none of these six.
|
||||
const string beta44 = """{"facts":[],"sources":{"nvapi":"Reading","sensors":"Reading","elevatedSensors":"Reading","inGame":"Reading","streamlineConstants":"Read","fsrFrameGeneration":"NeverCalled","streamlineFeatureVersion":"Read","streamlineFeatureRequirements":"Read"}}""";
|
||||
(_, AdvancedSources older) = AdvancedJson.ParseSession(beta44);
|
||||
older.StreamlineFeatureRequirements.Should().Be(AdvancedInGameCall.Read);
|
||||
older.StreamlineFeatureSupported.Should().BeNull("a row that never said is not a row that said the hook was not in");
|
||||
older.StreamlineShutdown.Should().BeNull();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(AdvancedInGameStatus.Reading)]
|
||||
[InlineData(AdvancedInGameStatus.NothingSeen)]
|
||||
|
||||
@@ -107,8 +107,6 @@ public sealed partial class AdvancedMetricCatalogTests
|
||||
// Train B, 0.1.0-beta.40: thirteen entries, each a member of a call the Overlay already hooked - and each
|
||||
// matched by a name on tools/overlay-allowed-fields.txt, which a build gate holds to the Overlay's own code.
|
||||
// 0.1.0-beta.43: six more, from the two calls hooked only for Advanced metrics (slSetConstants, ffxConfigure).
|
||||
// 0.1.0-beta.44: two more, what Streamline answers about a feature (slGetFeatureVersion, slGetFeatureRequirements).
|
||||
// 0.1.0-beta.45: two more, from six calls - whether a feature is supported and loaded, and what the game does with it.
|
||||
// Everything else of Streamline and FidelityFX is still named, not read; NGX and XeSS are never read.
|
||||
string[] inGame = [.. _all.Where(static m => m.Reach == AdvancedReach.Game).Select(static m => m.Id)];
|
||||
inGame.Should().Equal(
|
||||
@@ -116,14 +114,7 @@ public sealed partial class AdvancedMetricCatalogTests
|
||||
"ffx.upscale.sharpening", "ffx.upscale.jitter", "ffx.upscale.exposure", "ffx.upscale.depth", "ffx.upscale.flags",
|
||||
"ffx.upscale.frame_time_delta", "ffx.memory_usage",
|
||||
"sl.constants.jitter", "sl.constants.motion_vectors", "sl.constants.depth", "sl.constants.projection", "sl.constants.resets",
|
||||
"ffx.framegen.config",
|
||||
"sl.feature.versions", "sl.feature.requirements",
|
||||
"sl.feature.support", "sl.feature.lifecycle");
|
||||
// What a game starts Streamline with is not read and will not be (D129): the call is made before FrameLedger is
|
||||
// inside the game. No entry waits for a hook any more.
|
||||
AdvancedMetricCatalog.Find("sl.init.preferences")!.Reach.Should().Be(AdvancedReach.BeforeAttach);
|
||||
AdvancedMetricCatalog.Find("sl.init.preferences")!.IsRead.Should().BeFalse();
|
||||
_all.Should().NotContain(static m => m.Reach == AdvancedReach.NewHook);
|
||||
"ffx.framegen.config");
|
||||
// The camera's position, axes and matrices are in the same struct as the constants read, and are the player's.
|
||||
AdvancedMetricCatalog.Find("sl.constants.camera")!.Reach.Should().Be(AdvancedReach.PlayerState);
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public sealed class InGameAdvancedSamplerTests
|
||||
sampler.Take(new InGameAdvanced(s));
|
||||
|
||||
Rows(Fact(sampler, "ffx.upscale.sharpening")).Should().Equal("enableSharpening=on_and_off", "sharpness=0.2 – 0.35");
|
||||
InGameAdvancedSampler.Tokens.Should().Contain(["on", "off", "on_and_off", "none", "not_radians", "draw_debug_view", "non_linear_color_srgb", "non_linear_color_pq"],
|
||||
InGameAdvancedSampler.Tokens.Should().Contain(["on", "off", "on_and_off", "none", "draw_debug_view", "non_linear_color_srgb", "non_linear_color_pq"],
|
||||
"each is a word the App has in three languages; a test there holds it to this list");
|
||||
Fact(sampler, "ffx.upscale.exposure").Value.Text.Should().Be("1.25 – 2");
|
||||
Rows(Fact(sampler, "ffx.upscale.depth")).Should().Contain("cameraFovAngleVertical=0.9 rad (51.6°)", "one value is said once");
|
||||
@@ -277,233 +277,10 @@ public sealed class InGameAdvancedSamplerTests
|
||||
Rows(Fact(other, "ffx.framegen.config")).Should().Equal(
|
||||
"frameGenerationEnabled=on_and_off", "onlyPresentGenerated=off", "flags=DRAW_DEBUG_TEAR_LINES, bit 9");
|
||||
|
||||
// A rectangle with no area is one the game did not give. A configure that set no flag says so, as an upscale
|
||||
// does (0.1.0-beta.44): the row was missing, and "no row" read as "not read".
|
||||
// A rectangle with no area is one the game did not give.
|
||||
var none = new InGameAdvancedSampler();
|
||||
none.Take(new InGameAdvanced(InGameStates.WithRect(InGameStates.FrameGeneration() with { FfxFgFlagsSeen = 0 }, 0, 0, 0, 0)));
|
||||
AdvancedFact noFlags = Fact(none, "ffx.framegen.config");
|
||||
Rows(noFlags).Should().Equal("frameGenerationEnabled=on", "allowAsyncWorkloads=off", "onlyPresentGenerated=off", "flags=none");
|
||||
noFlags.Value.Rows![3].Token.Should().Be("none", "the App translates the word");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFieldOfViewOverPiIsSaidAsTheGameGaveItAndNeverConverted()
|
||||
{
|
||||
// D128. Cyberpunk 2077 gives Streamline its field of view in degrees - 51.0055 to 90 on 2026-11-12 - where the
|
||||
// vendor's header says radians, and the row read "51.0055 - 90 rad (2922.4 deg - 5156.6 deg)". A value over pi
|
||||
// cannot be radians: it is said as given, a second row says what it is not, and nothing is converted.
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Streamline() with { SlFovMinBits = InGameStates.Bits(51.0055f), SlFovMaxBits = InGameStates.Bits(90f) }));
|
||||
|
||||
AdvancedFact projection = Fact(sampler, "sl.constants.projection");
|
||||
Rows(projection).Should().Equal("cameraFOV=51.0055 – 90", "cameraFOV unit=not_radians", "cameraAspectRatio=1.75", "orthographicProjection=off");
|
||||
projection.Value.Rows![0].Token.Should().BeNull("the number is the game's");
|
||||
projection.Value.Rows![1].Token.Should().Be("not_radians", "the App says it in three languages");
|
||||
|
||||
// One value, and FSR's field the same way; a range that only ends over pi is not half radians.
|
||||
var one = new InGameAdvancedSampler();
|
||||
one.Take(new InGameAdvanced(InGameStates.Ffx() with { FfxFovMinBits = InGameStates.Bits(75f), FfxFovMaxBits = InGameStates.Bits(75f) }));
|
||||
Rows(Fact(one, "ffx.upscale.depth")).Should().ContainInOrder("cameraFovAngleVertical=75", "cameraFovAngleVertical unit=not_radians");
|
||||
var mixed = new InGameAdvancedSampler();
|
||||
mixed.Take(new InGameAdvanced(InGameStates.Streamline() with { SlFovMinBits = InGameStates.Bits(1.2f), SlFovMaxBits = InGameStates.Bits(3.5f) }));
|
||||
Rows(Fact(mixed, "sl.constants.projection")).Take(2).Should().Equal("cameraFOV=1.2 – 3.5", "cameraFOV unit=not_radians");
|
||||
|
||||
// Pi itself is a radian: a half-turn, which no game renders, and still not this rule's to refuse.
|
||||
var edge = new InGameAdvancedSampler();
|
||||
edge.Take(new InGameAdvanced(InGameStates.Streamline() with { SlFovMinBits = InGameStates.Bits(3.0f), SlFovMaxBits = InGameStates.Bits(3.0f) }));
|
||||
Rows(Fact(edge, "sl.constants.projection")).Take(2).Should().Equal("cameraFOV=3 rad (171.9°)", "cameraAspectRatio=1.75");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhatStreamlineAnsweredAboutEachFeatureIsTwoFactsInTheVendorsOwnNames()
|
||||
{
|
||||
// 0.1.0-beta.44: slGetFeatureVersion and slGetFeatureRequirements. A slot per feature in the order the game
|
||||
// first asked, every name the vendor's - the feature's constant, the struct's member, the flag's enumerator.
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Features()));
|
||||
|
||||
Rows(Fact(sampler, "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(Fact(sampler, "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");
|
||||
sampler.Facts.Should().Contain(static f => string.Equals(f.Id, "sl.constants.jitter", StringComparison.Ordinal), "the constants of the same game stay beside them");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFeatureAnsweredInPartAnIdWithNoNameAndAVersionNobodyStatedAreSaidAsTheyAre()
|
||||
{
|
||||
// Slot 0: only the version, of a feature with no NGX model - no versionNGX row. Slot 1: only the requirements,
|
||||
// of an id this build has no name for, two flag bits the header does not name, counts of 0 that are counts, and
|
||||
// one version stated out of four. Slot 2: a feature that requires nothing says so. Slot 4 is past an empty slot:
|
||||
// slots fill from 0, so it is not a slot.
|
||||
FlAdvancedState s = InGameStates.WithFeature(InGameStates.Empty(), 0, 3, FlAdvancedState.FeatureVersionAnswered, 2, 14, 1);
|
||||
s = InGameStates.WithFeature(s, 1, 4242, FlAdvancedState.FeatureRequirementsAnswered, 0, 0, 0, 0, 0, 0, 0x120, 0, 1, 0, 0, 0, 0, 10, 0, 22000);
|
||||
s = InGameStates.WithFeature(s, 2, 2, FlAdvancedState.FeatureRequirementsAnswered);
|
||||
s = InGameStates.WithFeature(s, 4, 5, FlAdvancedState.FeatureVersionAnswered, 9, 9, 9);
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.Take(new InGameAdvanced(s));
|
||||
|
||||
Rows(Fact(sampler, "sl.feature.versions")).Should().Equal("kFeatureReflex · versionSL=2.14.1");
|
||||
AdvancedFact requirements = Fact(sampler, "sl.feature.requirements");
|
||||
Rows(requirements).Should().Equal(
|
||||
"feature 4242 · flags=bit 5, bit 8",
|
||||
"feature 4242 · maxNumCPUThreads=0",
|
||||
"feature 4242 · maxNumViewports=1",
|
||||
"feature 4242 · numRequiredTags=0",
|
||||
"feature 4242 · osVersionRequired=10.0.22000",
|
||||
"kFeatureNIS · flags=none",
|
||||
"kFeatureNIS · maxNumCPUThreads=0",
|
||||
"kFeatureNIS · maxNumViewports=0",
|
||||
"kFeatureNIS · numRequiredTags=0");
|
||||
requirements.Value.Rows![5].Token.Should().Be("none", "the App translates the word");
|
||||
|
||||
// A publication with the group's bit and no slot in use makes neither fact.
|
||||
var none = new InGameAdvancedSampler();
|
||||
none.Take(new InGameAdvanced(InGameStates.Empty() with { ValidMask = FlAdvancedValid.SlFeatures }));
|
||||
none.Facts.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnAnswerAboutAFeatureThatArrivesLaterMakesTheFactsNewAndEachQuestionIsItsOwn()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureVersionAnswered, hookedIn: false).Should().Be(AdvancedInGameCall.NotHooked);
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureVersionAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled, "hooked, and the game did not ask again");
|
||||
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Streamline()));
|
||||
IReadOnlyList<AdvancedFact> before = sampler.Facts;
|
||||
before.Should().NotContain(static f => f.Id.StartsWith("sl.feature.", StringComparison.Ordinal));
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureRequirementsAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled);
|
||||
|
||||
// The version of one feature is answered: the list is new, that question is read, the other is not.
|
||||
FlAdvancedState versionOnly = InGameStates.WithFeature(InGameStates.Streamline(2), 0, 0, FlAdvancedState.FeatureVersionAnswered, 2, 14, 1, 310, 4, 0);
|
||||
sampler.Take(new InGameAdvanced(versionOnly));
|
||||
sampler.Facts.Should().NotBeSameAs(before);
|
||||
Rows(Fact(sampler, "sl.feature.versions")).Should().Equal("kFeatureDLSS · versionSL=2.14.1", "kFeatureDLSS · versionNGX=310.4.0");
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureVersionAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.Read);
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureRequirementsAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled);
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureRequirementsAnswered, hookedIn: false).Should().Be(AdvancedInGameCall.NotHooked);
|
||||
|
||||
// The same slots again: the same list. Both questions answered: a new one, and both read.
|
||||
IReadOnlyList<AdvancedFact> held = sampler.Facts;
|
||||
sampler.Take(new InGameAdvanced(InGameStates.WithFeature(InGameStates.Streamline(3), 0, 0, FlAdvancedState.FeatureVersionAnswered, 2, 14, 1, 310, 4, 0)));
|
||||
sampler.Facts.Should().BeSameAs(held, "nothing a fact is made of moved");
|
||||
sampler.Take(new InGameAdvanced(InGameStates.Features(4)));
|
||||
sampler.Facts.Should().NotBeSameAs(held);
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureRequirementsAnswered, hookedIn: false).Should().Be(AdvancedInGameCall.Read, "a publication that carried it is the proof");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhetherAFeatureIsSupportedAndLoadedAndWhatTheGameDidWithItAreTwoFacts()
|
||||
{
|
||||
// 0.1.0-beta.45: six more calls, all kept in word 1 of a feature's slot but the shutdowns. DLSS - supported,
|
||||
// loaded, switched on, its resources allocated three times; frame generation - supported, switched off and
|
||||
// on, freed fifteen times or more (the count stops there); NIS - refused, and the refusal is the answer; PCL -
|
||||
// asked only whether it is loaded, and it is not. Streamline shut down twice.
|
||||
const uint dlss = FlAdvancedState.FeatureSupportAnswered | FlAdvancedState.FeatureLoadedAnswered | FlAdvancedState.FeatureLoadedValue
|
||||
| FlAdvancedState.FeatureSwitchedOn | (3u << FlAdvancedState.FeatureAllocShift);
|
||||
const uint frameGeneration = FlAdvancedState.FeatureSupportAnswered | FlAdvancedState.FeatureSwitchedOff | FlAdvancedState.FeatureSwitchedOn
|
||||
| (15u << FlAdvancedState.FeatureFreeShift);
|
||||
const uint nis = FlAdvancedState.FeatureSupportAnswered | (32u << FlAdvancedState.FeatureSupportResultShift);
|
||||
FlAdvancedState s = InGameStates.WithFeature(InGameStates.Empty(), 0, 0, dlss);
|
||||
s = InGameStates.WithFeature(s, 1, 1000, frameGeneration);
|
||||
s = InGameStates.WithFeature(s, 2, 2, nis);
|
||||
s = InGameStates.WithFeature(s, 3, 4, FlAdvancedState.FeatureLoadedAnswered);
|
||||
s = s with { SlShutdowns = 2, ValidMask = s.ValidMask | FlAdvancedValid.SlShutdown };
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.Take(new InGameAdvanced(s));
|
||||
|
||||
AdvancedFact support = Fact(sampler, "sl.feature.support");
|
||||
Rows(support).Should().Equal(
|
||||
"kFeatureDLSS · slIsFeatureSupported=eOk",
|
||||
"kFeatureDLSS · slIsFeatureLoaded=on",
|
||||
"kFeatureDLSS_G · slIsFeatureSupported=eOk",
|
||||
"kFeatureNIS · slIsFeatureSupported=eErrorFeatureNotSupported",
|
||||
"kFeaturePCL · slIsFeatureLoaded=off");
|
||||
support.Value.Rows![1].Token.Should().Be("on", "the App translates the word");
|
||||
support.Value.Rows![0].Token.Should().BeNull("a result is the vendor's own name");
|
||||
Rows(Fact(sampler, "sl.feature.lifecycle")).Should().Equal(
|
||||
"kFeatureDLSS · slSetFeatureLoaded=on",
|
||||
"kFeatureDLSS · slAllocateResources=3",
|
||||
"kFeatureDLSS_G · slSetFeatureLoaded=on_and_off",
|
||||
"kFeatureDLSS_G · slFreeResources=≥ 15",
|
||||
"slShutdown=2");
|
||||
sampler.Facts.Should().NotContain(static f => f.Id == "sl.feature.versions" || f.Id == "sl.feature.requirements", "neither question of beta.44 was answered");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AResultWithNoNameAShutdownAloneAndAFeatureNobodyTouchedAreSaidAsTheyAre()
|
||||
{
|
||||
// The last code the vendor names, the first number past its list, and what the capture side writes for a code
|
||||
// a byte could not carry. A slot with nothing of this release in word 1 adds no row.
|
||||
FlAdvancedState s = InGameStates.WithFeature(InGameStates.Empty(), 0, 0, FlAdvancedState.FeatureSupportAnswered | (39u << FlAdvancedState.FeatureSupportResultShift));
|
||||
s = InGameStates.WithFeature(s, 1, 3, FlAdvancedState.FeatureSupportAnswered | (40u << FlAdvancedState.FeatureSupportResultShift));
|
||||
s = InGameStates.WithFeature(s, 2, 5, FlAdvancedState.FeatureSupportAnswered | (0xFFu << FlAdvancedState.FeatureSupportResultShift));
|
||||
s = InGameStates.WithFeature(s, 3, 1001, FlAdvancedState.FeatureVersionAnswered, 2, 14, 1);
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.Take(new InGameAdvanced(s));
|
||||
|
||||
Rows(Fact(sampler, "sl.feature.support")).Should().Equal(
|
||||
"kFeatureDLSS · slIsFeatureSupported=eWarnOutOfVRAM",
|
||||
"kFeatureReflex · slIsFeatureSupported=result 40",
|
||||
"kFeatureDeepDVC · slIsFeatureSupported=result 255");
|
||||
sampler.Facts.Should().NotContain(static f => string.Equals(f.Id, "sl.feature.lifecycle", StringComparison.Ordinal), "the game switched, allocated, freed and shut down nothing");
|
||||
|
||||
// Streamline shut down in a game that asked about no feature: one row, and no other fact.
|
||||
var shutdown = new InGameAdvancedSampler();
|
||||
shutdown.Take(new InGameAdvanced(InGameStates.Empty() with { ValidMask = FlAdvancedValid.SlShutdown, SlShutdowns = 1 }));
|
||||
Rows(Fact(shutdown, "sl.feature.lifecycle")).Should().Equal("slShutdown=1");
|
||||
shutdown.Facts.Should().ContainSingle();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EachOfTheSixCallsOfBeta45IsItsOwnQuestionAndACountThatMovesMakesTheFactsNew()
|
||||
{
|
||||
var sampler = new InGameAdvancedSampler();
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureSupportAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled);
|
||||
sampler.Call(FlAdvancedValid.SlShutdown, hookedIn: false).Should().Be(AdvancedInGameCall.NotHooked);
|
||||
|
||||
// Supported and one allocation: those two are read; loaded, switched, freed and shut down are not.
|
||||
const uint first = FlAdvancedState.FeatureSupportAnswered | (1u << FlAdvancedState.FeatureAllocShift);
|
||||
sampler.Take(new InGameAdvanced(InGameStates.WithFeature(InGameStates.Empty(), 0, 0, first)));
|
||||
IReadOnlyList<AdvancedFact> one = sampler.Facts;
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureSupportAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.Read);
|
||||
sampler.FeatureCall(InGameAdvancedSampler.FeatureAllocated, hookedIn: true).Should().Be(AdvancedInGameCall.Read);
|
||||
sampler.FeatureCall(FlAdvancedState.FeatureLoadedAnswered, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled);
|
||||
sampler.FeatureCall(InGameAdvancedSampler.FeatureSwitched, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled);
|
||||
sampler.FeatureCall(InGameAdvancedSampler.FeatureFreed, hookedIn: false).Should().Be(AdvancedInGameCall.NotHooked);
|
||||
sampler.Call(FlAdvancedValid.SlShutdown, hookedIn: true).Should().Be(AdvancedInGameCall.NeverCalled);
|
||||
|
||||
// The same word again: the same list. A second allocation: a new one. A shutdown: a new one, and read.
|
||||
sampler.Take(new InGameAdvanced(InGameStates.WithFeature(InGameStates.Empty(2), 0, 0, first)));
|
||||
sampler.Facts.Should().BeSameAs(one, "nothing a fact is made of moved");
|
||||
const uint second = FlAdvancedState.FeatureSupportAnswered | (2u << FlAdvancedState.FeatureAllocShift);
|
||||
sampler.Take(new InGameAdvanced(InGameStates.WithFeature(InGameStates.Empty(3), 0, 0, second)));
|
||||
IReadOnlyList<AdvancedFact> two = sampler.Facts;
|
||||
two.Should().NotBeSameAs(one);
|
||||
Rows(Fact(sampler, "sl.feature.lifecycle")).Should().Equal("kFeatureDLSS · slAllocateResources=2");
|
||||
FlAdvancedState withShutdown = InGameStates.WithFeature(InGameStates.Empty(4), 0, 0, second);
|
||||
sampler.Take(new InGameAdvanced(withShutdown with { SlShutdowns = 1, ValidMask = withShutdown.ValidMask | FlAdvancedValid.SlShutdown }));
|
||||
sampler.Facts.Should().NotBeSameAs(two);
|
||||
sampler.Call(FlAdvancedValid.SlShutdown, hookedIn: true).Should().Be(AdvancedInGameCall.Read);
|
||||
Rows(Fact(none, "ffx.framegen.config")).Should().Equal("frameGenerationEnabled=on", "allowAsyncWorkloads=off", "onlyPresentGenerated=off");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -570,14 +347,10 @@ public sealed class InGameAdvancedSamplerTests
|
||||
DlssColorBuffersHdr = 2,
|
||||
};
|
||||
|
||||
both = InGameStates.WithFeature(
|
||||
both, 0, 0, FlAdvancedState.FeatureVersionAnswered | FlAdvancedState.FeatureRequirementsAnswered | FlAdvancedState.FeatureSupportAnswered | FlAdvancedState.FeatureSwitchedOn, 2, 14, 1, 310, 4, 0, 7, 2, 32, 3);
|
||||
|
||||
IReadOnlyList<AdvancedReading> readings = sampler.Take(new InGameAdvanced(both))!;
|
||||
|
||||
sampler.Facts.Should().OnlyContain(static f => AdvancedMetricCatalog.Find(f.Id)!.Reach == AdvancedReach.Game);
|
||||
sampler.Facts.Select(static f => f.Id).Should().Contain(
|
||||
["sl.constants.jitter", "sl.constants.resets", "ffx.framegen.config", "ffx.upscale.flags", "sl.dlss.presets", "sl.feature.versions", "sl.feature.requirements", "sl.feature.support", "sl.feature.lifecycle"]);
|
||||
sampler.Facts.Select(static f => f.Id).Should().Contain(["sl.constants.jitter", "sl.constants.resets", "ffx.framegen.config", "ffx.upscale.flags", "sl.dlss.presets"]);
|
||||
AdvancedJson.Storable(sampler.Facts).Should().HaveCount(sampler.Facts.Count, "what the game said may be stored");
|
||||
readings.Select(static r => AdvancedMetricCatalog.Find(r.Series[AdvancedMetric.SeriesPrefix.Length..])!.Reach).Should().OnlyContain(static reach => reach == AdvancedReach.Game);
|
||||
}
|
||||
|
||||
@@ -126,32 +126,6 @@ internal static class InGameStates
|
||||
1920,
|
||||
1080);
|
||||
|
||||
/// <summary>
|
||||
/// What the stub interposer answers <c>hook-harness --advanced</c> about DLSS and DLSS frame generation
|
||||
/// (0.1.0-beta.44), beside what the same target tells Streamline each frame: slots 0 and 1, both questions answered.
|
||||
/// </summary>
|
||||
public static FlAdvancedState Features(uint samples = 1) => WithFeature(
|
||||
WithFeature(Streamline(samples), 0, 0, 3, 2, 14, 1, 310, 4, 0, 7, 2, 32, 3, 10, 0, 26100, 10, 0, 19041, 591, 44, 0, 512, 15, 0),
|
||||
1, 1000, 3, 2, 14, 1, 310, 4, 1, 26, 1, 1, 4, 10, 0, 26100, 10, 0, 19041, 591, 44, 0, 551, 23, 0);
|
||||
|
||||
/// <summary>
|
||||
/// One feature slot, set through the struct's bytes: the <c>sl::Feature</c> id, which questions were answered, and
|
||||
/// the slot's words from 2 on - versionSL, versionNGX, the flags, three counts, then Windows found and required and
|
||||
/// the driver found and required (three words a version). The group's bit of the mask goes on with it.
|
||||
/// </summary>
|
||||
public static FlAdvancedState WithFeature(FlAdvancedState state, int slot, uint feature, uint answered, params ReadOnlySpan<uint> from2)
|
||||
{
|
||||
int at = (int)Marshal.OffsetOf<FlAdvancedState>(nameof(FlAdvancedState.Features)) + (slot * FlAdvancedState.FeatureWords * sizeof(uint));
|
||||
Span<uint> words = MemoryMarshal.Cast<byte, uint>(
|
||||
MemoryMarshal.AsBytes(new Span<FlAdvancedState>(ref state)).Slice(at, FlAdvancedState.FeatureWords * sizeof(uint)));
|
||||
words.Clear();
|
||||
words[0] = feature + 1;
|
||||
words[1] = answered;
|
||||
from2.CopyTo(words[2..]);
|
||||
state.ValidMask |= FlAdvancedValid.SlFeatures;
|
||||
return state;
|
||||
}
|
||||
|
||||
/// <summary>The generation rectangle - left, top, width, height: a fixed buffer, set through the struct's bytes.</summary>
|
||||
public static FlAdvancedState WithRect(FlAdvancedState state, int left, int top, int width, int height)
|
||||
{
|
||||
|
||||
@@ -1004,16 +1004,8 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
InGame = AdvancedInGameStatus.NothingSeen,
|
||||
StreamlineConstants = AdvancedInGameCall.NotHooked,
|
||||
FsrFrameGeneration = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFeatureVersion = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFeatureRequirements = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFeatureSupported = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFeatureLoaded = AdvancedInGameCall.NotHooked,
|
||||
StreamlineSetFeatureLoaded = AdvancedInGameCall.NotHooked,
|
||||
StreamlineAllocateResources = AdvancedInGameCall.NotHooked,
|
||||
StreamlineFreeResources = AdvancedInGameCall.NotHooked,
|
||||
StreamlineShutdown = AdvancedInGameCall.NotHooked,
|
||||
},
|
||||
"the Agent's sources never answered; the game was measured from inside, made none of the calls, and the capture side published none of the ten hooks that are installed only for Advanced metrics");
|
||||
"the Agent's sources never answered; the game was measured from inside, made none of the calls, and the capture side published neither of the two hooks that are installed only for Advanced metrics");
|
||||
hub.Released.Should().Be(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -223,32 +223,6 @@ public sealed class SqliteGameConsentStoreTests
|
||||
(await store.FindAsync(Fingerprint().ExePath, Ct)).Fingerprint.SizeBytes.Should().Be(12345);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AGrantStartsTheCountOfEarlyAbnormalEndsAgain()
|
||||
{
|
||||
// Owner decision D126 (2026-11-12). The count was never set back: Lies of P had two early ends in October, its
|
||||
// user switched hooking on again, and one more - the game's own crash - switched it off at once, under a reason
|
||||
// that says "twice". The grant is the user's act and the only statement that turns hooking on.
|
||||
await using LedgerFixture f = await LedgerFixture.OpenAsync();
|
||||
var store = new SqliteGameConsentStore(f.Db);
|
||||
var games = new SqliteGameRepository(f.Db);
|
||||
ExecutableFingerprint fp = Fingerprint();
|
||||
await store.RecordOperatorAcknowledgementAsync(Ack(fp), Ct);
|
||||
GameRow row = (await games.FindAsync(fp.ExePath, Ct))!;
|
||||
(await games.RecordCrashAsync(row.Id, Ct)).Should().Be(1);
|
||||
(await games.RecordCrashAsync(row.Id, Ct)).Should().Be(2);
|
||||
(await games.AutoDisableHookAsync(row.Id, "ended abnormally twice", DateTimeOffset.UnixEpoch.AddSeconds(9), Ct)).Should().BeTrue();
|
||||
(await games.FindAsync(fp.ExePath, Ct))!.HookEnabled.Should().BeFalse();
|
||||
|
||||
(await store.RecordOperatorAcknowledgementAsync(Ack(fp), Ct)).Should().Be(ConsentWriteOutcome.Written);
|
||||
|
||||
GameRow again = (await games.FindAsync(fp.ExePath, Ct))!;
|
||||
again.HookEnabled.Should().BeTrue();
|
||||
again.HookCrashCount.Should().Be(0, "two more are needed before hooking goes off again");
|
||||
again.HookAutoDisabledReason.Should().Be("ended abnormally twice", "what happened the last time stays on the row");
|
||||
(await games.RecordCrashAsync(row.Id, Ct)).Should().Be(1, "one early end after the grant is one, not three");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AStoreWhoseTableIsGoneRefusesEveryWriteAndConsentsToNothing()
|
||||
{
|
||||
|
||||
@@ -61,22 +61,6 @@ sl::Constants::orthographicProjection
|
||||
sl::Constants::motionVectorsDilated
|
||||
sl::Constants::motionVectorsJittered
|
||||
|
||||
# sl::FeatureVersion and sl::FeatureRequirements, what Streamline ANSWERS when the game asks about a feature
|
||||
# (parameters `fv` and `fr`; 0.1.0-beta.44) - read after the original call said OK. The two versions; the flags,
|
||||
# three counts and four versions of the requirements. The count of required buffer tags is read and its pointer,
|
||||
# `requiredTags`, is not; nothing after `driverVersionRequired` is - the Vulkan queue counts and the pointers to
|
||||
# the names of extensions and features.
|
||||
sl::FeatureVersion::versionSL
|
||||
sl::FeatureVersion::versionNGX
|
||||
sl::FeatureRequirements::flags
|
||||
sl::FeatureRequirements::maxNumCPUThreads
|
||||
sl::FeatureRequirements::maxNumViewports
|
||||
sl::FeatureRequirements::numRequiredTags
|
||||
sl::FeatureRequirements::osVersionDetected
|
||||
sl::FeatureRequirements::osVersionRequired
|
||||
sl::FeatureRequirements::driverVersionDetected
|
||||
sl::FeatureRequirements::driverVersionRequired
|
||||
|
||||
# ffxConfigureDescFrameGeneration, how the game configures FSR frame generation (parameter `g`; 0.1.0-beta.43):
|
||||
# on or off, asynchronous or not, the flags, generated frames only or not, the rectangle generated in. The swapchain,
|
||||
# the two callbacks and their contexts, the HUD-less resource and the frame id in the same descriptor are not read.
|
||||
|
||||
@@ -58,8 +58,6 @@ $script:Parameter = [ordered]@{
|
||||
q = 'ffxQueryDescUpscaleGetGPUMemoryUsage'
|
||||
k = 'sl::Constants'
|
||||
g = 'ffxConfigureDescFrameGeneration'
|
||||
fv = 'sl::FeatureVersion'
|
||||
fr = 'sl::FeatureRequirements'
|
||||
desc = 'ffxQueryDescHeader'
|
||||
}
|
||||
|
||||
@@ -72,10 +70,6 @@ $script:Camera = @(
|
||||
'cameraPosition', 'cameraForward'
|
||||
)
|
||||
|
||||
# What identifies the adapter a game asks Streamline about (sl::AdapterInfo, owner decision D131): its LUID, the
|
||||
# size of it, or a Vulkan physical device. Named nowhere in the code loaded into a game.
|
||||
$script:Adapter = @('deviceLUID', 'deviceLUIDSizeInBytes', 'vkPhysicalDevice')
|
||||
|
||||
# The two structs that hold one.
|
||||
$script:CameraStruct = @('sl::Constants', 'ffxDispatchDescFrameGenerationPrepareV2')
|
||||
|
||||
@@ -112,7 +106,7 @@ function Get-HeaderRead([string]$Code) {
|
||||
$reads = [System.Collections.Generic.SortedSet[string]]::new([StringComparer]::Ordinal)
|
||||
$problems = [System.Collections.Generic.List[string]]::new()
|
||||
|
||||
foreach ($m in [regex]::Matches($Code, '(?<![\w.>:])(o|d|m|q|k|g|fv|fr)\b(\s*\.\s*([A-Za-z_]\w*))?')) {
|
||||
foreach ($m in [regex]::Matches($Code, '(?<![\w.>:])(o|d|m|q|k|g)\b(\s*\.\s*([A-Za-z_]\w*))?')) {
|
||||
$name = $m.Groups[1].Value
|
||||
if ($m.Groups[3].Success) {
|
||||
[void]$reads.Add("$($script:Parameter[$name])::$($m.Groups[3].Value)")
|
||||
@@ -161,9 +155,6 @@ function Test-Field([string]$Header, [string]$ListText, [hashtable]$Others) {
|
||||
foreach ($token in $script:Camera) {
|
||||
if ($code -cmatch "(?<!\w)$token(?!\w)") { $problems.Add("$key names $token - where a camera is or looks is read nowhere in code loaded into a game (rule 4)") }
|
||||
}
|
||||
foreach ($token in $script:Adapter) {
|
||||
if ($code -cmatch "(?<!\w)$token(?!\w)") { $problems.Add("$key names $token - which adapter a game asks Streamline about is read nowhere in code loaded into a game (D131)") }
|
||||
}
|
||||
foreach ($struct in $script:CameraStruct) {
|
||||
$bare = [regex]::Escape($struct)
|
||||
if ($code -cmatch "sizeof\s*\(\s*$bare\s*\)") { $problems.Add("$key measures ${struct}: the struct holds a camera, and is neither measured nor copied") }
|
||||
@@ -228,12 +219,6 @@ inline void Publish(Accumulators& a, FlAdvancedState* region) noexcept { region-
|
||||
@{ Name = 'the sl::Constants parameter handed on whole FAILS'; Header = $goodHeader + "`ninline void ObserveK(const sl::Constants& k, Accumulators& a) noexcept { a.n.store(k.cameraNear); Other(k); }"; List = $goodList + "sl::Constants::cameraNear`n"; Other = $goodOther; Expect = 1 },
|
||||
@{ Name = 'the frame-generation configuration read through its parameter, each member on the list, passes'; Header = $goodHeader + "`ninline void ObserveG(const ffxConfigureDescHeader* desc, Accumulators& a) noexcept { const auto& g = *reinterpret_cast<const ffxConfigureDescFrameGeneration*>(desc); a.n.store(g.flags + g.generationRect.left); }"; List = $goodList + "ffxConfigureDescFrameGeneration::flags`nffxConfigureDescFrameGeneration::generationRect`n"; Other = $goodOther; Expect = 0 },
|
||||
@{ Name = 'a member of the frame-generation configuration the list does not allow FAILS'; Header = $goodHeader + "`ninline void ObserveG(const ffxConfigureDescHeader* desc, Accumulators& a) noexcept { const auto& g = *reinterpret_cast<const ffxConfigureDescFrameGeneration*>(desc); a.n.store(g.flags); Keep(g.swapChain); }"; List = $goodList + "ffxConfigureDescFrameGeneration::flags`n"; Other = $goodOther; Expect = 1 },
|
||||
@{ Name = 'the answers about a feature read through their parameters, each member on the list, pass'; Header = $goodHeader + "`ninline void ObserveV(uint32_t feature, const sl::FeatureVersion& fv, Accumulators& a) noexcept { Put(a.f, fv.versionSL); }`ninline void ObserveR(uint32_t feature, const sl::FeatureRequirements& fr, Accumulators& a) noexcept { a.n.store(fr.numRequiredTags); Put(a.f, fr.osVersionDetected); }"; List = $goodList + "sl::FeatureVersion::versionSL`nsl::FeatureRequirements::numRequiredTags`nsl::FeatureRequirements::osVersionDetected`n"; Other = $goodOther; Expect = 0 },
|
||||
@{ Name = 'the list of required tags, a pointer of the game''s, FAILS when it is not on the list'; Header = $goodHeader + "`ninline void ObserveR(uint32_t feature, const sl::FeatureRequirements& fr, Accumulators& a) noexcept { a.n.store(fr.numRequiredTags); Keep(fr.requiredTags[0]); }"; List = $goodList + "sl::FeatureRequirements::numRequiredTags`n"; Other = $goodOther; Expect = 1 },
|
||||
@{ Name = 'a member of the answer read outside the header FAILS'; Header = $goodHeader + "`ninline void ObserveR(uint32_t feature, const sl::FeatureRequirements& fr, Accumulators& a) noexcept { a.n.store(fr.numRequiredTags); }"; List = $goodList + "sl::FeatureRequirements::numRequiredTags`n"; Other = @{ 'dllmain.cpp' = 'void Hook(sl::FeatureRequirements& requirements) { Keep(requirements.numRequiredTags); }' }; Expect = 1 },
|
||||
@{ Name = 'the adapter a game asks about, forwarded by its parameter and never looked into, passes'; Header = $goodHeader; List = $goodList; Other = @{ 'dllmain.cpp' = 'sl::Result Hook(sl::Feature feature, const sl::AdapterInfo& adapterInfo) { return g_orig(feature, adapterInfo); } // never adapterInfo.deviceLUID' }; Expect = 0 },
|
||||
@{ Name = 'the adapter''s LUID read in the detour FAILS'; Header = $goodHeader; List = $goodList; Other = @{ 'dllmain.cpp' = 'sl::Result Hook(sl::Feature feature, const sl::AdapterInfo& adapterInfo) { Keep(adapterInfo.deviceLUID[0]); return g_orig(feature, adapterInfo); }' }; Expect = 1 },
|
||||
@{ Name = 'a Vulkan physical device taken from the adapter in the layer FAILS'; Header = $goodHeader; List = $goodList; Other = @{ 'layer.cpp' = 'void* device = info->vkPhysicalDevice;' }; Expect = 1 },
|
||||
@{ Name = 'a header with no read at all FAILS'; Header = '// o.outputWidth is somewhere else'; List = "# nothing`n"; Other = $goodOther; Expect = 1 }
|
||||
)
|
||||
foreach ($c in $cases) {
|
||||
|
||||
Reference in new issue
Block a user