Compare commits

...
Author SHA1 Message Date
poli0981andClaude Fable 5.1 a28a45def4 docs: the AMD half of 7c complete on Lies of P; the Intel licence re-checked and unchanged; identity by elimination proposed for XeFG
Lies of P at FSR 3.1 + FSR FG on #129: Fsr3 / FsrFg / 59.77 -> 119.55 (x2 FG) / 2560x1440 ->
2560x1440, presents/frame 2.00, frames/upscale-drained 1.00, unseen 0, the NVIDIA driver's
word saying nothing was created. The owner called the AMD half done.

Intel: LICENSE.txt and inc/xess/xess.h re-fetched 2026-09-06 -- Intel Simplified Software
License, unchanged; the reversal condition has not fired. Intel's README says XeSS-FG runs
on non-Intel GPUs with SM 6.4, so an XeFG session is measurable here. §H11 carries the
in-policy proposal: identity by elimination, labelled, never XeFg as a measured identity.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 13:07:29 +07:00
poli0981andClaude Fable 5.1 7cc4efc8e2 docs: §H5's DLSS / DLSS-G question closed on Cronos with frame generation on -- the 2.8.0 pacer bypass is Dying Light: The Beast's, not the SDK's (#130)
Cronos: The New Dawn demo (Streamline 2.8.0, UE) with FG on: 86.8 -> 172.72 (x1.99 FG),
unseen=0 over 10,063 samples, DlssG with the driver agreeing, upscaler Dlss driver-reported.
Every measured NVIDIA title now prints the rule-6 trio or a counted none; the owner closed
the item. HANDOFF 7a struck; the next item is the owner's pick from 7b / 7c.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 05:36:54 +00:00
poli0981andClaude Fable 5.1 a55be828cd feat(capturehost): the driver's FG word beside the frame-generation line, and a counted-but-refused session says so -- §H5 rows N1-N4 landed (#129)
The owner's run on #128: N3 held (Lies of P with upscaling OFF reads SR 0x5, CREATED clear),
N1 prints `Dlss (driver-reported ...)` on Lies of P, Expedition 33, Hell Is Us and the new
Cronos demo, N2 prints agreement on Onimusha and DL:TB, and a DL:TB session at FSR + DLSS-G
read SR 0x205 (created, not evaluated) and correctly claimed nothing.

One correction from the run's own readings: the FG word is NOT blind to Streamline DLSS-G.
It read CREATED | EVALUATE on every x4 session, changing between readings as the feature
came up; the morning's INITIALIZED | DLL_EXISTS was an early reading. The multiplier bits
stay clear at x4, so the word is an identity witness: printed beside `frame generation:`
as agreement or a printed disagreement, promoted to `DlssG (driver-reported ...)` only where
the count is active and no tag named the technology. The count is never the driver's.

And the FSR + DLSS-G session exposed a wrong qualifier: 4,415 tokens, 8,174 DXGI-counted
presents, a factor refused for uniformity, and the line said "no evaluation was observed".
It now says the factor was counted and refused, that DXGI counted presents this hook never
saw so the Displayed rate is above the printed number, and that the number is neither
Native nor Displayed.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 12:06:32 +07:00
poli0981andClaude Fable 5.1 f7c700acb8 feat(capturehost): the super-resolution identity from the NVIDIA driver where no hook can see it -- the driver-reported rung (#128)
Owner decision 2026-09-06 ("noi probe de bat dau"). Three NGX-direct titles printed
`upscaler: N/A` on every capture while the driver's per-process NGX word
(NvAPI_NGX_GetNGXOverrideState) reads CREATED | EVALUATE for them without an override.

- fl-probe-nvapi --ngx-state prints one machine line (NGXSTATE status=... sr=0x... ...)
  after its human output; the capture host stages the probe beside itself.
- NgxDriverProbe spawns it beside every module snapshot (out of process, no injection);
  NgxDriverState parses and merges the readings (last answered word is the state, a
  change between readings is printed, an earlier answer outranks a later silence).
- The report prints `NVIDIA driver NGX state:` in the runtime block; the `upscaler:` line
  reads `Dlss (driver-reported: ... not counted by this hook)` when no hook named one,
  prints agreement or a disagreement (printed, not resolved) beside a hook's Dlss, and
  the driver's attributed negative beside an N/A.
- Identity only, each limit measured: no quality/preset (override fields), no ratio
  (scalingRatio 0 even under an override), no FG mode/multiplier (the FG word is blind
  to Streamline DLSS-G).
- §H5 pre-commits rows N1-N4; N3 (DLSS OFF) withdraws the rung if the bit stays set.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 03:26:23 +00:00
poli0981andClaude Fable 5.1 ec181de07d docs: the NVAPI NGX-state probe measured on three running titles -- SR identity is driver-reported without an override; the FG word does not see DLSS-G (#127)
Hell Is Us (no override, DLSS-G x4 running), Expedition 33 (NVIDIA-app override ON, FG off)
and Lies of P (no override): CREATED | EVALUATE on the SR word on both no-override titles;
the FG word reads INITIALIZED | DLL_EXISTS beside a x4 DLSS-G session; frameGenerationCount
is 0 everywhere (the override target, not the multiplier); scalingRatio is 0 even under the
override. §H5 states what a driver-reported rung may and may not claim and the negative
still owed (DLSS off in the menu); HANDOFF 7a's START HERE moves to that decision.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 02:51:39 +00:00
poli0981andClaude Fable 5.1 d670824058 feat(capturehost): the withheld none narrowed to sessions where DXGI's counter was not read -- §H5 Leg 0 landed (#126)
The owner's morning run on #125: DL:TB at DLSS FG x4 printed the rule-6 trio from the
DXGI-counted Displayed (70.52 -> 282.08 (x4 FG), 12,387 presents DXGI-counted, DlssG),
then twice with frame generation OFF: census unchanged (sl.dlss_g.dll is a startup-time
load), presents = tokens, unseen = 0 over 3,659 / 4,519 samples, and the report withheld
`none` exactly as the gate's cost paragraph pre-committed. Expedition 33 FG off: none by
count, tag census 0.

The DXGI counter is the discriminator the gate lacked -- on the 2.8.0 shape the pacer's
presents are DXGI presents on the hooked chain -- so a counted none beside a READ counter
with zero unseen prints as none with "DXGI's own present counter agrees: 0 unseen over N
hooked present(s)"; it is withheld only when the counter was not read, with the reason
saying so; a writer state that counted unseen presents the records do not carry is refused
as a contradiction. Every other title prints the counter beside none as a second witness.
CLAUDE.md rule 6 carries the amendment; 03_METRICS, §H5, spike-notes §9, HANDOFF updated.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 09:09:55 +07:00
poli0981andClaude Fable 5.1 61dc4c4036 feat(overlay): Displayed counted by DXGI where the hook cannot count it -- §H5 row P1-DXGI landed, twice (#125)
The owner's run on #124 read 2.90 and 2.95 presents per hooked present that DXGI counted
on the same chain and the inline patches never saw (Dying Light: The Beast, Streamline
2.8.0, DLSS FG x4), against 0.00 on Streamline 2.7.3 (Hell Is Us x3.86) and 2.10.3 (the
Onimusha: Way of the Sword demo x3.67), whose generated frames come through the patched
bodies. So 2.8.0's pacer is the odd one, and the pre-committed action is built:

- FlFrameRecord.dxgiUnseen @52 (first byte of v3's reserved word, no offset moved, no
  layout bump) under FL_MEASURED_DXGI_PRESENTS; mirror, fl-layout-dump and asserts follow.
- FgWindow counts Displayed = hooked + sum(dxgiUnseen): in the rule-6 trio, presents/batch
  and the uniformity buckets, never in a frame-time distribution. The report prints
  "Displayed is DXGI-COUNTED" on its own line whenever the sum is above zero. A saturated
  byte is refused; a byte under a clear bit is an honesty violation.
- A present the hook SAW and declined (a paused session) is not unseen: every declined
  present bumps an epoch that invalidates the chain's last reading. The paused-session
  integration case caught the first record after a resume claiming the whole pause (0x55).
- The "sl.interposer + sl.common must be loaded on >= 2.8" lead is closed by the 2.10.3
  title, which injects, tags on the frame route and counts like 2.7.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 16:18:12 +00:00
poli0981andClaude Fable 5.1 ef7d657f9d feat(overlay): DXGI's own present counter against the hook's -- the in-process half of §H5 Leg 1 (#124)
On every hooked present the Overlay now reads IDXGISwapChain::GetLastPresentCount on
the chain it just saw (rule 4: the object FindOrAdd already calls GetDesc on; no new
hook) and publishes dxgiPresentSamples / dxgiPresentsUnseen on the watchdog tick
(FlWriterState @48/@52 from reserved[], no layout bump; mirror, fl-layout-dump and
the offset asserts follow). The report prints the ratio with its reading and the
withheld qualifier says which side of DXGI the generated presents fall on. §H5 carries
the rows written before the run (P1-DXGI / P3-DXGI / P5-DXGI). The harness's own
presents are the negative control (fl_guard [fg]: zero unseen); the positive cannot
be fixtured. hook-harness --probe-frames prints the call's cost (12.4 ns on WARP).

The owner's lead -- Streamline >= 2.8 needs sl.interposer.dll and sl.common.dll loaded
before injection succeeds -- was checked against the interposer source: the DXGI proxy
is identical at 2.7.32 and 2.8.0, and injection into DL:TB already succeeds. The
unknown is where the closed pacer presents, which is what this counter asks DXGI.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 14:48:49 +00:00
poli0981andClaude Fable 5.1 5656707733 feat(capturehost): a stall diagnostic placed against FrameLedger's own touches on the target (#123)
The owner saw Cyberpunk 2077 fall to 1 FPS for about a second under capture and the report
could say nothing about whose it was. The loop now records the QPC moment of every guard scan
and module snapshot (CaptureResult.TouchQpc, the records' own clock), and StallReport prints
the three longest present-to-present intervals with their session time and the nearest host
touch: inside or within 1 s -> FrameLedger is a SUSPECT, re-run on the 30 s cadence; far away ->
not ours. Counts intervals at or over 100 ms; calls itself a diagnostic, not 03_METRICS' stutter.
Four cases pin the placement. No Overlay change.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 13:29:46 +00:00
poli0981andClaude Fable 5.1 a34d9e3cd2 docs: the tag route measured -- DlssG on six of six Streamline titles; DL:TB's scaling-input tag arrives with no size (7a closed by the census) (#122)
The owner's evening run on #121: `frame generation: DlssG` on Hell Is Us (x4, twice), Expedition
33 (x1.97), Wukong (x4), Rune Factory (x3.98) and Cyberpunk; every Streamline title tags the
DLSS-G inputs through a route this build hooks (UE + Cyberpunk 2.7.1 globally, DL:TB 2.8 via
slSetTagForFrame). DL:TB's census shows a scaling-in tag on the frame route with UpscalerParams
still 0 -- no size on the tag -- closing 7a's last question at no layout cost. Cyberpunk's factor
was refused on a mixed session (bucket 1 at 3.0 vs 1.67, tokens/batch 2.97), as designed.
Recorded in spike-notes §9, §H5 and HANDOFF 7a; the one NVIDIA gap left is `upscaler: N/A` on
the NGX-direct titles (the --ngx-state probe).

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 20:07:48 +07:00
38 changed files with 2547 additions and 71 deletions

No files matched your search

+94
View File
@@ -19,6 +19,92 @@ GitHub release body, so a missing section will mean an empty release note.
### Added
- **The super-resolution identity from the NVIDIA driver, where no hook can see it — the driver-reported
rung (owner decision 2026-09-06).** Three NGX-direct titles printed `upscaler: N/A` on every capture
while the driver's per-process NGX word (`NvAPI_NGX_GetNGXOverrideState`, R570+, MIT NVAPI) reads
`CREATED | EVALUATE` for them — measured 2026-09-06 without an NVIDIA-app override. The capture host now
spawns `fl-probe-nvapi --ngx-state <pid>` beside every module snapshot (the probe gained one machine line,
`NGXSTATE status=… sr=0x… …`, and is staged beside the host), merges the readings (`NgxDriverState`: the
last answered word is the state, a change between readings is printed), prints `NVIDIA driver NGX state:`
in the runtime block, and the `upscaler:` line reads `Dlss (driver-reported: … not counted by this hook)`
when no hook named one. Identity only, each limit measured: no quality or preset (override fields), no
ratio (`scalingRatio` is 0 even under an override), no frame-generation multiplier (`FG_MODE` /
`FG_MULTI_FRAME` stay clear at ×4). **The FG word follows DLSS-G too, corrected on the first run's own
readings:** `CREATED | EVALUATE` on every ×4 session, changing between readings as the feature came up, so
it is printed beside `frame generation:` as agreement or a printed disagreement, and promoted to
`DlssG (driver-reported …)` only where the count is active and no tag named the technology — the count is
never the driver's. Owner's run (§H5 rows N1–N4): the negative held (`CREATED` clear with upscaling off),
four NGX-direct titles now print `Dlss (driver-reported …)`, two hooked titles print agreement, and an
FSR + DLSS-G session read `SR 0x205` (created, not evaluated) and correctly claimed nothing. Beside a hook's `Dlss` the driver's word prints as agreement or as a
disagreement printed rather than resolved; beside an `N/A` with the bit clear it prints the driver's
negative. `20_OPEN_QUESTIONS` §H5 pre-commits rows N1–N4, and N3 — DLSS switched off — withdraws the rung
if the bit stays set. `03_METRICS` §Upscaling, `05_DETECTION`, `18_GPU_VENDOR_APIS` carry it.
### Changed
- **A counted session whose factor was refused no longer reads "no evaluation was observed".** DL:TB at FSR
upscaling + DLSS Frame Generation (2026-09-06): 4,415 tokens, 8,174 DXGI-counted presents, `DlssG` from
the tags, factor refused because bucket 8 of 8 read 1.96 against 2.85 — and the Presented qualifier said
a runtime was loaded and nothing was seen. It now says frame generation was counted and its factor
refused, that DXGI counted presents this hook never saw so the Displayed rate is above the printed
number, and that the number is neither Native nor Displayed.
- **The withheld `none` is narrowed to sessions where DXGI's counter was not read (§H5 Leg 0 landed).**
The owner's morning run on the DXGI-counted build printed the rule-6 trio on Dying Light: The Beast
(`Native 70.52 -> Displayed 282.08 (x4 FG)`, 12,387 presents DXGI-counted, `DlssG`) and then ran the
title twice with frame generation OFF: census unchanged (`sl.dlss_g.dll` is a startup-time load),
presents = tokens, `unseen=0` over thousands of samples, and the report withheld `none` exactly as the
gate's cost paragraph pre-committed. The counter is the discriminator the gate lacked — on that shape
the pacer's presents are DXGI presents on the hooked chain — so a counted `none` beside a READ counter
with zero unseen now prints as `none`, with *"DXGI's own present counter agrees: 0 unseen over N hooked
present(s)"* on the line; it is withheld only when the counter was not read, with the reason saying so.
A writer state that counted unseen presents the records do not carry is refused as a contradiction.
On every other title the counter is printed beside `none` as a second witness. CLAUDE.md rule 6 carries
the amendment; three cases changed sides and four are new.
### Added
- **Displayed FPS counted by DXGI where the hook cannot count it — the 2.8.0 pacer's presents.** The
owner's run on the DXGI counter landed `20_OPEN_QUESTIONS` §H5 row P1-DXGI twice: Dying Light: The
Beast at DLSS Frame Generation ×4 on Streamline 2.8.0 reads 2.90 and 2.95 presents per hooked present
that DXGI counted on the same chain and the inline patches never saw, while Streamline 2.7.3 (Hell Is
Us, ×3.86) and 2.10.3 (the Onimusha: Way of the Sword demo, ×3.67) read 0.00 — their generated frames
come through the patched bodies. So the record now carries `dxgiUnseen` (@52, from the reserved word,
under `FL_MEASURED_DXGI_PRESENTS`, no layout bump; mirror and `fl-layout-dump` follow), and the
consumer's window counts `Displayed = hooked + Σ dxgiUnseen` — in the rule-6 trio, in `presents/batch`
and in the uniformity buckets, never in a frame-time distribution — printing *"Displayed is
DXGI-COUNTED"* on its own line whenever the sum is above zero, because that number is a count DXGI
made rather than this hook. `none` withdraws on that title by count; a saturated byte is refused like
a saturated `fgEvaluations`; a byte under a clear bit is an honesty violation. A present the hook SAW and
declined — a paused session — is not an unseen present: every declined present bumps an epoch that
invalidates the chain's last reading, which the paused-session integration case caught (the first record
after a resume claimed the whole pause, 0x55, before the guard). On every other title
the window is byte-identical (five cases pin it; the injected `[fg]` case checks the byte is claimed
and zero on the harness). `03_METRICS` §Displayed may be DXGI-COUNTED carries the rule.
- **DXGI's own present counter against the hook's, in the writer state and the report.** On the one shape
where `none` is withheld (Streamline ≥ 2.8 with `sl.dlss_g.dll` loaded, Dying Light: The Beast), the
open question was whether the closed pacer's generated presents reach DXGI through a body the inline
patches miss or are displayed below DXGI. The Overlay now reads `IDXGISwapChain::GetLastPresentCount`
on every hooked present of the chain it just saw (rule 4: the same object `GetDesc` is already read
from) and publishes `dxgiPresentSamples` and `dxgiPresentsUnseen` (`FlWriterState @48/@52`, from
`reserved[]`, no layout bump; mirror, `fl-layout-dump` and the offset asserts updated). The report prints
`DXGI present counter: unseen=M over samples=N (r unseen per hooked present)` with the reading, and the
withheld qualifier says which side of DXGI the generated presents fall on. `20_OPEN_QUESTIONS` §H5
carries the rows written before the run: r ≈ 3 at ×4 means the generated presents ARE DXGI presents
and the next PR labels a DXGI-counted Displayed rate; r ≈ 0 means below DXGI and only the kernel and
vendor reads remain. The harness's presents are the negative control (`fl_guard` `[fg]`: zero unseen);
the positive cannot be fixtured. `hook-harness --probe-frames` now prints the call's cost.
- **A stall diagnostic in the report, placed against FrameLedger's own touches on the target.** The
owner saw Cyberpunk 2077 fall to 1 FPS for about a second under capture (2026-09-05) and the report
could say nothing about whose it was. The capture host now records the QPC moment of every guard scan
and module snapshot (`CaptureResult.TouchQpc`, the records' own clock), and `StallReport` prints the
three longest present-to-present intervals with their session time and the nearest host touch: a
touch inside or within 1 s names FrameLedger a SUSPECT and asks for a longer run on the 30 s cadence;
a far one says *not ours*. It counts intervals at or over 100 ms and calls itself a diagnostic — it is
not `03_METRICS`' stutter, which P2's calculators own. Four cases pin the placement.
- **DLSS Frame Generation is NAMED, from the tags the title already sends.** On every NVIDIA title measured
the count was right and the technology unnamed — `Active (technology not identified)` on Cyberpunk at
MFG ×3 and on the three UE titles at ×4 — because `kFeatureDLSS_G` is never evaluated through the export
@@ -38,6 +124,14 @@ GitHub release body, so a missing section will mean an empty release note.
the call resets the plugin's counter a title may read for its own FPS display, and the header marks it
not thread safe.
### Changed
- **The tag route is measured on real titles** (docs): the owner's evening run on #121 read `frame generation:
DlssG` on Hell Is Us, Expedition 33, Wukong, Rune Factory and Cyberpunk — every Streamline title tags the
DLSS-G inputs through a route this build hooks — and Dying Light: The Beast's census shows the title tags its
scaling input through `slSetTagForFrame` with no size, which closes HANDOFF 7a's last question without a
layout bump. `spike-notes` §9 carries the table; §H5 records the pre-commitment as landed.
### Fixed
- **`render -> output` prints under frame generation.** `UpscaleExtent` keyed its window on the
+2
View File
@@ -20,6 +20,8 @@ A C++ DLL (`FrameLedger.Overlay.dll`) is injected into games the user explicitly
> **Amended 2026-09-03 (owner decision).** When frame generation is *not measured* — `FL_MEASURED_FG` clear, which is every title on today's writer — the one number that may stand alone is **Presented FPS** (`presents / D`), with a mandatory qualifier from the **runtime census** (`FlWriterState.runtimeCensus`): "no frame-generation runtime was loaded, so this cannot include in-process generated frames" or "a frame-generation runtime is loaded and nothing was observed — this MAY include generated frames". The word "Native" never appears alone. **The census never produces `none`**: a statically linked FSR has no module to see, and a census-`none` there would be exactly the inflated number this rule forbids.
>
> **Amended 2026-09-05.** A counted `none` (`presents = application frames`) is **withheld** — Presented FPS with a third qualifier, "this number counts application frames; the Displayed rate is unknown" — on the one shape measured to produce a false `none`: Streamline ≥ 2.8.0 with `sl.dlss_g.dll` loaded (Dying Light: The Beast, five captures, DLSS FG ×4 per the owner). `docs/03_METRICS.md` §Frame Generation carries the key and why it is the Streamline plugin rather than `nvngx_dlssg.dll`; `20_OPEN_QUESTIONS` §H5 carries the session that keeps or withdraws it.
>
> **Amended 2026-09-06 (Leg 0 landed): narrowed, not withdrawn.** `sl.dlss_g.dll` is a startup-time load on that title (frame generation off, census unchanged, twice), and the same morning's ×4 capture measured the discriminator the gate lacked: the 2.8.0 pacer's generated presents are DXGI presents on the hooked chain (§H5 row P1-DXGI), counted through `dxgiUnseen` into `Native 70.52 → Displayed 282.08 (×4 FG)`. So a counted `none` beside a READ `IDXGISwapChain::GetLastPresentCount` with zero unseen is `none`, printed with DXGI's agreement; it is withheld only when the counter was not read.
7. **RT / PT / RR are tri-state** (`Yes` / `No` / `N/A`) with manual override. They are now *measured*, not guessed — but where measurement is genuinely impossible, the honest answer is still `N/A`. Never fabricate `Yes`.
> **Amended 2026-08-20 with the PR that wrote the hooks, per the owner ruling of 2026-08-14.** This rule named *"inline RayQuery without DXIL scan"* as one of the impossible cases, and that conflated two questions. **Whether rays are being traced is measurable** — `BuildRaytracingAccelerationStructure` is called by RayQuery titles and by `DispatchRays` titles alike, which is why both hooks exist and why the `No` branch requires the AS-build hook to have been *installed*. What needs a DXIL scan is **classifying the technique as RayQuery**, and that stays `N/A`. So the impossible cases are: naming the technique, and path-tracing classification, which has no API-level signature at all (`03_METRICS` §RT/PT/RR — a confidence score that may only ever *suggest*).
+69 -1
View File
@@ -77,6 +77,41 @@ This is the metric the rewrite exists for. Resolution ladder, highest confidence
published `presents / tokens` at or below 1.05 over a uniform window (§The source, below).
Never from a hook that merely saw nothing (rung 0), and never from the census.
> ### Displayed may be DXGI-COUNTED — measured 2026-09-05 on Dying Light: The Beast
>
> `F_disp = presents observed by the hook` (§Counting, below) assumed every present reaches the
> `Present` / `Present1` bodies the Overlay inline-patches. On Streamline 2.8.0 with DLSS Frame
> Generation ×4 it does not: the hook timed 4,392 presents while `IDXGISwapChain::GetLastPresentCount`,
> read on the same chain at every hooked present, moved by 17,133 — **2.90 unseen presents per hooked
> one** (2.95 on the second capture) — against **0.00** on Streamline 2.7.3 (Hell Is Us, ×3.86) and
> 2.10.3 (the Onimusha demo, ×3.67), where the generated presents come through the patched bodies. So
> the record carries `dxgiUnseen` (@52, under `FL_MEASURED_DXGI_PRESENTS`) and the consumer's window
> counts
>
> ```
> F_disp = hooked presents + Σ dxgiUnseen (DXGI-COUNTED when the sum is > 0)
> ```
>
> **When the sum is above zero the report says so on its own line — "Displayed is DXGI-COUNTED" —
> because the number is then a count DXGI made, on the hooked chain, of presents this hook never
> timed.** It may stand in the rule-6 trio and in `presents/batch`; it may NOT stand in a frame-time
> distribution, which has no timestamps for those presents. The uniformity buckets take the same
> numerator, so a session whose pacer stopped mid-way refuses exactly as one whose tokens stopped. A
> saturated byte (255) is refused like a saturated `fgEvaluations`, and a present the hook saw and
> declined (a paused session) is not unseen — the resume's first record differences nothing.
>
> **Landed 2026-09-06 (`spike-notes` §9): `Native FPS: 70.52 -> Displayed FPS: 282.08 (x4 FG) over 16516
> present(s)` on Dying Light: The Beast, 12,387 of them DXGI-counted, `frame generation: DlssG`** — the
> rule-6 trio on the title that could not print it. **And the counter decides `none` on that shape.**
> Leg 0 the same morning (frame generation off, twice) read presents = tokens with `unseen=0` over 3,659
> and 4,519 samples, census unchanged (`sl.dlss_g.dll` is a startup-time load), so the withheld gate is
> narrowed rather than withdrawn: a counted `none` beside a READ counter with zero unseen prints as
> `none` with DXGI's agreement on the line; only a session where the counter was not read withholds.
> A writer state that counted unseen presents the records do not carry is a contradiction and is
> refused as neither. `20_OPEN_QUESTIONS` §H5 keeps the
> rows this landed on; which body the 2.8.0 pacer presents through is unlocalised and does not need
> to be for the count.
>
> **RUNG 2 IS CONDITIONAL ON THE VENDOR, measured 2026-08-20, and this list read as
> though it were not.** `--track_frame_type` is a **beta** option in PresentMon 2.5.1
> and its own help says it *"requires application and/or driver instrumentation using
@@ -259,7 +294,8 @@ F_app = Σ fgEvaluations (APPLICATION frames, counted at the
> frame generation switched off in its menu, so the consumer's rule is: **the count decides `none`,
> identity decides the name** — an active count beside the mark prints `DlssG`; a counted 1.0 beside it
> prints `none` with the inputs noted; the withheld shape (§H5) keeps its N/A with the tags reported in
> the census line. `FsrFg` keeps precedence over the count, because a drained FRAMEGENERATION dispatch
> the census line — narrowed 2026-09-06 to sessions where DXGI's counter was not read (§Displayed may be
> DXGI-COUNTED). `FsrFg` keeps precedence over the count, because a drained FRAMEGENERATION dispatch
> is a generated batch. `FlWriterState.slTagCensus` carries which types arrived on which route for the
> session (`fl_shm.h` §slTagCensus).
>
@@ -431,6 +467,38 @@ From the upscaler hooks we get, per frame:
Tier 2 has none of this: `upscaler = unknown`, ratio `N/A`.
> ### The driver-reported rung — owner decision 2026-09-06, identity only
>
> Three NGX-direct titles (Lies of P, Hell Is Us, Expedition 33) evaluate DLSS super resolution through
> a path no hook of this build sees, and printed `upscaler: N/A` on every capture. The NVIDIA driver
> keeps per-process bookkeeping of the feature — `NvAPI_NGX_GetNGXOverrideState` (R570+, MIT NVAPI,
> `18_GPU_VENDOR_APIS` L3) returns a feedback word per feature — and **measured 2026-09-06 (driver
> 616.64) its `CREATED | EVALUATE` bits are set for a process with NO NVIDIA-app override** on both
> no-override titles (`20_OPEN_QUESTIONS` §H5). So the capture host probes it out of process beside
> each module snapshot (`fl-probe-nvapi --ngx-state <pid>`, no injection, no consent), and the
> `upscaler:` line has a rung between the hooks and `N/A`:
>
> ```
> upscaler: Dlss (driver-reported: the NVIDIA driver reports an NGX super-resolution feature created
> and evaluated in this process - not counted by this hook)
> ```
>
> **What it may claim: the vendor and the feature, attributed to the driver.** What it may NOT claim,
> each one measured: a quality (`performanceMode` / `renderPreset` are populated only under an
> NVIDIA-app override and are then the OVERRIDE's values), a ratio or render size (`scalingRatio` is
> 0 even under the override), a frame-generation multiplier (`FG_MODE` / `FG_MULTI_FRAME` stay clear
> and `frameGenerationCount` is 0 at ×4 — it is the override target). **Corrected the same day, on the
> loop's own readings:** the FG word DOES follow DLSS-G once the feature exists — `CREATED | EVALUATE`
> on Hell Is Us, Onimusha and DL:TB at ×4, the word CHANGING between the session's readings; the
> morning's `INITIALIZED | DLL_EXISTS` was read before creation. So the FG word is a second witness
> for the DLSS-G IDENTITY, printed beside `frame generation:` as agreement or a printed disagreement,
> and promoted to `DlssG (driver-reported: …)` only where the count is active and no tag named the
> technology. The COUNT is never the driver's. A hook's name always outranks it, and
> beside a hook's name the driver's word is printed as agreement, or as a disagreement *printed rather
> than resolved*. Beside an `N/A` with the bit clear it prints the driver's negative, attributed, which
> says nothing about FSR or XeSS. **The negative is owed** (§H5): a title with DLSS switched off should
> read the bit clear; if it does not, the rung is withdrawn.
## RT / PT / RR — evidence-based tri-state
Tri-state `Yes | No | N/A` per session with `source` (`measured | manual | inherited`).
+1 -1
View File
@@ -18,7 +18,7 @@ Derived in the Agent from the record stream; the mapping is in `03_METRICS`. Sum
| Graphics API + swapchain format, buffer count, swap effect, flags | `CreateSwapChain*` / present hooks |
| Present mode (flip / blt / independent flip) | swapchain desc + `presentFlags` + `syncInterval` |
| HDR output | `SetColorSpace1` |
| Upscaler identity + quality preset | NGX / Streamline / FFX / XeSS create+evaluate calls |
| Upscaler identity + quality preset | NGX / Streamline / FFX / XeSS create+evaluate calls — **or, when no hook saw one, the NVIDIA driver's per-process NGX word, out of process and attributed (`03_METRICS` §Upscaling, the driver-reported rung, 2026-09-06): identity only, never the preset** |
| Render resolution vs output resolution (incl. mid-session changes) | upscaler parameter reads + `ResizeBuffers` |
| Frame Generation mode + factor | NGX/SL/FFX FG feature evaluation, then cadence — **Tier 1 only**. ~~then (Tier 2 only) PresentMon `FrameType`~~ retired (§S31 row P2), and Tier 2 no longer produces frames to run cadence over either |
| Ray Tracing active | AS builds + `DispatchRays` (both, to catch inline RayQuery) |
+1 -1
View File
@@ -135,7 +135,7 @@ Every hook must be listed here with a purpose. Anything not on this list is not
### Presentation
| Hook | Purpose |
|---|---|
| ✅ `IDXGISwapChain::Present`, `Present1` | Frame boundary, QPC, sync interval, present flags. **`DXGI_PRESENT_TEST` calls are dropped without a record** — the occlusion probe submits nothing, and a minimised game emits a stream of them (`07_IPC` §Protocol rules) |
| ✅ `IDXGISwapChain::Present`, `Present1` | Frame boundary, QPC, sync interval, present flags. **`DXGI_PRESENT_TEST` calls are dropped without a record** — the occlusion probe submits nothing, and a minimised game emits a stream of them (`07_IPC` §Protocol rules). **Since 2026-09-05 the hook also reads `IDXGISwapChain::GetLastPresentCount` on the chain it just saw** (rule 4: the same COM object `FindOrAdd` already calls `GetDesc` on, no new hook) and publishes `dxgiPresentSamples` / `dxgiPresentsUnseen` — DXGI's count of presents on that chain that this hook never saw, the in-process half of `20_OPEN_QUESTIONS` §H5 Leg 1. One virtual call per hooked present, costed by `hook-harness --probe-frames`. **And per record since the same night: `dxgiUnseen` @52 under `FL_MEASURED_DXGI_PRESENTS`**, so the consumer's window counts `Displayed = hooked + unseen` per bucket (`03_METRICS` §Displayed may be DXGI-COUNTED) — measured 2.90 / 2.95 on DL:TB at Streamline 2.8.0, 0 on 2.7.3 and 2.10.3 |
| ✅ `IDXGISwapChain::ResizeBuffers` · ⏳ `ResizeTarget` | Output resolution changes mid-session. `ResizeBuffers` re-reads the swapchain description *after* the original returns; `ResizeTarget` is not hooked |
| ⏳ `IDXGISwapChain::SetFullscreenState` | Fullscreen ↔ borderless transitions |
| ⏳ `IDXGISwapChain3::SetColorSpace1` | HDR output detection. **`IDXGISwapChain3`, not 4** — 4 adds only `SetHDRMetaData` (`20_OPEN_QUESTIONS` §H9). Unbuilt, which is why `colorSpace` reads `NOT_REPORTED` and `FL_MEASURED_HDR` stays clear. **When it is built, the writer must initialise `colorSpace = FL_COLOR_SPACE_SDR` at swapchain identification** — an SDR title never calls `SetColorSpace1`, so "hook live, no call" would otherwise sit at `NOT_REPORTED` forever and HDR's definite `No` would be unreachable. DXGI documents G22/Rec.709 as the default, which makes SDR a *measured* default rather than an affirmative negative |
+6 -1
View File
@@ -105,6 +105,7 @@ Still resolve **entry points defensively at runtime**: `nvapi64.dll` may be abse
| Memory | `NvAPI_GPU_GetMemoryInfoEx` — **not `NvAPI_GPU_GetMemoryInfo`**, which this table named until 2026-08-05. The vendored headers mark it `__nvapi_deprecated_function` ("deprecated in release 520"), so under `/W4 /WX` a call to it fails the native build |
| **Throttle reasons** | `NvAPI_GPU_GetPerfDecreaseInfo` — not available from L1 or L2 |
| Driver version | `NvAPI_SYS_GetDriverAndBranchVersion` |
| **NGX per-process state** | `NvAPI_NGX_GetNGXOverrideState` (R570+) — the driver's feedback word per DLSS feature for a PID, read OUT OF PROCESS by `fl-probe-nvapi --ngx-state` and, since 2026-09-06, by the capture host beside each module snapshot. Measured: the SR word's `CREATED \| EVALUATE` is set without an NVIDIA-app override; the FG word follows DLSS-G once created (`CREATED \| EVALUATE` at ×4, corrected the same day — the first reading was blind because it was early), the multiplier bits stay clear; `scalingRatio` is 0 even under an override. Identity only, SR and FG (`03_METRICS` §Upscaling) |
| **Reflex / PC latency** | `NvAPI_D3D_GetLatency` → per-frame sim/render/present/driver/GPU timestamps; hooking `NvAPI_D3D_SetSleepMode` / `SetLatencyMarker` in the Overlay tells us the game enabled Reflex (`17_HOOK_ENGINE`) |
Reflex latency is the single strongest reason L3 exists — it is genuinely unavailable anywhere else.
@@ -198,7 +199,11 @@ refused the same day (delegated by the owner, decided 2026-09-04).** It declares
reads no argument, but installing it inline-patches Intel's code inside the game process, and
the same licence forbids *"any modification"*; the census is the answer NGX got and Intel gets
the same one. Reversal condition: Intel publishing the headers under a licence that clears the
checklist, at which point this paragraph is re-run, not argued around.
checklist, at which point this paragraph is re-run, not argued around. **Re-run 2026-09-06 against
<https://raw.githubusercontent.com/intel/xess/main/LICENSE.txt> and `inc/xess/xess.h`: unchanged** —
the same licence, the same three needles, the same header banner. Not fired. Intel's README does
state that XeSS-FG runs on *"non-Intel GPUs with SM 6.4 support"*, so an XeFG session is measurable
on the NVIDIA dev box even though nothing in it may be hooked or declared.
### Checklist before adding any vendor SDK
+186 -3
View File
@@ -3127,7 +3127,21 @@ lazily, which is the case the hook exists for. Until then, keep the rule and do
not let anyone "simplify" it back to an inline install on the grounds that the
probe never showed a deadlock.
### H5 ◐ · Proxy swapchains defeat the dummy-vtable assumption
### H5 ✅ · Proxy swapchains defeat the dummy-vtable assumption — **the DLSS / DLSS-G question closed 2026-09-06 (owner)**
> **CLOSED 2026-09-06, 12:17, on Cronos: The New Dawn demo with frame generation ON (`spike-notes` §9).**
> The second Streamline 2.8.0 title, UE: `Native FPS: 86.8 -> Displayed FPS: 172.72 (x1.99 FG)`,
> `unseen=0 over samples=10063`, `frame generation: DlssG — the NVIDIA driver agrees`, `upscaler: Dlss
> (driver-reported)`, RT Yes. **So the pacer that bypasses the patched `Present` bodies is Dying Light:
> The Beast's integration, not SDK 2.8.0's** — 2.8.0 on UE presents its generated frames through the body
> the inline patches cover, exactly as 2.7.x and 2.10.x do. Every measured title now prints the rule-6 trio
> or a counted `none`, on NVIDIA through one of three producers: the hooked bodies (Cyberpunk, Hell Is Us,
> Expedition 33, Wukong, Rune Factory, Onimusha, Cronos), DXGI's own counter where the hook cannot count
> (DL:TB), or a withheld `N/A` only when that counter was never read. Identity comes from the tags (DLSS-G)
> and the hooks, and from the driver's per-process word where no hook can see it (the NGX-direct titles),
> with the negative measured. **What stays unlocalised and is not needed for any number the report
> prints:** which body DL:TB's pacer reaches. The owner closed the item on this reading; the sub-items
> below are its history.
> ### CASE 3 HAS A CANDIDATE TITLE — Dying Light: The Beast, Streamline 2.8.0, DLSS Frame Generation ON, 2026-09-05
>
@@ -3241,6 +3255,83 @@ probe never showed a deadlock.
> the rule-6 pair on the hidden-presents shape could then read *application frames counted ×
> multiplier reported* — labelled as such, never as a measured Displayed.
>
> **MEASURED 2026-09-06 morning, three titles, driver 616.64 (`spike-notes` §9): the bits ARE populated
> without an override, for super resolution only.**
>
> | Title (override?) | SR feedback | RR feedback | FG feedback | ratio / mode / preset / fgCount |
> |---|---|---|---|---|
> | Hell Is Us (none), DLSS + **DLSS-G ×4 running** | `0x80605` INITIALIZED DLL_EXISTS **CREATED EVALUATE** ERR_NOT_FOUND | INITIALIZED DLL_EXISTS ERR_NOT_FOUND | `0x5` INITIALIZED DLL_EXISTS — **no CREATED / EVALUATE / FG_MODE** | 0 / 0 / 0 / 0 |
> | Expedition 33 (NVIDIA-app override ON), FG off | `0x8067F` … ENABLED DLL_LOADED DLL_SELECTED PRESET PERF_MODE **CREATED EVALUATE** ERR_NOT_FOUND | INITIALIZED DLL_EXISTS ERR_NOT_FOUND | `0x1F` INITIALIZED ENABLED DLL_EXISTS DLL_LOADED DLL_SELECTED | 0 / **2** / **11** / 0 |
> | Lies of P (none), DLSS, no FG | `0x605` INITIALIZED DLL_EXISTS **CREATED EVALUATE** | INITIALIZED ERR_FAILED ERR_NOT_FOUND | INITIALIZED ERR_FAILED ERR_NOT_FOUND | 0 / 0 / 0 / 0 |
>
> Four readings. **(1) `CREATED | EVALUATE` on the SR word is set on both no-override titles** — the
> driver keeps per-process bookkeeping of the NGX super-resolution feature whatever route the title took,
> which is exactly the identity `upscaler: N/A` lacks on the NGX-direct titles (all three print it). **(2)
> The FG word does NOT reflect DLSS-G activity:** Hell Is Us was generating at ×4 through Streamline
> (`83.21 → 332.82 (×4 FG)`, `DlssG`, the same session) and its FG word says INITIALIZED | DLL_EXISTS and
> nothing more — the word tracks the override machinery's DLL, not the plugin's evaluations. Frame
> generation stays with the tags and the count. **(3) `frameGenerationCount` is 0 on every title,
> including the one at ×4 — it is the override target the header names, never the title's multiplier**,
> so the "application frames counted × multiplier reported" pair above has no producer and is dropped.
> **(4) `scalingRatio` is 0 everywhere, override included; `performanceMode` / `renderPreset` are
> populated only under the override (E33: 2 / 11) and are then the OVERRIDE's values, not the title's** —
> so this route gives an identity and nothing about the render size or quality. `ERR_NOT_FOUND` sits
> beside CREATED | EVALUATE on two titles and is absent on the third; the header does not say what it
> refers to (a DRS profile, most likely), and it is not read as anything.
>
> **What a driver-reported rung may therefore claim — the owner's decision, not yet built:** on a
> session where every hook says `upscaler: N/A`, `Dlss (driver-reported: the NVIDIA driver reports an
> NGX super-resolution feature created and evaluated in this process — not counted by this hook)`. It
> may name the vendor and the feature; it may not state a quality, a ratio, a render size, a frame
> generation mode or a multiplier. On a hooked-identity session (Cyberpunk, DL:TB, Onimusha) the word
> is a consistency check the report prints beside the hooked name. **Owed before it is built — the
> negative:** the probe on Lies of P or Hell Is Us with DLSS switched OFF in the menu, expected
> `CREATED` clear; a rung that has only ever seen the positive would be the census's mistake again.
> Plumbing when decided: the probe already builds against `fl_nvapi`; the capture host would call it
> beside each module snapshot (out of process, no consent needed) or, if it goes in-process, through
> `Infrastructure` only (CLAUDE.md: no P/Invoke elsewhere).
>
> **BUILT 2026-09-06, on the owner's decision ("nối probe để bắt đầu").** The capture host spawns
> `fl-probe-nvapi --ngx-state <pid>` beside every module snapshot (the probe prints one machine line,
> `NGXSTATE status=… sr=0x… …`, and is staged beside the host by the project file), merges the readings
> (the last answered word is the state; a change between readings is printed, never averaged) and
> prints `NVIDIA driver NGX state:` in the runtime block. `03_METRICS` §Upscaling carries the rung and
> its limits. **Pre-committed, read off the next run:**
>
> | Row | Title / setting | Expected | Else |
> |---|---|---|---|
> | **N1** | Lies of P, Hell Is Us, Expedition 33 at DLSS | `upscaler: Dlss (driver-reported: …)` | a `CREATED \| EVALUATE` word beside `N/A` is a parser or plumbing defect — localise |
> | **N2** | Cyberpunk, DL:TB, Onimusha (hooked `Dlss`) | `upscaler: Dlss — the NVIDIA driver agrees …` | a disagreement WARNING is printed as such; it is not resolved by preferring either |
> | **N3** | **the negative, still owed:** Lies of P with DLSS switched OFF in the menu | `CREATED` clear → `upscaler: N/A (…) — the NVIDIA driver reports no NGX super-resolution feature created …` | `CREATED \| EVALUATE` still set with DLSS off → **the rung is withdrawn** (the bit is a session-lifetime latch, not a state) and the line goes back to N/A |
> | **N4** | a title at FSR / XeSS with no NGX feature | `Fsr3` / `N/A` with the driver's negative beside it | `CREATED` set on a title with no DLSS in its menu → withdraw |
>
> Lies of P has no DLSS Frame Generation (owner, 2026-09-06), which is why its FG word reads
> `ERR_FAILED ERR_NOT_FOUND`: nothing to load.
>
> **LANDED 2026-09-06, 10:39–11:36 (`spike-notes` §9): N1, N2 and N3 as pre-committed, N4 in a shape the
> row did not foresee, and one correction.** N3 first, because it decides: the standalone probe on Lies of
> P with upscaling OFF read `SR 0x5` — `CREATED` clear — and with DLSS on `0x605`; **the rung stands.** N1:
> Lies of P, Expedition 33, Hell Is Us and the new Cronos: The New Dawn demo all print
> `upscaler: Dlss (driver-reported: …)` where they printed `N/A`. N2: Onimusha and DL:TB print
> `upscaler: Dlss — the NVIDIA driver agrees`. N4 arrived as DL:TB at **FSR upscaling + DLSS Frame
> Generation**: `upscaler: FSR (3.1 or 4 …)`, `2560x1440 -> 2560x1440`, `SR 0x205` — CREATED without
> EVALUATE, so the driver's word correctly does NOT claim DLSS beside FSR (the rung needs both bits).
> **The correction:** the FG word is NOT blind to DLSS-G. It read `CREATED | EVALUATE` on Hell Is Us,
> Onimusha and DL:TB at ×4, and *"the words CHANGED between readings"* on all three — the morning's
> `INITIALIZED | DLL_EXISTS` on Hell Is Us was a first reading taken before the feature came up.
> `FG_MODE` / `FG_MULTI_FRAME` stay clear and `fgCount` is 0 at ×4, so it names the feature and never the
> multiplier: printed beside `frame generation:` as agreement, promoted to `DlssG (driver-reported)` only
> where the count is active and no tag named the technology. Also on this run: Cronos is a **second
> Streamline 2.8.0 title** (UE, FG off, `sl.dlss_g.dll` absent from its census — per-setting there — `FPS
> 105.01`, `none` with DXGI agreeing); its FG-on capture would say whether the 2.8.0 pacer bypass is the
> SDK's or Techland's. And the FSR + DLSS-G session's factor was refused (bucket 8 of 8 at 1.96 against
> 2.85 — the guard working) while the qualifier said *"no evaluation was observed"* beside 4,415 tokens; the
> qualifier now says the factor was counted and refused, and that DXGI counted 8,174 presents this hook
> never saw so the Displayed rate is above the printed one.
>
> **The last row, 12:17 — Cronos with frame generation ON: `86.8 → 172.72 (×1.99 FG)`, `unseen=0`, `DlssG`
> with the driver agreeing.** The 2.8.0 pacer bypass is Techland's, not the SDK's. Closed above.
>
> ### THE STREAMLINE DOCS, READ 2026-09-05 (v2.8.0 and main), AND WHAT THEY CHANGED
>
> The owner asked for the vendor's own guides before any rewrite. Three things in them decide this item.
@@ -3277,6 +3368,77 @@ probe never showed a deadlock.
> generation"* beside the withheld count. Lies of P at DLSS (no Streamline tokens at all) → unchanged:
> the super-resolution identity on NGX-direct titles is what the NVAPI probe above is for.
>
> **LANDED 2026-09-05 evening, on the owner's run on #121 (`spike-notes` §9):** `frame generation: DlssG` on
> Hell Is Us (×4, twice), Expedition 33 (×1.97), Wukong (×4), Rune Factory (×3.98) and Cyberpunk — every
> Streamline title tags the DLSS-G inputs through a route this build hooks (the UE plugin and Cyberpunk 2.7.1
> globally, DL:TB 2.8 through `slSetTagForFrame`), so the identity is measured six of six and *"technology
> not identified"* is gone from all of them. DL:TB's withheld line now says *"FEEDING frame generation"*
> beside the count it cannot make; its census also shows a `scaling-in` tag on the frame route with
> `UpscalerParams` still 0 — the tag carries no size on this title, which closes 7a's last question without
> the layout bump it was thought to need. Cyberpunk's factor was refused on that run (bucket 1 at 3.0 against
> 1.67 overall, `tokens/batch 2.97`): a mixed session, refused as designed rather than averaged. **What is
> left on NVIDIA is one thing: `upscaler: N/A` on the NGX-direct titles** — the probe above.
>
> **BUILT 2026-09-05, late — A1.7 promoted from "not in A1" to the in-process half of Leg 1.** The owner
> read that Streamline ≥ 2.8 "needs `sl.interposer.dll` and `sl.common.dll` loaded before an injection
> succeeds". Checked against the source, not the claim: the interposer's DXGI proxy
> (`source/core/sl.interposer/d3d12/dxgiSwapchain.cpp`) is **byte-for-byte the same file at v2.7.32 and
> v2.8.0** — plugins' before-hooks receive `m_base` and may `skip` the base call, exactly as before — and
> 2.8's `sl.common` gains `resourceTaggingForFrame.cpp` (the `slSetTagForFrame` route #121 already hooks).
> Injection into DL:TB already succeeds (every capture there has `streams=1`, a full `runtime census`, a
> tag census), so "loaded before injection" is a launcher's problem, not this hook's. What 2.8 does NOT
> show is where its closed `sl.dlss_g` pacer presents. So the Overlay now asks DXGI itself: on every hooked
> present it reads `IDXGISwapChain::GetLastPresentCount` on the chain it just saw (rule 4: the same object
> `FindOrAdd` already calls `GetDesc` on) and publishes two words on the 1 Hz watchdog —
> `dxgiPresentSamples` (hooked presents that read it) and `dxgiPresentsUnseen` (presents DXGI counted
> between two hooked ones, beyond the one seen). The report prints
> `DXGI present counter: unseen=M over samples=N (r unseen per hooked present)` and the withheld qualifier
> carries the reading. The harness's own presents are the negative control (`fl_guard` `[fg]`:
> `unseen == 0`, `samples >= drained`); the positive cannot be fixtured — nothing in this repo presents
> through a body the inline patches miss — which is why the rows below are written before the run.
> Cost: one virtual call per hooked present, measured by `hook-harness --probe-frames` (number in the PR
> body); `--probe-cost` is the empty-detour floor and does not include it.
>
> Leg 1's in-process rows, read off the new line on a DL:TB DLSS FG ×4 capture (r = unseen / samples):
>
> | Row | Reading | Meaning | Action |
> |---|---|---|---|
> | **P1-DXGI** | r ≈ 3 (×4) — `unseen ≈ 3 × samples` | the pacer presents on the SAME chain through a body the inline patches do not cover; the generated presents ARE DXGI presents | the next PR promotes `Displayed = hooked + unseen`, labelled **DXGI-counted** (a count DXGI made, not this hook), `presents/batch` from it, and `none` withdraws by count; the pacer's entry is then localised (a second `CDXGISwapChain` class, or a path that bypasses `Present`'s body) at leisure |
> | **P3-DXGI** | r ≈ 0 | DXGI counted nothing this hook did not: the generated frames are displayed below DXGI (driver pacing / flip metering) or on an object this hook never saw | the withheld wording stays; no in-process sink exists; only PresentMon (kernel) and the NVAPI corroboration remain, and if PresentMon also reads 1× the frames never were kernel presents |
> | **P5-DXGI** | 0 < r < 2.5, or r ≠ 0 with `streams > 1` | a mixed path or a second chain | stop and localise; the number is printed, never averaged into a factor |
> | **P2/P4** | r ≈ 0 with ours ≈ 4× tokens, or the count itself moved | as the kernel rows say: not generating, or the title changed | the kernel rows above decide |
>
> **LANDED 2026-09-05 night, on the owner's run on #124 (`spike-notes` §9): row P1-DXGI, twice.** DL:TB at
> DLSS FG ×4 read `unseen=12204 over samples=4136 (2.95)` at 21:56 and `unseen=12741 over samples=4392
> (2.90)` at 22:06 — DXGI counted 3.9× the presents this hook did, on the SAME chain, which is the owner's
> ~300 against ours ~75 from the afternoon, now measured in-process. The two controls read 0.00: Hell Is Us
> (Streamline **2.7.3**, `79.89 → 308.14 (×3.86)` through the patched bodies, 18,207 samples) and the
> owner's new title, the **Onimusha: Way of the Sword demo on Streamline 2.10.3** (`60.04 → 220.33
> (×3.67)`, `DlssG`, `upscaler: Dlss`, 12,914 samples, 0 unseen). So **2.8.0's pacer is the odd one** —
> 2.7.x before it and 2.10.x after it present the generated frames through `Present`'s body — and the
> "`sl.interposer.dll` + `sl.common.dll` must be loaded on ≥ 2.8" lead is closed by 2.10.3, which injects,
> tags on the frame route and counts exactly like 2.7. **The pre-committed action is built:** the record
> carries `dxgiUnseen` (@52, `FL_MEASURED_DXGI_PRESENTS`), the window counts `Displayed = hooked +
> unseen` and prints *"Displayed is DXGI-COUNTED"* on its own line, `presents/batch` takes the same
> numerator, and `none` withdraws on DL:TB by count (`03_METRICS` §Displayed may be DXGI-COUNTED). Expected
> on DL:TB's next capture: the trio at ≈ ×3.9 with the label, no withheld line, `frame generation: DlssG`.
> Which body the 2.8.0 pacer reaches stays unlocalised, as the row said.
>
> **LANDED 2026-09-06 morning, on the owner's run on #125 (`spike-notes` §9): the promotion, and Leg 0.**
> DL:TB at DLSS FG ×4 (07:31): `Native FPS: 70.52 -> Displayed FPS: 282.08 (x4 FG) over 16516 present(s)`,
> *"Displayed is DXGI-COUNTED: 12387 of those present(s)"*, `unseen=12483 over samples=4202 (2.97)`,
> `frame generation: DlssG`, uniform across every bucket, no withheld line — the trio rule 6 asks for, on
> the title that could not print it. **Leg 0, twice (07:45, 07:55): frame generation OFF**, census still
> `0x25F0F` — `sl.dlss_g.dll` is a **startup-time load**, the cost paragraph's fear measured true —
> presents = tokens, `unseen=0 over samples=3659` and `4519`, tag census `0x23600` (depth, mvec,
> scaling-in, scaling-out, other: **no hudless / UI tag with FG off**, so the DLSS-G identity is
> per-setting on this title too), and the report withheld `none` exactly as pre-committed. **The gate is
> narrowed rather than withdrawn:** DXGI's counter is the discriminator it lacked — the 2.8.0 pacer's
> presents are DXGI presents on this chain (P1-DXGI), so a counted 1.0 beside a READ counter with zero
> unseen is `none`, printed with DXGI's agreement; withheld only when the counter was not read. Control:
> Expedition 33 FG off (Streamline 2.7.30) reads `FPS: 85.86`, `none` by count, tag census `0x0` — the UE
> plugin sends no tags at all with FG off.
>
> Leg 1's rows (ours = `presents / span`; PM = PresentMon rows / span; C = the counter; ≈ = within 5 %):
>
> | Row | Reading | Meaning | Action |
@@ -3290,7 +3452,8 @@ probe never showed a deadlock.
>
> Leg 0's own row: if `sl.dlss_g.dll` is **absent** with FG off, the census bit is per-setting on
> this title and the gate is sharper than its cost paragraph feared (consider dropping the version
> conjunct); if present, the interim cost stands as written.
> conjunct); if present, the interim cost stands as written. **Landed 2026-09-06: PRESENT, twice** —
> and the cost stood for one morning, because the DXGI counter (above) narrowed the gate the same day.
>
> **Second-present-sink candidates for P1 / P5, one line each, none chosen:** MinHook inline
> patches on the `gdi32.dll` D3DKMT thunks (`D3DKMTPresent`, `D3DKMTPresentMultiPlaneOverlay3`,
@@ -3479,7 +3642,27 @@ turns a would-be STL throw into `__fastfail`, which SEH cannot intercept
(`spike-notes.md` §H3). The "no throwing STL in hook paths" rule is therefore
load-bearing rather than stylistic.
### H11 ◐ · XeFG and FSR3-FG identity — **AMD built 2026-09-04 through the ffx-api leaves; Intel closed by licence; FSR 3.0 host route deferred**
### 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**
> **2026-09-06: the AMD half is complete on its oracle** — Lies of P at FSR 3.1 + FSR FG on the #129 build
> prints `Fsr3` / `FsrFg` / `59.77 → 119.55 (×2 FG)` / `2560x1440 -> 2560x1440` with `presents/frame=2.00`,
> `frames/upscale-drained=1.00`, `unseen=0` and the NVIDIA driver's word saying nothing was created
> (`spike-notes` §9); the owner called it done. **Intel, re-checked the same day: the licence has not
> changed** (`18_GPU_VENDOR_APIS` §Intel), so nothing in `libxess*.dll` may be hooked or declared, and the
> signature-free thunk stays refused. **What is left in policy for an XeFG session, proposed and not yet
> built — identity BY ELIMINATION, labelled as such:** frame generation is COUNTED by the Streamline token
> (UE titles request it whatever the FG vendor — measured on Rune Factory's compiled-in FSR) or by DXGI's
> counter; DLSS-G is EXCLUDED by the NVIDIA driver's FG word (no feature created) and by the absence of the
> HUD-less / UI tags; FSR-FG through a shipped DLL is EXCLUDED by the ffx census (no FRAMEGENERATION dispatch
> at any hooked module); the frame-generation runtime the census names is `libxess_fg.dll`. The line would
> read `Active (technology not identified) — by elimination among the runtimes loaded: not DLSS-G (the
> NVIDIA driver reports no NGX frame-generation feature), no FSR dispatch reached a hooked module, and the
> frame-generation runtime present is libxess_fg.dll; a frame generator compiled into the executable would
> read the same`. Never `XeFg` as a measured identity; never a render extent. Intel's README says XeSS-FG
> runs on non-Intel GPUs with SM 6.4, so DL:TB / Hell Is Us / Cronos / Expedition 33 with XeSS FG on are
> the sessions that measure it, and the pre-commitment is the last clause: the wording must survive the
> one static title (Rune Factory at FSR FG) reading the same way.
>
> **BUILT, 2026-09-04, the AMD half — and the deferral's own rule was kept: header first, decode
> second, never from observation.** `HANDOFF` item 7c. The FidelityFX headers cleared the
+52 -5
View File
@@ -690,7 +690,15 @@ FG factor and RT state are measured against the titles' own menus. What follows
owner's list for the next session, in the order the dependencies run, each with what makes
it fail on unmodified `main` — because a criterion already true on `main` is decoration.
#### 7a. The quality preset — the last value criterion 1 lacks
#### ~~7a. The quality preset — the last value criterion 1 lacks~~ — **CLOSED 2026-09-06 (owner): DLSS / DLSS-G done on every measured title**
*Closed on the Cronos FG-on capture (`20_OPEN_QUESTIONS` §H5 head, `spike-notes` §9): the trio or a counted
`none` on every NVIDIA title through the hooked bodies, DXGI's counter where the hook cannot count (DL:TB —
that title's integration, not SDK 2.8.0's), and the driver-reported identity where no hook can see it, with
its negative measured. The quality preset itself stays `0xFF` / N/A everywhere — the override fields are
the override's, the tags carry no size on D3D12 — and the owner closed the item on that. What follows is
the history.*
*Fails on `main` because:* every real title measured reads `upscalerQuality = 0xFF`.
Cyberpunk 2077 never chains `sl::DLSSOptions`, so 0xFF there is the title's truth; **Alan Wake
@@ -758,13 +766,41 @@ Cyberpunk 2077 never chains `sl::DLSSOptions`, so 0xFF there is the title's trut
Cyberpunk at MFG and on the UE titles at ×4 on the next run, with the new `Streamline tag census:` line saying
which route carried the tags — and DL:TB's census line says whether that title feeds DLSS-G through a route
this build sees. `slDLSSGGetState` was refused (`03_METRICS` §FG: it resets the plugin's own counter).
**START HERE next:** `fl-probe-nvapi --ngx-state <pid>` against a running Lies of P, Hell Is Us, DL:TB
~~**START HERE next:** `fl-probe-nvapi --ngx-state <pid>` against a running Lies of P, Hell Is Us, DL:TB
and Cyberpunk (no capture, no injection) — the super-resolution identity on NGX-direct titles is still the
gap the tags cannot close. If the driver's per-process NGX feedback is
gap the tags cannot close.~~ **RAN 2026-09-06 on Hell Is Us, Expedition 33 and Lies of P (§H5, `spike-notes`
§9): `CREATED | EVALUATE` on the SR word without an override on both no-override titles — the identity
exists in the driver's bookkeeping; the FG word does not see DLSS-G at ×4; `frameGenerationCount` is the
override target, `scalingRatio` is 0 even under an override.** ~~**START HERE next: the owner decides the
driver-reported rung (§H5 says exactly what it may claim: `Dlss (driver-reported …)` on a session where
every hook says N/A, nothing about quality, ratio or FG), and the negative is owed first — the probe on
Lies of P with DLSS switched OFF, expected `CREATED` clear.**~~ **Decided and BUILT 2026-09-06: the capture
host probes the driver beside every module snapshot and the `upscaler:` line has the driver-reported rung
(`03_METRICS` §Upscaling). START HERE next: the owner's run — §H5 rows N1–N4, and N3 (Lies of P with DLSS
OFF) is the one that keeps or withdraws the rung — LANDED 2026-09-06 midday: N3 read `CREATED` clear with
upscaling off, N1 prints `Dlss (driver-reported …)` on four NGX-direct titles, N2 prints agreement on two,
and the FG word turned out to follow DLSS-G too (identity, never the multiplier). START HERE next: Cronos
(a second Streamline 2.8.0 title, UE) with frame generation ON — does the 2.8.0 pacer bypass the patched
bodies there too (`DXGI present counter` ≈ 3) or is it Techland's (0)? — ANSWERED 12:17: Cronos FG on reads
`86.8 → 172.72 (×1.99 FG)` with `unseen=0`; the bypass is Techland's. Item closed; the next item is the
owner's pick from 7b / 7c below.** **The tag route LANDED on the owner's evening run (`spike-notes` §9): `DlssG` on
six of six Streamline titles, and DL:TB's census shows its scaling-input tag arrives with no size, which
closes 7a's last question.** If the driver's per-process NGX feedback is
populated without an NVIDIA-app override, the identity question has a producer that is not a
hook and the owner decides whether `03_METRICS` gains a *driver-reported* rung (§H5 says what
that rung may and may not claim). If it is not populated, the answer stays `N/A` and the
session goes back to the PresentMon leg.
session goes back to the PresentMon leg. **The in-process half of that leg LANDED (2026-09-05,
night): DL:TB at DLSS FG ×4 read 2.90 and 2.95 unseen presents per hooked one on the same chain —
§H5 row P1-DXGI — while Streamline 2.7.3 (Hell Is Us) and 2.10.3 (the Onimusha demo) read 0.00, so
2.8.0's pacer is the one that bypasses the patched bodies. The record now carries `dxgiUnseen` and
the window counts `Displayed = hooked + unseen`, labelled DXGI-COUNTED (`03_METRICS`); DL:TB's next
capture is expected to print the trio at ≈ ×3.9 with that label and no withheld line — LANDED
2026-09-06: `70.52 → 282.08 (×4 FG)`, DXGI-COUNTED 12,387, `DlssG`. Leg 0 the same morning (FG off,
twice) showed the plugin is a startup-time load and the report withheld as pre-committed, so the
gate is now narrowed to sessions where the DXGI counter was not read; a read counter with zero
unseen prints `none` with DXGI's agreement.** The
"sl.common must be loaded on 2.8" lead is closed by the 2.10.3 title, which injects and counts like
2.7 (§H5).
#### 7b. Titles whose upscaler or frame generation is compiled into the executable
@@ -801,7 +837,18 @@ hole; it does not close it.
capture with the census line can. **Black Myth: Wukong is the second** — its FSR upscaling
dispatches to neither the loaded monolith nor the loader, and it offers no FSR frame generation.
#### ~~7c. AMD and Intel identity, measured rather than inferred~~ — **AMD LANDED 2026-09-04; Intel closed; the owner's three launches are owed**
#### ~~7c. AMD and Intel identity, measured rather than inferred~~ — **AMD LANDED 2026-09-04 and re-confirmed complete 2026-09-06 on Lies of P; Intel closed by licence (re-checked 2026-09-06, unchanged)**
*2026-09-06, 12:46: Lies of P at FSR 3.1 + FSR FG prints `Fsr3` / `FsrFg` / `59.77 → 119.55 (×2 FG)` /
`2560x1440 -> 2560x1440` with every count agreeing (`spike-notes` §9) — acceptance step 5 in full, beside
the DXGI counter (0 unseen) and the NVIDIA driver's word (nothing created). The owner called the AMD half
done. Intel: the licence was re-fetched the same day — Intel Simplified Software License, October 2022,
binary-only, "nor any modification", termination; the header banner still forbids copying — so the
reversal condition has not fired and the census stays the answer. What is new: Intel's own README says
XeSS-FG runs on non-Intel GPUs with SM 6.4, so an XeFG session IS capturable on this box (DL:TB, Hell Is
Us, Cronos, Expedition 33 ship `libxess_fg.dll`), and the proposal on the table is identity BY ELIMINATION,
labelled — see `20_OPEN_QUESTIONS` §H11's 2026-09-06 note.*
**Do not start here.** The three ffx-api leaves are hooked, the FidelityFX headers are vendored
at tag **`v2.3.0`** (not the `v1.1.4` step 1 below names — its own reversal condition fired:
+128
View File
@@ -1796,6 +1796,134 @@ one launch per capture, consent granted after launch. Exit codes and full report
(`NvAPI_NGX_GetNGXOverrideState`, by PID) and the probe that measures it before anything is
built on it.
- **2026-09-05 evening, the owner's run on #121 (the tag route) — eight captures, six titles, every one at DLSS**
**with frame generation on**, the first with the `Streamline tag census:` line. The pre-commitment in
`20_OPEN_QUESTIONS` §H5 landed on every title that goes through Streamline:
| Title / setting | `frame generation:` | Trio | Tag census (route: types) |
|---|---|---|---|
| **Hell Is Us**, DLSS + FG ×4 (twice) | **`DlssG`** | `38.5 → 154.04 (×4)`, `81.41 → 325.58 (×4)` | global: depth, mvec, hudless, ui-color-alpha, backbuffer, other |
| **Expedition 33**, DLSS + FG ×2 | **`DlssG`** | `75.95 → 149.83 (×1.97)` | global: same set |
| **Black Myth: Wukong**, DLSS + FG ×4 | **`DlssG`** | `47.99 → 191.89 (×4)` | global: depth, mvec, hudless, ui-color-alpha, backbuffer |
| **Rune Factory**, DLSS + FG ×4 | **`DlssG`** | `128.85 → 513.02 (×3.98)` | global: same as Hell Is Us |
| **Cyberpunk 2077**, DLSS + RR + MFG | **`DlssG`**, `upscaler: Dlss`, `1707x960 -> 2560x1440 = 1.5x (67%)` | **factor refused** — bucket 1 of 8 reads 3.0 against 1.67 overall; `tokens/batch 2.97` | global: depth, mvec, hudless, scaling-in, scaling-out, other (no UI tag) |
| **Dying Light: The Beast**, DLSS FG ×4 | N/A (`none` withheld, §H5) + *"it is FEEDING frame generation"* | `Presented FPS 67.13` | **frame** (`slSetTagForFrame`): depth, mvec, hudless, scaling-in, scaling-out, ui-color-alpha, other |
Three readings. **The identity is measured on six of six Streamline titles** — the UE Streamline plugin tags
the DLSS-G inputs globally (`slSetTag`) on every UE title, Cyberpunk on 2.7.1 tags globally too, DL:TB on 2.8
tags through `slSetTagForFrame` — so `Active (technology not identified)` is gone from every one of them,
and `upscaler: N/A` on the UE titles is now the ONLY NVIDIA gap (NGX-direct super-resolution, the NVAPI
probe's job). **DL:TB's 7a question is answered by the census, at no layout cost**: the title DOES tag
`kBufferTypeScalingInputColor`, through the 2.8 export, and `UpscalerParams` is still 0 of 4030 — so the tag
carries neither an extent nor a Resource size, which is exactly the shape #116 named and could not see; the
`N/A` there is the title's truth. **Cyberpunk's refusal is the guard working**: `tokens/batch 2.97` with
`presents/batch 4.97` and bucket 1 at 3.0 is a session whose state changed after the first eighth — tokens
kept flowing while Ray Reconstruction stopped being evaluated, which is what a menu or a pause does — and the
report refused the session-level number rather than averaging two configurations (the 2026-08-16 alt-tab
lesson). The owner's settings for that run are recorded when known; the earlier 14:01 run at MFG ×3 read
`×2.98` with `tokens/batch 1.00` on the same title.
- **2026-09-05 night, the owner's run on #124 (the DXGI present counter) — DL:TB twice, Hell Is Us, and a
new title, the Onimusha: Way of the Sword demo on Streamline 2.10.3.** `20_OPEN_QUESTIONS` §H5 row
P1-DXGI landed on the first title and both controls read zero:
| Title / Streamline | Trio or Presented | `DXGI present counter:` | `frame generation:` |
|---|---|---|---|
| **Dying Light: The Beast**, 2.8.0, DLSS FG ×4 (21:56) | `Presented FPS 69.99` (withheld) | `unseen=12204 over samples=4136 (2.95)` | N/A (withheld) + *FEEDING* |
| **Dying Light: The Beast**, 2.8.0, DLSS FG ×4 (22:06) | `Presented FPS 73.19` (withheld) | `unseen=12741 over samples=4392 (2.90)` | same |
| **Hell Is Us**, 2.7.3, DLSS + FG ×4 | `79.89 → 308.14 (×3.86)` | `unseen=0 over samples=18207` | `DlssG` |
| **Onimusha: Way of the Sword demo**, **2.10.3**, DLSS + FG | `60.04 → 220.33 (×3.67)` | `unseen=0 over samples=12914` | `DlssG`, `upscaler: Dlss`, RT Yes (27.1 %) |
The 2.8.0 pacer presents on the hooked chain through a body the inline patches do not cover; 2.7.3 and
2.10.3 present through the body they do. The owner's "`sl.interposer.dll` + `sl.common.dll` must be
loaded on ≥ 2.8" lead is closed by the 2.10.3 title: it injects, tags on the frame route (`depth, mvec,
hudless, scaling-in, scaling-out, ui-color-alpha, backbuffer, other`) and counts like 2.7. Onimusha's
`render -> output: N/A` with `UpscalerParams 0/13014` is DL:TB's shape again — the frame-route tags carry
no size on D3D12, where `sl::Resource` declares none. The PR after #124 turns the 2.8.0 reading into a
DXGI-COUNTED Displayed (`03_METRICS` §Displayed may be DXGI-COUNTED).
- **2026-09-06 morning, the owner's run on #125 — DL:TB three times (frame generation on, then off twice)
and Expedition 33 with frame generation off.** The promotion landed and §H5's Leg 0 answered:
| Title / setting | Line | `DXGI present counter:` | `frame generation:` |
|---|---|---|---|
| **Dying Light: The Beast**, DLSS FG ×4 (07:31) | `Native FPS: 70.52 -> Displayed FPS: 282.08 (x4 FG) over 16516 present(s)` + *Displayed is DXGI-COUNTED: 12387* | `unseen=12483 over samples=4202 (2.97)` | **`DlssG`** |
| **Dying Light: The Beast**, DLSS, FG **off** (07:45) | `Presented FPS 75.52` (withheld) | `unseen=0 over samples=4519` | N/A (withheld) — census still `0x25F0F`, tags `0x23600` (no hudless / UI) |
| **Dying Light: The Beast**, DLSS, FG **off** (07:55) | `Presented FPS 61.14` (withheld) | `unseen=0 over samples=3659` | same |
| **Expedition 33**, FG off (Streamline 2.7.30) | `FPS: 85.86` | `unseen=0 over samples=5063` | `none` by count; tag census `0x0` |
Two readings. **The trio is printed on the title that could not print it**, from a count DXGI made
(12,387 presents this hook never timed), and it is the number the owner's own counter showed (~300 at
×4 against ~75 native). **Leg 0: `sl.dlss_g.dll` is a startup-time load** — the census cannot tell FG
off from FG on, exactly the cost the gate pre-committed — but the DXGI counter can (0 unseen with FG
off, 2.9–3.0 with it on), so the gate is narrowed to sessions where the counter was not read, and the
two FG-off captures above print `none` with DXGI's agreement on the next build. Also visible: with FG
off DL:TB sends no hudless / UI tag and the UE plugin sends no tags at all, so the DLSS-G identity is
per-setting on both.
- **2026-09-06, 09:20–09:35, the NVAPI probe against three running titles (`fl-probe-nvapi --ngx-state
<pid>`, driver 616.64), each beside a capture on the #126 build.** The question §H5 opened on 2026-09-05 —
are the driver's per-process NGX feedback bits populated without an NVIDIA-app override? — is answered
YES for super resolution and NO for frame generation:
| Title / override / capture beside it | SR | RR | FG | `scalingRatio` / `performanceMode` / `renderPreset` / `frameGenerationCount` |
|---|---|---|---|---|
| **Hell Is Us**, no override, `83.21 → 332.82 (×4 FG)` `DlssG`, `upscaler: N/A` | `0x80605` CREATED EVALUATE (+ INITIALIZED DLL_EXISTS ERR_NOT_FOUND) | INITIALIZED DLL_EXISTS ERR_NOT_FOUND | `0x5` INITIALIZED DLL_EXISTS only | 0 / 0 / 0 / 0 |
| **Expedition 33**, override ON, FG off, `FPS: 79.4` `none` (DXGI agrees), `upscaler: N/A` | `0x8067F` CREATED EVALUATE ENABLED DLL_LOADED DLL_SELECTED PRESET PERF_MODE (+ …) | INITIALIZED DLL_EXISTS ERR_NOT_FOUND | `0x1F` INITIALIZED ENABLED DLL_EXISTS DLL_LOADED DLL_SELECTED | 0 / 2 / 11 / 0 |
| **Lies of P**, no override, `Presented FPS 59.89`, `upscaler: N/A` | `0x605` CREATED EVALUATE (+ INITIALIZED DLL_EXISTS) | INITIALIZED ERR_FAILED ERR_NOT_FOUND | INITIALIZED ERR_FAILED ERR_NOT_FOUND | 0 / 0 / 0 / 0 |
The SR word carries the identity the hooks cannot see on these three titles; the FG word does not see
DLSS-G running at ×4 (it tracks the override machinery's DLL, not the plugin), `frameGenerationCount` is
the override target and not the multiplier, and `scalingRatio` is 0 even under the override. §H5 carries
what a driver-reported rung may and may not claim, and the negative still owed (DLSS off in the menu).
Also on this run: Expedition 33 with FG off now prints `none` with *DXGI's own present counter agrees:
0 unseen over 4774* (#126), and Lies of P's `Presented FPS` keeps its "MAY include generated frames"
qualifier because `amd_fidelityfx_dx12.dll` is loaded there — the census cannot say `none` and the
token count is 0 on that title, so that line is right as printed.
- **2026-09-06, 10:39–11:36, the owner's run on #128 (the driver-reported rung) — §H5 rows N1–N4 and one
correction.** The standalone probe first: Lies of P with upscaling OFF reads `SR 0x5` (CREATED clear), with
DLSS on `0x605` — N3 keeps the rung. Then the captures:
| Title / setting | `upscaler:` | `NVIDIA driver NGX state:` SR / RR / FG | FG line |
|---|---|---|---|
| **Lies of P**, DLSS (no override) | **`Dlss (driver-reported: …)`** | `0x605` / `0x90001` / `0x90001` | N/A (no FG in this title) |
| **Expedition 33**, override ON, FG off | **`Dlss (driver-reported: …)`** | `0x8067F` (mode 2, preset 11) / `0x80005` / `0x1F` | `none`, DXGI agrees |
| **Hell Is Us**, DLSS + FG ×4 | **`Dlss (driver-reported: …)`** | `0x80605` / `0x80005` / **`0x605`** (CHANGED between readings) | `81.32 → 321.73 (×3.96)`, `DlssG` |
| **Onimusha demo**, SL 2.10.3, DLSS + FG | `Dlss — the NVIDIA driver agrees` | `0x605` / `0x5` / **`0x605`** (CHANGED) | `59.99 → 235.47 (×3.93)`, `DlssG` |
| **Dying Light: The Beast**, DLSS + FG ×4 | `Dlss — the NVIDIA driver agrees` | `0x605` / `0x90001` / **`0x605`** (CHANGED) | `39.63 → 158.5 (×4)` DXGI-COUNTED, `DlssG` |
| **Cronos: The New Dawn demo** (new; UE, **SL 2.8.0**), DLSS, FG off | **`Dlss (driver-reported: …)`** | `0x80605` / `0x80005` / `0x5` | `FPS 105.01`, `none`, DXGI agrees; RT Yes |
| **Dying Light: The Beast**, **FSR upscaling + DLSS FG** | `FSR (3.1 or 4 …)`, `2560x1440 -> 2560x1440` | **`0x205`** (CREATED, not EVALUATE) / `0x90001` / `0x605` | `DlssG` from the tags; factor REFUSED (bucket 8 of 8 at 1.96 vs 2.85); DXGI 1.80 unseen / present |
Three readings. **The rung works as written and its negative held.** **The FG word is not blind** — the
morning's Hell Is Us reading was taken before the feature came up, and every ×4 session's loop readings
show `CREATED | EVALUATE` with the word changing mid-session; the multiplier bits never set, so it is an
identity witness and is now printed beside `frame generation:`. **`SR 0x205` on the FSR session is the
word telling the truth finely**: DLSS was created at some point (the title initialises it) and not
evaluated, and the rung's two-bit key keeps it from claiming DLSS beside FSR. The FSR + DLSS-G session
also exposed a wrong qualifier ("no evaluation was observed" beside 4,415 tokens and a refused factor),
fixed the same day. Cronos is a second Streamline 2.8.0 title; its FG-on capture is the one that says
whether the pacer bypass measured on DL:TB belongs to SDK 2.8.0 or to that title.
- **2026-09-06, 12:17, Cronos: The New Dawn demo with frame generation ON — the row that closed §H5's
DLSS / DLSS-G question.** Streamline 2.8.0, UE: `Native FPS: 86.8 -> Displayed FPS: 172.72 (x1.99 FG)`
over 9,948 presents, `unseen=0 over samples=10063`, tag census `frame=[depth, mvec, hudless,
ui-color-alpha, backbuffer, other]`, `frame generation: DlssG — the NVIDIA driver agrees`, `upscaler: Dlss
(driver-reported)`, RT Yes. The 2.8.0 SDK presents its generated frames through the body the inline
patches cover; the bypass measured on Dying Light: The Beast is that title's integration. With this row
every measured NVIDIA title prints the rule-6 trio or a counted `none`, and the owner closed the item.
- **2026-09-06, 12:46, Lies of P at FSR 3.1 + FSR frame generation, on the #129 build — §H11 row A1 again,
now with every witness on the page.** `upscaler: Fsr3`, `render -> output: 2560x1440 -> 2560x1440 = 1x` on
3,538 records, `frame generation: FsrFg`, `Native FPS: 59.77 -> Displayed FPS: 119.55 (x2 FG)` over 7,042
presents; the ffx census `upscale-drained=3518 fg-dispatch-drained=3518 frames=3520`, `presents/frame=2.00`,
`frames/upscale-drained=1.00`; `DXGI present counter: unseen=0 over samples=7096` (the FSR 3.1 pacer presents
through the patched body); the NVIDIA driver's word `SR 0x5` / `FG 0x90001` — nothing created, so the
driver-reported rung correctly says nothing beside an AMD identity. The census names only
`amd_fidelityfx_dx12.dll` (the 3.1 monolith Lies of P calls) — the AMD half of 7c is complete on its oracle.
Same run, Rune Factory at DLSS + FG ×4: `125.45 → 498.51 (×3.97)`, `Dlss (driver-reported)`, `DlssG` with the
driver agreeing — the 7b title on its NVIDIA path.
## 10 · Telemetry layering
- L1 baseline vendor-neutral:
@@ -30,7 +30,8 @@ internal sealed class CaptureLoop(
Func<int, ITargetLiveness?> liveness,
Func<int, (ICaptureSink? Sink, ShmAttachRefusal Refusal)> attach,
CaptureOptions options,
Func<int, RuntimeModuleSet>? modules = null)
Func<int, RuntimeModuleSet>? modules = null,
Func<int, NgxDriverState>? ngx = null)
{
/// <summary>Start one session, or say why not.</summary>
/// <remarks>
@@ -160,13 +161,15 @@ internal sealed class CaptureLoop(
var records = new List<FlFrameRecord>();
var gaps = new List<ulong>();
var focus = new FocusTally();
var loaded = new ModuleTally(modules);
var loaded = new ModuleTally(modules, ngx);
SessionEndReason end = await SuperviseAsync(pid, alive, sink, supervisor, records, gaps, focus, loaded, ct)
.ConfigureAwait(false);
return new CaptureResult
{
RuntimeModules = loaded.Set,
NgxDriver = loaded.Ngx,
TouchQpc = loaded.TouchQpc,
Reason = end,
Verdict = verdict,
AttachRefusal = ShmAttachRefusal.Ok,
@@ -296,17 +299,37 @@ internal sealed class CaptureLoop(
return mayContinue;
}
/// <summary>Accumulates module snapshots; a loop built without a source takes none.</summary>
private sealed class ModuleTally(Func<int, RuntimeModuleSet>? source)
/// <summary>
/// Accumulates module snapshots and the driver's NGX word; a loop built without a source takes none.
/// The NGX probe rides on the same touch as the snapshot: out of process, and the moment a title that
/// enabled DLSS from its menu is caught by the next scan, exactly as a late-loading module is.
/// </summary>
private sealed class ModuleTally(Func<int, RuntimeModuleSet>? source, Func<int, NgxDriverState>? ngxSource)
{
public RuntimeModuleSet Set { get; private set; } = RuntimeModuleSet.Empty;
public NgxDriverState Ngx { get; private set; } = NgxDriverState.NotRun;
/// <summary>
/// When this host touched the target — a guard scan just completed, and the module snapshot
/// is about to run — as QPC ticks (<see cref="System.Diagnostics.Stopwatch.GetTimestamp"/> is
/// QueryPerformanceCounter on Windows, the clock the records carry). Recorded whether or not a
/// snapshot source exists, because it is the stall diagnostic's alibi, not the snapshot's.
/// </summary>
public List<long> TouchQpc { get; } = [];
public void Take(int pid)
{
TouchQpc.Add(System.Diagnostics.Stopwatch.GetTimestamp());
if (source is not null)
{
Set = Set.Merge(source(pid));
}
if (ngxSource is not null)
{
Ngx = Ngx.Merge(ngxSource(pid));
}
}
}
@@ -52,4 +52,17 @@ internal sealed record CaptureResult
/// had no snapshot source.
/// </summary>
public RuntimeModuleSet RuntimeModules { get; init; } = RuntimeModuleSet.Empty;
/// <summary>
/// The NVIDIA driver's per-process NGX word, probed out of process beside each module snapshot and merged.
/// <see cref="NgxDriverState.NotRun"/> when the loop had no probe.
/// </summary>
public NgxDriverState NgxDriver { get; init; } = NgxDriverState.NotRun;
/// <summary>
/// QPC timestamps of every moment this host touched the target's process — a guard scan
/// completing, followed by the module snapshot — in the records' own clock, so a stall in the
/// frame stream can be checked against what FrameLedger itself was doing at that moment.
/// </summary>
public IReadOnlyList<long> TouchQpc { get; init; } = [];
}
@@ -0,0 +1,66 @@
using System.ComponentModel;
using System.Diagnostics;
using FrameLedger.CaptureHost.Consume;
namespace FrameLedger.CaptureHost.Capture;
/// <summary>
/// Runs <c>fl-probe-nvapi --ngx-state &lt;pid&gt;</c> beside this host and parses its machine line.
/// </summary>
/// <remarks>
/// <para>
/// <b>Out of process, on purpose.</b> The probe links <c>nvapi64.lib</c> (MIT, vendored) and asks the driver about
/// a pid; nothing is injected, nothing in the target is touched, no consent is involved. Spawning the tool this
/// repo already builds keeps the native layer reachable only through what is already there (CLAUDE.md: no
/// P/Invoke outside <c>Infrastructure</c>) — the day the shipped Agent wants this fact, it goes through
/// <c>Infrastructure</c> as a native call, not through a child process.
/// </para>
/// <para>
/// The probe is staged beside the host by the project file the way the Overlay payload is; a missing binary is
/// an outcome the report prints, never an exception the loop sees.
/// </para>
/// </remarks>
internal static class NgxDriverProbe
{
private const string _probeFileName = "fl-probe-nvapi.exe";
private static readonly TimeSpan _budget = TimeSpan.FromSeconds(5);
public static string ProbePath => Path.Combine(AppContext.BaseDirectory, _probeFileName);
public static NgxDriverState Run(int pid) => Run(pid, ProbePath);
public static NgxDriverState Run(int pid, string probePath)
{
if (!File.Exists(probePath))
{
return NgxDriverState.Of(NgxProbeOutcome.ProbeMissing, probePath);
}
try
{
using var probe = new Process();
probe.StartInfo = new ProcessStartInfo(probePath)
{
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
};
probe.StartInfo.ArgumentList.Add("--ngx-state");
probe.StartInfo.ArgumentList.Add(pid.ToString(System.Globalization.CultureInfo.InvariantCulture));
probe.Start();
string output = probe.StandardOutput.ReadToEnd();
if (!probe.WaitForExit((int)_budget.TotalMilliseconds))
{
probe.Kill();
return NgxDriverState.Of(NgxProbeOutcome.ProbeFailed, "the probe did not exit within " + _budget.TotalSeconds + " s");
}
return NgxDriverState.Parse(output);
}
catch (Exception e) when (e is Win32Exception or InvalidOperationException or IOException)
{
return NgxDriverState.Of(NgxProbeOutcome.ProbeFailed, e.Message);
}
}
}
+105 -11
View File
@@ -61,6 +61,30 @@ internal sealed record FgWindow
/// <summary>Records whose count hit the byte's ceiling.</summary>
public required int Saturated { get; init; }
/// <summary>
/// Σ <c>dxgiUnseen</c> over the records that claim <see cref="FlMeasured.DxgiPresents"/>: presents DXGI
/// counted on the hooked chain that this hook never saw. 0 on every title measured except Dying Light:
/// The Beast on Streamline 2.8.0, where it is ≈ 3 × <see cref="Presents"/> at DLSS FG ×4 (§H5 row P1-DXGI).
/// </summary>
public required long DxgiUnseen { get; init; }
/// <summary>Records claiming <see cref="FlMeasured.DxgiPresents"/> — the byte's own denominator.</summary>
public required int DxgiClaiming { get; init; }
/// <summary>Records whose <c>dxgiUnseen</c> hit 255, the saturation sentinel; any means a refusal.</summary>
public required int DxgiSaturated { get; init; }
/// <summary>
/// The presents the window counts as DISPLAYED: the ones this hook timed plus the ones DXGI counted on the
/// same chain and this hook never saw. Equal to <see cref="Presents"/> on every title where DXGI and the hook
/// agree, and the numerator of <see cref="Factor"/>, <see cref="DisplayedFps"/> and
/// <see cref="PresentsPerBatch"/> — never of a frame-time distribution, which has no timestamps for them.
/// </summary>
public long DisplayedPresents => Presents + DxgiUnseen;
/// <summary>True when Displayed is a count DXGI made rather than this hook — the report must say so.</summary>
public bool DxgiCounted => DxgiUnseen > 0;
/// <summary>How many records carried 0, 1, 2 … evaluations. Index is the value.</summary>
public required IReadOnlyList<int> Histogram { get; init; }
@@ -86,11 +110,11 @@ internal sealed record FgWindow
/// <summary><c>presents / Σ evaluations</c>, or null.</summary>
public double? Factor =>
Refusal is null && Evaluations > 0 ? Presents / (double)Evaluations : null;
Refusal is null && Evaluations > 0 ? DisplayedPresents / (double)Evaluations : null;
/// <summary><c>F_disp</c> over this window's own intervals.</summary>
public double? DisplayedFps =>
Refusal is null && Seconds > 0 && Presents > 1 ? (Presents - 1) / Seconds : null;
Refusal is null && Seconds > 0 && DisplayedPresents > 1 ? (DisplayedPresents - 1) / Seconds : null;
/// <summary><c>F_app</c>, counted rather than derived.</summary>
public double? NativeFps => Refusal is null && Seconds > 0 ? Evaluations / Seconds : null;
@@ -129,7 +153,7 @@ internal sealed record FgWindow
/// <see cref="BatchRefusal"/>; it is never published as <c>fg_factor</c>, and
/// <see cref="Factor"/> stays keyed on counted evaluations.
/// </remarks>
public double? PresentsPerBatch => Batches > 0 ? Presents / (double)Batches : null;
public double? PresentsPerBatch => Batches > 0 ? DisplayedPresents / (double)Batches : null;
/// <summary>
/// Why <see cref="PresentsPerBatch"/> may not be read as one configuration's number, or
@@ -178,6 +202,9 @@ internal sealed record FgWindow
Unidentified = 0,
Streams = 0,
Saturated = 0,
DxgiUnseen = 0,
DxgiClaiming = 0,
DxgiSaturated = 0,
Histogram = [],
BucketFactors = [],
BatchFactors = [],
@@ -205,6 +232,7 @@ internal sealed record FgWindow
int batches = 0;
int unidentified = 0;
int saturated = 0;
(long dxgiUnseen, int dxgiClaiming, int dxgiSaturated) = TallyDxgi(all, start);
for (int i = start; i < all.Count; i++)
{
@@ -242,6 +270,9 @@ internal sealed record FgWindow
Unidentified = unidentified,
Streams = streams.Count,
Saturated = saturated,
DxgiUnseen = dxgiUnseen,
DxgiClaiming = dxgiClaiming,
DxgiSaturated = dxgiSaturated,
Histogram = histogram,
BucketFactors = BucketsOf(all, start, EvaluationWeight),
BatchFactors = BucketsOf(all, start, BatchWeight),
@@ -249,6 +280,34 @@ internal sealed record FgWindow
};
}
/// <summary>
/// Σ <c>dxgiUnseen</c>, the records claiming it, and the ones at the 255 sentinel — the DXGI half of
/// the tally, in its own pass because it is its own measurement (<c>fl_shm.h</c> §dxgiUnseen).
/// </summary>
private static (long Unseen, int Claiming, int Saturated) TallyDxgi(IReadOnlyList<FlFrameRecord> all, int start)
{
long unseen = 0;
int claiming = 0;
int saturated = 0;
for (int i = start; i < all.Count; i++)
{
FlFrameRecord r = all[i];
if (!((FlMeasured)r.MeasuredMask).HasFlag(FlMeasured.DxgiPresents))
{
continue;
}
claiming++;
unseen += r.DxgiUnseen;
if (r.DxgiUnseen == byte.MaxValue)
{
saturated++;
}
}
return (unseen, claiming, saturated);
}
/// <summary>
/// Per-bucket <c>presents ÷ weight</c> in time order, or empty when the window is too
/// short. One slicing, two weights.
@@ -276,23 +335,53 @@ internal sealed record FgWindow
int lo = start + (int)((long)n * b / _buckets);
int hi = start + (int)((long)n * (b + 1) / _buckets);
long sigma = 0;
long displayed = 0;
for (int i = lo; i < hi; i++)
{
sigma += weight(all[i]);
displayed += 1 + Unseen(all[i]);
}
factors.Add(sigma > 0 ? (hi - lo) / (double)sigma : double.PositiveInfinity);
// The SAME numerator the window publishes: a DXGI-counted present belongs to the
// bucket of the hooked present that read it, so a session where the 2.8 pacer
// stopped mid-way fails uniformity exactly as one where tokens stopped would.
factors.Add(sigma > 0 ? displayed / (double)sigma : double.PositiveInfinity);
}
return factors;
}
/// <summary><c>dxgiUnseen</c> where the record claims it, else 0 — an unclaimed byte is nobody's count.</summary>
private static long Unseen(FlFrameRecord r) =>
((FlMeasured)r.MeasuredMask).HasFlag(FlMeasured.DxgiPresents) ? r.DxgiUnseen : 0L;
/// <summary>The first reason a factor may not be published, or null.</summary>
/// <remarks>
/// Ordered so the most specific cause is named. Every one of these is a number this
/// consumer would otherwise have printed as a measurement.
/// </remarks>
private static string? RefusalFor(FgWindow w)
{
if (RefusalForRecordSet(w) is string aboutTheRecords)
{
return aboutTheRecords;
}
if (w.Evaluations == 0)
{
return "no application-frame token was counted in the window (slGetNewFrameToken, or an ffx-api "
+ "PREPARE / UPSCALE dispatch) — a data gap, "
+ "and treating it as 'no frame generation' is how fg_factor becomes 1.0";
}
return RefusalForRatio(w);
}
/// <summary>
/// Facts about the record SET that refuse a factor before anything is divided: attribution, and the
/// two saturation sentinels.
/// </summary>
private static string? RefusalForRecordSet(FgWindow w)
{
// ATTRIBUTION FIRST, AND THE ORDER IS THE FIX. These two are facts about the record
// set and hold whether or not anything was counted — but they used to sit BELOW the
@@ -319,14 +408,19 @@ internal sealed record FgWindow
+ "saturation sentinel rather than a count — dividing by it would report a floor";
}
if (w.Evaluations == 0)
if (w.DxgiSaturated > 0)
{
return "no application-frame token was counted in the window (slGetNewFrameToken, or an ffx-api "
+ "PREPARE / UPSCALE dispatch) — a data gap, "
+ "and treating it as 'no frame generation' is how fg_factor becomes 1.0";
return $"{w.DxgiSaturated} record(s) hit the dxgiUnseen ceiling of 255, which is a saturation "
+ "sentinel rather than a count — DXGI counted more presents than the byte can carry";
}
string? nonUniform = NonUniform(w.BucketFactors, w.Presents / (double)w.Evaluations, w.Presents,
return null;
}
/// <summary>The refusals that need the ratio itself: uniformity, then the unnameable band.</summary>
private static string? RefusalForRatio(FgWindow w)
{
string? nonUniform = NonUniform(w.BucketFactors, w.DisplayedPresents / (double)w.Evaluations, w.Presents,
"the frame-generation state");
if (nonUniform is not null)
{
@@ -346,7 +440,7 @@ internal sealed record FgWindow
// What is still refused is the band between: a steady 1.05–1.5 is not a configuration
// any vendor ships, and a window that mixed states would usually have failed the
// uniformity check above. Naming it would be guessing.
double factor = w.Presents / (double)w.Evaluations;
double factor = w.DisplayedPresents / (double)w.Evaluations;
return factor > NoneCeiling && factor < ActiveThreshold
? $"presents/tokens = {factor.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)} sits "
+ $"between the `none` ceiling ({NoneCeiling.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)}) "
@@ -405,7 +499,7 @@ internal sealed record FgWindow
+ "so a batch belonging to one stream can be drained by another's present";
}
return NonUniform(w.BatchFactors, w.Presents / (double)w.Batches, w.Presents,
return NonUniform(w.BatchFactors, w.DisplayedPresents / (double)w.Batches, w.Presents,
"the presents-per-batch ratio");
}
@@ -124,13 +124,27 @@ internal sealed record MeasuredFacts
/// <b>And on the interposer's version, read from the file, ≥ 2.8.0.</b> A 2.7 title that loads the
/// plugin keeps <c>none</c> — it is what Cyberpunk would be if it loaded it. A plugin loaded beside
/// an interposer whose version could not be read is withheld with its own reason: an N/A over a
/// <c>none</c> this consumer cannot discriminate. <b>Interim, and its cost is pre-committed:</b> the
/// same title with frame generation OFF reads withheld too if the plugin is a startup-time load;
/// §H5's Leg 0 measures which, and the gate is withdrawn or narrowed on that reading.
/// <c>none</c> this consumer cannot discriminate.
/// </para>
/// <para>
/// <b>Narrowed 2026-09-06, on Leg 0.</b> The plugin IS a startup-time load on Dying Light: The Beast
/// (frame generation off, census unchanged, twice), so the cost paragraph's fear was measured true —
/// and the same morning's ×4 capture measured the discriminator the gate lacked: the 2.8.0 pacer's
/// generated presents are DXGI presents on the hooked chain (§H5 row P1-DXGI, 2.90–2.97 per hooked
/// present, <c>70.52 → 282.08 (×4)</c> counted through <c>dxgiUnseen</c>). So a counted 1.0 beside a
/// READ counter is what it says: DXGI itself counted no present this hook did not. <c>none</c> is
/// withheld on this shape only when the counter was not read at all.
/// </para>
/// </remarks>
public string? NoneWithheld { get; init; }
/// <summary>
/// What DXGI's own present counter said beside a counted <c>none</c>, or null when it was not read. On the
/// Streamline 2.8.0 shape this is the discriminator the gate lacked (Leg 0, 2026-09-06); on every other
/// title it is a second witness printed beside the count.
/// </summary>
public string? NoneBesideDxgi { get; init; }
/// <summary>The Streamline interposer's file version, when a module snapshot saw it.</summary>
public Version? InterposerVersion { get; init; }
@@ -139,6 +153,22 @@ internal sealed record MeasuredFacts
/// </summary>
public uint SlTagCensus { get; init; }
/// <summary>
/// <see cref="FlWriterState.DxgiPresentsUnseen"/>: presents DXGI's own counter recorded on the hooked chain(s)
/// between two consecutive hooked presents, beyond the one the hook saw.
/// </summary>
public uint DxgiPresentsUnseen { get; init; }
/// <summary><see cref="FlWriterState.DxgiPresentSamples"/>: hooked presents on which DXGI's counter was read.</summary>
public uint DxgiPresentSamples { get; init; }
/// <summary>
/// Unseen presents per hooked present, or null before the counter was read. <c>0</c> means DXGI counted nothing this
/// hook did not; <c>≈ N−1</c> beside a withheld count is a frame-generation pacer presenting on the hooked chain
/// through a body the inline patches do not cover — i.e. the generated presents ARE DXGI presents.
/// </summary>
public double? DxgiUnseenPerHookedPresent => DxgiPresentSamples > 0 ? DxgiPresentsUnseen / (double)DxgiPresentSamples : null;
/// <summary>
/// The title tagged a HUD-less or UI buffer through Streamline on some route — the inputs only DLSS Frame
/// Generation consumes (DLSS-G programming guide §5.0). Identity, never a count: the title is FEEDING frame
@@ -160,6 +190,115 @@ internal sealed record MeasuredFacts
/// </remarks>
public bool UpscalerHookRan { get; init; }
/// <summary>The driver's per-process NGX word, merged over the session; <see cref="NgxDriverState.NotRun"/> without a probe.</summary>
public NgxDriverState NgxDriver { get; init; } = NgxDriverState.NotRun;
/// <summary>The string the <c>upscaler:</c> line carries when the identity is the driver's word and not a hook's.</summary>
public const string UpscalerDlssDriverReported =
"Dlss (driver-reported: the NVIDIA driver reports an NGX super-resolution feature created and evaluated in "
+ "this process - not counted by this hook; 03_METRICS §Upscaling, the driver-reported rung)";
/// <summary>
/// <c>03_METRICS</c> §Upscaling, the driver-reported rung (owner decision 2026-09-06): when NO hook named an
/// upscaler and the driver says an NGX super-resolution feature was created and evaluated in this process,
/// the identity is DLSS, attributed to the driver. Null whenever a hook answered, or the driver did not.
/// </summary>
/// <remarks>
/// Identity and nothing else. Measured 2026-09-06 on Hell Is Us, Expedition 33 and Lies of P: the bits are
/// set without an NVIDIA-app override; <c>scalingRatio</c> is 0 even with one; <c>performanceMode</c> and
/// <c>renderPreset</c> are the override's values; the FG word is blind to Streamline DLSS-G. So this may name
/// the vendor and the feature and may not state a quality, a ratio, a render size or a frame-generation mode.
/// The negative is owed: a title with DLSS switched off should read the bit clear, and until it is measured
/// this rung has only ever seen the positive — §H5 pre-commits its withdrawal if the bit stays set.
/// </remarks>
public string? UpscalerDriverReported => Upscaler is null && NgxDriver.SrCreatedAndEvaluated ? UpscalerDlssDriverReported : null;
/// <summary>The string <see cref="FgMode"/> carries when the count is active, no tag named the technology, and the driver did.</summary>
public const string FgDlssGDriverReported =
"DlssG (driver-reported: the NVIDIA driver reports an NGX frame-generation feature created and evaluated in this "
+ "process - the identity only; the count above is the record)";
/// <summary>
/// The FG line as printed: the resolved mode, promoted to <see cref="FgDlssGDriverReported"/> only on the one shape
/// where the count is active and no tag named the technology (<c>03_METRICS</c>: identity decides the name, the
/// count decides <c>none</c> — the driver's word is a second identity source, never a count).
/// </summary>
public string? FgModePrinted =>
string.Equals(FgMode, FgActiveUnidentified, StringComparison.Ordinal) && NgxDriver.FgCreatedAndEvaluated
? FgDlssGDriverReported
: FgMode;
/// <summary>
/// What the driver's FG word adds beside the FG line — agreement with a tagged DLSS-G, a disagreement printed
/// rather than resolved, or the bare fact beside a count that read <c>none</c> — or null when it says nothing.
/// </summary>
/// <remarks>
/// Corrected 2026-09-06 midday: the morning's reading called this word blind to Streamline DLSS-G; the captures
/// beside the loop read <c>CREATED | EVALUATE</c> on every ×4 session (Hell Is Us, Onimusha, DL:TB), the word
/// changing between readings as the feature came up. Identity only — the multiplier bits stay clear at ×4.
/// </remarks>
public string? FgDriverNote
{
get
{
if (NgxDriver.Outcome != NgxProbeOutcome.Answered)
{
return null;
}
bool created = NgxDriver.FgCreatedAndEvaluated;
bool dlssg = FgMode is not null && FgMode.StartsWith(nameof(FlFgMode.DlssG), StringComparison.Ordinal);
if (dlssg)
{
return created
? "the NVIDIA driver agrees: an NGX frame-generation feature was created and evaluated in this process"
: "WARNING: the NVIDIA driver reports NO NGX frame-generation feature created in this process while the "
+ "tags named DLSS-G - a disagreement, printed rather than resolved";
}
return created
? "the NVIDIA driver reports an NGX frame-generation feature created and evaluated in this process "
+ "(driver-reported identity; the count above is the record and is not changed by it)"
: null;
}
}
/// <summary>
/// What the driver's word adds beside a hook's identity — agreement, a disagreement printed rather than
/// resolved, or the driver's negative beside an N/A — or null when the driver did not answer.
/// </summary>
public string? UpscalerDriverNote
{
get
{
if (NgxDriver.Outcome != NgxProbeOutcome.Answered)
{
return null;
}
bool created = NgxDriver.SrCreatedAndEvaluated;
if (Upscaler is null)
{
return created
? null
: "the NVIDIA driver reports no NGX super-resolution feature created in this process (driver-reported; "
+ "it says nothing about FSR or XeSS)";
}
if (string.Equals(Upscaler, nameof(FlUpscaler.Dlss), StringComparison.Ordinal))
{
return created
? "the NVIDIA driver agrees: an NGX super-resolution feature was created and evaluated in this process"
: "WARNING: the NVIDIA driver reports NO NGX super-resolution feature created in this process while the "
+ "hook named DLSS - a disagreement, printed rather than resolved";
}
return created
? "the NVIDIA driver also reports an NGX super-resolution feature created and evaluated in this process"
: null;
}
}
/// <summary>Whether a hook capable of naming the frame-generation mode was live.</summary>
public bool FgHookRan { get; init; }
@@ -242,7 +381,8 @@ internal sealed record MeasuredFacts
/// overstates the factor. <see cref="FgWindow"/> owns that decision and its refusals.
/// </remarks>
public static MeasuredFacts From(IReadOnlyList<FlFrameRecord> stream, FlWriterState writer,
long qpcFrequency, long totalGaps, long totalDropped, FgWindow? fg = null, RuntimeModuleSet? modules = null)
long qpcFrequency, long totalGaps, long totalDropped, FgWindow? fg = null, RuntimeModuleSet? modules = null,
NgxDriverState? ngx = null)
{
ArgumentNullException.ThrowIfNull(stream);
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(qpcFrequency);
@@ -260,7 +400,7 @@ internal sealed record MeasuredFacts
int violations = stream.Count(r => !IsHonest(r, entitled));
var census = (FlRuntimeCensus)writer.RuntimeCensus;
string? withheld = fg?.IsNone == true ? WithholdNone(census, modules) : null;
string? withheld = fg?.IsNone == true ? WithholdNone(census, modules, writer) : null;
return new MeasuredFacts
{
@@ -270,8 +410,11 @@ internal sealed record MeasuredFacts
Fg = fg,
FgMode = ResolveFgMode(FgModeOf(stream), fg, withheld),
NoneWithheld = withheld,
NoneBesideDxgi = fg?.IsNone == true && withheld is null ? DxgiBesideNone(writer) : null,
InterposerVersion = modules?.VersionOf(_slInterposerFileName),
SlTagCensus = writer.SlTagCensus,
DxgiPresentsUnseen = writer.DxgiPresentsUnseen,
DxgiPresentSamples = writer.DxgiPresentSamples,
UpscalerHookRan = RecordWindow.ClaimedSuffixStart(
stream, static r => ((FlMeasured)r.MeasuredMask).HasFlag(FlMeasured.Upscaler)) < stream.Count,
FgHookRan = RecordWindow.ClaimedSuffixStart(
@@ -280,6 +423,7 @@ internal sealed record MeasuredFacts
Extent = UpscaleExtent.From(stream),
Upscaler = UpscalerOf(stream),
NgxDriver = ngx ?? NgxDriverState.NotRun,
RayTracing = RayTracingOf(stream, writer),
RayReconstruction = RayReconstructionOf(stream),
Hdr = HdrOf(stream),
@@ -325,7 +469,7 @@ internal sealed record MeasuredFacts
var allowed = FlMeasured.None;
if (hooks.HasFlag(FlHookFamily.Present))
{
allowed |= FlMeasured.OutputRes | FlMeasured.PresentArgs;
allowed |= FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.DxgiPresents;
}
if (hooks.HasFlag(FlHookFamily.UpscalerIdentity))
@@ -396,6 +540,13 @@ internal sealed record MeasuredFacts
return false;
}
// dxgiUnseen has no in-band sentinel either — 0 is DXGI agreeing with the hook — so a
// value under a clear bit is the same defect as an unclaimed count.
if (!mask.HasFlag(FlMeasured.DxgiPresents) && r.DxgiUnseen != 0)
{
return false;
}
// fgEvaluations has no in-band sentinel — 0 is a real count — so only the mask bit
// can say whether anyone counted. Added here to keep this in step with the native
// twin in guard_test.cpp, which HANDOFF item 3 will make load-bearing.
@@ -462,26 +613,57 @@ internal sealed record MeasuredFacts
/// The one shape on which a counted 1.0 may not be published as <c>none</c> — see
/// <see cref="NoneWithheld"/> for the measurement and the choice of key.
/// </summary>
private static string? WithholdNone(FlRuntimeCensus census, RuntimeModuleSet? modules)
private static string? WithholdNone(FlRuntimeCensus census, RuntimeModuleSet? modules, FlWriterState writer)
{
if (!census.HasFlag(FlRuntimeCensus.Ran) || !census.HasFlag(FlRuntimeCensus.SlDlssG))
{
return null;
}
// THE DISCRIMINATOR, since Leg 0 (2026-09-06): DXGI's own counter on the hooked chain. The
// 2.8.0 pacer's generated presents ARE DXGI presents there (§H5 row P1-DXGI), so a counter that
// was read and saw nothing unseen is DXGI saying what the count says. A counter that was read
// and DID see presents while the count still sits at 1.0 is a contradiction between two words
// of the same writer — the records should have carried them — and is refused as such.
if (writer.DxgiPresentSamples > 0)
{
return writer.DxgiPresentsUnseen == 0
? null
: $"DXGI's present counter read {writer.DxgiPresentsUnseen} present(s) this hook never saw over "
+ $"{writer.DxgiPresentSamples} hooked present(s) while the records carry none of them — the writer "
+ "state and the records disagree, and neither may be read as `none`";
}
const string notRead = "DXGI's present counter was not read this session, and on Streamline 2.8.0 the DLSS-G "
+ "pacer's generated presents are DXGI presents this hook never sees (20_OPEN_QUESTIONS "
+ "§H5 row P1-DXGI), so a 1.0 cannot be told from generation";
Version? v = modules?.VersionOf(_slInterposerFileName);
if (v is null)
{
return "sl.dlss_g.dll (Streamline's DLSS Frame Generation plugin) is loaded and sl.interposer.dll's file "
+ "version could not be read, so the discriminator 20_OPEN_QUESTIONS §H5 names is missing";
return "sl.dlss_g.dll (Streamline's DLSS Frame Generation plugin) is loaded, sl.interposer.dll's file "
+ "version could not be read, and " + notRead;
}
return v >= StreamlineNoneWithheldFrom
? $"sl.dlss_g.dll (Streamline's DLSS Frame Generation plugin) is loaded on sl.interposer.dll {v}, the shape "
+ "Dying Light: The Beast measured five times with the title's frame generation ON while presents = tokens"
? $"sl.dlss_g.dll (Streamline's DLSS Frame Generation plugin) is loaded on sl.interposer.dll {v}; " + notRead
: null;
}
/// <summary>DXGI's counter as a second witness beside a counted <c>none</c>; null when it was not read.</summary>
private static string? DxgiBesideNone(FlWriterState writer)
{
if (writer.DxgiPresentSamples == 0)
{
return null;
}
string samples = writer.DxgiPresentSamples.ToString(System.Globalization.CultureInfo.InvariantCulture);
return writer.DxgiPresentsUnseen == 0
? $"DXGI's own present counter agrees: 0 unseen over {samples} hooked present(s)"
: $"DXGI's own present counter read {writer.DxgiPresentsUnseen.ToString(System.Globalization.CultureInfo.InvariantCulture)} "
+ $"unseen over {samples} hooked present(s), inside the `none` ceiling";
}
/// <summary>Which frame-generation technology ran, or null. NEVER the string "none".</summary>
/// <remarks>
/// <c>03_METRICS</c>'s ladder ends "otherwise <c>fg_mode = none</c>", and rung 0 — added
@@ -0,0 +1,165 @@
using System.Globalization;
namespace FrameLedger.CaptureHost.Consume;
/// <summary>
/// The NVIDIA driver's own per-process NGX bookkeeping — <c>NvAPI_NGX_GetNGXOverrideState</c>, read out of
/// process by <c>fl-probe-nvapi --ngx-state</c> beside each module snapshot — merged over a session.
/// </summary>
/// <remarks>
/// <para>
/// <b>A driver-reported fact, and the report says so wherever it uses one.</b> It is neither a hooked argument
/// (CLAUDE.md rule 4) nor a static hint (<c>05_DETECTION</c>): the driver says a feature was created and
/// evaluated in this process, and this host repeats that with the attribution. What it may stand in for is
/// the super-resolution IDENTITY on a session where no hook saw an evaluation (<c>03_METRICS</c> §Upscaling,
/// the driver-reported rung, owner decision 2026-09-06). What it may not stand in for: a quality, a ratio, a
/// render size, a frame-generation mode or a multiplier — measured 2026-09-06 to be override fields or blind.
/// </para>
/// <para>
/// The last ANSWERED reading is the state; <see cref="Readings"/> counts probe runs, <see cref="Answered"/> the
/// ones the driver answered, and <see cref="Changed"/> whether two answered readings disagreed on a mask — a
/// title switching DLSS on mid-session would show as a change, and the report prints it rather than averaging.
/// </para>
/// </remarks>
internal sealed record NgxDriverState(
NgxProbeOutcome Outcome,
ulong Sr,
ulong Rr,
ulong Fg,
double ScalingRatio,
uint PerformanceMode,
uint RenderPreset,
uint FgCount,
uint FgPreset,
uint FgMode,
uint Driver,
int Readings,
int Answered,
bool Changed,
string? Detail)
{
/// <summary>The loop was built without a probe.</summary>
public static readonly NgxDriverState NotRun = new(NgxProbeOutcome.NotRun, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false, null);
/// <summary>The one reading this host acts on: the driver says an NGX super-resolution feature ran here.</summary>
public bool SrCreatedAndEvaluated =>
Outcome == NgxProbeOutcome.Answered && (Sr & NgxOverrideFlags.CreatedAndEvaluated) == NgxOverrideFlags.CreatedAndEvaluated;
/// <summary>The driver says an NGX frame-generation feature ran here — an IDENTITY witness, never a count.</summary>
public bool FgCreatedAndEvaluated =>
Outcome == NgxProbeOutcome.Answered && (Fg & NgxOverrideFlags.CreatedAndEvaluated) == NgxOverrideFlags.CreatedAndEvaluated;
/// <summary>One outcome with no masks — a probe that did not answer, and why.</summary>
public static NgxDriverState Of(NgxProbeOutcome outcome, string? detail) =>
NotRun with { Outcome = outcome, Readings = 1, Detail = detail };
/// <summary>
/// The machine line the probe prints (<c>NGXSTATE status=… sr=0x… …</c>), or a <see cref="NgxProbeOutcome.ProbeFailed"/>
/// when nothing in <paramref name="output"/> is one. Every other line of the probe's output is for a human.
/// </summary>
public static NgxDriverState Parse(string output)
{
ArgumentNullException.ThrowIfNull(output);
foreach (string raw in output.Split('\n'))
{
string line = raw.Trim();
if (!line.StartsWith("NGXSTATE ", StringComparison.Ordinal))
{
continue;
}
Dictionary<string, string> kv = new(StringComparer.Ordinal);
foreach (string token in line.Split(' ', StringSplitOptions.RemoveEmptyEntries).Skip(1))
{
int eq = token.IndexOf('=', StringComparison.Ordinal);
if (eq > 0)
{
kv[token[..eq]] = token[(eq + 1)..];
}
}
return FromFields(kv, line);
}
return Of(NgxProbeOutcome.ProbeFailed, "the probe printed no NGXSTATE line");
}
private static NgxDriverState FromFields(Dictionary<string, string> kv, string line)
{
string status = kv.GetValueOrDefault("status", "");
if (string.Equals(status, "ANSWERED", StringComparison.Ordinal))
{
try
{
return new NgxDriverState(NgxProbeOutcome.Answered, Hex(kv["sr"]), Hex(kv["rr"]), Hex(kv["fg"]),
double.Parse(kv["ratio"], CultureInfo.InvariantCulture), U(kv["mode"]), U(kv["preset"]),
U(kv["fgcount"]), U(kv["fgpreset"]), U(kv["fgmode"]), U(kv["driver"]), 1, 1, false, null);
}
catch (Exception e) when (e is KeyNotFoundException or FormatException or OverflowException)
{
return Of(NgxProbeOutcome.ProbeFailed, "an NGXSTATE line this host could not read: " + line);
}
}
return status switch
{
"UNANSWERED" => Of(NgxProbeOutcome.Unanswered, "NvAPI " + kv.GetValueOrDefault("nvapi", "?")),
"DEGRADED" => Of(NgxProbeOutcome.Degraded, "NvAPI_Initialize " + kv.GetValueOrDefault("nvapi", "?")),
_ => Of(NgxProbeOutcome.ProbeFailed, "an NGXSTATE status this host does not know: " + status),
};
}
private static ulong Hex(string v) =>
ulong.Parse(v.StartsWith("0x", StringComparison.OrdinalIgnoreCase) ? v[2..] : v, NumberStyles.HexNumber,
CultureInfo.InvariantCulture);
private static uint U(string v) => uint.Parse(v, CultureInfo.InvariantCulture);
/// <summary>Fold a later reading in: an answered one becomes the state, any one counts.</summary>
public NgxDriverState Merge(NgxDriverState later)
{
ArgumentNullException.ThrowIfNull(later);
if (Outcome == NgxProbeOutcome.NotRun)
{
return later;
}
int readings = Readings + later.Readings;
int answered = Answered + later.Answered;
if (later.Outcome != NgxProbeOutcome.Answered)
{
// An earlier answer outranks a later silence: the driver's words do not expire, and a
// probe that failed once mid-session says nothing about what it had already read.
return Outcome == NgxProbeOutcome.Answered
? this with { Readings = readings }
: later with { Readings = readings, Answered = answered };
}
bool changed = Changed || (Outcome == NgxProbeOutcome.Answered && (Sr != later.Sr || Rr != later.Rr || Fg != later.Fg));
return later with { Readings = readings, Answered = answered, Changed = changed };
}
/// <summary>The report's line: the three words decoded, the override fields named as such, the caveats measured.</summary>
public string Describe()
{
string head = " NVIDIA driver NGX state (NvAPI_NGX_GetNGXOverrideState, out of process): ";
return Outcome switch
{
NgxProbeOutcome.NotRun => head + "not probed",
NgxProbeOutcome.ProbeMissing => head + "probe not found - " + Detail,
NgxProbeOutcome.ProbeFailed => head + "probe failed - " + Detail,
NgxProbeOutcome.Degraded => head + "no usable NVIDIA driver on this machine (" + Detail + ")",
NgxProbeOutcome.Unanswered => head + $"the driver did not answer for this process over {Readings} probe(s) ({Detail}) - "
+ "not an NVIDIA-rendered process, a driver older than R570, or the API refusing the caller",
_ => head + $"answered {Answered} of {Readings} probe(s){(Changed ? ", and the words CHANGED between readings" : "")}"
+ $"; driver {Driver / 100}.{Driver % 100:00}\n"
+ $" SR 0x{Sr:X} [{NgxOverrideFlags.Describe(Sr)}] RR 0x{Rr:X} [{NgxOverrideFlags.Describe(Rr)}] "
+ $"FG 0x{Fg:X} [{NgxOverrideFlags.Describe(Fg)}]\n"
+ $" override fields: scalingRatio={ScalingRatio.ToString("0.0000", CultureInfo.InvariantCulture)} "
+ $"performanceMode={PerformanceMode} renderPreset={RenderPreset} fgCount={FgCount} fgPreset={FgPreset} fgMode={FgMode} "
+ "- the OVERRIDE's values when an NVIDIA-app override is set, zero otherwise (measured 2026-09-06); "
+ "the SR and FG words name a feature the driver saw created and evaluated - identity, never a count or a multiplier "
+ "(FG_MODE / FG_MULTI_FRAME stay clear and fgCount is 0 at x4)",
};
}
}
@@ -0,0 +1,79 @@
namespace FrameLedger.CaptureHost.Consume;
/// <summary>
/// The bits of <c>NV_NGX_DLSS_OVERRIDE_BITFIELD</c> (vendored <c>nvapi.h</c>, R570+), as the driver reports them per
/// process through <c>NvAPI_NGX_GetNGXOverrideState</c>. Constants rather than a <c>[Flags]</c> enum because the
/// masks are 64-bit words the probe prints raw, and a word is what the parser keeps.
/// </summary>
/// <remarks>
/// <b>Measured 2026-09-06 (driver 616.64, <c>20_OPEN_QUESTIONS</c> §H5):</b> <see cref="Created"/> and
/// <see cref="Evaluate"/> on the super-resolution word are set for a process with NO NVIDIA-app override
/// (Hell Is Us, Lies of P), and CLEAR on Lies of P with upscaling switched off — the negative that keeps the rung.
/// <b>The frame-generation word follows DLSS-G too, once the feature exists</b> — the morning's
/// <see cref="Initialized"/> | <see cref="DllExists"/> on Hell Is Us was read before creation; the captures beside
/// the loop read <see cref="Created"/> | <see cref="Evaluate"/> on Hell Is Us, Onimusha and Dying Light: The Beast at
/// ×4, with the word CHANGING between the session's readings. <see cref="FgMode"/> and <see cref="FgMultiFrame"/>
/// stay clear at ×4 and <c>frameGenerationCount</c> is 0, so the word names the feature and never the multiplier.
/// </remarks>
internal static class NgxOverrideFlags
{
public const ulong Initialized = 1UL << 0;
public const ulong Enabled = 1UL << 1;
public const ulong DllExists = 1UL << 2;
public const ulong DllLoaded = 1UL << 3;
public const ulong DllSelected = 1UL << 4;
public const ulong Preset = 1UL << 5;
public const ulong PerfMode = 1UL << 6;
public const ulong ScalingRatio = 1UL << 7;
public const ulong OptimalSettings = 1UL << 8;
public const ulong Created = 1UL << 9;
public const ulong Evaluate = 1UL << 10;
public const ulong FgMode = 1UL << 13;
public const ulong SrDlaaMode = 1UL << 14;
public const ulong FgMultiFrame = 1UL << 15;
public const ulong ErrFailed = 1UL << 16;
public const ulong ErrDenied = 1UL << 17;
public const ulong ErrDrs = 1UL << 18;
public const ulong ErrNotFound = 1UL << 19;
public const ulong ErrDllLoad = 1UL << 20;
/// <summary>The two bits that together say "this feature ran in this process": created, and evaluated.</summary>
public const ulong CreatedAndEvaluated = Created | Evaluate;
private static readonly (ulong Bit, string Name)[] _names =
[
(Initialized, "INITIALIZED"), (Enabled, "ENABLED"), (DllExists, "DLL_EXISTS"), (DllLoaded, "DLL_LOADED"),
(DllSelected, "DLL_SELECTED"), (Preset, "PRESET"), (PerfMode, "PERF_MODE"), (ScalingRatio, "SCALING_RATIO"),
(OptimalSettings, "OPTIMAL_SETTINGS"), (Created, "CREATED"), (Evaluate, "EVALUATE"), (FgMode, "FG_MODE"),
(SrDlaaMode, "SR_DLAA_MODE"), (FgMultiFrame, "FG_MULTI_FRAME"), (ErrFailed, "ERR_FAILED"),
(ErrDenied, "ERR_DENIED"), (ErrDrs, "ERR_DRS"), (ErrNotFound, "ERR_NOT_FOUND"), (ErrDllLoad, "ERR_DLL_LOAD"),
];
/// <summary>The probe's own spelling of a word's bits, unknown bits printed as hex so nothing is dropped.</summary>
public static string Describe(ulong mask)
{
if (mask == 0)
{
return "-";
}
List<string> parts = [];
ulong seen = 0;
foreach ((ulong bit, string name) in _names)
{
if ((mask & bit) != 0)
{
parts.Add(name);
seen |= bit;
}
}
ulong unknown = mask & ~seen;
if (unknown != 0)
{
parts.Add("0x" + unknown.ToString("X", System.Globalization.CultureInfo.InvariantCulture));
}
return string.Join(' ', parts);
}
}
@@ -0,0 +1,23 @@
namespace FrameLedger.CaptureHost.Consume;
/// <summary>What one run of <c>fl-probe-nvapi --ngx-state</c> came back with.</summary>
internal enum NgxProbeOutcome
{
/// <summary>The loop was built without a probe, or the probe never ran.</summary>
NotRun,
/// <summary>The driver answered for this pid; the masks are the driver's.</summary>
Answered,
/// <summary>NvAPI answered but not for this pid: not NVIDIA-rendered, an old driver, or the API refusing the caller.</summary>
Unanswered,
/// <summary>No usable NVIDIA driver on this machine.</summary>
Degraded,
/// <summary>The probe binary was not beside this host.</summary>
ProbeMissing,
/// <summary>The probe could not be started, timed out, or printed nothing this host understands.</summary>
ProbeFailed,
}
@@ -46,7 +46,17 @@ internal static class SessionReport
sb.Append(" Native FPS: ").Append(Num(w.NativeFps))
.Append(" -> Displayed FPS: ").Append(Num(w.DisplayedFps))
.Append(" (x").Append(Num(w.Factor)).Append(" FG)")
.Append(" over ").Append(Count(w.Presents)).AppendLine(" present(s)");
.Append(" over ").Append(Count(w.DisplayedPresents)).AppendLine(" present(s)");
if (w.DxgiCounted)
{
// A COUNT DXGI MADE, NOT THIS HOOK, and the line says so before anyone reads the
// trio: those presents have no timestamps here, so they may stand in a rate and
// a factor and never in a frame-time distribution (03_METRICS §Counting).
sb.Append(" Displayed is DXGI-COUNTED: ").Append(Count(w.DxgiUnseen))
.Append(" of those present(s) were counted by IDXGISwapChain::GetLastPresentCount on the hooked ")
.Append("chain and never reached this hook (").Append(Count(w.Presents))
.AppendLine(" hooked) — a count DXGI made, not this hook; 20_OPEN_QUESTIONS §H5 row P1-DXGI");
}
}
else if (facts.Fg?.IsNone == true && facts.NoneWithheld is null)
{
@@ -58,13 +68,7 @@ internal static class SessionReport
// 1.00 five times while the title was generating (§H5 case 3), so that shape falls
// through to the Presented line and its qualifier says why. MeasuredFacts owns the
// decision; this branch only honours it.
FgWindow w = facts.Fg;
sb.Append(" FPS: ").Append(Num(w.NativeFps))
.Append(" over ").Append(Count(w.Presents)).AppendLine(" present(s)");
sb.Append(" frame generation: none — ").Append(Count(w.Evaluations))
.Append(" application frame(s) counted (slGetNewFrameToken, or an ffx-api PREPARE / UPSCALE dispatch) against ")
.Append(Count(w.Presents))
.AppendLine(" present(s); every present carried an application frame");
AppendNone(sb, facts.Fg, facts);
}
else
{
@@ -78,6 +82,18 @@ internal static class SessionReport
return sb.ToString().TrimEnd();
}
/// <summary>The bare number and the counted negative, with DXGI's counter beside it when it was read.</summary>
private static void AppendNone(StringBuilder sb, FgWindow w, MeasuredFacts facts)
{
sb.Append(" FPS: ").Append(Num(w.NativeFps))
.Append(" over ").Append(Count(w.Presents)).AppendLine(" present(s)");
sb.Append(" frame generation: none — ").Append(Count(w.Evaluations))
.Append(" application frame(s) counted (slGetNewFrameToken, or an ffx-api PREPARE / UPSCALE dispatch) against ")
.Append(Count(w.Presents))
.Append(" present(s); every present carried an application frame")
.AppendLine(facts.NoneBesideDxgi is string dxgi ? "; " + dxgi : "");
}
/// <summary>
/// PRESENTED FPS, the name for the one number that stands alone (03_METRICS §Core definitions,
/// 2026-09-03). Numerically it is Displayed FPS; the name changes because "Displayed" is half of
@@ -154,6 +170,22 @@ internal static class SessionReport
: "");
}
// A COUNTED SESSION WHOSE FACTOR WAS REFUSED is not "no evaluation was observed". Measured
// 2026-09-06 on DL:TB at FSR + DLSS-G: 4,415 tokens, 8,174 DXGI-counted presents, the tags naming
// DLSS-G, and the factor refused because the last bucket read 1.96 against 2.85 — and this line
// said a runtime was loaded and nothing was seen. The number is every hooked present over a
// session that held more than one configuration, and it is neither Native nor Displayed.
if (facts.Fg is { Refusal: not null, Evaluations: > 0 } counted)
{
return "WARNING: frame generation was counted (" + Count(counted.Evaluations) + " application-frame token(s)"
+ (counted.DxgiCounted
? ", and DXGI counted " + Count(counted.DxgiUnseen) + " present(s) this hook never saw, so the "
+ "Displayed rate is ABOVE this number"
: "")
+ ") and its factor is REFUSED — see `no FG factor` below — so this number is every hooked present "
+ "over a session that did not hold one configuration; read it as neither Native nor Displayed";
}
if (!facts.CensusRan)
{
return "frame generation: NOT measured, and the runtime census did not run — this number is presents, "
@@ -189,18 +221,33 @@ internal static class SessionReport
// can tell that apart from a title driving DLSS through a path we do not hook — Black Myth:
// Wukong loads sl.interposer.dll, runs DLSS-G, and calls it never — so the line names all
// three rather than picking the one that flatters the hook.
sb.Append(" upscaler: ").AppendLine(facts.Upscaler
// A hook's name first; else the driver's word, attributed (03_METRICS §Upscaling, the
// driver-reported rung); else the two N/As. The driver's note rides beside whichever printed.
sb.Append(" upscaler: ").Append(facts.Upscaler
?? facts.UpscalerDriverReported
?? (facts.UpscalerHookRan
? "N/A (an upscaler hook ran — Streamline's slEvaluateFeature and/or an ffx-api leaf's ffxDispatch — "
+ "and no evaluation this build decodes arrived: "
+ "upscaling is off in this title's settings, or it runs through a path this build does not "
+ "hook — measured on 3 of 5 Streamline titles — or a vendor this build does not decode)"
: NoHookRan("upscaler", facts.CensusRan, facts.UpscalerRuntimesLoaded)));
if (facts.UpscalerDriverNote is string driver)
{
sb.Append(" — ").Append(driver);
}
sb.AppendLine();
sb.Append(" render -> output: ").AppendLine(RenderToOutput(facts.Extent));
sb.Append(" frame generation: ").AppendLine(facts.FgMode
sb.Append(" frame generation: ").Append(facts.FgModePrinted
?? (facts.FgHookRan
? "N/A (a hook ran and saw no frame-generation evaluation — see the FG counts above)"
: NoHookRan("frame-generation", facts.CensusRan, facts.FgRuntimesLoaded)));
if (facts.FgDriverNote is string fgDriver)
{
sb.Append(" — ").Append(fgDriver);
}
sb.AppendLine();
sb.Append(" ray tracing: ").AppendLine(facts.RayTracing.ToString());
sb.Append(" ray reconstruction: ").AppendLine(facts.RayReconstruction.ToString());
sb.Append(" path tracing: ").AppendLine(facts.PathTracing.ToString());
@@ -246,6 +293,7 @@ internal static class SessionReport
// record 0 while this one starts after the lazy-install prefix — and the resulting rate
// moved across 78.6-83 on window choice alone, ten times the residual that draft quoted.
sb.Append(" FG counts: presents=").Append(Count(w.Presents))
.Append(" dxgi-unseen=").Append(Count(w.DxgiUnseen))
.Append(" batches=").Append(Count(w.Batches))
.Append(" tokens=").Append(Count(w.Evaluations))
.Append(" streams=").Append(Count(w.Streams))
@@ -0,0 +1,146 @@
using System.Globalization;
using System.Text;
using FrameLedger.Shared;
namespace FrameLedger.CaptureHost.Consume;
/// <summary>
/// The longest present-to-present intervals in a stream, each placed against the moments this host
/// touched the target — so "the game dropped to 1 FPS for a second" can be read as ours or not ours.
/// </summary>
/// <remarks>
/// <para>
/// <b>Why this exists.</b> The owner saw Cyberpunk 2077 fall to 1 FPS for about a second under capture
/// (2026-09-05) and the report had nothing to say about it: no frame-time statistic is computed by this
/// throwaway (P2's calculators own them), and nothing correlated a gap with what FrameLedger was doing.
/// FrameLedger touches the target at known moments — the guard's 30 s re-scan enumerates its modules,
/// and the module snapshot reads the same list beside it — and the records carry QPC, the same clock
/// <see cref="System.Diagnostics.Stopwatch.GetTimestamp"/> reads. So a stall can be placed: within a
/// touch window it is a suspect; far from every touch it is the title's own (a shader compile, a
/// level stream, a menu).
/// </para>
/// <para>
/// <b>Not a stutter metric.</b> <c>03_METRICS</c> defines stutter against a rolling median with edge
/// rules and a sufficiency floor, and this prints none of that. It prints the few longest raw
/// intervals and where they sit, which is a diagnostic, and it says so.
/// </para>
/// </remarks>
internal sealed record StallReport
{
/// <summary>One long interval: where it starts in the session, how long it is, and the nearest touch.</summary>
internal sealed record Stall(double AtSeconds, double Milliseconds, double? NearestTouchSeconds)
{
/// <summary>A touch inside the interval or within <see cref="TouchWindowSeconds"/> of it is a suspect.</summary>
public bool NearATouch => NearestTouchSeconds is double d && Math.Abs(d) <= TouchWindowSeconds;
}
/// <summary>How far a host touch may be from a stall and still be named beside it.</summary>
public const double TouchWindowSeconds = 1.0;
/// <summary>Intervals at or above this are counted as stalls — ten presents' worth at 100 FPS.</summary>
public const double StallThresholdMs = 100.0;
public required IReadOnlyList<Stall> Longest { get; init; }
public required int OverThreshold { get; init; }
public required int Intervals { get; init; }
public required int Touches { get; init; }
public static StallReport From(IReadOnlyList<FlFrameRecord> stream, long qpcFrequency, IReadOnlyList<long> touchQpc,
int keep = 3)
{
ArgumentNullException.ThrowIfNull(stream);
ArgumentNullException.ThrowIfNull(touchQpc);
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(qpcFrequency);
var stalls = new List<Stall>();
int over = 0;
int intervals = 0;
if (stream.Count > 1)
{
long origin = (long)stream[0].Qpc;
var candidates = new List<(long StartQpc, long DeltaQpc)>();
for (int i = 1; i < stream.Count; i++)
{
long delta = (long)stream[i].Qpc - (long)stream[i - 1].Qpc;
if (delta <= 0)
{
continue; // a torn or reordered record; the drain reports gaps separately
}
intervals++;
if (delta * 1000.0 / qpcFrequency >= StallThresholdMs)
{
over++;
}
candidates.Add(((long)stream[i - 1].Qpc, delta));
}
foreach ((long startQpc, long deltaQpc) in candidates.OrderByDescending(c => c.DeltaQpc).Take(keep))
{
double at = (startQpc - origin) / (double)qpcFrequency;
double ms = deltaQpc * 1000.0 / qpcFrequency;
double? nearest = null;
foreach (long t in touchQpc)
{
// Distance from the touch to the interval [start, start + delta]: 0 when inside.
double d = t < startQpc ? (t - startQpc) / (double)qpcFrequency
: t > startQpc + deltaQpc ? (t - (startQpc + deltaQpc)) / (double)qpcFrequency
: 0.0;
if (nearest is null || Math.Abs(d) < Math.Abs(nearest.Value))
{
nearest = d;
}
}
stalls.Add(new Stall(at, ms, nearest));
}
}
return new StallReport { Longest = stalls, OverThreshold = over, Intervals = intervals, Touches = touchQpc.Count };
}
/// <summary>The report lines. A diagnostic, and it names itself as one.</summary>
public string Describe()
{
if (Intervals == 0)
{
return " stalls: no interval to read (fewer than two presents)";
}
var sb = new StringBuilder();
sb.Append(" stalls (diagnostic, not 03_METRICS' stutter): ").Append(Num(OverThreshold))
.Append(" interval(s) of ").Append(Num(Intervals)).Append(" at or over ")
.Append(Ms(StallThresholdMs)).Append("; host touches (guard scan + module snapshot): ").Append(Num(Touches));
foreach (Stall s in Longest)
{
sb.AppendLine();
sb.Append(" longest: ").Append(Ms(s.Milliseconds)).Append(" at t=").Append(Sec(s.AtSeconds)).Append(" — ");
if (s.NearestTouchSeconds is not double d)
{
sb.Append("no host touch recorded");
}
else if (s.NearATouch)
{
sb.Append("A HOST TOUCH ").Append(d == 0 ? "INSIDE the interval" : (Math.Abs(d).ToString("0.00", CultureInfo.InvariantCulture) + " s "
+ (d < 0 ? "before" : "after") + " it"))
.Append(" — FrameLedger is a SUSPECT for this one; re-run with a longer --seconds and see whether it recurs on the 30 s cadence");
}
else
{
sb.Append("nearest host touch ").Append(Math.Abs(d).ToString("0.0", CultureInfo.InvariantCulture)).Append(" s away — not ours");
}
}
return sb.ToString();
}
private static string Num(long v) => v.ToString(CultureInfo.InvariantCulture);
private static string Ms(double v) => v.ToString("0.#", CultureInfo.InvariantCulture) + " ms";
private static string Sec(double v) => v.ToString("0.00", CultureInfo.InvariantCulture) + " s";
}
@@ -83,4 +83,21 @@
<Import Project="$(MSBuildThisFileDirectory)..\..\FrameLedger.Rules.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\..\FrameLedger.Overlay.targets" />
<!--
fl-probe-nvapi.exe beside the host, the way the Overlay is: NgxDriverProbe spawns it
by absolute path from AppContext.BaseDirectory and reports ProbeMissing rather than
searching. Warn-not-fail for the same reason the Overlay targets do: build.ps1 runs
the native build first. UNSHIPPED with this host; the Agent would call NVAPI through
Infrastructure, not a child process.
-->
<PropertyGroup>
<FlNativeProbeDir>$(MSBuildThisFileDirectory)..\..\build\native\x64-release\tools\fl-probe-nvapi\</FlNativeProbeDir>
</PropertyGroup>
<ItemGroup>
<None Include="$(FlNativeProbeDir)fl-probe-nvapi.exe" Condition="Exists('$(FlNativeProbeDir)fl-probe-nvapi.exe')">
<Link>fl-probe-nvapi.exe</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
+31 -2
View File
@@ -10,6 +10,7 @@
// flag on a shipped one.
using System.Diagnostics;
using System.Globalization;
using FrameLedger.Application.AntiCheat;
using FrameLedger.Application.Consent;
using FrameLedger.Application.Rules;
@@ -184,12 +185,15 @@ internal static class Program
FgWindow fg = FgWindow.From(result.Records, Stopwatch.Frequency);
MeasuredFacts facts = MeasuredFacts.From(
dominant, result.WriterState, Stopwatch.Frequency, result.TotalGaps, result.TotalDropped, fg,
result.RuntimeModules);
result.RuntimeModules, result.NgxDriver);
HostConsole.Line($" guard ticks published: {result.GuardTicksPublished}");
HostConsole.Line($" records: {result.Records.Count} ({dominant.Count} on the dominant stream), " +
$"{segments.Count} segment(s), gaps {result.TotalGaps}, dropped {result.TotalDropped}");
HostConsole.Line(FocusNote(result));
// The longest raw intervals, placed against the moments this host touched the target: the
// owner saw a one-second drop to 1 FPS under capture and nothing here could say whose it was.
HostConsole.Line(StallReport.From(dominant, Stopwatch.Frequency, result.TouchQpc).Describe());
// WHICH HOOKS THE WRITER ACTUALLY INSTALLED, and it is not cosmetic.
//
@@ -242,11 +246,35 @@ internal static class Program
$"fg=[{CensusNames.Describe(census & FlRuntimeCensusFamilies.Fg)}] " +
$"upscaler=[{CensusNames.Describe(census & FlRuntimeCensusFamilies.Upscaler)}]");
PrintRuntimeModules(result.RuntimeModules);
// The driver's own word on this process, out of process: the super-resolution identity the
// hooks cannot see on NGX-direct titles (03_METRICS §Upscaling, the driver-reported rung).
HostConsole.Line(result.NgxDriver.Describe());
// Which Streamline buffer types the title tagged, on which route: the identity half of
// frame generation (fl_shm.h §slTagCensus). A DLSS-G title tags hudless and UI every
// frame; a super-resolution-only title tags neither.
HostConsole.Line($" Streamline tag census: 0x{result.WriterState.SlTagCensus:X} " +
SlTagCensusNames.DescribeRoutes(result.WriterState.SlTagCensus));
// DXGI's own present counter against this hook's, on the hooked chain(s): the in-process
// answer to whether a pacer's generated presents are DXGI presents this hook misses (§H5).
HostConsole.Line(DxgiCounterNote(result.WriterState));
}
/// <summary>DXGI's counter against ours, and what a ratio means; never a count of anything by itself.</summary>
private static string DxgiCounterNote(FlWriterState writer)
{
if (writer.DxgiPresentSamples == 0)
{
return " DXGI present counter: not read (no hooked present sampled it)";
}
double per = writer.DxgiPresentsUnseen / (double)writer.DxgiPresentSamples;
string reading = writer.DxgiPresentsUnseen == 0
? "DXGI counted nothing this hook did not: frame generation was off, or whatever generates frames on this title presents below DXGI or on another object"
: per >= 0.5
? "DXGI counted presents this hook never saw on the SAME chain - a pacer presenting through a body the inline patches do not cover; the generated presents ARE DXGI presents here and Displayed above is DXGI-counted from them"
: "a few presents reached DXGI outside this hook - too few for a pacer, read the number rather than the ratio";
return $" DXGI present counter: unseen={writer.DxgiPresentsUnseen} over samples={writer.DxgiPresentSamples} " +
$"({per.ToString("0.00", CultureInfo.InvariantCulture)} unseen per hooked present) - {reading}";
}
/// <summary>One line per census-named module the target had loaded, version and path beside it.</summary>
@@ -303,7 +331,8 @@ internal static class Program
// already honoured MaxDuration -- nothing could set it.
MaxDuration = seconds > 0 ? TimeSpan.FromSeconds(seconds) : TimeSpan.Zero,
},
pid => RuntimeModuleSnapshot.Take(pid, CensusNames.ModuleFileNames));
pid => RuntimeModuleSnapshot.Take(pid, CensusNames.ModuleFileNames),
NgxDriverProbe.Run);
}
/// <summary>
+31 -4
View File
@@ -453,7 +453,14 @@ public enum FlMeasured : ushort
/// </summary>
FgCounts = 1 << 10,
// Bits 11-15 reserved. Writers leave them zero; readers IGNORE them rather than validating them as
/// <summary>
/// <c>dxgiUnseen</c> (2026-09-05, <c>20_OPEN_QUESTIONS</c> §H5 row P1-DXGI): the present hook read
/// <c>IDXGISwapChain::GetLastPresentCount</c> at this present and at the previous hooked present on the
/// same chain, so the byte is a measurement, a zero included. Clear on a chain's first hooked present.
/// </summary>
DxgiPresents = 1 << 11,
// Bits 12-15 reserved. Writers leave them zero; readers IGNORE them rather than validating them as
// zero. That does NOT make a future field bump-free — recordSize and layoutVersion are compared
// first, so an old reader refuses a new writer outright.
}
@@ -547,8 +554,18 @@ public unsafe struct FlWriterState
/// </summary>
public uint SlTagCensus;
/// <summary>
/// Presents DXGI's own counter (<c>IDXGISwapChain::GetLastPresentCount</c>) recorded between two consecutive
/// hooked presents on the same chain, beyond the one the hook saw — presents that reached DXGI through a body
/// the inline patches do not cover. Watchdog-published. Took <c>reserved[0]</c> on 2026-09-05.
/// </summary>
public uint DxgiPresentsUnseen;
/// <summary>Hooked presents on which the DXGI counter was read. Took <c>reserved[1]</c> on 2026-09-05.</summary>
public uint DxgiPresentSamples;
/// <summary>Must be zero; room for additive fields.</summary>
public fixed uint Reserved[4];
public fixed uint Reserved[2];
// WHY THE COUNTERS ARE PUBLISHED AT 1 Hz AND NOT ACCUMULATED HERE PER FRAME: this struct is
// region 2, which the Overlay writes on the present path, and the regions are separate cache lines
@@ -588,7 +605,7 @@ public unsafe struct FlControlBlock
/// <summary>Region 4 — the ring. Exactly 64 bytes, no implicit padding.</summary>
[StructLayout(LayoutKind.Sequential, Size = 64)]
public struct FlFrameRecord
public unsafe struct FlFrameRecord
{
/// <summary>Present entry timestamp.</summary>
public ulong Qpc;
@@ -678,8 +695,18 @@ public struct FlFrameRecord
/// <summary>0 = unavailable.</summary>
public uint ReflexLatencyUs;
/// <summary>
/// Presents DXGI's own counter recorded on this record's chain since the previous hooked present, beyond
/// that one — the per-present form of <see cref="FlWriterState.DxgiPresentsUnseen"/>, under
/// <see cref="FlMeasured.DxgiPresents"/>. Measured 2.90 / 2.95 per hooked present on Dying Light: The
/// Beast (Streamline 2.8.0, DLSS FG ×4) and 0 on Streamline 2.7.3 and 2.10.3 titles, so on that shape
/// the generated presents ARE DXGI presents and the consumer counts <c>Displayed = hooked + this</c>,
/// labelled DXGI-COUNTED. Saturates at 255, which the consumer refuses as a sentinel.
/// </summary>
public byte DxgiUnseen;
/// <summary>Must be zero. Slack, so the next addition does not start from none.</summary>
public uint Reserved;
public fixed byte Reserved[3];
/// <summary>
/// Seqlock counter. Monotonic per slot and NEVER reset, so a full lap of the ring always changes it —
@@ -291,12 +291,18 @@ void NoteFault() noexcept {
// ---------------------------------------------------------------------------
constexpr size_t kMaxSwapChains = 16;
// The last GetLastPresentCount value read at a hooked present on this chain, and whether
// one has been read at all (fl_shm.h §dxgiPresentsUnseen). Per chain, because the
// counter is per chain.
struct SwapChainSlot {
void* ptr = nullptr;
uint32_t id = 0;
uint16_t outW = 0;
uint16_t outH = 0;
uint8_t api = FL_API_UNKNOWN;
bool haveDxgiCount = false;
uint32_t lastDxgiCount = 0;
uint32_t dxgiEpoch = 0; // g_dxgiEpoch when lastDxgiCount was read; a mismatch means presents went by unrecorded
};
// Ask the device whether it can ray-trace, once, and publish it as FlRtTier.
@@ -917,6 +923,20 @@ static_assert(offsetof(fsr3host::FfxFsr3DispatchUpscaleDescription, renderSize)
std::atomic<uint32_t> g_slTagTypes{0};
std::atomic<uint32_t> g_slTagCensus{0};
// DXGI's own present counter against ours (fl_shm.h §dxgiPresentsUnseen): hook-local,
// watchdog-published, monotonic.
std::atomic<uint32_t> g_dxgiUnseen{0};
std::atomic<uint32_t> g_dxgiSamples{0};
// A PRESENT THIS HOOK SAW AND DECLINED TO RECORD IS NOT ONE IT NEVER SAW. While a
// session is paused (MayObserve false) the title keeps presenting and DXGI keeps
// counting, so the first record after the resume would otherwise claim the whole
// pause as unseen presents -- measured 0x55 on the paused-session integration case.
// Every declined present bumps this epoch; a slot whose last read is from an older
// epoch differences nothing and starts again. DXGI_PRESENT_TEST presents do not bump
// it: they do not move the counter (#35), so there is nothing to invalidate.
std::atomic<uint32_t> g_dxgiEpoch{0};
void NoteTagTypes(uint32_t typeBits, uint32_t routeShift) noexcept {
if (typeBits == 0u) {
return;
@@ -1442,6 +1462,18 @@ void PublishRuntimeCensus() noexcept {
// The tag census, on the same tick and by the same rule: OR-only, from the
// process-local word the three tag routes accumulate into, so region 2 takes one
// write a second rather than one per tag list (fl_shm.h §slTagCensus).
// DXGI's counter against ours, published on the same tick. Monotonic, so a plain store
// of the hook-local value is the whole publish.
void PublishDxgiPresentCounters() noexcept {
if (g_state == nullptr) {
return;
}
std::atomic_ref<uint32_t> unseen{g_state->dxgiPresentsUnseen};
std::atomic_ref<uint32_t> samples{g_state->dxgiPresentSamples};
unseen.store(g_dxgiUnseen.load(std::memory_order_relaxed), std::memory_order_relaxed);
samples.store(g_dxgiSamples.load(std::memory_order_relaxed), std::memory_order_relaxed);
}
void PublishSlTagCensus() noexcept {
if (g_state == nullptr) {
return;
@@ -1856,6 +1888,7 @@ DWORD WINAPI WatchdogThread(LPVOID) noexcept {
// appeared this second is both hooked and counted in the same pass.
PublishRuntimeCensus();
PublishSlTagCensus();
PublishDxgiPresentCounters();
// Supervision loss. guardTicks counts COMPLETED guard evaluations, not
// seconds, so a stalled guard loop stops it advancing even while the
@@ -1886,6 +1919,9 @@ DWORD WINAPI WatchdogThread(LPVOID) noexcept {
// lock, no logging (NFR-1, target <= 1 us; a bare vtable detour measured 8.4 ns).
void RecordPresent(IDXGISwapChain* sc, UINT syncInterval, UINT flags) noexcept {
if (!MayObserve()) {
if ((flags & DXGI_PRESENT_TEST) == 0u) {
g_dxgiEpoch.fetch_add(1u, std::memory_order_relaxed); // see the declaration
}
return;
}
@@ -1920,6 +1956,35 @@ void RecordPresent(IDXGISwapChain* sc, UINT syncInterval, UINT flags) noexcept {
SwapChainSlot* slot = FindOrAdd(sc);
PublishAdapterOnce(sc);
// DXGI'S OWN COUNT OF THIS CHAIN'S PRESENTS, read here on the object the title passed
// (the same class of read as GetDesc above), BEFORE this present is forwarded: the
// value is therefore the number of presents completed before this one, and the
// delta from the previous hooked present on the same chain is 1 + whatever DXGI
// counted that this hook never saw -- a pacer presenting through a body the inline
// patches do not cover. A delta of exactly 1 every time says DXGI saw nothing more
// than we did. DXGI_PRESENT_TEST presents are already filtered above and do not
// move this counter (measured, #35), so they cannot read as unseen presents.
bool dxgiDelta = false;
uint8_t dxgiUnseenHere = 0;
if (slot != nullptr) {
UINT dxgiCount = 0;
const uint32_t epoch = g_dxgiEpoch.load(std::memory_order_relaxed);
if (SUCCEEDED(sc->GetLastPresentCount(&dxgiCount))) {
if (slot->haveDxgiCount && slot->dxgiEpoch == epoch) {
const uint32_t delta = dxgiCount - slot->lastDxgiCount;
dxgiDelta = true;
if (delta > 1u) {
g_dxgiUnseen.fetch_add(delta - 1u, std::memory_order_relaxed);
dxgiUnseenHere = fl::slseen::SaturateToByte(delta - 1u);
}
}
slot->lastDxgiCount = dxgiCount;
slot->dxgiEpoch = epoch;
slot->haveDxgiCount = true;
g_dxgiSamples.fetch_add(1u, std::memory_order_relaxed);
}
}
FlFrameRecord rec{};
rec.qpc = static_cast<uint64_t>(qpc.QuadPart);
rec.frameIndex = g_frameIndex++;
@@ -1961,6 +2026,14 @@ void RecordPresent(IDXGISwapChain* sc, UINT syncInterval, UINT flags) noexcept {
const uint16_t haveOutputRes = (rec.outputW != 0 && rec.outputH != 0) ? FL_MEASURED_OUTPUT_RES : 0u;
rec.measuredMask = static_cast<uint16_t>(haveOutputRes | FL_MEASURED_PRESENT_ARGS);
// The per-present form of the DXGI counter read above (fl_shm.h §dxgiUnseen). The
// bit says a delta EXISTED -- a zero under it is DXGI agreeing with this hook, not
// silence -- which is why the first present of a chain claims nothing.
if (dxgiDelta) {
rec.dxgiUnseen = dxgiUnseenHere;
rec.measuredMask = static_cast<uint16_t>(rec.measuredMask | FL_MEASURED_DXGI_PRESENTS);
}
// --- Upscaler identity, and the three states it must keep apart ----------
//
// The counter is CONSUMED here, once per present, so the record describes
+45 -7
View File
@@ -568,13 +568,20 @@ enum FlMeasured : uint16_t {
// must be able to say so.
FL_MEASURED_FG_COUNTS = 1u << 10,
// bits 11-15 reserved. Writers leave them zero; readers must IGNORE them
// dxgiUnseen @52 (2026-09-05, 20_OPEN_QUESTIONS §H5 row P1-DXGI): the present hook
// read IDXGISwapChain::GetLastPresentCount at this present AND at the previous
// hooked present on the same chain, so the byte is a measurement -- a zero
// included. Clear on the first hooked present of every chain, where there is no
// previous value to difference against, and whenever the read failed.
FL_MEASURED_DXGI_PRESENTS = 1u << 11,
// bits 12-15 reserved. Writers leave them zero; readers must IGNORE them
// rather than validate them as zero.
//
// BE PRECISE ABOUT WHAT THAT BUYS, because the tempting claim is false: it
// does NOT mean a future field can be added without a layout bump. Any new
// field also needs a byte, and every byte of this record is allocated except
// `reserved` @52 -- and FlShmHandshake::recordSize plus the layout version are
// `reserved` @53..55 -- and FlShmHandshake::recordSize plus the layout version are
// compared before a reader looks at anything, so an old reader refuses a new
// writer outright and never gets as far as an unknown bit. What the reserve
// actually buys is that existing offsets do not move, which keeps the diff,
@@ -687,7 +694,21 @@ struct alignas(64) FlWriterState {
// no layout bump, refused-before-read by the build-id handshake.
uint32_t slTagCensus; // @44
uint32_t reserved[4]; // @48..63 must be zero; room for additive fields
// DXGI'S OWN PRESENT COUNTER AGAINST THIS HOOK'S, on the hooked swapchain(s)
// (2026-09-05, 20_OPEN_QUESTIONS §H5 case 3). On every present the hook sees it
// reads IDXGISwapChain::GetLastPresentCount on the object the title passed -- the
// same class of read as GetDesc in FindOrAdd -- and compares it with the value at
// the previous hooked present on the same chain. Exactly one present (the previous
// hooked one) is expected in between; every present beyond that is one DXGI
// counted and this hook did not. A frame-generation pacer that presents on this
// chain through a body the inline patches do not cover shows up here; one that
// presents below DXGI, or on another object, does not. Hook-local counters,
// watchdog-published (the region-2 cache-line rule above). Took reserved[0..1],
// additive, no layout bump.
uint32_t dxgiPresentsUnseen; // @48 presents DXGI counted between two hooked presents, beyond the one seen
uint32_t dxgiPresentSamples; // @52 hooked presents on which the counter was read
uint32_t reserved[2]; // @56..63 must be zero; room for additive fields
// NOTE: there is deliberately no droppedRecords here. The writer has no
// reader index and cannot know whether the slot it overwrites was ever
@@ -818,7 +839,22 @@ struct alignas(64) FlFrameRecord {
// and layoutVersion are compared before a reader looks at anything, so an old
// reader refuses a new writer and never reaches an unknown field. What it buys
// is that existing offsets do not move, which keeps the next diff small.
uint32_t reserved; // @52
// @52 -- DXGI'S OWN COUNT OF THIS CHAIN'S PRESENTS SINCE THE PREVIOUS HOOKED ONE,
// beyond that one (2026-09-05, 20_OPEN_QUESTIONS §H5 row P1-DXGI). The per-present
// form of FlWriterState.dxgiPresentsUnseen: the delta of GetLastPresentCount between
// two consecutive hooked presents on the same chain, minus the one present the hook
// saw. Measured 2.90 and 2.95 per hooked present on Dying Light: The Beast
// (Streamline 2.8.0, DLSS Frame Generation x4) and 0 on every other title (Streamline
// 2.7.3 and 2.10.3 present their generated frames through the patched bodies) -- so
// on that shape the generated presents ARE DXGI presents, reaching a body the inline
// patches do not cover, and the consumer counts Displayed = hooked + this, labelled
// DXGI-COUNTED. Per record rather than per session so the consumer's uniformity
// buckets see it. SATURATES AT 255: a NUMERATOR, so a wrap would read low rather than
// high, but 255 is still a sentinel the consumer refuses rather than a count. Took the
// first byte of v3's reserved word; additive, no offset moved, no layout bump.
uint8_t dxgiUnseen; // @52
uint8_t reserved[3]; // @53..55 MUST BE ZERO
// Seqlock counter. Monotonic per slot and NEVER reset, so a full lap of
// the ring always changes it — otherwise a reader stalled exactly one lap
@@ -878,7 +914,9 @@ static_assert(offsetof(FlWriterState, rtStateObjectsCreated) == 32);
static_assert(offsetof(FlWriterState, rasterPsoCreated) == 36);
static_assert(offsetof(FlWriterState, runtimeCensus) == 40);
static_assert(offsetof(FlWriterState, slTagCensus) == 44);
static_assert(offsetof(FlWriterState, reserved) == 48);
static_assert(offsetof(FlWriterState, dxgiPresentsUnseen) == 48);
static_assert(offsetof(FlWriterState, dxgiPresentSamples) == 52);
static_assert(offsetof(FlWriterState, reserved) == 56);
static_assert(offsetof(FlControlBlock, pauseRequested) == 0);
static_assert(offsetof(FlControlBlock, unhookRequested) == 4);
@@ -908,7 +946,8 @@ static_assert(offsetof(FlFrameRecord, upscalerSharpness) == 42);
static_assert(offsetof(FlFrameRecord, fgEvaluations) == 43);
static_assert(offsetof(FlFrameRecord, vramUsedMb) == 44);
static_assert(offsetof(FlFrameRecord, reflexLatencyUs) == 48);
static_assert(offsetof(FlFrameRecord, reserved) == 52);
static_assert(offsetof(FlFrameRecord, dxgiUnseen) == 52);
static_assert(offsetof(FlFrameRecord, reserved) == 53);
static_assert(offsetof(FlFrameRecord, seq) == 56);
static_assert(offsetof(FlFrameRecord, swapchainId) == 60);
@@ -924,7 +963,6 @@ static_assert(offsetof(FlFrameRecord, swapchainId) == 60, "07_IPC pins the paylo
static_assert(offsetof(FlFrameRecord, qpc) % 8 == 0);
static_assert(offsetof(FlFrameRecord, measuredMask) % 2 == 0);
static_assert(offsetof(FlFrameRecord, vramUsedMb) % 4 == 0);
static_assert(offsetof(FlFrameRecord, reserved) % 4 == 0);
static_assert(offsetof(FlFrameRecord, seq) % 4 == 0);
// The regions must not overlap, and the ring must stay 64-aligned.
+37 -2
View File
@@ -1179,7 +1179,8 @@ bool StartHarness(Child& child) {
uint16_t EntitledBy(uint32_t hooks) noexcept {
uint16_t allowed = 0;
if ((hooks & fl::FL_HOOK_PRESENT) != 0u) {
allowed |= static_cast<uint16_t>(fl::FL_MEASURED_OUTPUT_RES | fl::FL_MEASURED_PRESENT_ARGS);
allowed |= static_cast<uint16_t>(fl::FL_MEASURED_OUTPUT_RES | fl::FL_MEASURED_PRESENT_ARGS |
fl::FL_MEASURED_DXGI_PRESENTS);
}
if ((hooks & fl::FL_HOOK_UPSCALER_IDENTITY) != 0u) {
allowed |= static_cast<uint16_t>(fl::FL_MEASURED_UPSCALER | fl::FL_MEASURED_FG);
@@ -1225,6 +1226,11 @@ bool IsHonest(const fl::FlFrameRecord& r, uint16_t entitled) noexcept {
if ((r.measuredMask & fl::FL_MEASURED_FG_COUNTS) == 0u && r.fgEvaluations != 0u) {
return false;
}
// dxgiUnseen has no in-band sentinel either -- 0 is DXGI agreeing with the hook -- so
// a value under a clear bit is the same defect as an unclaimed count.
if ((r.measuredMask & fl::FL_MEASURED_DXGI_PRESENTS) == 0u && r.dxgiUnseen != 0u) {
return false;
}
// featureFlags carries Ray Reconstruction's fact and OBSERVED bits, produced by the
// same Streamline detour as the upscaler identity. A writer not entitled to claim
// an upscaler is not entitled to say anything about RR either.
@@ -3175,8 +3181,12 @@ namespace {
// What one --hold-presenting-fg run yields, drained after the identity hook is live.
struct FgObservation {
std::uint32_t census = 0;
std::uint32_t dxgiUnseen = 0;
std::uint32_t dxgiSamples = 0;
std::size_t drained = 0;
std::uint64_t sigma = 0; // sum of fgEvaluations over the window
std::uint64_t sigma = 0; // sum of fgEvaluations over the window
std::uint64_t dxgiRecUnseen = 0; // sum of dxgiUnseen over records claiming it
std::size_t dxgiRecClaiming = 0; // records carrying FL_MEASURED_DXGI_PRESENTS
std::uint32_t hooks = 0;
std::uint32_t faults = 0;
bool everyRecordClaimsCounts = true;
@@ -3256,6 +3266,10 @@ bool ObserveFg(int presentsPerEval, FgObservation& out) {
out.drained = all.size();
for (const auto& r : all) {
out.sigma += r.fgEvaluations;
if ((r.measuredMask & fl::FL_MEASURED_DXGI_PRESENTS) != 0u) {
++out.dxgiRecClaiming;
out.dxgiRecUnseen += r.dxgiUnseen;
}
if ((r.measuredMask & fl::FL_MEASURED_FG_COUNTS) == 0u) {
out.everyRecordClaimsCounts = false;
}
@@ -3278,6 +3292,13 @@ bool ObserveFg(int presentsPerEval, FgObservation& out) {
}
}
out.hooks = st->hooksInstalledMask;
// DXGI's counter against ours: published by the watchdog on its 1 Hz tick, so poll for
// the samples to reach the window rather than reading the words once (HANDOFF §Traps).
for (int i = 0; i < 80 && st->dxgiPresentSamples < out.drained; ++i) {
Sleep(50);
}
out.dxgiUnseen = st->dxgiPresentsUnseen;
out.dxgiSamples = st->dxgiPresentSamples;
out.census = st->runtimeCensus;
out.faults = st->faultCount;
@@ -3354,6 +3375,20 @@ TEST_CASE("application-frame tokens are COUNTED, and the count tracks the fixtur
// is in this process. The second check is the one that matters: it is what
// keeps a title with Streamline loaded and no evaluation observed from being
// printed as "no frame-generation runtime was loaded".
// DXGI'S COUNTER AGAINST OURS, the negative control: this fixture presents only through
// the body the inline patch covers, so DXGI must count exactly the presents the hook
// saw -- zero unseen -- and the counter must have been read on every hooked present.
// A real title where DXGI counts MORE is the §H5 question this word exists to answer.
CAPTURE(obs.dxgiUnseen);
CAPTURE(obs.dxgiSamples);
CHECK(obs.dxgiUnseen == 0u);
CHECK(obs.dxgiSamples >= static_cast<std::uint32_t>(obs.drained));
// And per record, in the form the consumer's buckets read: every drained record
// claims the bit (the chain's first present, which cannot, is in the discarded
// backlog) and carries a zero byte.
CAPTURE(obs.dxgiRecClaiming);
CHECK(obs.dxgiRecUnseen == 0u);
CHECK(obs.dxgiRecClaiming == obs.drained);
CHECK((obs.census & fl::FL_CENSUS_RAN) != 0u);
CHECK((obs.census & fl::FL_CENSUS_SL_INTERPOSER) != 0u);
CHECK((obs.census & fl::FL_CENSUS_FG_FAMILIES) == 0u);
+5 -2
View File
@@ -64,7 +64,9 @@ int main() {
Field("rasterPsoCreated", offsetof(FlWriterState, rasterPsoCreated), sizeof(uint32_t));
Field("runtimeCensus", offsetof(FlWriterState, runtimeCensus), sizeof(uint32_t));
Field("slTagCensus", offsetof(FlWriterState, slTagCensus), sizeof(uint32_t));
Field("reserved", offsetof(FlWriterState, reserved), sizeof(uint32_t) * 4, true);
Field("dxgiPresentsUnseen", offsetof(FlWriterState, dxgiPresentsUnseen), sizeof(uint32_t));
Field("dxgiPresentSamples", offsetof(FlWriterState, dxgiPresentSamples), sizeof(uint32_t));
Field("reserved", offsetof(FlWriterState, reserved), sizeof(uint32_t) * 2, true);
std::printf(" ] },\n");
std::printf(" \"FlControlBlock\": { \"size\": %zu, \"fields\": [\n", sizeof(FlControlBlock));
@@ -99,7 +101,8 @@ int main() {
Field("fgEvaluations", offsetof(FlFrameRecord, fgEvaluations), sizeof(uint8_t));
Field("vramUsedMb", offsetof(FlFrameRecord, vramUsedMb), sizeof(uint32_t));
Field("reflexLatencyUs", offsetof(FlFrameRecord, reflexLatencyUs), sizeof(uint32_t));
Field("reserved", offsetof(FlFrameRecord, reserved), sizeof(uint32_t));
Field("dxgiUnseen", offsetof(FlFrameRecord, dxgiUnseen), sizeof(uint8_t));
Field("reserved", offsetof(FlFrameRecord, reserved), sizeof(uint8_t) * 3);
Field("seq", offsetof(FlFrameRecord, seq), sizeof(uint32_t));
Field("swapchainId", offsetof(FlFrameRecord, swapchainId), sizeof(uint32_t), true);
std::printf(" ] }\n");
+12
View File
@@ -124,6 +124,7 @@ int NgxState(unsigned long pid) {
NvAPI_GetErrorMessage(init, desc);
std::printf(" NvAPI_Initialize -> %d (%s)\n BRANCH: DEGRADED — no usable NVIDIA driver on this machine.\n",
static_cast<int>(init), desc);
std::printf("NGXSTATE status=DEGRADED nvapi=%d\n", static_cast<int>(init));
return 2;
}
NvU32 driverVersion = 0;
@@ -143,6 +144,7 @@ int NgxState(unsigned long pid) {
std::printf(" BRANCH: UNANSWERED — the driver did not answer for pid %lu (not an NVIDIA-rendered process, a "
"driver older than R570, or the API refusing this caller).\n",
pid);
std::printf("NGXSTATE status=UNANSWERED nvapi=%d\n", static_cast<int>(status));
NvAPI_Unload();
return 3;
}
@@ -160,6 +162,16 @@ int NgxState(unsigned long pid) {
std::printf(" frameGenerationPreset %u\n", params.frameGenerationPreset);
std::printf(" frameGenerationMode %u\n", params.frameGenerationMode);
std::printf(" reserved %u %u\n", params.reserved[0], params.reserved[1]);
// THE MACHINE LINE. FrameLedger.CaptureHost spawns this probe beside each module snapshot
// (NgxDriverProbe) and reads exactly this line; everything above is for a human. One line,
// key=value, hex masks, so a parser cannot mistake a decoded name for a field.
std::printf(
"NGXSTATE status=ANSWERED sr=0x%016llX rr=0x%016llX fg=0x%016llX ratio=%.4f mode=%u preset=%u fgcount=%u "
"fgpreset=%u fgmode=%u driver=%u\n",
static_cast<unsigned long long>(params.feedbackMaskSR), static_cast<unsigned long long>(params.feedbackMaskRR),
static_cast<unsigned long long>(params.feedbackMaskFG), static_cast<double>(params.scalingRatio),
params.performanceMode, params.renderPreset, params.frameGenerationCount, params.frameGenerationPreset,
params.frameGenerationMode, driverVersion);
NvAPI_Unload();
return 0;
}
+24
View File
@@ -2715,6 +2715,30 @@ bool ProbeFrameIdentity(Gfx& g) {
Check(realIsAFrame, "a real present submits exactly one frame");
std::printf(" %d real present(s) moved the counter by %u\n", kReal, afterReal - afterTest);
// The cost of asking. The Overlay reads this counter on every hooked present
// (dllmain RecordPresent, the DXGI-counted diagnostic 20_OPEN_QUESTIONS §H5
// A1.7), so the price of one call is part of the present hook's overhead
// statement. A measurement, not a check: a threshold here fails on a shared
// runner for reasons unrelated to the code (see --probe-cost).
{
constexpr int kCalls = 20000;
LARGE_INTEGER f{};
LARGE_INTEGER t0{};
LARGE_INTEGER t1{};
QueryPerformanceFrequency(&f);
UINT sink = 0;
QueryPerformanceCounter(&t0);
for (int i = 0; i < kCalls; ++i) {
g.swapChain1->GetLastPresentCount(&sink);
}
QueryPerformanceCounter(&t1);
const double ns =
static_cast<double>(t1.QuadPart - t0.QuadPart) * 1e9 / static_cast<double>(f.QuadPart) / kCalls;
std::printf(" GetLastPresentCount costs %.1f ns/call (%d calls, WARP; the Overlay pays this once per hooked "
"present)\n",
ns, kCalls);
}
// The two together are the contract. Separately, each passes against a
// wrong writer: a writer that ignores everything satisfies the first, and
// one that counts everything satisfies the second.
@@ -277,6 +277,56 @@ public sealed class CaptureLoopTests : IDisposable
CaptureResult r = await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
r.RuntimeModules.Should().BeSameAs(RuntimeModuleSet.Empty);
r.NgxDriver.Should().BeSameAs(NgxDriverState.NotRun, "no probe was given to the loop");
}
[Fact]
public async Task TheDriverProbeRidesOnTheSameTouchAsTheModuleSnapshotAndIsMergedOntoTheResult()
{
// The probe is out of process and answers per pid; it rides the scan's cadence exactly as the
// module snapshot does, and a later answer that differs is reported as a CHANGE, not averaged.
var guard = new CountingGuard();
using var sink = new FakeSink();
int probes = 0;
var loop = new CaptureLoop(
await StoreWithAsync(), new HookedCaptureGate(guard), guard, new FixedResolver(_pid, SessionEndReason.Running),
_ => new FakeLiveness(),
_ => (sink, ShmAttachRefusal.Ok),
new CaptureOptions
{
DrainInterval = TimeSpan.FromMilliseconds(1),
ScanInterval = TimeSpan.FromMilliseconds(5),
AttachBudget = TimeSpan.FromMilliseconds(50),
MaxDuration = TimeSpan.FromMilliseconds(120),
},
modules: null,
ngx: pid =>
{
pid.Should().Be(_pid);
probes++;
sink.Events.Add("ngx");
// The first reading has DLSS not yet created; every later one has it created and evaluated.
ulong sr = probes == 1 ? NgxOverrideFlags.Initialized | NgxOverrideFlags.DllExists
: NgxOverrideFlags.Initialized | NgxOverrideFlags.DllExists | NgxOverrideFlags.CreatedAndEvaluated;
return NgxDriverState.Parse($"NGXSTATE status=ANSWERED sr=0x{sr:X16} rr=0x1 fg=0x5 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664");
});
CaptureResult r = await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
probes.Should().Be(sink.Published.Count + 1, "one per scan, plus the one before the last drain");
r.NgxDriver.Outcome.Should().Be(NgxProbeOutcome.Answered);
r.NgxDriver.Readings.Should().Be(probes);
r.NgxDriver.Answered.Should().Be(probes);
r.NgxDriver.SrCreatedAndEvaluated.Should().BeTrue("the last answered reading is the state");
r.NgxDriver.Changed.Should().BeTrue("the first reading differed from the later ones");
r.NgxDriver.Driver.Should().Be(61664u);
for (int i = 0; i < sink.Events.Count; i++)
{
if (string.Equals(sink.Events[i], "publish", StringComparison.Ordinal))
{
sink.Events[i + 1].Should().Be("ngx", "the probe follows the publish directly, on the snapshot's touch");
}
}
}
[Fact]
@@ -0,0 +1,36 @@
using FluentAssertions;
using FrameLedger.CaptureHost.Capture;
using FrameLedger.CaptureHost.Consume;
namespace FrameLedger.CaptureHost.Tests.Capture;
/// <summary>
/// The out-of-process probe as the loop calls it: every way it can fail is an outcome on the result, never a throw.
/// </summary>
public sealed class NgxDriverProbeTests
{
[Fact]
public void AMissingProbeIsAnOutcomeThatNamesThePath()
{
NgxDriverState s = NgxDriverProbe.Run(Environment.ProcessId, @"C:\nowhere\fl-probe-nvapi.exe");
s.Outcome.Should().Be(NgxProbeOutcome.ProbeMissing);
s.Detail.Should().Contain("fl-probe-nvapi.exe");
s.SrCreatedAndEvaluated.Should().BeFalse();
}
[Fact]
public void RunAgainstThisTestProcessNeverThrowsAndNeverClaimsAFeature()
{
// The real binary is staged beside the host by the project file when the native build ran
// first (CI does; a fresh clone may not). Whichever it is, this process renders nothing
// through NGX, so the only honest outcomes are the ones that say so.
NgxDriverState s = NgxDriverProbe.Run(Environment.ProcessId);
s.Outcome.Should().BeOneOf(NgxProbeOutcome.Unanswered, NgxProbeOutcome.Degraded, NgxProbeOutcome.ProbeMissing,
NgxProbeOutcome.ProbeFailed);
s.SrCreatedAndEvaluated.Should().BeFalse();
s.Readings.Should().Be(1);
s.Describe().Should().StartWith(" NVIDIA driver NGX state");
}
}
@@ -0,0 +1,135 @@
using System.Diagnostics;
using FluentAssertions;
using FrameLedger.CaptureHost.Consume;
using FrameLedger.Shared;
namespace FrameLedger.CaptureHost.Tests.Consume;
/// <summary>
/// The driver's FG word beside the <c>frame generation:</c> line (corrected 2026-09-06: it follows DLSS-G once the
/// feature exists), and the qualifier a counted-but-refused session prints.
/// </summary>
public sealed class DriverReportedFrameGenerationTests
{
private const FlHookFamily _hooks =
FlHookFamily.Present | FlHookFamily.UpscalerIdentity | FlHookFamily.UpscalerParams | FlHookFamily.FgEvaluations;
private static readonly NgxDriverState _fgCreated = NgxDriverState.Parse(
"NGXSTATE status=ANSWERED sr=0x605 rr=0x5 fg=0x605 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664");
private static readonly NgxDriverState _fgNotCreated = NgxDriverState.Parse(
"NGXSTATE status=ANSWERED sr=0x605 rr=0x5 fg=0x5 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664");
/// <summary>k hooked presents per application frame; the token on the first; DLSS-G marked on it when tagged.</summary>
private static List<FlFrameRecord> Stream(int appFrames, int k, bool tagged, byte unseenFrom = 0, int unseenAfter = int.MaxValue)
{
List<FlFrameRecord> stream = [];
ulong qpc = 1_000_000;
ulong step = (ulong)(Stopwatch.Frequency / (60 * k));
for (int f = 0; f < appFrames; f++)
{
for (int p = 0; p < k; p++)
{
bool first = p == 0;
stream.Add(new FlFrameRecord
{
Qpc = qpc,
SwapchainId = 1,
OutputW = 2560,
OutputH = 1440,
MeasuredMask = (ushort)(FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.Upscaler
| FlMeasured.Fg | FlMeasured.FgCounts | FlMeasured.DxgiPresents),
Upscaler = (byte)(first ? FlUpscaler.Dlss : FlUpscaler.Unknown),
FgEvaluations = (byte)(first ? 1 : 0),
FgMode = (byte)(first && tagged ? FlFgMode.DlssG : FlFgMode.Unknown),
DxgiUnseen = f >= unseenAfter ? unseenFrom : (byte)0,
});
qpc += step;
}
}
return stream;
}
private static (MeasuredFacts Facts, string Text) Render(List<FlFrameRecord> stream, NgxDriverState ngx)
{
var writer = new FlWriterState
{
HooksInstalledMask = (uint)_hooks,
RuntimeCensus = (uint)(FlRuntimeCensus.Ran | FlRuntimeCensus.SlInterposer | FlRuntimeCensus.NvngxDlssG),
DxgiPresentSamples = (uint)stream.Count,
};
MeasuredFacts facts = MeasuredFacts.From(stream, writer, Stopwatch.Frequency, 0, 0,
FgWindow.From(stream, Stopwatch.Frequency), ngx: ngx);
return (facts, SessionReport.Render(facts));
}
[Fact]
public void ATaggedDlssGBesideTheDriversCreatedWordPrintsAgreement()
{
(MeasuredFacts facts, string text) = Render(Stream(100, 4, tagged: true), _fgCreated);
facts.FgMode.Should().Be("DlssG");
facts.FgModePrinted.Should().Be("DlssG");
text.Should().Contain("frame generation: DlssG — the NVIDIA driver agrees: an NGX frame-generation feature");
text.Should().Contain("(x4 FG)");
}
[Fact]
public void AnActiveCountWithNoTagAndTheDriversCreatedWordIsDlssGDriverReported()
{
(MeasuredFacts facts, string text) = Render(Stream(100, 4, tagged: false), _fgCreated);
facts.FgMode.Should().Be(MeasuredFacts.FgActiveUnidentified, "no tag named the technology");
facts.FgModePrinted.Should().Be(MeasuredFacts.FgDlssGDriverReported, "the driver did, as identity only");
text.Should().Contain("frame generation: DlssG (driver-reported:");
text.Should().Contain("(x4 FG)", "the count is the record and is not changed by the driver");
text.Should().NotContain("technology not identified");
}
[Fact]
public void ATaggedDlssGBesideTheDriversNegativeIsADisagreementPrintedNotResolved()
{
(_, string text) = Render(Stream(100, 4, tagged: true), _fgNotCreated);
text.Should().Contain("frame generation: DlssG — WARNING: the NVIDIA driver reports NO NGX frame-generation feature");
text.Should().Contain("printed rather than resolved");
}
[Fact]
public void ACountedNoneBesideTheDriversCreatedWordPrintsTheFactAndKeepsTheCount()
{
(MeasuredFacts facts, string text) = Render(Stream(200, 1, tagged: false), _fgCreated);
facts.FgMode.Should().Be(MeasuredFacts.FgNone);
facts.FgModePrinted.Should().Be(MeasuredFacts.FgNone, "the count decides none; the driver's word is identity only");
text.Should().Contain("frame generation: None — the NVIDIA driver reports an NGX frame-generation feature created and evaluated");
text.Should().Contain("the count above is the record and is not changed by it");
}
[Fact]
public void WithoutAnAnswerTheFgLineIsByteIdenticalToBefore()
{
(_, string text) = Render(Stream(100, 4, tagged: false), NgxDriverState.NotRun);
text.Should().Contain("frame generation: " + MeasuredFacts.FgActiveUnidentified);
text.Should().NotContain("NVIDIA driver");
}
[Fact]
public void ACountedSessionWhoseFactorWasRefusedSaysSoInsteadOfNoEvaluationObserved()
{
// DL:TB at FSR + DLSS-G, 2026-09-06: tokens counted, DXGI-counted presents, the pacer stopping
// in the last eighth. The factor is refused (uniformity), and the qualifier must say that.
List<FlFrameRecord> s = Stream(400, 1, tagged: true, unseenFrom: 3, unseenAfter: 200);
(MeasuredFacts facts, string text) = Render(s, _fgCreated);
facts.Fg!.Refusal.Should().Contain("changed during the session");
text.Should().Contain("Presented FPS:");
text.Should().Contain("WARNING: frame generation was counted (400 application-frame token(s), and DXGI counted 600 present(s) this hook never saw, so the Displayed rate is ABOVE this number) and its factor is REFUSED");
text.Should().Contain("read it as neither Native nor Displayed");
text.Should().NotContain("no evaluation was observed");
text.Should().Contain("no FG factor: the frame-generation state changed during the session");
}
}
@@ -0,0 +1,119 @@
using System.Diagnostics;
using FluentAssertions;
using FrameLedger.CaptureHost.Consume;
using FrameLedger.Shared;
namespace FrameLedger.CaptureHost.Tests.Consume;
/// <summary>
/// <c>03_METRICS</c> §Upscaling, the driver-reported rung: the driver's word names DLSS only where no hook did,
/// stands beside a hook's name as agreement or a printed disagreement, and never claims more than an identity.
/// </summary>
public sealed class DriverReportedUpscalerTests
{
private const FlHookFamily _hooks =
FlHookFamily.Present | FlHookFamily.UpscalerIdentity | FlHookFamily.UpscalerParams | FlHookFamily.FgEvaluations;
private static readonly NgxDriverState _created = NgxDriverState.Parse(
"NGXSTATE status=ANSWERED sr=0x605 rr=0x90001 fg=0x90001 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664");
private static readonly NgxDriverState _notCreated = NgxDriverState.Parse(
"NGXSTATE status=ANSWERED sr=0x5 rr=0x1 fg=0x1 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664");
/// <summary>Records with, or without, a hooked upscaler identity; the hook family is installed either way.</summary>
private static List<FlFrameRecord> Stream(FlUpscaler identity)
{
List<FlFrameRecord> stream = [];
ulong qpc = 1_000_000;
ulong step = (ulong)(Stopwatch.Frequency / 60);
for (int f = 0; f < 120; f++)
{
stream.Add(new FlFrameRecord
{
Qpc = qpc,
SwapchainId = 1,
OutputW = 2560,
OutputH = 1440,
MeasuredMask = (ushort)(FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.Upscaler),
Upscaler = (byte)identity,
});
qpc += step;
}
return stream;
}
private static (MeasuredFacts Facts, string Text) Render(FlUpscaler identity, NgxDriverState? ngx)
{
List<FlFrameRecord> stream = Stream(identity);
var writer = new FlWriterState { HooksInstalledMask = (uint)_hooks, RuntimeCensus = (uint)FlRuntimeCensus.Ran };
MeasuredFacts facts = MeasuredFacts.From(stream, writer, Stopwatch.Frequency, 0, 0, ngx: ngx);
return (facts, SessionReport.Render(facts));
}
[Fact]
public void LiesOfPShapeNoHookNamedAnUpscalerAndTheDriverSaysCreatedIsDlssDriverReported()
{
(MeasuredFacts facts, string text) = Render(FlUpscaler.Unknown, _created);
facts.Upscaler.Should().BeNull("the hook ran and decoded nothing on an NGX-direct title");
facts.UpscalerDriverReported.Should().Be(MeasuredFacts.UpscalerDlssDriverReported);
facts.UpscalerDriverNote.Should().BeNull("the identity line already carries the attribution");
text.Should().Contain("upscaler: Dlss (driver-reported:");
text.Should().Contain("not counted by this hook");
text.Should().NotContain("upscaler: N/A");
}
[Fact]
public void AHookedDlssBesideTheDriversCreatedWordPrintsAgreement()
{
(MeasuredFacts facts, string text) = Render(FlUpscaler.Dlss, _created);
facts.Upscaler.Should().Be("Dlss");
facts.UpscalerDriverReported.Should().BeNull("a hook's name always outranks the driver's word");
text.Should().Contain("upscaler: Dlss — the NVIDIA driver agrees");
text.Should().NotContain("driver-reported:");
}
[Fact]
public void AHookedDlssBesideTheDriversNegativeIsADisagreementPrintedNotResolved()
{
(MeasuredFacts facts, string text) = Render(FlUpscaler.Dlss, _notCreated);
facts.Upscaler.Should().Be("Dlss");
text.Should().Contain("upscaler: Dlss — WARNING: the NVIDIA driver reports NO NGX super-resolution feature created");
text.Should().Contain("printed rather than resolved");
}
[Fact]
public void NoHookNameAndTheDriversNegativeKeepsNaWithTheNegativeAttributed()
{
(MeasuredFacts facts, string text) = Render(FlUpscaler.Unknown, _notCreated);
facts.UpscalerDriverReported.Should().BeNull();
text.Should().Contain("upscaler: N/A (an upscaler hook ran");
text.Should().Contain("— the NVIDIA driver reports no NGX super-resolution feature created in this process (driver-reported; it says nothing about FSR or XeSS)");
}
[Fact]
public void AnFsrIdentityBesideTheDriversCreatedWordIsPrintedAsAlso()
{
(_, string text) = Render(FlUpscaler.Fsr3, _created);
text.Should().Contain("upscaler: Fsr3 — the NVIDIA driver also reports an NGX super-resolution feature");
}
[Fact]
public void WithoutAProbeOrWithoutAnAnswerTheLineIsByteIdenticalToBefore()
{
(_, string none) = Render(FlUpscaler.Unknown, null);
(_, string unanswered) = Render(FlUpscaler.Unknown, NgxDriverState.Parse("NGXSTATE status=UNANSWERED nvapi=-160"));
(_, string missing) = Render(FlUpscaler.Unknown, NgxDriverState.Of(NgxProbeOutcome.ProbeMissing, @"C:\nowhere\fl-probe-nvapi.exe"));
foreach (string text in new[] { none, unanswered, missing })
{
text.Should().Contain("upscaler: N/A (an upscaler hook ran");
text.Should().NotContain("NVIDIA driver");
}
}
}
@@ -0,0 +1,171 @@
using System.Diagnostics;
using FluentAssertions;
using FrameLedger.CaptureHost.Consume;
using FrameLedger.Shared;
namespace FrameLedger.CaptureHost.Tests.Consume;
/// <summary>
/// Displayed counted by DXGI (<c>FlFrameRecord.dxgiUnseen</c>, <c>20_OPEN_QUESTIONS</c> §H5 row P1-DXGI): on
/// Dying Light: The Beast (Streamline 2.8.0, DLSS FG ×4) the hook timed one present per application frame
/// while DXGI's own counter on the same chain moved by ≈ 3.9 — so the window counts
/// <c>Displayed = hooked + unseen</c>, says so on its own line, and every other title is byte-identical.
/// </summary>
public sealed class DxgiCountedWindowTests
{
private const FlHookFamily _hooks =
FlHookFamily.Present | FlHookFamily.UpscalerIdentity | FlHookFamily.UpscalerParams | FlHookFamily.FgEvaluations;
private const FlRuntimeCensus _dyingLightAtDlss = FlRuntimeCensus.Ran | FlRuntimeCensus.SlInterposer
| FlRuntimeCensus.SlDlss | FlRuntimeCensus.SlDlssG
| FlRuntimeCensus.NvngxDlssG;
private static readonly long _step = Stopwatch.Frequency / 70;
/// <summary>
/// The DL:TB shape: one hooked present per application frame (token drained, DLSS-G identity from the
/// tags), each carrying <paramref name="unseen"/> DXGI-counted presents under the bit, or under no bit
/// when <paramref name="claim"/> is false.
/// </summary>
private static List<FlFrameRecord> Stream(int appFrames, byte unseen, bool claim = true, int from = 0, int to = int.MaxValue)
{
List<FlFrameRecord> stream = [];
ulong qpc = 1_000_000;
for (int f = 0; f < appFrames; f++)
{
bool inRange = f >= from && f < to;
byte u = inRange ? unseen : (byte)0;
stream.Add(new FlFrameRecord
{
Qpc = qpc,
SwapchainId = 1,
OutputW = 2560,
OutputH = 1440,
MeasuredMask = (ushort)(FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.Upscaler
| FlMeasured.Fg | FlMeasured.FgCounts
| (claim ? FlMeasured.DxgiPresents : FlMeasured.None)),
Upscaler = (byte)FlUpscaler.Dlss,
FgEvaluations = 1,
FgMode = (byte)FlFgMode.DlssG,
FeatureFlags = (byte)FlFeatureFlags.RayReconstructionObserved,
DxgiUnseen = u,
});
qpc += (ulong)_step;
}
return stream;
}
private static RuntimeModuleSet Interposer(string version) => new(
[new RuntimeModuleInfo("sl.interposer.dll", @"D:\Games\title\sl.interposer.dll", version.Replace('.', ','),
Version.Parse(version))],
Snapshots: 1, Unreadable: 0);
private static (MeasuredFacts Facts, string Text) Render(List<FlFrameRecord> stream, uint unseenTotal, uint samples)
{
var writer = new FlWriterState
{
HooksInstalledMask = (uint)_hooks,
RuntimeCensus = (uint)_dyingLightAtDlss,
DxgiPresentsUnseen = unseenTotal,
DxgiPresentSamples = samples,
};
MeasuredFacts facts = MeasuredFacts.From(stream, writer, Stopwatch.Frequency, 0, 0,
FgWindow.From(stream, Stopwatch.Frequency), Interposer("2.8.0.0"));
return (facts, SessionReport.Render(facts));
}
[Fact]
public void ThreeUnseenPerHookedPresentMakesAFourTimesTrioLabelledDxgiCounted()
{
List<FlFrameRecord> s = Stream(200, unseen: 3);
(MeasuredFacts facts, string text) = Render(s, unseenTotal: 600, samples: 200);
FgWindow w = facts.Fg!;
w.Presents.Should().Be(200);
w.DxgiUnseen.Should().Be(600);
w.DxgiClaiming.Should().Be(200);
w.DisplayedPresents.Should().Be(800);
w.DxgiCounted.Should().BeTrue();
w.Refusal.Should().BeNull();
w.Factor.Should().BeApproximately(4.0, 0.001);
w.IsActive.Should().BeTrue();
w.PresentsPerBatch.Should().BeApproximately(4.0, 0.001);
(w.DisplayedFps / w.NativeFps).Should().BeApproximately(4.0, 0.03, "Native × factor ≈ Displayed over ONE window");
facts.NoneWithheld.Should().BeNull("the count is no longer 1.0, so there is nothing to withhold");
facts.FgMode.Should().Be("DlssG");
text.Should().Contain("Native FPS:").And.Contain("-> Displayed FPS:").And.Contain("(x4 FG)");
text.Should().Contain("over 800 present(s)");
text.Should().Contain("Displayed is DXGI-COUNTED: 600 of those present(s)");
text.Should().Contain("a count DXGI made, not this hook");
text.Should().Contain("dxgi-unseen=600");
text.Should().NotContain("WITHHELD").And.NotContain("Presented FPS:");
}
[Fact]
public void ZeroUnseenEverywhereIsByteIdenticalToTheWindowBeforeTheByteExisted()
{
List<FlFrameRecord> claimed = Stream(200, unseen: 0);
List<FlFrameRecord> unclaimed = Stream(200, unseen: 0, claim: false);
FgWindow a = FgWindow.From(claimed, Stopwatch.Frequency);
FgWindow b = FgWindow.From(unclaimed, Stopwatch.Frequency);
a.DxgiCounted.Should().BeFalse();
a.DxgiClaiming.Should().Be(200);
b.DxgiClaiming.Should().Be(0);
a.DisplayedPresents.Should().Be(200);
a.Factor.Should().Be(b.Factor);
a.DisplayedFps.Should().Be(b.DisplayedFps);
a.BucketFactors.Should().Equal(b.BucketFactors);
// And the DL:TB shape with the count at 1.0 beside a READ counter is `none` since Leg 0: DXGI itself
// counted nothing this hook did not, on the chain where the 2.8.0 pacer's presents would show.
(MeasuredFacts facts, string text) = Render(claimed, unseenTotal: 0, samples: 200);
facts.NoneWithheld.Should().BeNull();
text.Should().Contain("frame generation: none").And.Contain("DXGI's own present counter agrees")
.And.NotContain("WITHHELD").And.NotContain("DXGI-COUNTED");
}
[Fact]
public void APacerThatStopsHalfWayFailsUniformityLikeAnyOtherStateChange()
{
List<FlFrameRecord> s = Stream(400, unseen: 3, from: 0, to: 200);
FgWindow w = FgWindow.From(s, Stopwatch.Frequency);
w.DxgiUnseen.Should().Be(600);
w.Refusal.Should().Contain("changed during the session");
w.Factor.Should().BeNull();
w.BatchRefusal.Should().Contain("changed during the session", "presents/batch takes the same numerator");
}
[Fact]
public void ASaturatedByteIsASentinelAndTheFactorIsRefused()
{
List<FlFrameRecord> s = Stream(200, unseen: 3);
FlFrameRecord r = s[100];
r.DxgiUnseen = byte.MaxValue;
s[100] = r;
FgWindow w = FgWindow.From(s, Stopwatch.Frequency);
w.DxgiSaturated.Should().Be(1);
w.Refusal.Should().Contain("255");
w.Factor.Should().BeNull();
}
[Fact]
public void AByteUnderAClearBitIsNobodysCountAndAnHonestyViolation()
{
List<FlFrameRecord> s = Stream(200, unseen: 3, claim: false);
(MeasuredFacts facts, _) = Render(s, unseenTotal: 0, samples: 0);
facts.Fg!.DxgiUnseen.Should().Be(0, "an unclaimed byte is not read");
facts.Fg.Factor.Should().BeApproximately(1.0, 0.001);
facts.HonestyViolations.Should().Be(200);
}
}
@@ -0,0 +1,113 @@
using System.Diagnostics;
using FluentAssertions;
using FrameLedger.CaptureHost.Consume;
using FrameLedger.Shared;
namespace FrameLedger.CaptureHost.Tests.Consume;
/// <summary>
/// DXGI's own present counter in the writer state (<c>FlWriterState.dxgiPresentsUnseen / dxgiPresentSamples</c>,
/// <c>20_OPEN_QUESTIONS</c> §H5 A1.7) beside a counted <c>none</c>: since Leg 0 (2026-09-06) a READ counter
/// decides the Streamline 2.8.0 shape, and on every shape it is a second witness printed beside the count.
/// </summary>
public sealed class DxgiPresentCounterTests
{
private const FlHookFamily _countingHooks =
FlHookFamily.Present | FlHookFamily.UpscalerIdentity | FlHookFamily.FgEvaluations;
private const FlRuntimeCensus _dyingLightAtDlss = FlRuntimeCensus.Ran | FlRuntimeCensus.SlInterposer
| FlRuntimeCensus.SlDlss | FlRuntimeCensus.SlDlssG
| FlRuntimeCensus.NvngxDlssG;
private static List<FlFrameRecord> Stream(int appFrames)
{
List<FlFrameRecord> stream = [];
ulong qpc = 1_000_000;
ulong step = (ulong)(Stopwatch.Frequency / 60);
for (int f = 0; f < appFrames; f++)
{
stream.Add(new FlFrameRecord
{
Qpc = qpc,
SwapchainId = 1,
MeasuredMask = (ushort)(FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.Fg | FlMeasured.FgCounts),
FgEvaluations = 1,
FgMode = (byte)FlFgMode.Unknown,
});
qpc += step;
}
return stream;
}
private static RuntimeModuleSet Interposer(string version) => new(
[new RuntimeModuleInfo("sl.interposer.dll", @"D:\Games\title\sl.interposer.dll", version.Replace('.', ','),
Version.Parse(version))],
Snapshots: 1, Unreadable: 0);
private static (MeasuredFacts Facts, string Text) Render(FlRuntimeCensus census, RuntimeModuleSet? modules,
uint unseen, uint samples)
{
List<FlFrameRecord> stream = Stream(200);
var writer = new FlWriterState
{
HooksInstalledMask = (uint)_countingHooks,
RuntimeCensus = (uint)census,
DxgiPresentsUnseen = unseen,
DxgiPresentSamples = samples,
};
MeasuredFacts facts = MeasuredFacts.From(stream, writer, Stopwatch.Frequency, 0, 0,
FgWindow.From(stream, Stopwatch.Frequency), modules);
return (facts, SessionReport.Render(facts));
}
[Fact]
public void ZeroUnseenOverAReadCounterOnTheStreamline28ShapeIsNoneWithDxgiAgreeing()
{
(MeasuredFacts facts, string text) = Render(_dyingLightAtDlss, Interposer("2.8.0.0"), unseen: 0, samples: 200);
facts.DxgiUnseenPerHookedPresent.Should().Be(0.0);
facts.NoneWithheld.Should().BeNull();
facts.FgMode.Should().Be(MeasuredFacts.FgNone);
text.Should().Contain("frame generation: none");
text.Should().Contain("DXGI's own present counter agrees: 0 unseen over 200 hooked present(s)");
text.Should().NotContain("WITHHELD");
}
[Fact]
public void ACounterNeverReadStillWithholdsAndSaysSo()
{
(MeasuredFacts facts, string text) = Render(_dyingLightAtDlss, Interposer("2.8.0.0"), unseen: 0, samples: 0);
facts.DxgiUnseenPerHookedPresent.Should().BeNull("no hooked present read the counter");
facts.NoneWithheld.Should().Contain("was not read this session");
facts.NoneBesideDxgi.Should().BeNull();
text.Should().Contain("`none` is WITHHELD");
text.Should().NotContain("DXGI's own present counter");
}
[Fact]
public void UnseenPresentsInTheWriterStateButNotInTheRecordsIsAContradictionNotANone()
{
// The two words come from the same writer, so a total the records do not carry is a defect;
// it is refused rather than read as either `none` or a factor.
(MeasuredFacts facts, string text) = Render(_dyingLightAtDlss, Interposer("2.8.0.0"), unseen: 600, samples: 200);
facts.DxgiUnseenPerHookedPresent.Should().BeApproximately(3.0, 0.001);
facts.NoneWithheld.Should().Contain("disagree").And.Contain("600");
text.Should().Contain("`none` is WITHHELD");
text.Should().NotContain("frame generation: none");
}
[Fact]
public void AValidatedNoneOnStreamline27PrintsTheCounterAsASecondWitness()
{
(MeasuredFacts facts, string text) = Render(FlRuntimeCensus.Ran | FlRuntimeCensus.SlInterposer | FlRuntimeCensus.NvngxDlssG,
Interposer("2.7.1.0"), unseen: 7, samples: 200);
facts.NoneWithheld.Should().BeNull();
facts.FgMode.Should().Be(MeasuredFacts.FgNone);
text.Should().Contain("frame generation: none");
text.Should().Contain("DXGI's own present counter read 7 unseen over 200 hooked present(s), inside the `none` ceiling");
}
}
@@ -66,9 +66,16 @@ public sealed partial class H5CaseThreeTests
Snapshots: 1, Unreadable: 0);
private static (MeasuredFacts Facts, string Text) Render(List<FlFrameRecord> stream, FlRuntimeCensus census,
RuntimeModuleSet? modules, FlHookFamily hooks = _countingHooks)
RuntimeModuleSet? modules, FlHookFamily hooks = _countingHooks, uint dxgiSamples = 0)
{
var writer = new FlWriterState { HooksInstalledMask = (uint)hooks, RuntimeCensus = (uint)census };
// dxgiSamples 0 is the shape every case below was written against: DXGI's counter not read,
// which since Leg 0 (2026-09-06) is the only shape the gate still withholds on.
var writer = new FlWriterState
{
HooksInstalledMask = (uint)hooks,
RuntimeCensus = (uint)census,
DxgiPresentSamples = dxgiSamples,
};
MeasuredFacts facts = MeasuredFacts.From(stream, writer, Stopwatch.Frequency, 0, 0,
FgWindow.From(stream, Stopwatch.Frequency), modules);
return (facts, SessionReport.Render(facts));
@@ -99,6 +106,32 @@ public sealed partial class H5CaseThreeTests
FgFactorShape().IsMatch(text).Should().BeFalse("a withheld none prints no factor");
}
[Fact]
public void LegZeroDlssgOffOnStreamline28IsNoneWhenDxgiCountedNothingUnseen()
{
// 2026-09-06, 07:45 and 07:55: Dying Light: The Beast with frame generation OFF, census still
// 0x25F0F (the plugin is a startup-time load), presents = tokens, `unseen=0 over samples=3659`.
// The 2.8.0 pacer's presents are DXGI presents (row P1-DXGI), so DXGI counting none is `none`.
(MeasuredFacts facts, string text) = Render(Stream(200, 1), _dyingLightAtDlss, Interposer("2.8.0.0"),
dxgiSamples: 3659);
facts.NoneWithheld.Should().BeNull();
facts.FgMode.Should().Be(MeasuredFacts.FgNone);
facts.NoneBesideDxgi.Should().Contain("agrees").And.Contain("3659");
text.Should().Contain(" FPS: ");
text.Should().Contain("frame generation: none");
text.Should().Contain("DXGI's own present counter agrees: 0 unseen over 3659 hooked present(s)");
text.Should().NotContain("WITHHELD").And.NotContain("Presented FPS:");
}
[Fact]
public void TheWithheldReasonNamesTheCounterThatWasNotRead()
{
(MeasuredFacts facts, _) = Render(Stream(200, 1), _dyingLightAtDlss, Interposer("2.8.0.0"));
facts.NoneWithheld.Should().Contain("was not read this session").And.Contain("P1-DXGI");
}
[Fact]
public void CyberpunkOnStreamline271WithNvngxDlssgLoadedKeepsNone()
{
@@ -0,0 +1,86 @@
using FluentAssertions;
using FrameLedger.CaptureHost.Consume;
namespace FrameLedger.CaptureHost.Tests.Consume;
/// <summary>
/// The probe's machine line, parsed and merged: the words the owner measured on 2026-09-06 are the fixtures.
/// </summary>
public sealed class NgxDriverStateTests
{
private const string _hellIsUs =
"NGXSTATE status=ANSWERED sr=0x0000000000080605 rr=0x0000000000080005 fg=0x0000000000000005 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664";
private const string _expedition33Override =
"NGXSTATE status=ANSWERED sr=0x000000000008067F rr=0x0000000000080005 fg=0x000000000000001F ratio=0.0000 mode=2 preset=11 fgcount=0 fgpreset=0 fgmode=0 driver=61664";
[Fact]
public void TheAnsweredLineIsReadWholeAndTheHumanLinesAreIgnored()
{
string output = "fl-probe-nvapi --ngx-state 12468 — the driver's NGX feedback for one process\r\n\r\n"
+ " driver 616.64 (r616_41)\r\n SR feedback 0x0000000000080605 : INITIALIZED DLL_EXISTS CREATED EVALUATE ERR_NOT_FOUND\r\n"
+ _hellIsUs + "\r\n";
NgxDriverState s = NgxDriverState.Parse(output);
s.Outcome.Should().Be(NgxProbeOutcome.Answered);
s.Sr.Should().Be(0x80605UL);
s.Rr.Should().Be(0x80005UL);
s.Fg.Should().Be(0x5UL);
s.Driver.Should().Be(61664u);
s.SrCreatedAndEvaluated.Should().BeTrue("CREATED and EVALUATE are both set on Hell Is Us without an override");
s.Readings.Should().Be(1);
s.Answered.Should().Be(1);
NgxOverrideFlags.Describe(s.Sr).Should().Be("INITIALIZED DLL_EXISTS CREATED EVALUATE ERR_NOT_FOUND");
NgxOverrideFlags.Describe(s.Fg).Should().Be("INITIALIZED DLL_EXISTS");
NgxOverrideFlags.Describe(0).Should().Be("-");
NgxOverrideFlags.Describe(1UL << 40).Should().Be("0x10000000000", "an unknown bit is printed, never dropped");
}
[Fact]
public void TheOverrideFieldsAreCarriedAndNamedAsOverrideFields()
{
NgxDriverState s = NgxDriverState.Parse(_expedition33Override);
s.PerformanceMode.Should().Be(2u);
s.RenderPreset.Should().Be(11u);
s.ScalingRatio.Should().Be(0.0);
s.SrCreatedAndEvaluated.Should().BeTrue();
s.Describe().Should().Contain("performanceMode=2 renderPreset=11").And.Contain("the OVERRIDE's values")
.And.Contain("identity, never a count or a multiplier");
}
[Fact]
public void UnansweredDegradedAndGarbageAreOutcomesNotExceptions()
{
NgxDriverState.Parse("NGXSTATE status=UNANSWERED nvapi=-160").Outcome.Should().Be(NgxProbeOutcome.Unanswered);
NgxDriverState.Parse("NGXSTATE status=DEGRADED nvapi=-2").Outcome.Should().Be(NgxProbeOutcome.Degraded);
NgxDriverState.Parse("nothing here").Outcome.Should().Be(NgxProbeOutcome.ProbeFailed);
NgxDriverState.Parse("NGXSTATE status=ANSWERED sr=zz").Outcome.Should().Be(NgxProbeOutcome.ProbeFailed);
NgxDriverState.Parse("NGXSTATE status=WHAT").Outcome.Should().Be(NgxProbeOutcome.ProbeFailed);
NgxDriverState.Parse("NGXSTATE status=UNANSWERED nvapi=-160").SrCreatedAndEvaluated.Should().BeFalse();
NgxDriverState.Parse("NGXSTATE status=UNANSWERED nvapi=-160").Describe().Should().Contain("did not answer").And.Contain("NvAPI -160");
}
[Fact]
public void MergeKeepsTheLastAnswerCountsEveryReadingAndFlagsAChange()
{
NgxDriverState before = NgxDriverState.Parse(
"NGXSTATE status=ANSWERED sr=0x5 rr=0x1 fg=0x5 ratio=0.0000 mode=0 preset=0 fgcount=0 fgpreset=0 fgmode=0 driver=61664");
NgxDriverState after = NgxDriverState.Parse(_hellIsUs);
NgxDriverState silent = NgxDriverState.Parse("NGXSTATE status=UNANSWERED nvapi=-160");
NgxDriverState merged = NgxDriverState.NotRun.Merge(before).Merge(after).Merge(silent);
merged.Outcome.Should().Be(NgxProbeOutcome.Answered, "an earlier answer outranks a later silence");
merged.Sr.Should().Be(0x80605UL, "the last ANSWERED reading is the state");
merged.Readings.Should().Be(3);
merged.Answered.Should().Be(2);
merged.Changed.Should().BeTrue("the SR word gained CREATED | EVALUATE between readings");
merged.Describe().Should().Contain("answered 2 of 3 probe(s), and the words CHANGED between readings");
NgxDriverState same = NgxDriverState.NotRun.Merge(after).Merge(after);
same.Changed.Should().BeFalse();
same.Describe().Should().Contain("answered 2 of 2 probe(s); driver 616.64");
}
}
@@ -0,0 +1,96 @@
using System.Diagnostics;
using FluentAssertions;
using FrameLedger.CaptureHost.Consume;
using FrameLedger.Shared;
namespace FrameLedger.CaptureHost.Tests.Consume;
/// <summary>
/// The stall diagnostic: the longest intervals, placed against the host's own touches on the target.
/// </summary>
public sealed class StallReportTests
{
private static readonly long _hz = Stopwatch.Frequency;
/// <summary>A 120 FPS stream with one gap of <paramref name="gapMs"/> after <paramref name="gapAfter"/> presents.</summary>
private static List<FlFrameRecord> StreamWithGap(int presents, int gapAfter, double gapMs, out long gapStartQpc)
{
List<FlFrameRecord> s = [];
long qpc = 5_000_000;
long step = _hz / 120;
gapStartQpc = 0;
for (int i = 0; i < presents; i++)
{
s.Add(new FlFrameRecord { FrameIndex = (uint)i, Qpc = (ulong)qpc, SwapchainId = 1 });
if (i == gapAfter)
{
gapStartQpc = qpc;
qpc += (long)(gapMs / 1000.0 * _hz);
}
else
{
qpc += step;
}
}
return s;
}
[Fact]
public void TheLongestIntervalIsFoundAndPlacedInTheSession()
{
List<FlFrameRecord> s = StreamWithGap(600, 240, 1000.0, out _);
StallReport r = StallReport.From(s, _hz, []);
r.Intervals.Should().Be(599);
r.OverThreshold.Should().Be(1);
r.Longest.Should().HaveCount(3);
r.Longest[0].Milliseconds.Should().BeApproximately(1000.0, 1.0);
r.Longest[0].AtSeconds.Should().BeApproximately(2.0, 0.01, "240 presents at 120 FPS");
r.Longest[0].NearestTouchSeconds.Should().BeNull();
r.Describe().Should().Contain("1 interval(s) of 599 at or over 100 ms").And.Contain("longest: 1000 ms at t=2.00 s")
.And.Contain("no host touch recorded");
}
[Fact]
public void AHostTouchInsideTheStallNamesFrameLedgerAsASuspect()
{
List<FlFrameRecord> s = StreamWithGap(600, 240, 1000.0, out long gapStart);
long touch = gapStart + _hz / 2; // half a second into the gap
StallReport r = StallReport.From(s, _hz, [touch]);
r.Longest[0].NearestTouchSeconds.Should().Be(0.0);
r.Longest[0].NearATouch.Should().BeTrue();
r.Describe().Should().Contain("A HOST TOUCH INSIDE the interval").And.Contain("SUSPECT");
}
[Fact]
public void AHostTouchJustBeforeTheStallIsStillASuspectAndAFarOneIsNot()
{
List<FlFrameRecord> s = StreamWithGap(600, 240, 1000.0, out long gapStart);
StallReport near = StallReport.From(s, _hz, [gapStart - _hz / 4]); // 0.25 s before
StallReport far = StallReport.From(s, _hz, [gapStart + 30 * _hz]); // 30 s after
near.Longest[0].NearestTouchSeconds.Should().BeApproximately(-0.25, 0.01);
near.Longest[0].NearATouch.Should().BeTrue();
near.Describe().Should().Contain("0.25 s before it");
far.Longest[0].NearATouch.Should().BeFalse();
far.Describe().Should().Contain("not ours");
}
[Fact]
public void ASmoothStreamHasNoStallAndStillPrintsItsLongest()
{
List<FlFrameRecord> s = StreamWithGap(300, -1, 0, out _);
StallReport r = StallReport.From(s, _hz, [(long)s[10].Qpc]);
r.OverThreshold.Should().Be(0);
r.Longest[0].Milliseconds.Should().BeApproximately(1000.0 / 120, 0.05);
r.Touches.Should().Be(1);
StallReport.From([s[0]], _hz, []).Describe().Should().Contain("fewer than two presents");
}
}
@@ -195,12 +195,25 @@ public sealed class ShmDrainIntegrationTests
// else. In layout v3 the zero-defaults are honest by construction — FlUpscaler.NotReported and
// FlFgMode.NotReported are 0 — and the mask corroborates rather than being the sole defence.
//
// OutputRes is asserted as "no bit outside these two" rather than as an exact value, because the
// overflow fixture legitimately produces records with PresentArgs alone: past 16 swapchains the
// writer has no size to report and #57 made the bit conditional on there being one.
// OutputRes is asserted as "no bit outside these three" rather than as an exact value, because
// the overflow fixture legitimately produces records with PresentArgs alone: past 16 swapchains
// the writer has no size to report and #57 made the bit conditional on there being one. The
// third bit is DxgiPresents (2026-09-05): the present hook reads GetLastPresentCount on the chain
// it saw, and every record after a chain's first claims the delta — a zero here, which the
// byte assertion below pins, because this fixture presents only through the patched body.
records.Should().OnlyContain(
r => (r.MeasuredMask & ~(ushort)(FlMeasured.OutputRes | FlMeasured.PresentArgs)) == 0,
r => (r.MeasuredMask & ~(ushort)(FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.DxgiPresents)) == 0,
"the writer must claim exactly what it measured — no more");
// ...AND A PAUSE IS NOT AN UNSEEN PRESENT. The paused-session case below lets the harness
// present ~85 times while the hook declines them; the first record after the resume claimed
// them all as "presents DXGI counted and this hook never saw" until the epoch guard in
// RecordPresent made a declined present invalidate the chain's last reading. This assertion
// runs on every fixture, so that case is the one that keeps the guard honest.
records.Should().OnlyContain(r => r.DxgiUnseen == 0,
"DXGI must count nothing this hook did not on a fixture that presents only through the patched body "
+ "— including across a pause, which the hook SAW and declined");
records.Should().Contain(r => (r.MeasuredMask & (ushort)FlMeasured.DxgiPresents) != 0,
"after a chain's first hooked present the counter has a previous value to difference against");
records.Should().OnlyContain(r => (r.MeasuredMask & (ushort)FlMeasured.PresentArgs) != 0,
"syncInterval and presentFlags are the call's own arguments; a DXGI present hook always has them");
records.Should().OnlyContain(r => r.RtFlags == 0,