Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dc0dd48c2
|
||
|
|
d7f056947a | ||
|
|
5807220c51 |
No files matched your search
+2
-84
@@ -35,96 +35,14 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **Every frame-generation state a session held, in its summary** (owner request 2026-10-19, decision D62). Under the
|
||||
figures, *Frame generation in this session* lists each state — `×2.0`, `×3.0`, `×4.0`, `×6.0`… — with its own
|
||||
Native → Displayed and its share of the time to two decimals, then the time with no frame generation and the time no
|
||||
state explains (*Not classified*: switching, loading, a multiplier that changed faster than five seconds), above a bar
|
||||
of those shares. A line above them says how frame generation was set: in the NVIDIA App (*Dynamic, up to ×6, target:
|
||||
max refresh rate*, *Fixed ×4*, from the driver profile stored with the session) or in the game. Each state is read
|
||||
over the same five-second windows as the steady state and lasts at least 10 seconds; nothing is averaged across
|
||||
states (rule 6). Stored with the session (schema 0020, `sessions.fg_mix`): a session recorded before has none, and
|
||||
its summary says so in one line. The CSV export gains a `# fg_mix:` line; the JSON carries the column. The FG×
|
||||
column's two formats are translated strings now, and the driver-profile line's automatic dynamic target reads as the
|
||||
NVIDIA App says it: *max refresh rate*.
|
||||
|
||||
- **The quality mode the NVIDIA App set, on every page that names the upscaler** (owner request 2026-10-19, decision
|
||||
D63). Where the NVIDIA App overrides DLSS Super Resolution for a game and the NVIDIA driver reports that the
|
||||
override applied in the session, the summary, the Sessions tab, the game page and the live card say so:
|
||||
*DLSS (driver-reported) Quality · NVIDIA App*. It is read from what every session already stores, so sessions
|
||||
recorded before read the same; when the profile and the driver disagree, or the driver's report alone cannot settle
|
||||
the mode, the session reads *· NVIDIA App override* with no mode — never the game's own value in its place. The CSV
|
||||
export gains a `# quality_mode:` line. `legal/ACCURACY.md`'s *Quality mode* bullet says so, in the words approved
|
||||
with the plan; **the Disclaimer is 2.11** and the Legal Gate shows it once.
|
||||
|
||||
- **Which DLSS a session ran** (owner request 2026-10-19, decision D64). The summary's DLSS line gives each DLSS
|
||||
library's version and whether it was loaded from the game or from the graphics driver (the NVIDIA App's override
|
||||
loads the driver's own copy), the model preset the NVIDIA driver reports, and *DLSS 4* or *DLSS 4.5* only where the
|
||||
session shows it — the preset (L or M: 4.5; J or K: 4) or a measured multi-frame factor (×5–×6: 4.5; ×3–×4: 4) —;
|
||||
DLSS 2 and 3 from their libraries; *DLSS 5 runtime loaded* when its library is. The game page repeats the label and
|
||||
the CSV export gains `# dlss:`. The module snapshot now records every library under the NVIDIA override folder,
|
||||
whatever its name, and each module's folder class (schema 0021, `sessions.runtime_module_sources` — never the path),
|
||||
plus five more libraries by name (`sl.dlss_d.dll`, `sl.common.dll`, `sl.reflex.dll`, `amd_fidelityfx_loader_dx12.dll`,
|
||||
`nvngx_dlssnr.dll`). **Privacy Policy 2.12** says so, in the words approved with the plan; `legal/ACCURACY.md` gains
|
||||
the *DLSS version* bullet.
|
||||
|
||||
### Changed
|
||||
|
||||
- **SonarCloud analyses only FrameLedger's own code** (developers only; owner request 2026-10-19, decision D67). A
|
||||
`.sonarcloud.properties` at the root keeps the vendored SDK headers, generated files, test fixtures, licence texts and
|
||||
the SQLite migrations out of the analysis and reports the native code against C++20; `docs/13_CI_CD.md` §SonarCloud
|
||||
records the triage of the 341 issues the last analysis left — the rules this project breaks by design and why, the
|
||||
false positives, and the ones the next change fixes — with the steps to mark them in SonarCloud.
|
||||
- **The long documents are split** (developers only; owner request 2026-10-19, decision D66). `CHANGELOG.md`
|
||||
keeps `[Unreleased]` and a table of the releases; each release's section now lives in its own file,
|
||||
`docs/changelog/<version>.md`, and the ledger kept before the first tag in five parts — moved verbatim: the notes
|
||||
`tools/release-notes.ps1` takes for each of the 23 releases are byte for byte what they were, and it reads the
|
||||
version's own file. `docs/HANDOFF.md` (2,844 lines, now 299) keeps what to do next, the open owner-only items and an
|
||||
index of every owner decision; the history of each phase and train, the passed owner-only items and the traps
|
||||
moved to `docs/handoff/`, and a table there resolves every section the code and the documents cite. A new gate,
|
||||
`tools/docs-split-check.ps1`, keeps each index and its files naming each other.
|
||||
- **The open questions and the measurement notes are split too** (developers only, D66). `docs/20_OPEN_QUESTIONS.md`
|
||||
(4,467 lines, now 2,008) keeps its rules, §S24 and every entry not resolved; the 30 entries §S24 marks resolved
|
||||
moved, with their reasoning and in their order, to `docs/open-questions/closed-s.md` and `closed-h.md`, and a table
|
||||
at the end of each series lists them. `docs/spike-notes.md` (2,816 lines) is now the index of its 24 sections, each
|
||||
in its own file under `docs/spike-notes/`; a new measurement gets the next number, its own file and a row. Both
|
||||
rebuild their originals byte for byte, and the same gate holds their indexes to their files.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The NVIDIA driver line read the driver's mode in the wrong numbering.** The driver reports the mode an override
|
||||
set in NGX's own numbering, not the driver profile's: the owner's Silent Hill 2 session ran under the NVIDIA App's
|
||||
Ultra Performance (profile value 5) and the driver reported 3 — which the line printed as nothing, and a DLAA
|
||||
override's 5 would have printed as "Ultra Performance". Five comments in the native code called a quality byte of
|
||||
0 "NGX MaxPerf" — in the numbering that byte carries, 0 is "DLSS off" (comments only, no code changes).
|
||||
- **Opening a folder in Explorer** — the logs, the data folder, the licences, a bug report's zip and the folder named
|
||||
after a failed start — starts `explorer.exe` from the Windows folder by its full path, never a program of that name
|
||||
found on the search path, and always hands it the path in quotes (three of the five places passed it bare).
|
||||
- **What SonarCloud found that was real** (developers only): the one third-party GitHub Action is pinned to its
|
||||
commit; two string reads in native code are bounded by their buffer (the guard's rules-file path handed to the Agent,
|
||||
and the driver's branch name the NVAPI bridge copies); the pipe server's accept loop states that it ends only when
|
||||
cancelled; a launch's own session names its absent stop token (`CancellationToken.None`, with the reason) where it
|
||||
wrote `default` — the same value, now said on purpose; an unused overload of
|
||||
the process launcher that hid the other is gone; the identifier `module` (a C++20 keyword in some positions) is
|
||||
renamed in the hook layer — a rename only, no code changes; and a hook-overhead probe no longer uses a compound
|
||||
assignment on a `volatile`, which C++20 deprecates. The analyzers Dependabot updates in #314 flag the first-start
|
||||
window's own answer task and one test fake's synchronous wait; both are suppressed with their reasons, so that update
|
||||
can merge.
|
||||
- **The game-side log keeps every line a stop writes.** When hooking stopped on a game's own drawing thread — the
|
||||
capture agent's safety stop takes effect within one frame there — the Overlay's last write of its log could happen
|
||||
while that thread was still listing the hooks it removed, and the last of them never reached the file
|
||||
(`overlay-*.log`, the file a bug report carries). The last write now waits, at most two seconds, for the stop to
|
||||
finish and ends with a `STOP_FLUSHED` line; a line still being written is never printed half-done. Nothing changes
|
||||
on the per-frame path. This was the native test that went red under load since beta.9 (`fl_guard`'s log case),
|
||||
now run 20 times with every processor busy.
|
||||
|
||||
## Releases
|
||||
|
||||
Newest first. Each file holds that release's section exactly as it stood here.
|
||||
|
||||
| Version | Date | Notes |
|
||||
|---|---|---|
|
||||
| `0.1.0-beta.25` | 2026-10-19 | [`docs/changelog/0.1.0-beta.25.md`](docs/changelog/0.1.0-beta.25.md) |
|
||||
| `0.1.0-beta.24` | 2026-10-19 | [`docs/changelog/0.1.0-beta.24.md`](docs/changelog/0.1.0-beta.24.md) |
|
||||
| `0.1.0-beta.23` | 2026-10-14 | [`docs/changelog/0.1.0-beta.23.md`](docs/changelog/0.1.0-beta.23.md) |
|
||||
| `0.1.0-beta.22` | 2026-10-13 | [`docs/changelog/0.1.0-beta.22.md`](docs/changelog/0.1.0-beta.22.md) |
|
||||
| `0.1.0-beta.21` | 2026-10-13 | [`docs/changelog/0.1.0-beta.21.md`](docs/changelog/0.1.0-beta.21.md) |
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
|
||||
<ItemGroup Label="Analyzers (build-time only)">
|
||||
<PackageVersion Include="Roslynator.Analyzers" Version="5.0.1" />
|
||||
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.299" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="18.7.23" />
|
||||
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.307" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="18.12.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Testing">
|
||||
|
||||
+7
-3
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
|
||||
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
|
||||
page lists them in plain words; each item links to the document that has the details.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.23.*
|
||||
*Beta software: this page describes version 0.1.0-beta.25.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -89,8 +89,12 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
|
||||
reports it, the page says it is the driver's report.
|
||||
- **The quality mode** (Quality, Balanced, DLAA, …) is shown only when it is known: the NVIDIA App's override
|
||||
where the NVIDIA driver reports it applied (marked *· NVIDIA App*, since 0.1.0-beta.24), or the mode the game
|
||||
passed to a call FrameLedger reads — which no game has done yet. The mode chosen in a game's own menu is not
|
||||
readable for DLSS without Streamline, and is not inferred from the render scale. How the driver numbers DLAA in
|
||||
passed to a call FrameLedger reads. For FSR through AMD's FidelityFX libraries (since 0.1.0-beta.25) that is the
|
||||
mode whose render size the game asked AMD's library for and then rendered at — checked on a test program, not yet
|
||||
on a real game; a game at a dynamic resolution, one that sizes its frames without asking, and a game FrameLedger
|
||||
joined after it asked show none. For DLSS it is the options a Streamline game passes, which no game has done yet.
|
||||
The mode chosen in a game's own menu is not readable for DLSS without Streamline, and is not inferred from the
|
||||
render scale. How the driver numbers DLAA in
|
||||
its report is NVIDIA's documented value, not yet seen on a real game. The render resolution is N/A where the
|
||||
game's own calls do not carry it (DLSS without Streamline, for one). ([Metrics](docs/03_METRICS.md))
|
||||
- **Which DLSS ran** (since 0.1.0-beta.24) is named only from what the session showed: the model preset the NVIDIA
|
||||
|
||||
@@ -12,7 +12,7 @@ pages.
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-19.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.23`** (2026-10-14), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.25`** (2026-10-19), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -39,8 +39,9 @@ pages.
|
||||
> - **Quality mode:** shown only when it is known. When the NVIDIA App overrides DLSS Super Resolution for
|
||||
> the game and the NVIDIA driver reports that the override applied in the session, the override's mode is
|
||||
> shown and marked as the NVIDIA App's. Otherwise the mode the game itself passed: the DLSS options a
|
||||
> Streamline title passes with its per-frame call (not yet seen on a real title). In every other case no
|
||||
> mode is shown.
|
||||
> Streamline title passes with its per-frame call (not yet seen on a real title), or, for FSR through
|
||||
> AMD's FidelityFX libraries, the mode whose render size the game asked for and then rendered at. In
|
||||
> every other case — FSR at a dynamic resolution among them — no mode is shown.
|
||||
> - **DLSS version:** the version of each DLSS library the game loaded and whether it came from the game or from
|
||||
> the NVIDIA driver; "DLSS 4" or "DLSS 4.5" only when the session shows it (the model preset the driver reports,
|
||||
> or a measured multi-frame factor); DLSS 5 only as "runtime loaded".
|
||||
@@ -173,7 +174,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest pre-release is `v0.1.0-beta.23` (2026-10-14); before it `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
|
||||
> **The latest pre-release is `v0.1.0-beta.25` (2026-10-19); before it `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
|
||||
|
||||
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
|
||||
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
|
||||
|
||||
@@ -634,6 +634,29 @@ From the upscaler hooks we get, per frame:
|
||||
> `eOff` and anything past `eCount` never reach a row). The ffx-api dispatch carries no quality and XeSS has no hook,
|
||||
> so there is nothing of theirs to name. A value the table does not know is shown as stored. It names the MEASURED
|
||||
> byte only — a label derived from the render/output ratio is `HANDOFF` §7a's owner decision, still not taken.
|
||||
> *(Corrected 2026-10-19, beta.25: the ffx-api dispatch still carries no quality, and FSR's mode now comes from the
|
||||
> vendor's own query — the next note. XeSS still has no hook.)*
|
||||
|
||||
> **A second producer since beta.25 (2026-10-19, owner decision D65): FSR's mode, from the vendor's own query.**
|
||||
> `FfxApiUpscaleQualityMode` is an input to `ffxQuery`, which a title calls before it sizes its targets — "what
|
||||
> render size (`…GETRENDERRESOLUTIONFROMQUALITYMODE`) or ratio (`…GETUPSCALERATIOFROMQUALITYMODE`) does this mode
|
||||
> give at this display size?" — never to the per-frame dispatch, which carries the size alone. The Overlay hooks
|
||||
> `ffxQuery` on the four modules it hooks `ffxDispatch` on (`17_HOOK_ENGINE` §Hook inventory), keeps each answer the
|
||||
> vendor returned (one slot per mode), and an UPSCALE dispatch whose `renderSize` (and `upscaleSize`, where the title
|
||||
> states it) fits exactly ONE kept answer — a size answer exactly, a ratio answer within one pixel of
|
||||
> `display / ratio`, the vendor truncating and an engine perhaps rounding — publishes `0x10 + mode`: 16 Native AA ·
|
||||
> 17 Quality · 18 Balanced · 19 Performance · 20 Ultra Performance (offset so FSR's Native AA, 0, can never be read
|
||||
> as Streamline's `eOff`). No fit, two fits, or no query seen → `0xFF`. **A session, its segments and the live card
|
||||
> read one rule (`Domain.Metrics.QualityByte`)**: the most common told byte, and for FSR none when any FSR record
|
||||
> was rendered at a size no FSR-named record has. A dynamic resolution still matches an answer at the top of its
|
||||
> range, so the plain modal would name a mode the session mostly did not render at; `legal/ACCURACY.md` promises
|
||||
> none ("FSR at a dynamic resolution among them — no mode is shown"). A "not told" record at a named size — a
|
||||
> present that drained a frame-generation PREPARE alone, a frame before the title asked — is not that evidence. A
|
||||
> title that sizes its targets without asking, or asked before the Overlay was loaded, reads none: the honest
|
||||
> answer, not a gap. `Domain.Metrics.UpscalerNames` decodes the byte for the `fsr`, `fsr3` and `fsr4` tokens.
|
||||
> Measured on the hook harness with the vendor stub answering as the SDK documents (`fl_guard` "FSR's quality
|
||||
> mode", by size through the SDK 2.x loader and by ratio through the 1.1.x monolith); a real title is owner-only
|
||||
> item 21 (Lies of P at Quality, then Performance).
|
||||
- Resolution changes mid-session (user changed settings, or dynamic resolution scaling) produce **segments**: the session stores a segment list `(startFrame, renderW/H, outputW/H, upscaler, quality)`. Aggregates report the dominant segment plus a "settings changed during session" flag — averaging across a settings change is the classic way benchmark numbers become meaningless.
|
||||
|
||||
> **Two segmentation axes exist, they compose in ONE order, and neither document said so until
|
||||
|
||||
@@ -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 — **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 game's preset** — since beta.24 (D63) an NVIDIA App override's mode, where that report says the override applied, is the session's quality mode, marked as the App's (`QualityResolver`) |
|
||||
| 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 game's preset** — since beta.24 (D63) an NVIDIA App override's mode, where that report says the override applied, is the session's quality mode, marked as the App's (`QualityResolver`) — and since beta.25 (D65) FSR's mode where the title asked FidelityFX's `ffxQuery` for the size it then dispatched, none at a dynamic resolution (`03_METRICS` §Upscaling) |
|
||||
| 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) |
|
||||
|
||||
@@ -235,7 +235,8 @@ CREATE TABLE sessions (
|
||||
|
||||
-- upscaling / FG (measured at tier 1)
|
||||
upscaler TEXT, -- none|dlss|fsr2|fsr3|fsr4|xess|nis|unknown, and fsr since 2026-09-04 (FL_UPSCALER_FSR_UNVERSIONED; added 2026-10-04)
|
||||
upscaler_quality TEXT,
|
||||
upscaler_quality TEXT, -- the hooked byte, invariant: dlss 1-6 (sl::DLSSMode); fsr/fsr3 16-20 =
|
||||
-- 0x10 + FfxApiUpscaleQualityMode since beta.25 (D65); NULL when none told
|
||||
upscaler_sharpness INTEGER, -- percent; NULL when the API reports none
|
||||
render_w INTEGER, render_h INTEGER, -- dominant segment
|
||||
output_w INTEGER, output_h INTEGER,
|
||||
|
||||
@@ -575,6 +575,9 @@ Stat cards (Avg uses `FpsReadout`, Median, 1% Low, 0.1% Low, Min/Max, σ, stutte
|
||||
> name alone. Mode names come from the resources (`Nv_Mode_*`). Chart segments stay the hooks' (a segment carries no
|
||||
> driver report). The driver line reads the report's mode in NGX's numbering (it read it through the profile's table
|
||||
> until beta.24). CSV export: `# quality_mode:` (`quality (nvidia_app)`, `stored 9 (game)`, `N/A`).
|
||||
>
|
||||
> **beta.25 (D65): FSR's mode reads the same way** — *FSR 3 Quality*, *FSR Native AA* (`Fsr_Mode_NativeAa`), and
|
||||
> `native_aa (game)` in the export — wherever the session's byte names one (`03_METRICS` §Upscaling).
|
||||
|
||||
> **beta.24 (D62): the frame-generation mix.** Under the stat cards, **Frame generation in this session** — shown when
|
||||
> the session stored a mix of two rows or more (`sessions.fg_mix`, `03_METRICS` §The mix): a line saying how frame
|
||||
|
||||
@@ -123,7 +123,8 @@ Every hook must be listed here with a purpose. Anything not on this list is not
|
||||
> calls — and the FidelityFX row below is the ninth ✅.~~** *(Corrected 2026-10-04: as of 2026-09-06 it installs up
|
||||
> to SIXTEEN — the nine `FL_HOOK_INVENTORY` rows (four Streamline including `slSetTagForFrame`, four `ffxDispatch`,
|
||||
> `ffxFsr3ContextDispatchUpscale`), the three DXGI slots, the two `ID3D12GraphicsCommandList4` methods,
|
||||
> `wglSwapBuffers` and `LoadLibraryExW`; four hooks landed without this banner moving.)* The counts differed until 2026-09-03, because a
|
||||
> `wglSwapBuffers` and `LoadLibraryExW`; four hooks landed without this banner moving.)* *(And since beta.25,
|
||||
> 2026-10-19: up to TWENTY — four `ffxQuery` rows join them, on the same four AMD modules, D65.)* The counts differed until 2026-09-03, because a
|
||||
> row is a *capability* and a detour is a *patch*, and the FG-count row rode on the
|
||||
> evaluate detour; it has its own now, `sl.interposer.dll!slGetNewFrameToken`. The AMD row
|
||||
> is the opposite shape — **one row-family, four modules, four patches from one
|
||||
@@ -196,7 +197,8 @@ Every hook must be listed here with a purpose. Anything not on this list is not
|
||||
| ✅ Streamline: `slEvaluateFeature` · ⏳ `slInit`, `slSetFeatureLoaded`, `slSetConstants`, `slGetFeatureRequirements` | Feature set actually active when the game goes through SL rather than NGX directly (`kFeatureDLSS`, `DLSS_G`, `DLSS_RR`, `Reflex`, `NIS`). **Built 2026-08-09**, identity only: one MinHook detour on `sl.interposer.dll!slEvaluateFeature`, resolved **module-scoped** and installed lazily by the watchdog. Sets `FL_MEASURED_UPSCALER` + `FL_HOOK_UPSCALER_IDENTITY`; decodes `kFeatureDLSS`/`kFeatureNIS` and reports `FL_UPSCALER_UNKNOWN` for anything else. **Never `FL_UPSCALER_NONE`** — a Streamline-only writer cannot see FFX, XeSS or NGX-direct, and `NONE` is the only one of the three states that may be aggregated as a negative |
|
||||
| ✅ Streamline: `slSetTag` — **and, since 2026-09-05, every tag's TYPE** (`slTagCensus`; a HUD-less / UI tag marks the present `FL_FG_DLSS_G`, rule 4: the same argument) | The **global** resource tags, where a title states the size of the buffer it is upscaling *from*: `kBufferTypeScalingInputColor`'s extent → `renderW/H` — **or, since 2026-09-05, the size the tagged `sl::Resource` declares when the extent is zero** (`TagSize` in `fl_sl_inputs.h`, shared by all three tag routes; GUID-checked; a Resource declaring no size is still the honest unknown). **Built 2026-08-15** (`FL_HOOK_UPSCALER_PARAMS`), and it is an ALTERNATIVE to the local tags in `slEvaluateFeature`'s `inputs`, not a layer over them — `sl_core_api.h:258` says global and local tags "do NOT interact", so a title using one yields nothing from the other and both are read. Published only on a frame where an evaluation was also seen, because a tag is viewport state that outlives any one frame. This row was MISSING from this table while the hook shipped, which is the gap the banner above now names |
|
||||
| ✅ Streamline: `slSetTagForFrame` — **and every tag's TYPE, as above** | The same global tags through **Streamline 2.8's frame-based entry point**, which deprecates `slSetTag`: `(const FrameToken&, const ViewportHandle&, const ResourceTag*, uint32_t, CommandBuffer*)` — the token first, then exactly `slSetTag`'s list, handed to the same tag walk. **Built 2026-09-04** (`FL_HOOK_UPSCALER_PARAMS`, its own trampoline; the family is now **published when whole** — once every tag export the loaded interposer has is patched — because publishing on the first row entitled records the second was not yet producing, 38 of 41 on the fixture: the ffx leaves' #110 defect again, fixed the same way). Measured need: Dying Light: The Beast (SL 2.8.0) published `Dlss` identity on every batch and the params bit on none across three captures, because a 2.8 title that tags per frame never calls the deprecated export. The token is not read; the frame count stays with `slGetNewFrameToken`. The installer picks this detour by SYMBOL (`kSymbolSlSetTagForFrame`, bound to the row by `static_assert`), not by family, since the two rows share a family bit and differ in signature |
|
||||
| ✅ **FidelityFX ffx-api: `ffxDispatch` on the FOUR modules a game calls** — `amd_fidelityfx_dx12.dll` (SDK 1.1.x monolith), `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, **and `amd_fidelityfx_loader_dx12.dll`** (added the evening of 2026-09-04: three loader-shipping titles at FSR produced zero dispatches at any leaf export, so the loader is where their calls arrive) · ⏳ FSR 3.0 host route `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` / `ffxFsr3DispatchFrameGeneration` · ~~`ffxFsr2ContextCreate`~~ · ~~`ffxCreateContext`~~ | **Built 2026-09-04** (`HANDOFF` item 7c). One observer behind three trampolines reads the DESCRIPTOR the title passed — head type first, body only after the type matched a constant from the vendored MIT headers (`third_party/fidelityfx/`, tag v2.3.0): **UPSCALE** → identity (`FSR3` from the monolith, `FSR_UNVERSIONED` from the 2.x upscaler DLL, which hosts FSR 3.1 and FSR 4 behind one type) + `renderSize` → `renderW/H` (quality and sharpness `0xFF`: the dispatch carries neither) + one COUNT; **PREPARE / PREPARE_V2** → `frameID` counted on a *new* index only — this vendor's `slGetNewFrameToken`, the `fgEvaluations` producer once a title has ever prepared, with the UPSCALE count as the fallback for a title that never does; **FRAMEGENERATION** → `fgMode = FSR_FG` on that present. Rule 4: the argument of the API we hooked, never `context`, `pNext`, a command list or a resource. **Why all four:** a UE5 title ships the two leaves with no loader and calls their exports; a loader-shipping title calls the loader's export and the signed loader reaches its providers through an object, not the leaves' exports (measured: Dying Light: The Beast, KCD2, Wukong). The morning's "never the loader" rested on the export tables alone and was reversed by the run. What guards against a loader that DID re-enter a leaf's export is the K = 1 control with all four hooked and the consumer's `frames/upscale-drained`, both of which read 2× in that case. `ffxCreateContext` is deliberately NOT a row — nothing it carries fills a field the dispatch does not, and its honest family would collide with `slEvaluateFeature`'s under the installer's equality binding. The family is compound (`IDENTITY \| PARAMS \| FG_EVALUATIONS`), pinned by `static_assert`s that also bind the leaf table to the rows both ways and refuse the loader as a row. Streamline keeps precedence for the count once it has ever issued a token, so every §S31-validated title is byte-identical. Second count: the consumer prints `frames/upscale-drained`, the AMD `tokens/batch`. **FSR 3.0 — BUILT 2026-09-05 as a fifth AMD target:** `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` (Cyberpunk's copy; named export, its own descriptor, vendored from tag **`fsr3-v3.0.4`** — the tag whose twelve `ffxFsr3*` declarations match the shipped module, not the `v1.1.4` first named). Rule 4: the detour reads `renderSize` of the descriptor the title passed and nothing else — never the context, a resource or the command list; the offset is pinned to a literal (1256) so a re-vendoring that moved it fails to compile. Same family and publish point as the four rows (`PublishFfxFamilyIfWhole` waits for a loaded host too), keyed by module in the installer; identity `FSR3` as a fact. `ffxFsr3DispatchFrameGeneration` is deliberately not a row (§H11 carries the reversal condition); the `ffx_fsr3upscaler_x64.dll` leaf is the pre-committed alternative if the facade reads silent (row B2) — never both, or `frames/upscale-drained` reads 2.00 |
|
||||
| ✅ **FidelityFX ffx-api: `ffxDispatch` on the FOUR modules a game calls** — `amd_fidelityfx_dx12.dll` (SDK 1.1.x monolith), `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, **and `amd_fidelityfx_loader_dx12.dll`** (added the evening of 2026-09-04: three loader-shipping titles at FSR produced zero dispatches at any leaf export, so the loader is where their calls arrive) · ⏳ FSR 3.0 host route `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` / `ffxFsr3DispatchFrameGeneration` · ~~`ffxFsr2ContextCreate`~~ · ~~`ffxCreateContext`~~ | **Built 2026-09-04** (`HANDOFF` item 7c). One observer behind three trampolines reads the DESCRIPTOR the title passed — head type first, body only after the type matched a constant from the vendored MIT headers (`third_party/fidelityfx/`, tag v2.3.0): **UPSCALE** → identity (`FSR3` from the monolith, `FSR_UNVERSIONED` from the 2.x upscaler DLL, which hosts FSR 3.1 and FSR 4 behind one type) + `renderSize` → `renderW/H` (quality and sharpness `0xFF`: the dispatch carries neither — *since beta.25 the quality byte is the mode the `ffxQuery` row below names for the dispatched size, `0xFF` when none does*) + one COUNT; **PREPARE / PREPARE_V2** → `frameID` counted on a *new* index only — this vendor's `slGetNewFrameToken`, the `fgEvaluations` producer once a title has ever prepared, with the UPSCALE count as the fallback for a title that never does; **FRAMEGENERATION** → `fgMode = FSR_FG` on that present. Rule 4: the argument of the API we hooked, never `context`, `pNext`, a command list or a resource. **Why all four:** a UE5 title ships the two leaves with no loader and calls their exports; a loader-shipping title calls the loader's export and the signed loader reaches its providers through an object, not the leaves' exports (measured: Dying Light: The Beast, KCD2, Wukong). The morning's "never the loader" rested on the export tables alone and was reversed by the run. What guards against a loader that DID re-enter a leaf's export is the K = 1 control with all four hooked and the consumer's `frames/upscale-drained`, both of which read 2× in that case. `ffxCreateContext` is deliberately NOT a row — nothing it carries fills a field the dispatch does not, and its honest family would collide with `slEvaluateFeature`'s under the installer's equality binding. The family is compound (`IDENTITY \| PARAMS \| FG_EVALUATIONS`), pinned by `static_assert`s that also bind the leaf table to the rows both ways and refuse the loader as a row. Streamline keeps precedence for the count once it has ever issued a token, so every §S31-validated title is byte-identical. Second count: the consumer prints `frames/upscale-drained`, the AMD `tokens/batch`. **FSR 3.0 — BUILT 2026-09-05 as a fifth AMD target:** `ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale` (Cyberpunk's copy; named export, its own descriptor, vendored from tag **`fsr3-v3.0.4`** — the tag whose twelve `ffxFsr3*` declarations match the shipped module, not the `v1.1.4` first named). Rule 4: the detour reads `renderSize` of the descriptor the title passed and nothing else — never the context, a resource or the command list; the offset is pinned to a literal (1256) so a re-vendoring that moved it fails to compile. Same family and publish point as the four rows (`PublishFfxFamilyIfWhole` waits for a loaded host too), keyed by module in the installer; identity `FSR3` as a fact. `ffxFsr3DispatchFrameGeneration` is deliberately not a row (§H11 carries the reversal condition); the `ffx_fsr3upscaler_x64.dll` leaf is the pre-committed alternative if the facade reads silent (row B2) — never both, or `frames/upscale-drained` reads 2.00 |
|
||||
| ✅ **FidelityFX ffx-api: `ffxQuery` on the same four modules** (beta.25, owner decision D65) — `amd_fidelityfx_dx12.dll`, `amd_fidelityfx_upscaler_dx12.dll`, `amd_fidelityfx_framegeneration_dx12.dll`, `amd_fidelityfx_loader_dx12.dll` | **Built 2026-10-19.** The mode an FSR title runs at reaches the vendor only as an argument of `ffxQuery` — "what render size (`…GETRENDERRESOLUTIONFROMQUALITYMODE`, `0x00010003`) or ratio (`…GETUPSCALERATIOFROMQUALITYMODE`, `0x00010002`) does this mode give at this display size?" — asked before the title sizes its targets; the per-frame dispatch carries the size alone. The detour calls the original FIRST, exactly once, and only when it returned `FFX_API_RETURN_OK` reads the descriptor's type, display size and mode and the values the vendor wrote through the title's own out pointers, into a five-slot table (one per `FfxApiUpscaleQualityMode`); the `ffxDispatch` UPSCALE arm names the ONE mode whose kept answer fits the dispatched `renderSize` (and `upscaleSize`, where stated) as `0x10 + mode` in `upscalerQuality`, else `0xFF` (`03_METRICS` §Upscaling). **Rule 4:** the arguments of the API we hooked — the descriptor the title passed and the out values of that same call — never `context`, a resource or anything the title did not hand the hooked export; nothing of the title's is written, and every read is under the hook's SEH guard. Both query layouts and type ids are pinned to literals by `static_assert`s, identical at SDK v1.1.4 and v2.3.0. **Its own family**, `FL_HOOK_UPSCALER_QUALITY` (bit 11 of `hooksInstalledMask`, mirrored in `FlHookFamily` and `HookFamilies`): `InstallByFamily` binds a row by equality, and the query entitles no measured field by itself — the byte rides under `FL_MEASURED_UPSCALER_PARAMS` from the dispatch arm — so the bit says only that the query was hooked, which tells "never asked" from "could not have seen it ask". Published like the dispatch family, once every loaded leaf is patched (`PublishFfxQueryFamilyIfWhole`); the FSR 3.0 host has no `ffxQuery` and no row (`static_assert`). A loader that passes a query on to a leaf's export refreshes one kept answer twice; nothing is counted, so nothing is counted twice. **Measured overhead** (a copy of the two bodies, `/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3 runs, every slot holding both a size and a ratio — the worst case): 7.6–8.2 ns added per UPSCALE dispatch, i.e. per application frame, and 1.6 ns per query beside the trampoline; the per-present path gains one load. Harness: `--ffx-query sizes|ratios`; `fl_guard` "FSR's quality mode". |
|
||||
| ~~XeSS: `xessD3D12CreateContext`, `xessD3D12Init`, `xessD3D12Execute`~~ **Closed at the census by licence, 2026-09-04** (`20_OPEN_QUESTIONS` §Scope decisions, `18_GPU_VENDOR_APIS` §Intel XeSS SDK): no hook on any `libxess*.dll` export *(corrected 2026-10-04)* | ~~`outputResolution`, `qualitySetting`, XeSS version; `xess_fg` variants for XeFG~~ |
|
||||
| ✅ **Application frames per present** (`fgEvaluations`) — **`sl.interposer.dll!slGetNewFrameToken` since 2026-09-03** | Native vs Displayed frame counts at Tier 1 — see `03_METRICS` §Frame Generation. **The producer is the frame-token export**: Streamline hands a title one token per application frame and the title must ask; the detour counts distinct tokens between two presents (pointer changes, nothing dereferenced), `FL_HOOK_FG_EVALUATIONS` is its family, and it installs on every Streamline 2 title including the ones that evaluate nothing through `slEvaluateFeature`. Rule 4: the out-parameter of an API we hooked. Premise and its gate in `03_METRICS`; pre-committed table in `20_OPEN_QUESTIONS` §S31. *The row as it stood before:* ~~NGX/SL/FFX/XeSS FG feature evaluations per present. **Built 2026-08-15 for Streamline, and MEASURED TO YIELD NOTHING ON THAT ROUTE**~~ — `slEvaluateFeature(kFeatureDLSS_G)` is never called by Cyberpunk 2077 (0 across ~14,000 batches, four FG settings), so this row installs, is honest, and counts zero; see `docs/HANDOFF.md` item 3. Built on the detour that was already there: `kFeatureDLSS_G` contributes to a saturating COUNT in the same word the feature bits live in (`fl_sl_seen.h`) rather than to a bit, because a bit collapses several evaluations between two presents into one — and under multi-frame generation that is the common case, not the edge. The row's family is therefore compound (`FL_HOOK_UPSCALER_IDENTITY \| FL_HOOK_FG_EVALUATIONS`), pinned by a `static_assert` because `hookinventory-check` reads that column as an opaque identifier. **Counts EVALUATIONS, not generated frames** — the 2026-08-14 owner ruling; the multiplier lives in `sl::DLSSGOptions`, which is only reachable by the route §2b refused. ~~Non-NVIDIA FG vendors are **deferred with a written rationale**: `amd_fidelityfx_framegeneration_dx12.dll` 3.1.5 exports only the five generic `ffx*` entry points, identical to five sibling modules, so identity is in the arguments and we have no headers~~ — **AMD has a producer since 2026-09-04** (the FidelityFX row above: the PREPARE dispatch's `frameID`, or the UPSCALE count on a title that never prepares, feeds `fgEvaluations` when Streamline has never issued a token); Intel stays at the census (`20_OPEN_QUESTIONS` §Scope decisions, by licence); the FSR 3.0 host DLL's UPSCALE (`ffxFsr3ContextDispatchUpscale`, since 2026-09-05) counts like an ffx-api UPSCALE when neither Streamline nor a PREPARE has spoken |
|
||||
|
||||
@@ -479,7 +481,7 @@ struct alignas(64) FlFrameRecord { // 64 bytes exactly, static_assert'd
|
||||
uint16_t outputW, outputH; // @22
|
||||
uint8_t api; // @26 d3d11|d3d12|vulkan|opengl
|
||||
uint8_t upscaler; // @27 0 = NOT_REPORTED; dlss|fsr2..4|xess|nis|none(8)|unknown(0xFF)
|
||||
uint8_t upscalerQuality; // @28 vendor enum; 0xFF = a hook ran and could not tell
|
||||
uint8_t upscalerQuality; // @28 vendor enum (FSR: 0x10 + mode, beta.25); 0xFF = a hook ran and could not tell
|
||||
uint8_t fgMode; // @29 0 = NOT_REPORTED; dlss_g|fsr_fg|xefg|none(4)|unknown(0xFF)
|
||||
uint8_t rtFlags; // @30 bit0 asBuildOBSERVED, bit1 dispatchOBSERVED, bit2 psoCreatedEver
|
||||
uint8_t colorSpace; // @31 0 = NOT_REPORTED, 1 SDR, 2 HDR10, 3 scRGB
|
||||
|
||||
+73
-47
@@ -62,6 +62,8 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
| `§beta.20` | [`handoff/history/0.1.0-beta.20.md`](handoff/history/0.1.0-beta.20.md) |
|
||||
| `§beta.21` | [`handoff/history/0.1.0-beta.21.md`](handoff/history/0.1.0-beta.21.md) |
|
||||
| `§beta.22` | [`handoff/history/0.1.0-beta.22.md`](handoff/history/0.1.0-beta.22.md) |
|
||||
| `§beta.23` | [`handoff/history/0.1.0-beta.23.md`](handoff/history/0.1.0-beta.23.md) |
|
||||
| `§beta.24` | [`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md) |
|
||||
| `§Owner-only`, an open item | [§Owner-only](#owner-only--no-pr-can-close-these) below |
|
||||
| `§Owner-only`, a passed item (3, 12, 14–19) | [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) |
|
||||
| `§Traps`, `§Two corrections carried forward` | [`handoff/traps.md`](handoff/traps.md) |
|
||||
@@ -69,60 +71,45 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
|
||||
---
|
||||
|
||||
## **START HERE** — 2026-10-14, 0.1.0-beta.23: a game's artwork, pages that do not freeze, the documents that drifted
|
||||
## **START HERE** — 2026-10-19, 0.1.0-beta.25: FSR's quality mode
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.23]`; this is what no other file carries.* The owner, 2026-10-14: "Bạn phân tích
|
||||
và lên plan cho phần tiếp theo gồm những nội dung sau: 1. Thêm ảnh bìa/hero/cover của game từ các nền tảng đó - Đặt trong
|
||||
detail của game. (Nếu được); Tuỳ chọn: có thể sync màu cùa cover với màu của detail; 2. Cập nhật, sync docs; 3. Kiểm tra
|
||||
hiệu suất khi chuyển giữa các tab (nếu có vấn đề hiệu năng)" — then the whole train to the release without asking again.
|
||||
On top of #308 (PR-1): #309 (the pages, measured first), #310 (the artwork), #311 (the drift), then this release.
|
||||
*Status is `docs/changelog/0.1.0-beta.25.md`; this is what no other file carries.* The owner, 2026-10-19, while the
|
||||
beta.24 train was merging: "Bạn có thể publish beta24 xong, làm phần pr9 thành beta25 luôn nếu được nhé." — publish
|
||||
beta.24, then the train's PR-9, FSR's quality mode, as beta.25. One feature PR (#325) and this release, the whole
|
||||
way without asking again.
|
||||
|
||||
**Decisions:**
|
||||
|
||||
- **D60 — a game's artwork is what is already on the PC.** The image the user chose (*Edit… ▸ Choose image…*), else
|
||||
what the Steam or GOG GALAXY app keeps for the game it installed — found through the stores' own records as Play finds
|
||||
them (`StoreRecords.Owning`, never the row's platform alone). Nothing is downloaded: `privacy.online_metadata` stays
|
||||
reserved. A chosen image is a PNG copy, `<data>\covers\game-<id>-<unix ms>.png`, named relative in `cover_path`; only
|
||||
those names are followed — never a rooted, share or `..` path, never through a junction or a symbolic link, because a
|
||||
viewer's copy of a ledger may come from anywhere (D52).
|
||||
- **D61 — the band takes the artwork's colour as far as every text on it reads**: primary and secondary 4.5:1, tertiary
|
||||
3:1, the pills' and the warning's text 4.5:1 on their own fills; at most 30 % on the dark theme, 22 % on the light. On
|
||||
by default (the owner's choice); never in high contrast; it follows a theme switch by resource reference.
|
||||
- **The pages' speed was judged by a bar written before the first measurement** (`spike-notes` §21): fix what keeps the
|
||||
UI thread busy 50 ms or more, can block on I/O, or grows with each visit. Recorded, not fixed: page builds of 85–370 ms,
|
||||
and **the library grid (275 ms at 48 games) — non-virtualizing by the beta.11 decision; a virtualizing one changes the
|
||||
page's look, which is the owner's call** *(answered 2026-10-15: it stays as it is — §After the release below)*; no
|
||||
`sessions.started_at` index (a schema version locks out every earlier
|
||||
build, and nothing measured asked for it).
|
||||
- `LIST_GAME_TESTED`: the Everhex Demo row and the corrected Vulkan sentence, approved by the owner under D35.
|
||||
- **D65 — FSR's quality mode through `ffxQuery`: built** (deferred from beta.24,
|
||||
[`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md)). The query is hooked on the four modules
|
||||
`ffxDispatch` is, each answer the vendor returned is kept (one slot per mode), and an UPSCALE dispatch whose sizes fit
|
||||
exactly one answer names it as `0x10 + mode` (`03_METRICS` §Upscaling, `17_HOOK_ENGINE` §Hook inventory). **One rule
|
||||
the plan did not have:** a session, a segment or the live window names FSR's mode only when no FSR frame was rendered
|
||||
at a size no named frame has (`Domain.Metrics.QualityByte`). Without it a dynamic-resolution session whose top of
|
||||
range matched an answer would have named the mode, against the clause approved with the plan ("FSR at a dynamic
|
||||
resolution among them — no mode is shown"). The clause shipped in those words; the Disclaimer stays 2.11, as the
|
||||
accuracy statement's additions did in beta.19 and beta.20.
|
||||
|
||||
**Measured:** on the hook harness, with the vendor stub answering as the SDK documents (`fl_guard` "FSR's quality
|
||||
mode", 44 assertions): Quality named on every params record but at most one — the test allows the window's first —
|
||||
through the SDK 2.x loader by size and through the 1.1.x monolith by ratio, and no record named any other mode; the
|
||||
same five FFX cases ran five more times green. The added cost, from a copy of the two bodies built with the
|
||||
Overlay's flags (`/O2 /guard:cf /Qspectre /MT`, 20 M calls × 3, every slot holding a size and a ratio — the worst
|
||||
case): 7.6–8.2 ns per UPSCALE dispatch, 1.6 ns per query beside the trampoline. Nothing on a real title yet: item 21.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **Microsoft.Data.Sqlite completes its "async" calls synchronously**: after a ledger read, `ConfigureAwait(false)` is
|
||||
still on the UI thread — the session decode, the sorts and the stutter detection all ran there (`16_WPFUI_SYNTAX`
|
||||
§Gotchas).
|
||||
- **A transient view model that is `IDisposable` lives until the App exits** (the root container keeps it), and every
|
||||
Dashboard ever opened stayed subscribed. FR-3.8's "Session saved" lived in that view model and reached every page only
|
||||
through the leak — it is `Services.SessionNotices` now.
|
||||
- **A `ui:Image` given a `Style` of its own that is not based on `DefaultImageStyle` has no template** and draws nothing
|
||||
in the place it takes. Only a render showed it; `AccessibilityTests.NoStyleOfAWpfUiControlLeavesOutItsTemplate`
|
||||
refuses it now.
|
||||
- **A page just navigated to is mid-fade**: a `RenderTargetBitmap` of it reads every colour washed out unless the
|
||||
presenter's `Transition` is `None`.
|
||||
- **The Bash tool's heredocs halve backslashes**: `covers\game-` became an invalid C# escape, and `\r\n` in a Python
|
||||
heredoc became real line breaks. Write such files with the editor tools.
|
||||
- **`Directory.Delete(…, recursive: true)` over a junction throws without elevation** (it asks Windows to unmount a
|
||||
volume, and the link is removed anyway): a test deletes its junction itself first.
|
||||
- **`git rebase --update-refs` skips a branch checked out in another worktree.** The beta.25 branch sat on beta.24's
|
||||
PR-8 tip in its own worktree; the rebase of beta.24's train after its first merge left it where it was, and it was
|
||||
moved by hand (`git rebase --onto <new tip> <old tip>`) onto the release PR, then onto `main` as beta.24 merged.
|
||||
- **A new `.cs` file written as LF fails `dotnet format`'s `ENDOFLINE`** although it builds and its tests pass —
|
||||
convert it to CRLF before the gate (the checkout is CRLF).
|
||||
- **A per-frame byte is not a session's answer.** The modal of the told bytes was right for Streamline's byte and wrong
|
||||
for one that is told only on the frames whose size matches; read every surface's rule against the sentence the user
|
||||
is promised before writing the byte.
|
||||
|
||||
**Owner-only, added to the list below:** item 19 — **passed 2026-10-15**.
|
||||
**Owner-only, added to the list below:** item 21.
|
||||
|
||||
**After the release (owner, 2026-10-15):** "Item 19 hiện đã đạt 100% yêu cầu. Phần chip sẽ đi kèm với phiên bản tiếp
|
||||
theo. Bạn có thể cập nhật và đóng phiên, thư viện vẫn giữ như cũ." — item 19 passed; the chip the release tree's local
|
||||
gate left goes with the next pre-release (`fl_guard`'s native-log test, red under load: after the stop, the last
|
||||
`UNHOOK_RESTORED` lines were not in the file within its 10-second wait — known since beta.9, and no native code changed
|
||||
in beta.23; green on the re-run); and **the library grid stays as it is**: the beta.11 decision
|
||||
(`Controls/UniformWrapPanel`, non-virtualizing — cards an equal share of the width, each row as tall as its tallest
|
||||
card) holds, at 275 ms for 48 games (`spike-notes` §21). Recorded with no release: nothing a user runs changed.
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
@@ -207,6 +194,39 @@ card) holds, at 275 ms for 48 games (`spike-notes` §21). Recorded with no relea
|
||||
halves and a footer naming `v0.1.0-beta.17` — then tick *Restrict editing to collaborators only* (Settings ▸ General
|
||||
▸ Features ▸ Wikis), or anyone can change a page until the next release overwrites it. (e) The `ja` strings marked
|
||||
`review`.
|
||||
20. **beta.24 on real hardware — decision tables written before the runs.** (a) **The mix (D62):** a DLSS 4 title
|
||||
(Cyberpunk 2077 or Hell Is Us) with the NVIDIA App's *Frame Generation Mode* on *Use 3D app setting*, one session of
|
||||
about two minutes each at ×2, ×3 and ×4 chosen in the game's menu, plus its menus → the summary's *Frame generation in
|
||||
this session* lists ×2.0 / ×3.0 / ×4.0 with shares near the time spent, each with its own Native → Displayed, and the
|
||||
line *Set in the game — no NVIDIA App frame-generation override*. Then the MFG title with the App's *Fixed ×6* → a
|
||||
×6.0 row and *Set in the NVIDIA App: Fixed ×6*. Then *Dynamic, Target FPS = Max refresh rate, Multiplier = Up to 6x*
|
||||
→ several rows or *Not classified*, and *Set in the NVIDIA App: Dynamic, up to ×6, target: max refresh rate*. Record
|
||||
the stored `driver_profile` values for the Dynamic run: `NGX_DLSSG_DYNAMIC_MULTI_FRAME_COUNT_MAX` 5 and the target
|
||||
`0x01000000` confirm the decode; anything else corrects `NvidiaOverrides.FrameGenerationContext`.
|
||||
(b) **The quality mode (D63) on Expedition 33:** the App's Super Resolution mode *Quality*, then *DLAA*, *Ultra
|
||||
Performance*, *Performance*, one short session each → the header reads *DLSS (driver-reported) Quality · NVIDIA App*
|
||||
and so on. Stored `performanceMode`: Ultra Performance 3 (already measured on Silent Hill 2) and DLAA 5 confirm NGX's
|
||||
numbering; DLAA 4 would mean the report follows the profile's numbering above 3 — then
|
||||
`UpscalerNames.FromDriverReport` changes, and the row goes into `spike-notes`.
|
||||
(c) **The libraries (D64):** the same sessions' DLSS line names the super-resolution library and *from the graphics
|
||||
driver* when the override's copy is loaded; preset L → *DLSS 4.5 (preset L)*. With *Model Presets* on *Use 3D app
|
||||
setting*, the game's own library and no generation beyond what was observed. Record the names the override loads
|
||||
under `%ProgramData%\NVIDIA\NGX` (the summary's *Loaded:* line) — they correct `05_DETECTION` §Shipped is not loaded.
|
||||
(d) **DLSS 5** on the owner's DLSS 5 title: *DLSS 5 runtime loaded*. If it is not shown, record the module names it
|
||||
loads (*Loaded:* line); `nvngx_dlssnr.dll` is then corrected in `CensusNames` and `05_DETECTION`.
|
||||
(e) **SonarCloud (D67):** bulk-mark per `13_CI_CD` §SonarCloud; optionally its *Ignore issues on multiple criteria*
|
||||
rows; close PR #315. (f) The Legal Gate shows **Disclaimer 2.11** and **Privacy Policy 2.12** once. (g) The `ja`
|
||||
strings marked `review`.
|
||||
21. **beta.25 on real hardware — FSR's quality mode (D65), decision table written before the run.** Lies of P (FSR
|
||||
through AMD's FidelityFX libraries) launched by FrameLedger, not attached, with the game's own *FSR* at *Quality*,
|
||||
then a second session at *Performance* → the summary's header reads *FSR 3 Quality*, then *FSR 3 Performance* (or
|
||||
*FSR Quality* where the SDK 2.x libraries name no version), and the CSV export's `# quality_mode:` says
|
||||
`quality (game)`. Then: **no mode on both** → the title sizes its frames without asking, or asked before the hook
|
||||
was in: record the session's render → output resolution and the *Loaded:* line in `spike-notes`, and D65 stays built
|
||||
and silent for that title. **A wrong mode** (the Quality session reading Balanced) → the answers this title receives
|
||||
are not the vendor's documented ratios: record the stored `upscaler_quality` and the render size in `spike-notes`,
|
||||
and the match is withdrawn until it is explained. **With the game's dynamic resolution on** (if it offers one) → no
|
||||
mode.
|
||||
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
|
||||
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
|
||||
headers **and** `amd64/nvapi64.lib`; Windows 11 is the **measurement scope** only —
|
||||
@@ -280,8 +300,14 @@ Where each owner decision is recorded — the file and its section, and a label
|
||||
| D57 | [`handoff/history/0.1.0-beta.21.md`](handoff/history/0.1.0-beta.21.md) | the four itch "launchers" are malware: the documentation is corrected, the import is no… |
|
||||
| D58 | [`handoff/history/0.1.0-beta.21.md`](handoff/history/0.1.0-beta.21.md) | Wuthering Waves is on the title list (Steam 3513350, Anti-Cheat Expert), beside the fix… |
|
||||
| D59 | [`handoff/history/0.1.0-beta.21.md`](handoff/history/0.1.0-beta.21.md) | Play, in two modes switched in Settings: "1: press Play → the platform opens → it runs;… |
|
||||
| D60 | this file, §START HERE | a game's artwork is what is already on the PC |
|
||||
| D61 | this file, §START HERE | the band takes the artwork's colour as far as every text on it reads: primary and secon… |
|
||||
| D60 | [`handoff/history/0.1.0-beta.23.md`](handoff/history/0.1.0-beta.23.md) | a game's artwork is what is already on the PC |
|
||||
| D61 | [`handoff/history/0.1.0-beta.23.md`](handoff/history/0.1.0-beta.23.md) | the band takes the artwork's colour as far as every text on it reads: primary and secon… |
|
||||
| D62 | [`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md) | the mix: every frame-generation state a session held, with its share, never averaged |
|
||||
| D63 | [`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md) | the NVIDIA App's override is the quality mode where the driver reports it applied |
|
||||
| D64 | [`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md) | DLSS labels are evidence-bound: versions and folder class, DLSS 4/4.5 only when shown, 5 only loaded |
|
||||
| D65 | this file, §START HERE | FSR's quality mode through ffxQuery — deferred from beta.24, built in beta.25; none at a dynamic resolution |
|
||||
| D66 | [`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md) | the long documents are split; every original path stays as the index of its parts |
|
||||
| D67 | [`handoff/history/0.1.0-beta.24.md`](handoff/history/0.1.0-beta.24.md) | SonarCloud stays on Automatic Analysis with .sonarcloud.properties; the owner marks in its UI |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.24 was cut, 2026-10-19 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.24] - 2026-10-19
|
||||
|
||||
**The twenty-fourth pre-release: every frame-generation state a session held, the quality mode the NVIDIA App set, and
|
||||
which DLSS ran.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**Updating from `0.1.0-beta.23`:** Help ▸ Check for updates, then *Restart to update* with no game running. The
|
||||
Disclaimer (2.11) and the Privacy Policy (2.12) are shown once for you to accept. The ledger moves to schema 21, which
|
||||
a beta.23 cannot open. No game is read again: the detection rules (`2026.10.4`) are beta.23's. The mix of
|
||||
frame-generation states and where each DLSS library was loaded from are kept for sessions recorded from now on; the
|
||||
quality mode the NVIDIA App set reads on sessions you already have.
|
||||
|
||||
### Added
|
||||
|
||||
- **Every frame-generation state a session held, in its summary** (owner request 2026-10-19, decision D62). Under the
|
||||
figures, *Frame generation in this session* lists each state — `×2.0`, `×3.0`, `×4.0`, `×6.0`… — with its own
|
||||
Native → Displayed and its share of the time to two decimals, then the time with no frame generation and the time no
|
||||
state explains (*Not classified*: switching, loading, a multiplier that changed faster than five seconds), above a bar
|
||||
of those shares. A line above them says how frame generation was set: in the NVIDIA App (*Dynamic, up to ×6, target:
|
||||
max refresh rate*, *Fixed ×4*, from the driver profile stored with the session) or in the game. Each state is read
|
||||
over the same five-second windows as the steady state and lasts at least 10 seconds; nothing is averaged across
|
||||
states (rule 6). Stored with the session (schema 0020, `sessions.fg_mix`): a session recorded before has none, and
|
||||
its summary says so in one line. The CSV export gains a `# fg_mix:` line; the JSON carries the column. The FG×
|
||||
column's two formats are translated strings now, and the driver-profile line's automatic dynamic target reads as the
|
||||
NVIDIA App says it: *max refresh rate*.
|
||||
|
||||
- **The quality mode the NVIDIA App set, on every page that names the upscaler** (owner request 2026-10-19, decision
|
||||
D63). Where the NVIDIA App overrides DLSS Super Resolution for a game and the NVIDIA driver reports that the
|
||||
override applied in the session, the summary, the Sessions tab, the game page and the live card say so:
|
||||
*DLSS (driver-reported) Quality · NVIDIA App*. It is read from what every session already stores, so sessions
|
||||
recorded before read the same; when the profile and the driver disagree, or the driver's report alone cannot settle
|
||||
the mode, the session reads *· NVIDIA App override* with no mode — never the game's own value in its place. The CSV
|
||||
export gains a `# quality_mode:` line. `legal/ACCURACY.md`'s *Quality mode* bullet says so, in the words approved
|
||||
with the plan; **the Disclaimer is 2.11** and the Legal Gate shows it once.
|
||||
|
||||
- **Which DLSS a session ran** (owner request 2026-10-19, decision D64). The summary's DLSS line gives each DLSS
|
||||
library's version and whether it was loaded from the game or from the graphics driver (the NVIDIA App's override
|
||||
loads the driver's own copy), the model preset the NVIDIA driver reports, and *DLSS 4* or *DLSS 4.5* only where the
|
||||
session shows it — the preset (L or M: 4.5; J or K: 4) or a measured multi-frame factor (×5–×6: 4.5; ×3–×4: 4) —;
|
||||
DLSS 2 and 3 from their libraries; *DLSS 5 runtime loaded* when its library is. The game page repeats the label and
|
||||
the CSV export gains `# dlss:`. The module snapshot now records every library under the NVIDIA override folder,
|
||||
whatever its name, and each module's folder class (schema 0021, `sessions.runtime_module_sources` — never the path),
|
||||
plus five more libraries by name (`sl.dlss_d.dll`, `sl.common.dll`, `sl.reflex.dll`, `amd_fidelityfx_loader_dx12.dll`,
|
||||
`nvngx_dlssnr.dll`). **Privacy Policy 2.12** says so, in the words approved with the plan; `legal/ACCURACY.md` gains
|
||||
the *DLSS version* bullet.
|
||||
|
||||
### Changed
|
||||
|
||||
- **The analyzers are Meziantou.Analyzer 3.0.307 and Microsoft.VisualStudio.Threading.Analyzers 18.12.1**
|
||||
(developers only): the update Dependabot proposed in #314 and then closed itself as "updatable in another way" —
|
||||
applied by hand, with the two suppressions it needed merged earlier in the train.
|
||||
- **SonarCloud analyses only FrameLedger's own code** (developers only; owner request 2026-10-19, decision D67). A
|
||||
`.sonarcloud.properties` at the root keeps the vendored SDK headers, generated files, test fixtures, licence texts and
|
||||
the SQLite migrations out of the analysis and reports the native code against C++20; `docs/13_CI_CD.md` §SonarCloud
|
||||
records the triage of the 341 issues the last analysis left — the rules this project breaks by design and why, the
|
||||
false positives, and the ones the next change fixes — with the steps to mark them in SonarCloud.
|
||||
- **The long documents are split** (developers only; owner request 2026-10-19, decision D66). `CHANGELOG.md`
|
||||
keeps `[Unreleased]` and a table of the releases; each release's section now lives in its own file,
|
||||
`docs/changelog/<version>.md`, and the ledger kept before the first tag in five parts — moved verbatim: the notes
|
||||
`tools/release-notes.ps1` takes for each of the 23 releases are byte for byte what they were, and it reads the
|
||||
version's own file. `docs/HANDOFF.md` (2,844 lines, now 299) keeps what to do next, the open owner-only items and an
|
||||
index of every owner decision; the history of each phase and train, the passed owner-only items and the traps
|
||||
moved to `docs/handoff/`, and a table there resolves every section the code and the documents cite. A new gate,
|
||||
`tools/docs-split-check.ps1`, keeps each index and its files naming each other.
|
||||
- **The open questions and the measurement notes are split too** (developers only, D66). `docs/20_OPEN_QUESTIONS.md`
|
||||
(4,467 lines, now 2,008) keeps its rules, §S24 and every entry not resolved; the 30 entries §S24 marks resolved
|
||||
moved, with their reasoning and in their order, to `docs/open-questions/closed-s.md` and `closed-h.md`, and a table
|
||||
at the end of each series lists them. `docs/spike-notes.md` (2,816 lines) is now the index of its 24 sections, each
|
||||
in its own file under `docs/spike-notes/`; a new measurement gets the next number, its own file and a row. Both
|
||||
rebuild their originals byte for byte, and the same gate holds their indexes to their files.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The NVIDIA driver line read the driver's mode in the wrong numbering.** The driver reports the mode an override
|
||||
set in NGX's own numbering, not the driver profile's: the owner's Silent Hill 2 session ran under the NVIDIA App's
|
||||
Ultra Performance (profile value 5) and the driver reported 3 — which the line printed as nothing, and a DLAA
|
||||
override's 5 would have printed as "Ultra Performance". Five comments in the native code called a quality byte of
|
||||
0 "NGX MaxPerf" — in the numbering that byte carries, 0 is "DLSS off" (comments only, no code changes).
|
||||
- **Opening a folder in Explorer** — the logs, the data folder, the licences, a bug report's zip and the folder named
|
||||
after a failed start — starts `explorer.exe` from the Windows folder by its full path, never a program of that name
|
||||
found on the search path, and always hands it the path in quotes (three of the five places passed it bare).
|
||||
- **What SonarCloud found that was real** (developers only): the one third-party GitHub Action is pinned to its
|
||||
commit; two string reads in native code are bounded by their buffer (the guard's rules-file path handed to the Agent,
|
||||
and the driver's branch name the NVAPI bridge copies); the pipe server's accept loop states that it ends only when
|
||||
cancelled; a launch's own session names its absent stop token (`CancellationToken.None`, with the reason) where it
|
||||
wrote `default` — the same value, now said on purpose; an unused overload of
|
||||
the process launcher that hid the other is gone; the identifier `module` (a C++20 keyword in some positions) is
|
||||
renamed in the hook layer — a rename only, no code changes; and a hook-overhead probe no longer uses a compound
|
||||
assignment on a `volatile`, which C++20 deprecates. The analyzers Dependabot updates in #314 flag the first-start
|
||||
window's own answer task and one test fake's synchronous wait; both are suppressed with their reasons, so that update
|
||||
can merge.
|
||||
- **The game-side log keeps every line a stop writes.** When hooking stopped on a game's own drawing thread — the
|
||||
capture agent's safety stop takes effect within one frame there — the Overlay's last write of its log could happen
|
||||
while that thread was still listing the hooks it removed, and the last of them never reached the file
|
||||
(`overlay-*.log`, the file a bug report carries). The last write now waits, at most two seconds, for the stop to
|
||||
finish and ends with a `STOP_FLUSHED` line; a line still being written is never printed half-done. Nothing changes
|
||||
on the per-frame path. This was the native test that went red under load since beta.9 (`fl_guard`'s log case),
|
||||
now run 20 times with every processor busy.
|
||||
@@ -0,0 +1,27 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.25 was cut, 2026-10-19 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.25] - 2026-10-19
|
||||
|
||||
**The twenty-fifth pre-release: FSR's quality mode.** The same unsigned installer: verify its hash against
|
||||
`SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**Updating from `0.1.0-beta.24`:** Help ▸ Check for updates, then *Restart to update* with no game running. Nothing is
|
||||
shown for you to accept again (the Disclaimer stays 2.11, the Privacy Policy 2.12), the ledger stays at schema 21, and
|
||||
no game is read again: the detection rules (`2026.10.4`) are beta.24's. FSR's quality mode is recorded for sessions
|
||||
from now on; a session recorded before keeps what it had.
|
||||
|
||||
### Added
|
||||
|
||||
- **FSR's quality mode** (owner decision D65, planned for beta.24 and moved to this release). For a game that runs FSR
|
||||
through AMD's FidelityFX libraries, the summary, the Sessions tab, the game page and the live card name the mode —
|
||||
*FSR 3 Quality*, *FSR Performance*, *FSR Native AA* — when the game asked AMD's library what render size that mode
|
||||
gives and then rendered at that size. A game at a dynamic resolution, one that sizes its frames without asking, and
|
||||
one FrameLedger joined after it asked show none. FrameLedger reads one more call in those libraries (`ffxQuery`,
|
||||
beside the `ffxDispatch` it already reads): the size or ratio AMD's library answered, nothing else — about 8 ns per
|
||||
upscaled frame. The CSV export's `# quality_mode:` carries it (`native_aa (game)` for Native AA).
|
||||
`legal/ACCURACY.md`'s *Quality mode* bullet gains its FSR clause, in the words approved with the beta.24 plan; the
|
||||
Disclaimer stays 2.11, as it did for the accuracy statement's additions in beta.19 and beta.20. Checked with AMD's
|
||||
interface on the test program; a real game is owner-only item 21. Developers: the hook has its own family bit
|
||||
(`FL_HOOK_UPSCALER_QUALITY`, bit 11 of `hooksInstalledMask`), the byte is `0x10 + FfxApiUpscaleQualityMode`, the
|
||||
harness asks with `--ffx-query sizes|ratios`, and `Domain.Metrics.QualityByte` is the one rule a session, its
|
||||
segments and the live card read.
|
||||
@@ -0,0 +1,58 @@
|
||||
# HANDOFF history — 0.1.0-beta.23
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.24 was cut, 2026-10-19 (owner decision D66); `docs/HANDOFF.md` §How this file is split lists every part. Nothing below was edited, so its "below" and "above" point inside the original file.*
|
||||
|
||||
## **START HERE** — 2026-10-14, 0.1.0-beta.23: a game's artwork, pages that do not freeze, the documents that drifted
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.23]`; this is what no other file carries.* The owner, 2026-10-14: "Bạn phân tích
|
||||
và lên plan cho phần tiếp theo gồm những nội dung sau: 1. Thêm ảnh bìa/hero/cover của game từ các nền tảng đó - Đặt trong
|
||||
detail của game. (Nếu được); Tuỳ chọn: có thể sync màu cùa cover với màu của detail; 2. Cập nhật, sync docs; 3. Kiểm tra
|
||||
hiệu suất khi chuyển giữa các tab (nếu có vấn đề hiệu năng)" — then the whole train to the release without asking again.
|
||||
On top of #308 (PR-1): #309 (the pages, measured first), #310 (the artwork), #311 (the drift), then this release.
|
||||
|
||||
**Decisions:**
|
||||
|
||||
- **D60 — a game's artwork is what is already on the PC.** The image the user chose (*Edit… ▸ Choose image…*), else
|
||||
what the Steam or GOG GALAXY app keeps for the game it installed — found through the stores' own records as Play finds
|
||||
them (`StoreRecords.Owning`, never the row's platform alone). Nothing is downloaded: `privacy.online_metadata` stays
|
||||
reserved. A chosen image is a PNG copy, `<data>\covers\game-<id>-<unix ms>.png`, named relative in `cover_path`; only
|
||||
those names are followed — never a rooted, share or `..` path, never through a junction or a symbolic link, because a
|
||||
viewer's copy of a ledger may come from anywhere (D52).
|
||||
- **D61 — the band takes the artwork's colour as far as every text on it reads**: primary and secondary 4.5:1, tertiary
|
||||
3:1, the pills' and the warning's text 4.5:1 on their own fills; at most 30 % on the dark theme, 22 % on the light. On
|
||||
by default (the owner's choice); never in high contrast; it follows a theme switch by resource reference.
|
||||
- **The pages' speed was judged by a bar written before the first measurement** (`spike-notes` §21): fix what keeps the
|
||||
UI thread busy 50 ms or more, can block on I/O, or grows with each visit. Recorded, not fixed: page builds of 85–370 ms,
|
||||
and **the library grid (275 ms at 48 games) — non-virtualizing by the beta.11 decision; a virtualizing one changes the
|
||||
page's look, which is the owner's call** *(answered 2026-10-15: it stays as it is — §After the release below)*; no
|
||||
`sessions.started_at` index (a schema version locks out every earlier
|
||||
build, and nothing measured asked for it).
|
||||
- `LIST_GAME_TESTED`: the Everhex Demo row and the corrected Vulkan sentence, approved by the owner under D35.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **Microsoft.Data.Sqlite completes its "async" calls synchronously**: after a ledger read, `ConfigureAwait(false)` is
|
||||
still on the UI thread — the session decode, the sorts and the stutter detection all ran there (`16_WPFUI_SYNTAX`
|
||||
§Gotchas).
|
||||
- **A transient view model that is `IDisposable` lives until the App exits** (the root container keeps it), and every
|
||||
Dashboard ever opened stayed subscribed. FR-3.8's "Session saved" lived in that view model and reached every page only
|
||||
through the leak — it is `Services.SessionNotices` now.
|
||||
- **A `ui:Image` given a `Style` of its own that is not based on `DefaultImageStyle` has no template** and draws nothing
|
||||
in the place it takes. Only a render showed it; `AccessibilityTests.NoStyleOfAWpfUiControlLeavesOutItsTemplate`
|
||||
refuses it now.
|
||||
- **A page just navigated to is mid-fade**: a `RenderTargetBitmap` of it reads every colour washed out unless the
|
||||
presenter's `Transition` is `None`.
|
||||
- **The Bash tool's heredocs halve backslashes**: `covers\game-` became an invalid C# escape, and `\r\n` in a Python
|
||||
heredoc became real line breaks. Write such files with the editor tools.
|
||||
- **`Directory.Delete(…, recursive: true)` over a junction throws without elevation** (it asks Windows to unmount a
|
||||
volume, and the link is removed anyway): a test deletes its junction itself first.
|
||||
|
||||
**Owner-only, added to the list below:** item 19 — **passed 2026-10-15**.
|
||||
|
||||
**After the release (owner, 2026-10-15):** "Item 19 hiện đã đạt 100% yêu cầu. Phần chip sẽ đi kèm với phiên bản tiếp
|
||||
theo. Bạn có thể cập nhật và đóng phiên, thư viện vẫn giữ như cũ." — item 19 passed; the chip the release tree's local
|
||||
gate left goes with the next pre-release (`fl_guard`'s native-log test, red under load: after the stop, the last
|
||||
`UNHOOK_RESTORED` lines were not in the file within its 10-second wait — known since beta.9, and no native code changed
|
||||
in beta.23; green on the re-run); and **the library grid stays as it is**: the beta.11 decision
|
||||
(`Controls/UniformWrapPanel`, non-virtualizing — cards an equal share of the width, each row as tall as its tallest
|
||||
card) holds, at 275 ms for 48 games (`spike-notes` §21). Recorded with no release: nothing a user runs changed.
|
||||
@@ -0,0 +1,70 @@
|
||||
# HANDOFF history — 0.1.0-beta.24
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.25 was cut, 2026-10-19 (owner decision D66); `docs/HANDOFF.md` §How this file is split lists every part. Nothing below was edited, so its "below" and "above" point inside the original file.*
|
||||
|
||||
## **START HERE** — 2026-10-19, 0.1.0-beta.24: every frame-generation state, the NVIDIA App's quality mode, which DLSS ran, SonarCloud, the documents split
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.24.md`; this is what no other file carries.* The owner, 2026-10-19: "Bạn xem xét,
|
||||
đánh giá và lên plan cho bản beta mới với những nội dung như sau:" — six items: the mix of frame-generation modes inside
|
||||
one session, shown in the App; the upscaler's quality mode (Ultra Performance … DLAA, FSR's too) only when captured, the
|
||||
NVIDIA App's override as the standard where there is one; SonarCloud fixed and its false positives marked; a SonarCloud
|
||||
configuration that keeps third-party headers out; which DLSS is in use (3, 4, 4.5, 5), if it can be found; the long
|
||||
documents split — then, with the plan approved, the whole train to the release without asking again. Later the same
|
||||
day: "Bạn có thể xét tới trường framegen chỉnh trong setting in-game nếu chưa có" (the frame generation chosen in the
|
||||
game's own menu). Answers that set the decisions below, given before the plan: the mix as a share bar and a table; the
|
||||
owner marks Sonar's false positives in its UI from a list we write; all four long documents split; the override is the
|
||||
standard only where the driver confirms it applied; DLSS labels bound to evidence; FSR's mode through `ffxQuery` as a
|
||||
separate PR that may slip; owner-only items 7–11 and 13 not yet run; Dependabot #314 rebased and merged in the train.
|
||||
|
||||
**Decisions:**
|
||||
|
||||
- **D62 — the mix.** Every frame-generation state a session held, each with its own factor, Native → Displayed and its
|
||||
share of the presenting time, then *no frame generation* (only where a counted `none` is allowed) and *not
|
||||
classified*; never an average across states (CLAUDE.md rule 6, amended). Computed at finalize over the steady state's
|
||||
own five-second windows and stored (`sessions.fg_mix`, schema 0020); sessions recorded before have none and are not
|
||||
rebuilt. Above the rows, how frame generation was set — the NVIDIA App's Dynamic / Fixed from the stored driver
|
||||
profile, or the game — as configuration, never as a row. The multiplier chosen in a game's menu is not read (§2b's
|
||||
refusal stands); the measured row is its evidence.
|
||||
- **D63 — the NVIDIA App's override is the quality mode where the driver reports it applied** (`03_METRICS`
|
||||
§Upscaling, amended; `QualityResolver`, read at display time, so sessions recorded before resolve alike). Otherwise
|
||||
the mode the game passed to a hooked call; otherwise none; never the game's own value under an override.
|
||||
- **D64 — DLSS labels are evidence-bound** (`05_DETECTION` §DLSS generation): each library's version and folder class
|
||||
(`sessions.runtime_module_sources`, schema 0021 — never the path), the preset the driver reports applied, DLSS 4 /
|
||||
4.5 only from a preset or a measured multi-frame factor, DLSS 5 only as "runtime loaded".
|
||||
- **D65 — FSR's quality mode through `ffxQuery`: deferred to the next beta.** The plan allowed it to slip, and it was
|
||||
kept out of this train — a new hook on four FidelityFX modules, a hook-family bit in the shared layout, a new byte
|
||||
encoding, the stubs and the harness, on the hook path rule 5 guards — rather than written against the release.
|
||||
ACCURACY's FSR clause did not ship with it. The design stands in the plan: query → the five (mode, size) pairs → the
|
||||
mode whose size the game then dispatched. The owner asked for it as 0.1.0-beta.25 the same day.
|
||||
- **D66 — the long documents are split**, every original path kept as the index of its parts, moved byte for byte
|
||||
(`tools/docs-split-check.ps1`; `release-notes.ps1` reads `docs/changelog/<version>.md`).
|
||||
- **D67 — SonarCloud stays on Automatic Analysis** with `.sonarcloud.properties`; the by-design rules and false
|
||||
positives are listed in `13_CI_CD` §SonarCloud for the owner to mark in its UI.
|
||||
|
||||
**Measured on the owner's ledger** (a read-only SQLite backup copy — never the data folder): **the NVIDIA driver's
|
||||
`performanceMode` is in NGX's own numbering, not the profile's** — Silent Hill 2 (2026-10-13) ran under the App's Ultra
|
||||
Performance (profile value 5) and the driver reported 3; `NvidiaOverrides.DriverLine` had read it through the profile's
|
||||
table since beta.8 and dropped the mode. The same session's SR word has no `CREATED | EVALUATE` (no mode is claimed),
|
||||
its FG word applied ×6 and the session measured a ×6.0 steady state, and **none of the override's libraries carried a
|
||||
census name** — the module snapshot now records everything under `%ProgramData%\NVIDIA\NGX`. Bit 19 is set on a working
|
||||
override (Expedition 33's `0x8067F`) and bit 1 with no override at all (`0x60F`): only `PERF_MODE`, `SR_DLAA_MODE` and
|
||||
`SCALING_RATIO` say an override applied. The App's global profile stores `NGX_DLSSG_DYNAMIC_MULTI_FRAME_COUNT_MAX = 5`.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **`gh pr merge --squash --delete-branch` on a stacked PR closes the PR based on it** (#319), and a closed PR cannot be
|
||||
reopened once its head was force-pushed. Recovery: push the base back, push the head back to the SHA it closed at,
|
||||
reopen, retarget to `main`, push the rebased head, delete the base. Instead: retarget the next PR to `main` first,
|
||||
merge without `--delete-branch`, rebase the rest (`git rebase --update-refs --onto origin/main <old tip>`, in a
|
||||
temporary `git worktree` when the checkout is busy), then delete the merged branch.
|
||||
- **Dependabot closed #314 itself** after `@dependabot rebase` ("updatable in another way") and did not answer
|
||||
`@dependabot reopen`; the two analyzer versions it proposed went into the release PR by hand.
|
||||
- **SonarCloud's PR gate fails on new `cpp:S8417`** (explicit memory orders, by design): not a required check; the
|
||||
optional ignore row in `13_CI_CD` §SonarCloud stops it.
|
||||
- **A Domain.Metrics enum must be listed in `MetricEnumMirrorTests`** (mirrored or explicitly local), **every enum needs
|
||||
a zero member** (CA1008), **private consts in tests take the `_` prefix** (IDE1006 is `dotnet format`'s, not the
|
||||
build's), and **`null` literals make overloads ambiguous** across a `string?` and a record parameter.
|
||||
- **Python strings in the scratch scripts read `\N` as an escape** — a Windows path in a C# comment written through a
|
||||
Python script needs its backslashes doubled, and a Bash heredoc halves them (the beta.23 trap again).
|
||||
|
||||
**Owner-only, added to the list below:** item 20.
|
||||
@@ -13,9 +13,11 @@ A value FrameLedger could not measure reads **N/A** — never 0, and never an es
|
||||
- **When frame generation was measured**, the game's own frames and the frames you saw are shown together:
|
||||
`62 → 118 FPS (×1.9 FG)`. If frame generation changed during the session (menus, loading screens, a settings change),
|
||||
the figures are for the state that lasted longest, with the share of the session it covers: `(×1.9 FG · 75%)`.
|
||||
- **The upscaler's quality mode** — Quality, Balanced, Performance, Ultra Performance, DLAA — is shown only when it is
|
||||
known. *· NVIDIA App* after it means the NVIDIA App overrode DLSS for this game and the NVIDIA driver reported that
|
||||
the override applied; *· NVIDIA App override* alone means it applied and its mode could not be settled.
|
||||
- **The upscaler's quality mode** — Quality, Balanced, Performance, Ultra Performance, DLAA, and FSR's Native AA — is
|
||||
shown only when it is known. *· NVIDIA App* after it means the NVIDIA App overrode DLSS for this game and the NVIDIA
|
||||
driver reported that the override applied; *· NVIDIA App override* alone means it applied and its mode could not be
|
||||
settled. For FSR it is the mode the game asked AMD's library about and then rendered at; at a dynamic resolution
|
||||
none is shown.
|
||||
- **The DLSS line** names the DLSS the game ran: *DLSS 4.5* or *DLSS 4* only when the session showed it (the model
|
||||
preset the NVIDIA driver reports, or a frame-generation multiplier of ×3 and above), each DLSS library's version and
|
||||
whether it came from the game or from the graphics driver (the NVIDIA App can swap in the driver's copy), and *DLSS 5
|
||||
|
||||
@@ -38,8 +38,9 @@ What the words on FrameLedger's screens mean, in alphabetical order. How each fi
|
||||
- **Presented FPS** — every frame the game handed to Windows, shown when frame generation could not be measured, with a
|
||||
note saying whether generated frames could be among them.
|
||||
- **RAM (this game)** — the game's own memory, what Task Manager's Details tab shows as its private working set.
|
||||
- **Quality mode** — the upscaler's setting (Quality, Balanced, Performance, Ultra Performance, DLAA). *· NVIDIA App*
|
||||
marks one the NVIDIA App set for the game, which the NVIDIA driver reported applied.
|
||||
- **Quality mode** — the upscaler's setting (Quality, Balanced, Performance, Ultra Performance, DLAA; FSR's Native AA
|
||||
renders at full resolution). *· NVIDIA App* marks one the NVIDIA App set for the game, which the NVIDIA driver
|
||||
reported applied.
|
||||
- **Ray tracing, Path tracing, Ray reconstruction** — read *Yes*, *No* or *N/A*. Ray tracing is measured on DirectX 12
|
||||
games; path tracing is never stated as a fact.
|
||||
- **Render scale** — the share of the screen's resolution the game drew at before upscaling. 100% means no upscaling.
|
||||
|
||||
+4
-3
@@ -12,7 +12,7 @@
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-19.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.23`** (2026-10-14), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.25`** (2026-10-19), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -39,8 +39,9 @@
|
||||
> - **Quality mode:** shown only when it is known. When the NVIDIA App overrides DLSS Super Resolution for
|
||||
> the game and the NVIDIA driver reports that the override applied in the session, the override's mode is
|
||||
> shown and marked as the NVIDIA App's. Otherwise the mode the game itself passed: the DLSS options a
|
||||
> Streamline title passes with its per-frame call (not yet seen on a real title). In every other case no
|
||||
> mode is shown.
|
||||
> Streamline title passes with its per-frame call (not yet seen on a real title), or, for FSR through
|
||||
> AMD's FidelityFX libraries, the mode whose render size the game asked for and then rendered at. In
|
||||
> every other case — FSR at a dynamic resolution among them — no mode is shown.
|
||||
> - **DLSS version:** the version of each DLSS library the game loaded and whether it came from the game or from
|
||||
> the NVIDIA driver; "DLSS 4" or "DLSS 4.5" only when the session shows it (the model preset the driver reports,
|
||||
> or a measured multi-frame factor); DLSS 5 only as "runtime loaded".
|
||||
|
||||
+4
-3
@@ -114,7 +114,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-19.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.23`** (2026-10-14), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.25`** (2026-10-19), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -141,8 +141,9 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
> - **Quality mode:** shown only when it is known. When the NVIDIA App overrides DLSS Super Resolution for
|
||||
> the game and the NVIDIA driver reports that the override applied in the session, the override's mode is
|
||||
> shown and marked as the NVIDIA App's. Otherwise the mode the game itself passed: the DLSS options a
|
||||
> Streamline title passes with its per-frame call (not yet seen on a real title). In every other case no
|
||||
> mode is shown.
|
||||
> Streamline title passes with its per-frame call (not yet seen on a real title), or, for FSR through
|
||||
> AMD's FidelityFX libraries, the mode whose render size the game asked for and then rendered at. In
|
||||
> every other case — FSR at a dynamic resolution among them — no mode is shown.
|
||||
> - **DLSS version:** the version of each DLSS library the game loaded and whether it came from the game or from
|
||||
> the NVIDIA driver; "DLSS 4" or "DLSS 4.5" only when the session shows it (the model preset the driver reports,
|
||||
> or a measured multi-frame factor); DLSS 5 only as "runtime loaded".
|
||||
|
||||
@@ -203,6 +203,7 @@ public static class Formats
|
||||
UpscalerQualityMode.UltraPerformance => Strings.Nv_Mode_UltraPerformance,
|
||||
UpscalerQualityMode.UltraQuality => Strings.Nv_Mode_UltraQuality,
|
||||
UpscalerQualityMode.Dlaa => Strings.Nv_Mode_Dlaa,
|
||||
UpscalerQualityMode.NativeAa => Strings.Fsr_Mode_NativeAa,
|
||||
UpscalerQualityMode.Custom => resolved.CustomPercent is uint percent
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Nv_Mode_Custom_Format, percent)
|
||||
: Strings.Nv_Mode_Custom,
|
||||
|
||||
Generated
+3
@@ -477,6 +477,7 @@ public static class Strings
|
||||
nameof(Fps_Native_Tooltip),
|
||||
nameof(Fps_None_Tooltip),
|
||||
nameof(Fps_Presented_Format),
|
||||
nameof(Fsr_Mode_NativeAa),
|
||||
nameof(GameDetail_AntiCheat_Exceptionable_Format),
|
||||
nameof(GameDetail_AntiCheat_Format),
|
||||
nameof(GameDetail_AntiCheat_Header),
|
||||
@@ -2062,6 +2063,8 @@ public static class Strings
|
||||
|
||||
public static string Fps_Presented_Format => ResourceManager.GetString(nameof(Fps_Presented_Format), Culture) ?? nameof(Fps_Presented_Format);
|
||||
|
||||
public static string Fsr_Mode_NativeAa => ResourceManager.GetString(nameof(Fsr_Mode_NativeAa), Culture) ?? nameof(Fsr_Mode_NativeAa);
|
||||
|
||||
public static string GameDetail_AntiCheat_Exceptionable_Format => ResourceManager.GetString(nameof(GameDetail_AntiCheat_Exceptionable_Format), Culture) ?? nameof(GameDetail_AntiCheat_Exceptionable_Format);
|
||||
|
||||
public static string GameDetail_AntiCheat_Format => ResourceManager.GetString(nameof(GameDetail_AntiCheat_Format), Culture) ?? nameof(GameDetail_AntiCheat_Format);
|
||||
|
||||
@@ -4573,4 +4573,8 @@
|
||||
<value>DLSS 5 ランタイムを読み込み済み</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Fsr_Mode_NativeAa" xml:space="preserve">
|
||||
<value>ネイティブ AA</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3440,4 +3440,7 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Dlss_NeuralRendering_Loaded" xml:space="preserve">
|
||||
<value>DLSS 5 runtime loaded</value>
|
||||
</data>
|
||||
<data name="Fsr_Mode_NativeAa" xml:space="preserve">
|
||||
<value>Native AA</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3435,4 +3435,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="Dlss_NeuralRendering_Loaded" xml:space="preserve">
|
||||
<value>đã nạp runtime DLSS 5</value>
|
||||
</data>
|
||||
<data name="Fsr_Mode_NativeAa" xml:space="preserve">
|
||||
<value>Native AA</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -64,7 +64,7 @@ public static class SessionProgressCalculator
|
||||
FgRefusal = usable ? null : fg?.Refusal is { } refusal ? Vocabulary.FgRefusal(refusal.Kind) : null,
|
||||
FgRuntimeCensus = progress.WriterState.RuntimeCensus,
|
||||
Upscaler = upscaler is { } u ? Vocabulary.Upscaler(u) : FgLadder.UpscalerHookRan(progress.Records) ? "unknown" : null,
|
||||
UpscalerQuality = Modal([.. withParams.Where(static s => s.UpscalerQuality != FrameSample.QualityNotTold)])?.ToString(CultureInfo.InvariantCulture),
|
||||
UpscalerQuality = QualityByte.Of(withParams)?.ToString(CultureInfo.InvariantCulture),
|
||||
UpscalerDriverReported = progress.NgxDriver.SrCreatedAndEvaluated ? "dlss" : null,
|
||||
UpscalerQualityOverride = QualityResolver.Token(QualityResolver.Live(
|
||||
upscaler == FlUpscaler.Dlss || (upscaler is null && progress.NgxDriver.SrCreatedAndEvaluated),
|
||||
@@ -120,11 +120,6 @@ public static class SessionProgressCalculator
|
||||
return null;
|
||||
}
|
||||
|
||||
private static int? Modal(IReadOnlyList<FrameSample> samples) =>
|
||||
samples.Count == 0
|
||||
? null
|
||||
: samples.GroupBy(static s => s.UpscalerQuality).OrderByDescending(static g => g.Count()).ThenBy(static g => g.Key).First().Key;
|
||||
|
||||
/// <summary>The last <see cref="WindowSeconds"/> of records, and the dominant stream within them with its gaps.</summary>
|
||||
private sealed class Window
|
||||
{
|
||||
|
||||
@@ -83,6 +83,7 @@ public static class QualityResolver
|
||||
UpscalerQualityMode.UltraQuality => "ultra_quality",
|
||||
UpscalerQualityMode.Dlaa => "dlaa",
|
||||
UpscalerQualityMode.Custom => "custom",
|
||||
UpscalerQualityMode.NativeAa => "native_aa",
|
||||
_ => null,
|
||||
};
|
||||
|
||||
@@ -98,6 +99,7 @@ public static class QualityResolver
|
||||
"ultra_quality" => UpscalerQualityMode.UltraQuality,
|
||||
"dlaa" => UpscalerQualityMode.Dlaa,
|
||||
"custom" => UpscalerQualityMode.Custom,
|
||||
"native_aa" => UpscalerQualityMode.NativeAa,
|
||||
_ => null,
|
||||
};
|
||||
return mode is not null || string.Equals(token, OverrideToken, StringComparison.Ordinal) ? new ResolvedQuality(mode, QualitySource.NvidiaApp) : null;
|
||||
|
||||
@@ -183,11 +183,10 @@ public static class SessionAggregator
|
||||
FlUpscaler? identity = FgLadder.UpscalerIdentity(c.Input.Records);
|
||||
bool hookRan = FgLadder.UpscalerHookRan(c.Input.Records);
|
||||
IReadOnlyList<FrameSample> withParams = [.. c.Dominant.Where(static s => s.Claims(MeasuredFields.UpscalerParams))];
|
||||
IReadOnlyList<FrameSample> withQuality = [.. withParams.Where(static s => s.UpscalerQuality != FrameSample.QualityNotTold)];
|
||||
return row with
|
||||
{
|
||||
Upscaler = identity is { } u ? Vocabulary.Upscaler(u) : hookRan ? "unknown" : null,
|
||||
UpscalerQuality = Modal(withQuality, static s => s.UpscalerQuality)?.ToString(CultureInfo.InvariantCulture),
|
||||
UpscalerQuality = QualityByte.Of(withParams)?.ToString(CultureInfo.InvariantCulture),
|
||||
UpscalerSharpness = Modal(withParams, static s => s.UpscalerSharpness),
|
||||
UpscalerDriverReported = c.Input.Ngx.SrCreatedAndEvaluated ? "dlss" : null,
|
||||
RenderW = extent?.RenderW,
|
||||
@@ -419,8 +418,7 @@ public static class SessionAggregator
|
||||
OutputW = seg.OutputW == 0 ? null : seg.OutputW,
|
||||
OutputH = seg.OutputH == 0 ? null : seg.OutputH,
|
||||
Upscaler = upscaler is { } u && u != UpscalerKind.NotReported ? Vocabulary.Upscaler(u) : null,
|
||||
UpscalerQuality = Modal([.. seg.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams) && s.UpscalerQuality != FrameSample.QualityNotTold)], static s => s.UpscalerQuality)
|
||||
?.ToString(CultureInfo.InvariantCulture),
|
||||
UpscalerQuality = QualityByte.Of([.. seg.Samples.Where(static s => s.Claims(MeasuredFields.UpscalerParams))])?.ToString(CultureInfo.InvariantCulture),
|
||||
FgMode = null,
|
||||
NativeFps = null,
|
||||
DisplayedFps = series.AverageFps,
|
||||
|
||||
@@ -53,7 +53,8 @@ public readonly record struct FrameSample
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="UpscalerQuality"/>'s "a hook ran and could not tell" (<c>fl_shm.h</c> <c>upscalerQuality</c>): not a preset,
|
||||
/// so it is never a value in a row. Every AMD dispatch carries it, because that call has no preset.
|
||||
/// so it is never a value in a row. An AMD dispatch carries it unless the vendor's own query answer names the size it
|
||||
/// was handed (beta.25, D65; <see cref="QualityByte"/>), because that call has no preset.
|
||||
/// </summary>
|
||||
public const byte QualityNotTold = 0xFF;
|
||||
|
||||
|
||||
@@ -23,4 +23,7 @@ public enum HookFamilies
|
||||
ColorSpace = 1 << 8,
|
||||
Reflex = 1 << 9,
|
||||
Vram = 1 << 10,
|
||||
|
||||
/// <summary>The FidelityFX quality query (beta.25, D65).</summary>
|
||||
UpscalerQuality = 1 << 11,
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Domain.Metrics;
|
||||
|
||||
/// <summary>
|
||||
/// The quality byte a run of params records names — a session's, a segment's or the live card's window — so the three
|
||||
/// read one rule (beta.25, D65). The most common byte that is not <see cref="FrameSample.QualityNotTold"/>, a tie going
|
||||
/// to the lower; and for FSR's bytes, none when the game rendered at a size no FSR-named record has.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>Why FSR's byte needs the second condition.</b> FSR's dispatch carries no mode: the Overlay names one per frame
|
||||
/// only when the size the frame was upscaled from is the size the vendor's query gave for that mode (<c>dllmain.cpp</c>
|
||||
/// <c>FfxQualityOf</c>). At a dynamic resolution most frames are at sizes no answer gave and carry "not told", while the
|
||||
/// frames at the top of the range still match — so the plain modal would name a mode for a session that mostly did not
|
||||
/// render at it. <c>legal/ACCURACY.md</c> promises the opposite: "FSR at a dynamic resolution among them — no mode is
|
||||
/// shown". An FSR record at a size no named record has is that evidence, and it withholds the mode.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>What is not evidence.</b> A "not told" record at a named size — a present that drained a frame-generation PREPARE
|
||||
/// alone, or a frame before the title asked — and a record of another upscaler (its sizes are its own).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class QualityByte
|
||||
{
|
||||
/// <summary>FSR's NativeAA: <c>0x10</c> plus <c>FFX_UPSCALE_QUALITY_MODE_NATIVEAA</c> (<c>fl_shm.h</c>).</summary>
|
||||
public const byte FsrFirst = 0x10;
|
||||
|
||||
/// <summary>FSR's Ultra Performance: <c>0x10</c> plus <c>FFX_UPSCALE_QUALITY_MODE_ULTRA_PERFORMANCE</c>.</summary>
|
||||
public const byte FsrLast = 0x14;
|
||||
|
||||
/// <summary>Whether a byte is one of FSR's five.</summary>
|
||||
public static bool IsFsr(byte value) => value is >= FsrFirst and <= FsrLast;
|
||||
|
||||
/// <summary>The byte the records name, or null when none is told or an FSR mode is withheld.</summary>
|
||||
/// <param name="withParams">The records that claim the params bit; the caller filters, as it does today.</param>
|
||||
public static byte? Of(IReadOnlyList<FrameSample> withParams)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(withParams);
|
||||
byte? modal = withParams
|
||||
.Where(static s => s.UpscalerQuality != FrameSample.QualityNotTold)
|
||||
.GroupBy(static s => s.UpscalerQuality)
|
||||
.OrderByDescending(static g => g.Count())
|
||||
.ThenBy(static g => g.Key)
|
||||
.Select(static g => (byte?)g.Key)
|
||||
.FirstOrDefault();
|
||||
if (modal is not { } named || !IsFsr(named))
|
||||
{
|
||||
return modal;
|
||||
}
|
||||
|
||||
HashSet<(ushort W, ushort H)> namedSizes = [.. withParams.Where(static s => IsFsr(s.UpscalerQuality)).Select(static s => (s.RenderW, s.RenderH))];
|
||||
return withParams.Any(s => IsFsrRecord(s) && !namedSizes.Contains((s.RenderW, s.RenderH))) ? null : named;
|
||||
}
|
||||
|
||||
private static bool IsFsrRecord(FrameSample s) =>
|
||||
s.Claims(MeasuredFields.Upscaler) && s.Upscaler is UpscalerKind.Fsr2 or UpscalerKind.Fsr3 or UpscalerKind.Fsr4 or UpscalerKind.FsrUnversioned;
|
||||
}
|
||||
@@ -5,15 +5,19 @@ namespace FrameLedger.Domain.Metrics;
|
||||
|
||||
/// <summary>
|
||||
/// The vendors' own quality values as modes (<c>03_METRICS</c> §Upscaling promised this type from the start; until
|
||||
/// 2026-09-21 the UI printed the raw integer beside the upscaler). Three numberings reach this build, one table each:
|
||||
/// the hooked byte (Streamline's <c>sl::DLSSMode</c>), the NVIDIA driver's per-process report (NGX's own
|
||||
/// 2026-09-21 the UI printed the raw integer beside the upscaler). Four numberings reach this build, one table each:
|
||||
/// the hooked byte for DLSS (Streamline's <c>sl::DLSSMode</c>) and for FSR (<c>0x10</c> plus
|
||||
/// <c>FfxApiUpscaleQualityMode</c>, since beta.25), the NVIDIA driver's per-process report (NGX's own
|
||||
/// <c>PerfQuality</c> values) and the NVIDIA App's override as the driver profile stores it (<c>NGX_DLSS_SR_MODE</c>).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The hooked byte.</b> Its only writer is the Streamline route: <c>sl::DLSSMode</c> as the title chained it into
|
||||
/// <b>The hooked byte.</b> Two writers. The Streamline route: <c>sl::DLSSMode</c> as the title chained it into
|
||||
/// <c>slEvaluateFeature</c> (<c>fl_sl_inputs.h</c> <c>QualityFromMode</c>), where <c>eOff</c> and anything at or past
|
||||
/// <c>eCount</c> are already folded to "not told" and never reach a row. A value this table does not know is not named —
|
||||
/// <c>eCount</c> are already folded to "not told" and never reach a row. And since beta.25 (D65) the FidelityFX route:
|
||||
/// <c>0x10</c> plus the mode whose <c>ffxQuery</c> answer is the size the UPSCALE dispatch was handed, offset so that
|
||||
/// FSR's NativeAA (0) can never be read as Streamline's <c>eOff</c>, and withheld for a session at a dynamic resolution
|
||||
/// (<see cref="QualityByte"/>). A value this table does not know is not named —
|
||||
/// the App prints the stored number, because a number nobody can name is still what was measured.
|
||||
/// </para>
|
||||
/// <para>
|
||||
@@ -33,7 +37,17 @@ public static class UpscalerNames
|
||||
/// <param name="quality">The row's quality value: the vendor's integer, invariant.</param>
|
||||
public static UpscalerQualityMode? Mode(string? upscaler, string? quality)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(quality) || !string.Equals(upscaler, "dlss", StringComparison.Ordinal))
|
||||
if (string.IsNullOrWhiteSpace(quality))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (upscaler is "fsr" or "fsr3" or "fsr4")
|
||||
{
|
||||
return FromFsrByte(quality);
|
||||
}
|
||||
|
||||
if (!string.Equals(upscaler, "dlss", StringComparison.Ordinal))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -50,6 +64,21 @@ public static class UpscalerNames
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FSR's byte (beta.25, D65): <c>0x10</c> plus <c>FfxApiUpscaleQualityMode</c> — the mode whose <c>ffxQuery</c>
|
||||
/// answer is the size the title's UPSCALE dispatch was handed (NativeAA 16, Quality 17, Balanced 18, Performance 19,
|
||||
/// Ultra Performance 20). Offset at the writer because FSR's NativeAA is 0 and 0 is "nobody looked".
|
||||
/// </summary>
|
||||
private static UpscalerQualityMode? FromFsrByte(string quality) => quality switch
|
||||
{
|
||||
"16" => UpscalerQualityMode.NativeAa,
|
||||
"17" => UpscalerQualityMode.Quality,
|
||||
"18" => UpscalerQualityMode.Balanced,
|
||||
"19" => UpscalerQualityMode.Performance,
|
||||
"20" => UpscalerQualityMode.UltraPerformance,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The NVIDIA driver's per-process report (<c>NvAPI_NGX_GetNGXOverrideState</c>'s <c>performanceMode</c>) in NGX's own
|
||||
/// numbering: 0 Performance, 1 Balanced, 2 Quality, 3 Ultra Performance, 4 Ultra Quality, 5 DLAA. 0–2 agree with the
|
||||
|
||||
@@ -23,4 +23,7 @@ public enum UpscalerQualityMode
|
||||
|
||||
/// <summary>An override's custom render-scale ratio; its percentage travels beside it.</summary>
|
||||
Custom = 7,
|
||||
|
||||
/// <summary>FSR at a per-dimension ratio of 1.0: anti-aliasing at native resolution (beta.25, D65).</summary>
|
||||
NativeAa = 8,
|
||||
}
|
||||
@@ -255,6 +255,9 @@ public enum FlHookFamily : uint
|
||||
ColorSpace = 1u << 8,
|
||||
Reflex = 1u << 9,
|
||||
Vram = 1u << 10,
|
||||
|
||||
/// <summary>The FidelityFX quality query, <c>ffxQuery</c> (beta.25, D65): what lets a dispatch's size name its mode.</summary>
|
||||
UpscalerQuality = 1u << 11,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -117,7 +117,8 @@ inline constexpr uint32_t kFamiliesEvaluateFeatureDoesNotImplement =
|
||||
static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS) | static_cast<uint32_t>(fl::FL_HOOK_RT_DISPATCH) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_RT_AS_BUILD) | static_cast<uint32_t>(fl::FL_HOOK_RT_PSO) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_PSO) | static_cast<uint32_t>(fl::FL_HOOK_COLOR_SPACE) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM);
|
||||
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY);
|
||||
|
||||
static_assert((kFamilyEvaluateFeature & kFamiliesEvaluateFeatureDoesNotImplement) == 0u,
|
||||
"the slEvaluateFeature row claims a family its detour does not implement -- hookinventory-check "
|
||||
@@ -188,7 +189,8 @@ inline constexpr uint32_t kFamiliesFfxDispatchDoesNotImplement =
|
||||
static_cast<uint32_t>(fl::FL_HOOK_PRESENT) | static_cast<uint32_t>(fl::FL_HOOK_RT_DISPATCH) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_RT_AS_BUILD) | static_cast<uint32_t>(fl::FL_HOOK_RT_PSO) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_PSO) | static_cast<uint32_t>(fl::FL_HOOK_COLOR_SPACE) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM);
|
||||
static_cast<uint32_t>(fl::FL_HOOK_REFLEX) | static_cast<uint32_t>(fl::FL_HOOK_VRAM) |
|
||||
static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY);
|
||||
|
||||
static_assert((kFamilyFfxDispatch & kFamiliesFfxDispatchDoesNotImplement) == 0u,
|
||||
"the ffxDispatch rows claim a family their detour does not implement -- hookinventory-check reads "
|
||||
@@ -237,6 +239,28 @@ static_assert(kFamilyFsr3Host == kFamilyFfxDispatch,
|
||||
"one family, one publish point, one live latch: the host row shares the ffx-api rows' drain word and "
|
||||
"must share their claims, or fgEvaluations would be fed by a row that does not claim FG_EVALUATIONS");
|
||||
|
||||
// --- AMD FidelityFX: ffxQuery on the same four modules (beta.25, owner decision D65) ---
|
||||
//
|
||||
// THE QUALITY MODE IS AN ARGUMENT OF A QUERY, NEVER OF THE DISPATCH. FfxApiUpscaleQualityMode reaches the vendor
|
||||
// only through ffxQuery -- "what render size (or ratio) does this mode give at this display size?" -- which a title
|
||||
// asks before it sizes its targets; the UPSCALE dispatch then carries the size alone. So the answers the vendor
|
||||
// returned are kept, and the dispatch arm names the mode whose answer is the size it was handed (dllmain.cpp). The
|
||||
// rows are the four modules ffxDispatch is hooked on, for the reason those rows give -- whatever module the game
|
||||
// calls -- and a query a loader passed on to a leaf's export would only refresh one kept answer twice: nothing is
|
||||
// counted, so nothing can be counted twice.
|
||||
//
|
||||
// ITS OWN BIT, NOT A SHARE OF kFamilyFfxDispatch. The query entitles no measured field by itself -- the mode rides
|
||||
// in the byte FL_MEASURED_UPSCALER_PARAMS already covers, from the dispatch arm -- and the bit says only that the
|
||||
// query was hooked, so "the title never asked" can be told from "nobody could have seen it ask".
|
||||
inline constexpr uint32_t kFamilyFfxQuery = static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY);
|
||||
static_assert(kFamilyFfxQuery != kFamilyFfxDispatch && kFamilyFfxQuery != kFamilyEvaluateFeature &&
|
||||
kFamilyFfxQuery != static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS) &&
|
||||
kFamilyFfxQuery != static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS),
|
||||
"InstallByFamily binds a row by EQUALITY on this value -- a collision would hand the query's detour "
|
||||
"body to a dispatch export, whose signature it does not share");
|
||||
static_assert((kFamilyFfxDispatch & kFamilyFfxQuery) == 0u,
|
||||
"the dispatch rows must not claim the query's bit: they do not hook ffxQuery");
|
||||
|
||||
// The leaves, in the order dllmain's per-leaf trampoline and latch arrays are indexed.
|
||||
enum FfxLeaf : uint32_t {
|
||||
kFfxLeafMonolith = 0, // amd_fidelityfx_dx12.dll -- SDK 1.1.x, FSR 3.1 only
|
||||
@@ -336,6 +360,10 @@ inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
|
||||
X(L"amd_fidelityfx_upscaler_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
|
||||
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
|
||||
X(L"amd_fidelityfx_loader_dx12.dll", "ffxDispatch", fl::inventory::kFamilyFfxDispatch) \
|
||||
X(L"amd_fidelityfx_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
|
||||
X(L"amd_fidelityfx_upscaler_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
|
||||
X(L"amd_fidelityfx_framegeneration_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
|
||||
X(L"amd_fidelityfx_loader_dx12.dll", "ffxQuery", fl::inventory::kFamilyFfxQuery) \
|
||||
X(L"ffx_fsr3_x64.dll", "ffxFsr3ContextDispatchUpscale", fl::inventory::kFamilyFsr3Host)
|
||||
|
||||
// The FSR 3.0 host module and the one symbol dllmain's ffx arm keys on for it. Named
|
||||
@@ -425,6 +453,39 @@ static_assert(FfxLeafOfExact(kModuleFfxFsr3Host) < 0,
|
||||
static_assert(!FfxDispatchRowExistsFor(kModuleFfxFsr3Host),
|
||||
"the host exports no ffxDispatch; a row claiming one would resolve nothing and install nothing");
|
||||
|
||||
// The ffxQuery rows, bound to the leaf table the same way (beta.25, D65): a leaf without its query row is a
|
||||
// trampoline slot nothing installs into; a query row on a module the table does not know would install nothing.
|
||||
inline constexpr const char* kSymbolFfxQuery = "ffxQuery";
|
||||
|
||||
constexpr bool FfxQueryRowExistsFor(const wchar_t* moduleName) noexcept {
|
||||
#define FL_FFX_QUERY_ROW_FOR(mod, sym, family) \
|
||||
if (SameW(mod, moduleName) && SameA(sym, kSymbolFfxQuery)) { \
|
||||
return true; \
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_FFX_QUERY_ROW_FOR)
|
||||
#undef FL_FFX_QUERY_ROW_FOR
|
||||
return false;
|
||||
}
|
||||
constexpr bool EveryFfxQueryRowIsALeaf() noexcept {
|
||||
#define FL_FFX_QUERY_ROW_IS_LEAF(mod, sym, family) \
|
||||
if (SameA(sym, kSymbolFfxQuery) && FfxLeafOfExact(mod) < 0) { \
|
||||
return false; \
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_FFX_QUERY_ROW_IS_LEAF)
|
||||
#undef FL_FFX_QUERY_ROW_IS_LEAF
|
||||
return true;
|
||||
}
|
||||
static_assert(FfxQueryRowExistsFor(kFfxLeafModules[kFfxLeafMonolith]) &&
|
||||
FfxQueryRowExistsFor(kFfxLeafModules[kFfxLeafUpscaler]) &&
|
||||
FfxQueryRowExistsFor(kFfxLeafModules[kFfxLeafFrameGeneration]) &&
|
||||
FfxQueryRowExistsFor(kFfxLeafModules[kFfxLeafLoader]),
|
||||
"every ffx leaf needs its ffxQuery row, spelled identically -- the query reaches whatever module the "
|
||||
"game calls, as the dispatch does");
|
||||
static_assert(EveryFfxQueryRowIsALeaf(),
|
||||
"an ffxQuery row names a module the leaf table does not know -- InstallByFamily would find no slot");
|
||||
static_assert(!FfxQueryRowExistsFor(kModuleFfxFsr3Host),
|
||||
"the FSR 3.0 host has its own query API, not ffxQuery; a row claiming one would resolve nothing");
|
||||
|
||||
// Does this module speak the Streamline 2 ABI the vendored headers describe?
|
||||
//
|
||||
// MEASURED 2026-08-14, and it cost an access violation to find. The Witcher 3
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <d3d12.h>
|
||||
#include <dxgi1_2.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
@@ -1150,6 +1151,61 @@ PFN_FfxDispatch g_origFfxDispatch[fl::inventory::kFfxLeafCount] = {};
|
||||
std::atomic<uint32_t> g_ffxPatched[fl::inventory::kFfxLeafCount] = {};
|
||||
std::atomic<uint32_t> g_ffxLive{0};
|
||||
|
||||
// --- The FidelityFX quality query: ffxQuery on the same four modules (beta.25, owner decision D65) ---------------
|
||||
//
|
||||
// THE DISPATCH CARRIES NO QUALITY MODE, AND THE QUERY IS WHERE A TITLE NAMES ONE. FfxApiUpscaleQualityMode is an input
|
||||
// to a query the title makes -- "what render size (or ratio) does this mode give at this display size?" -- before it
|
||||
// sizes its targets; the per-frame UPSCALE dispatch then carries the size alone. So every answer the vendor returned
|
||||
// is kept, one slot per mode, and an UPSCALE dispatch whose renderSize (and upscaleSize, where the title states it)
|
||||
// fits exactly ONE kept answer names that answer's mode. A title that sizes its targets without asking, a title that
|
||||
// asked before this DLL was loaded (attach), and a dynamic-resolution title dispatching sizes no answer gave all keep
|
||||
// 0xFF -- "a hook ran and could not tell" -- which is the answer, not a gap.
|
||||
//
|
||||
// WHAT IS READ (CLAUDE.md rule 4): the descriptor the title passed to a hooked export -- its type, the display size
|
||||
// and the mode -- and, after the original returned FFX_API_RETURN_OK, the values the vendor wrote through the title's
|
||||
// own out pointers, which are arguments of the hooked call. Under the hook's SEH guard like every other argument;
|
||||
// nothing of the title's is written, and nothing beyond those fields is read.
|
||||
constexpr uint32_t kFfxQualityModes = 5; // FFX_UPSCALE_QUALITY_MODE_NATIVEAA .. _ULTRA_PERFORMANCE
|
||||
constexpr uint32_t kFfxQualityNone = 0xFFu;
|
||||
constexpr uint32_t kFfxQualityBase = 0x10u; // the byte FSR's mode is published as: 0x10 + mode (fl_shm.h)
|
||||
// displayW | displayH << 16 | renderW << 32 | renderH << 48; 0 = no answer (every field is non-zero when kept).
|
||||
std::atomic<uint64_t> g_ffxQualitySizes[kFfxQualityModes] = {};
|
||||
// A ratio answer's float bits; 0 = no answer (a kept ratio is at least 1.0).
|
||||
std::atomic<uint32_t> g_ffxQualityRatios[kFfxQualityModes] = {};
|
||||
// The last UPSCALE dispatch's mode, as the byte publishes it. RecordPresent reads it only on a present that drained an
|
||||
// UPSCALE, so it cannot outlive the frame it describes -- g_ffxExtent's rule.
|
||||
std::atomic<uint32_t> g_ffxQuality{kFfxQualityNone};
|
||||
|
||||
using PFN_FfxQuery = ::PfnFfxQuery;
|
||||
PFN_FfxQuery g_origFfxQuery[fl::inventory::kFfxLeafCount] = {};
|
||||
// Per leaf, patched; the family is published once every loaded leaf is (PublishFfxQueryFamilyIfWhole), for the reason
|
||||
// g_ffxPatched gives.
|
||||
std::atomic<uint32_t> g_ffxQueryPatched[fl::inventory::kFfxLeafCount] = {};
|
||||
std::atomic<uint32_t> g_ffxQueryLive{0};
|
||||
|
||||
// THE VALUES AND LAYOUTS THE QUERY ARM READS, PINNED TO LITERALS. Identical at FidelityFX SDK v1.1.4 (the monolith's
|
||||
// generation) and v2.3.0 (the vendored headers), checked against both on 2026-10-19: the two type ids, the mode enum,
|
||||
// and both query descriptors -- a re-vendoring that moved a field fails here, not on a title's own descriptor.
|
||||
static_assert(FFX_API_QUERY_DESC_TYPE_UPSCALE_GETUPSCALERATIOFROMQUALITYMODE == 0x00010002u,
|
||||
"the ratio query's type id (SDK 1.1.4 and 2.3.0)");
|
||||
static_assert(FFX_API_QUERY_DESC_TYPE_UPSCALE_GETRENDERRESOLUTIONFROMQUALITYMODE == 0x00010003u,
|
||||
"the render-size query's type id (SDK 1.1.4 and 2.3.0)");
|
||||
static_assert(FFX_UPSCALE_QUALITY_MODE_NATIVEAA == 0 && FFX_UPSCALE_QUALITY_MODE_ULTRA_PERFORMANCE == 4 &&
|
||||
kFfxQualityModes == FFX_UPSCALE_QUALITY_MODE_ULTRA_PERFORMANCE + 1,
|
||||
"one slot per vendor quality mode, NativeAA (0) through Ultra Performance (4)");
|
||||
static_assert(offsetof(ffxQueryDescUpscaleGetRenderResolutionFromQualityMode, displayWidth) == 16u &&
|
||||
offsetof(ffxQueryDescUpscaleGetRenderResolutionFromQualityMode, displayHeight) == 20u &&
|
||||
offsetof(ffxQueryDescUpscaleGetRenderResolutionFromQualityMode, qualityMode) == 24u &&
|
||||
offsetof(ffxQueryDescUpscaleGetRenderResolutionFromQualityMode, pOutRenderWidth) == 32u &&
|
||||
offsetof(ffxQueryDescUpscaleGetRenderResolutionFromQualityMode, pOutRenderHeight) == 40u,
|
||||
"the render-size query's layout after its 16-byte header");
|
||||
static_assert(offsetof(ffxQueryDescUpscaleGetUpscaleRatioFromQualityMode, qualityMode) == 16u &&
|
||||
offsetof(ffxQueryDescUpscaleGetUpscaleRatioFromQualityMode, pOutUpscaleRatio) == 24u,
|
||||
"the ratio query's layout after its 16-byte header");
|
||||
static_assert(offsetof(ffxDispatchDescUpscale, upscaleSize) ==
|
||||
offsetof(ffxDispatchDescUpscale, renderSize) + sizeof(FfxApiDimensions2D),
|
||||
"upscaleSize follows renderSize in the UPSCALE descriptor (SDK 1.1.4 and 2.3.0)");
|
||||
|
||||
// --- The FSR 3.0 HOST API: ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale ----------
|
||||
//
|
||||
// The fifth AMD target, and NOT a leaf: a different export with a different signature,
|
||||
@@ -1731,6 +1787,82 @@ void NoteFfxExtent(const FfxApiDimensions2D& size) noexcept {
|
||||
NoteFfxExtent(size.width, size.height);
|
||||
}
|
||||
|
||||
// The answer one query returned, kept for the dispatch arm. Read only after the vendor answered OK; a mode, a size or a
|
||||
// ratio the byte or the match cannot carry is not kept.
|
||||
void ObserveFfxQuery(const ffxQueryDescHeader* desc) noexcept {
|
||||
if (desc == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GETRENDERRESOLUTIONFROMQUALITYMODE) {
|
||||
const auto* q = reinterpret_cast<const ffxQueryDescUpscaleGetRenderResolutionFromQualityMode*>(desc);
|
||||
if (q->qualityMode >= kFfxQualityModes || q->pOutRenderWidth == nullptr || q->pOutRenderHeight == nullptr) {
|
||||
return;
|
||||
}
|
||||
const uint64_t dw = q->displayWidth;
|
||||
const uint64_t dh = q->displayHeight;
|
||||
const uint64_t rw = *q->pOutRenderWidth;
|
||||
const uint64_t rh = *q->pOutRenderHeight;
|
||||
if (dw == 0u || dh == 0u || rw == 0u || rh == 0u || dw > 0xFFFFu || dh > 0xFFFFu || rw > 0xFFFFu ||
|
||||
rh > 0xFFFFu) {
|
||||
return;
|
||||
}
|
||||
g_ffxQualitySizes[q->qualityMode].store(dw | (dh << 16) | (rw << 32) | (rh << 48), std::memory_order_release);
|
||||
return;
|
||||
}
|
||||
if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GETUPSCALERATIOFROMQUALITYMODE) {
|
||||
const auto* q = reinterpret_cast<const ffxQueryDescUpscaleGetUpscaleRatioFromQualityMode*>(desc);
|
||||
if (q->qualityMode >= kFfxQualityModes || q->pOutUpscaleRatio == nullptr) {
|
||||
return;
|
||||
}
|
||||
const float ratio = *q->pOutUpscaleRatio;
|
||||
if (!(ratio >= 1.0f && ratio <= 16.0f)) { // a NaN fails both
|
||||
return;
|
||||
}
|
||||
g_ffxQualityRatios[q->qualityMode].store(std::bit_cast<uint32_t>(ratio), std::memory_order_release);
|
||||
}
|
||||
}
|
||||
|
||||
// Whether a ratio answer gives this render dimension at this display dimension: the vendor truncates
|
||||
// display / ratio, and a title sizing its own targets from the ratio may round instead -- one pixel either way.
|
||||
bool RatioFits(uint32_t display, float ratio, uint32_t render) noexcept {
|
||||
const auto expected = static_cast<int64_t>(static_cast<float>(display) / ratio);
|
||||
const int64_t diff = expected - static_cast<int64_t>(render);
|
||||
return diff >= -1 && diff <= 1;
|
||||
}
|
||||
|
||||
// The byte an UPSCALE dispatch's sizes name: 0x10 + the ONE mode whose kept answer fits them, else 0xFF. A size
|
||||
// answer fits when its render size is the dispatched one and its display size the dispatched upscaleSize (or the
|
||||
// title stated none -- the field is optional); a ratio answer fits within RatioFits, and only with a stated
|
||||
// upscaleSize, which it needs to be a size at all. Two modes that fit name nothing.
|
||||
uint32_t FfxQualityOf(uint32_t renderW, uint32_t renderH, uint32_t displayW, uint32_t displayH) noexcept {
|
||||
if (renderW == 0u || renderH == 0u) {
|
||||
return kFfxQualityNone;
|
||||
}
|
||||
const bool displayStated = displayW != 0u && displayH != 0u;
|
||||
uint32_t found = kFfxQualityNone;
|
||||
for (uint32_t mode = 0; mode < kFfxQualityModes; ++mode) {
|
||||
bool fits = false;
|
||||
const uint64_t sizes = g_ffxQualitySizes[mode].load(std::memory_order_acquire);
|
||||
if (sizes != 0u) {
|
||||
const bool sameDisplay =
|
||||
!displayStated || ((sizes & 0xFFFFu) == displayW && ((sizes >> 16) & 0xFFFFu) == displayH);
|
||||
fits = sameDisplay && ((sizes >> 32) & 0xFFFFu) == renderW && ((sizes >> 48) & 0xFFFFu) == renderH;
|
||||
}
|
||||
const uint32_t bits = g_ffxQualityRatios[mode].load(std::memory_order_acquire);
|
||||
if (!fits && bits != 0u && displayStated) {
|
||||
const float ratio = std::bit_cast<float>(bits);
|
||||
fits = RatioFits(displayW, ratio, renderW) && RatioFits(displayH, ratio, renderH);
|
||||
}
|
||||
if (fits) {
|
||||
if (found != kFfxQualityNone) {
|
||||
return kFfxQualityNone; // two modes fit these sizes: neither is named
|
||||
}
|
||||
found = kFfxQualityBase + mode;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
void ObserveFfxDispatch(uint32_t leaf, const ffxDispatchDescHeader* desc) noexcept {
|
||||
if (desc == nullptr) {
|
||||
return;
|
||||
@@ -1739,6 +1871,10 @@ void ObserveFfxDispatch(uint32_t leaf, const ffxDispatchDescHeader* desc) noexce
|
||||
case FFX_API_DISPATCH_DESC_TYPE_UPSCALE: {
|
||||
const auto* up = reinterpret_cast<const ffxDispatchDescUpscale*>(desc);
|
||||
NoteFfxExtent(up->renderSize);
|
||||
// beta.25 (D65): the mode a kept query answer names for these sizes, or 0xFF.
|
||||
g_ffxQuality.store(
|
||||
FfxQualityOf(up->renderSize.width, up->renderSize.height, up->upscaleSize.width, up->upscaleSize.height),
|
||||
std::memory_order_release);
|
||||
g_ffxUpscaleLeaf.store(leaf + 1u, std::memory_order_relaxed);
|
||||
g_ffxSeen.fetch_add(fl::slseen::kCountOne, std::memory_order_relaxed);
|
||||
break;
|
||||
@@ -1820,6 +1956,35 @@ void* FfxDispatchDetour(uint32_t leaf) noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
// The query's trampolines, one per leaf for the reason Hook_FfxDispatchT gives. The ORIGINAL RUNS FIRST, exactly once,
|
||||
// on every path: the answer is read from what it wrote, and only when it said OK. Every argument forwarded untouched.
|
||||
template <uint32_t Leaf>
|
||||
ffxReturnCode_t Hook_FfxQueryT(ffxContext* context, ffxQueryDescHeader* desc) {
|
||||
static_assert(Leaf < fl::inventory::kFfxLeafCount, "a trampoline per leaf, and no more");
|
||||
const ffxReturnCode_t rc = g_origFfxQuery[Leaf](context, desc);
|
||||
FL_HOOK_GUARD({
|
||||
if (rc == FFX_API_RETURN_OK && MayObserve()) {
|
||||
ObserveFfxQuery(desc);
|
||||
}
|
||||
})
|
||||
return rc;
|
||||
}
|
||||
|
||||
void* FfxQueryDetour(uint32_t leaf) noexcept {
|
||||
switch (leaf) {
|
||||
case fl::inventory::kFfxLeafMonolith:
|
||||
return reinterpret_cast<void*>(&Hook_FfxQueryT<fl::inventory::kFfxLeafMonolith>);
|
||||
case fl::inventory::kFfxLeafUpscaler:
|
||||
return reinterpret_cast<void*>(&Hook_FfxQueryT<fl::inventory::kFfxLeafUpscaler>);
|
||||
case fl::inventory::kFfxLeafFrameGeneration:
|
||||
return reinterpret_cast<void*>(&Hook_FfxQueryT<fl::inventory::kFfxLeafFrameGeneration>);
|
||||
case fl::inventory::kFfxLeafLoader:
|
||||
return reinterpret_cast<void*>(&Hook_FfxQueryT<fl::inventory::kFfxLeafLoader>);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Ray tracing (docs/HANDOFF.md item 4, 03_METRICS §RT/PT/RR).
|
||||
//
|
||||
@@ -2162,6 +2327,27 @@ bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t fam
|
||||
g_ffxPatched[slot].store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
if (family == fl::inventory::kFamilyFfxQuery) {
|
||||
// FOUR ROWS, ONE ARM, the dispatch arm's shape: the row's MODULE picks the trampoline and the latch slot.
|
||||
// Published in PublishFfxQueryFamilyIfWhole, once every loaded leaf is in.
|
||||
const int leaf = fl::inventory::FfxLeafOf(moduleName);
|
||||
if (leaf < 0) {
|
||||
return false; // the static_asserts make this unreachable for the rows as written
|
||||
}
|
||||
const auto slot = static_cast<uint32_t>(leaf);
|
||||
if (g_ffxQueryPatched[slot].load(std::memory_order_acquire) != 0) {
|
||||
return true;
|
||||
}
|
||||
void* target = fl::inventory::ResolveScoped(moduleName, symbol);
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak ffx-api
|
||||
}
|
||||
if (!PatchTarget(target, FfxQueryDetour(slot), reinterpret_cast<void**>(&g_origFfxQuery[slot]))) {
|
||||
return false;
|
||||
}
|
||||
g_ffxQueryPatched[slot].store(1, std::memory_order_release);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2201,6 +2387,28 @@ void PublishFfxFamilyIfWhole() noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
// Publish kFamilyFfxQuery once every ffx leaf the process has loaded has its query patched, and at least one does --
|
||||
// PublishFfxFamilyIfWhole's rule, for its reason: a family published on the first leaf would claim a hook the second
|
||||
// leaf does not have yet.
|
||||
void PublishFfxQueryFamilyIfWhole() noexcept {
|
||||
if (g_ffxQueryLive.load(std::memory_order_acquire) != 0) {
|
||||
return;
|
||||
}
|
||||
bool anyPatched = false;
|
||||
for (uint32_t i = 0; i < fl::inventory::kFfxLeafCount; ++i) {
|
||||
if (g_ffxQueryPatched[i].load(std::memory_order_acquire) != 0) {
|
||||
anyPatched = true;
|
||||
continue;
|
||||
}
|
||||
if (fl::inventory::IsModuleLoaded(fl::inventory::kFfxLeafModules[i])) {
|
||||
return; // loaded and not yet patched: the family is not whole
|
||||
}
|
||||
}
|
||||
if (anyPatched) {
|
||||
PublishHookFamily(fl::inventory::kFamilyFfxQuery, g_ffxQueryLive);
|
||||
}
|
||||
}
|
||||
|
||||
// Publish FL_HOOK_UPSCALER_PARAMS once EVERY TAG EXPORT THE LOADED INTERPOSER HAS is
|
||||
// patched, and at least one is. "Has" is the export table, not the module list: a
|
||||
// 2.7 interposer exports slSetTag alone and is whole with that one row patched; a
|
||||
@@ -2239,6 +2447,7 @@ bool InstallUpscalerHooks() noexcept {
|
||||
#undef FL_INSTALL_ROW
|
||||
PublishParamsFamilyIfWhole();
|
||||
PublishFfxFamilyIfWhole();
|
||||
PublishFfxQueryFamilyIfWhole();
|
||||
return any;
|
||||
}
|
||||
|
||||
@@ -2814,13 +3023,16 @@ void RecordPresent(IDXGISwapChain* sc, UINT syncInterval, UINT flags) noexcept {
|
||||
if ((ext & kTagValid) != 0u) {
|
||||
rec.renderW = static_cast<uint16_t>(ext & 0xFFFFu);
|
||||
rec.renderH = static_cast<uint16_t>((ext >> 16) & 0xFFFFu);
|
||||
// 0xFF for both, and for this vendor it is the TRUE value rather than a
|
||||
// gap: the ffx-api dispatch carries no quality mode at all -- the
|
||||
// FfxApiUpscaleQualityMode enum is an input to a QUERY the title makes
|
||||
// before creating its context, never to the per-frame dispatch -- and no
|
||||
// sharpness travels here either. A preset label derived from the measured
|
||||
// ratio is HANDOFF item 7a's owner decision, not this byte's.
|
||||
rec.upscalerQuality = 0xFFu;
|
||||
// The ffx-api dispatch carries no quality mode at all -- the
|
||||
// FfxApiUpscaleQualityMode enum is an input to a QUERY the title makes,
|
||||
// never to the per-frame dispatch. Since beta.25 (D65) the query's kept
|
||||
// answers name it: the mode whose answer is the size this present's
|
||||
// UPSCALE dispatched, as 0x10 + mode -- else 0xFF, the TRUE value for a
|
||||
// title that never asked, and the only value on a present that drained a
|
||||
// PREPARE alone. A label derived from the measured ratio is HANDOFF item
|
||||
// 7a's owner decision, not this byte's; no sharpness travels here either.
|
||||
rec.upscalerQuality =
|
||||
ffxUpscales != 0u ? static_cast<uint8_t>(g_ffxQuality.load(std::memory_order_acquire)) : 0xFFu;
|
||||
rec.upscalerSharpness = 0xFFu;
|
||||
rec.measuredMask = static_cast<uint16_t>(rec.measuredMask | FL_MEASURED_UPSCALER_PARAMS);
|
||||
}
|
||||
|
||||
@@ -375,6 +375,10 @@ enum FlHookFamily : uint32_t {
|
||||
FL_HOOK_COLOR_SPACE = 1u << 8,
|
||||
FL_HOOK_REFLEX = 1u << 9,
|
||||
FL_HOOK_VRAM = 1u << 10,
|
||||
// The FidelityFX quality QUERY (beta.25, owner decision D65): ffxQuery on the modules ffxDispatch is hooked on.
|
||||
// It measures nothing by itself; it is what lets an UPSCALE dispatch's renderSize name the mode the title asked
|
||||
// for, so "hooked, and the title never asked" can be told from "not hooked".
|
||||
FL_HOOK_UPSCALER_QUALITY = 1u << 11,
|
||||
};
|
||||
|
||||
// FlWriterState::runtimeCensus -- which vendor RUNTIME MODULES the loader reported
|
||||
@@ -555,6 +559,10 @@ enum FlMeasured : uint16_t {
|
||||
// upscalerQuality = 0 as a measurement -- in the byte's numbering
|
||||
// (sl::DLSSMode) 0 is eOff, not a quality; "NGX MaxPerf" until beta.24 named
|
||||
// NGX's own numbering, which the byte does not use.
|
||||
//
|
||||
// THE BYTE'S NUMBERING IS THE VENDOR'S, PER UPSCALER: sl::DLSSMode (1..6) for DLSS; for FSR since beta.25,
|
||||
// 0x10 plus FfxApiUpscaleQualityMode (0x10..0x14) -- offset, because FSR's NativeAA is 0 and 0 is "nobody
|
||||
// looked" (D65: the mode whose ffxQuery answer is the size the UPSCALE dispatch was handed).
|
||||
FL_MEASURED_UPSCALER_PARAMS = 1u << 8,
|
||||
|
||||
// syncInterval + presentFlags.
|
||||
|
||||
@@ -5238,6 +5238,8 @@ struct FfxObservation {
|
||||
std::size_t valueWithoutBit = 0;
|
||||
std::size_t dishonestParams = 0;
|
||||
std::size_t fsrFgRecords = 0;
|
||||
std::size_t qualityNamed = 0; // params records carrying Quality's byte, 0x11 (beta.25, D65)
|
||||
std::size_t qualityOther = 0; // params records carrying any byte but 0x11 and 0xFF
|
||||
};
|
||||
|
||||
// Inject into an ffx-api target and drain a post-install window.
|
||||
@@ -5247,11 +5249,12 @@ struct FfxObservation {
|
||||
// tolerance the other does not have, and the pair stops discriminating the moment
|
||||
// they differ.
|
||||
bool ObserveFfx(int presentsPerEval, const wchar_t* topology, bool prepare, fl::FlUpscaler expected,
|
||||
FfxObservation& out) {
|
||||
FfxObservation& out, const wchar_t* query = nullptr) {
|
||||
Child child;
|
||||
std::wstring cmd = std::wstring(L"\"") + FL_HARNESS_EXE + L"\" --real --presents-per-eval " +
|
||||
std::to_wstring(presentsPerEval) + L" --ffx-topology " + topology +
|
||||
(prepare ? L"" : L" --ffx-no-prepare") + L" --hold-presenting-ffx 14";
|
||||
std::wstring cmd =
|
||||
std::wstring(L"\"") + FL_HARNESS_EXE + L"\" --real --presents-per-eval " + std::to_wstring(presentsPerEval) +
|
||||
L" --ffx-topology " + topology + (prepare ? L"" : L" --ffx-no-prepare") +
|
||||
(query != nullptr ? std::wstring(L" --ffx-query ") + query : std::wstring()) + L" --hold-presenting-ffx 14";
|
||||
STARTUPINFOW si{};
|
||||
si.cb = sizeof(si);
|
||||
if (!CreateProcessW(FL_HARNESS_EXE, cmd.data(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW, nullptr, nullptr, &si,
|
||||
@@ -5299,8 +5302,11 @@ bool ObserveFfx(int presentsPerEval, const wchar_t* topology, bool prepare, fl::
|
||||
// ONE ROW PUBLISHES ALL THREE FAMILIES, so the FG_EVALUATIONS wait is the same wait
|
||||
// as identity's -- kept anyway, so the assertion is about the family the count is
|
||||
// entitled by rather than about which bit happened to be set first.
|
||||
// With the quality query asked, the window opens only once ITS family is published too: a record drained before
|
||||
// the query was hooked carries 0xFF honestly, and the window is about what a hooked query names.
|
||||
bool ok = st->status == fl::FL_STATUS_READY && WaitForIdentityHook(st) &&
|
||||
WaitForHookFamily(st, static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS));
|
||||
WaitForHookFamily(st, static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS)) &&
|
||||
(query == nullptr || WaitForHookFamily(st, static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY)));
|
||||
if (ok) {
|
||||
fl::RingReader rd;
|
||||
ok = rd.Init(base, FL_SHM_DEFAULT_CAPACITY);
|
||||
@@ -5339,6 +5345,11 @@ bool ObserveFfx(int presentsPerEval, const wchar_t* topology, bool prepare, fl::
|
||||
if (r.renderW != FL_TAGGED_RENDER_W || r.renderH != FL_TAGGED_RENDER_H) {
|
||||
++out.wrongExtent;
|
||||
}
|
||||
if (r.upscalerQuality == 0x11u) { // 0x10 + FFX_UPSCALE_QUALITY_MODE_QUALITY (1)
|
||||
++out.qualityNamed;
|
||||
} else if (r.upscalerQuality != 0xFFu) {
|
||||
++out.qualityOther;
|
||||
}
|
||||
} else if (r.renderW != 0u || r.renderH != 0u) {
|
||||
++out.valueWithoutBit;
|
||||
}
|
||||
@@ -5356,7 +5367,7 @@ bool ObserveFfx(int presentsPerEval, const wchar_t* topology, bool prepare, fl::
|
||||
|
||||
// The assertions every combination shares. Catch2's CHECK works from a helper, and
|
||||
// one helper is what keeps the four runs asserting ONE expression.
|
||||
void AssertFfxWindow(const FfxObservation& obs, int k) {
|
||||
void AssertFfxWindow(const FfxObservation& obs, int k, bool asked = false) {
|
||||
CAPTURE(obs.drained);
|
||||
CAPTURE(obs.sigma);
|
||||
CAPTURE(obs.measured);
|
||||
@@ -5397,6 +5408,13 @@ void AssertFfxWindow(const FfxObservation& obs, int k) {
|
||||
CHECK(obs.valueWithoutBit == 0u);
|
||||
CHECK(obs.dishonestParams == 0u);
|
||||
|
||||
// THE QUALITY BYTE (beta.25, D65): never a mode nobody asked for. Unasked, every params record carries 0xFF -- the
|
||||
// dispatch names no mode by itself; asked, Quality's 0x11 and nothing else, four answers that do not fit beside it.
|
||||
CHECK(obs.qualityOther == 0u);
|
||||
if (!asked) {
|
||||
CHECK(obs.qualityNamed == 0u);
|
||||
}
|
||||
|
||||
// FSR_FG is named on the presents that drained a FRAMEGENERATION dispatch -- one
|
||||
// per application frame at K > 1, none at all at K = 1. The K = 1 half is what
|
||||
// stops a writer from naming frame generation off the PREPARE alone.
|
||||
@@ -5408,8 +5426,15 @@ void AssertFfxWindow(const FfxObservation& obs, int k) {
|
||||
|
||||
// EQUALITY, not a bit test, for the reason the token test gives: the compound
|
||||
// family constant is the one value no gate reads.
|
||||
CHECK(obs.hooks == static_cast<std::uint32_t>(fl::FL_HOOK_PRESENT | fl::FL_HOOK_UPSCALER_IDENTITY |
|
||||
fl::FL_HOOK_UPSCALER_PARAMS | fl::FL_HOOK_FG_EVALUATIONS));
|
||||
//
|
||||
// The quality query's family joins wherever an ffx-api LEAF is loaded -- every leaf exports ffxQuery and every one
|
||||
// has a row (beta.25, D65) -- and NOT on the FSR 3.0 host alone, which has no ffxQuery and no row.
|
||||
const bool anyLeaf = (obs.census & (fl::FL_CENSUS_AMD_FFX_DX12 | fl::FL_CENSUS_AMD_FFX_UPSCALER |
|
||||
fl::FL_CENSUS_AMD_FFX_FRAMEGENERATION)) != 0u;
|
||||
const auto query = anyLeaf ? static_cast<std::uint32_t>(fl::FL_HOOK_UPSCALER_QUALITY) : 0u;
|
||||
CHECK(obs.hooks == (static_cast<std::uint32_t>(fl::FL_HOOK_PRESENT | fl::FL_HOOK_UPSCALER_IDENTITY |
|
||||
fl::FL_HOOK_UPSCALER_PARAMS | fl::FL_HOOK_FG_EVALUATIONS) |
|
||||
query));
|
||||
CHECK((obs.census & fl::FL_CENSUS_RAN) != 0u);
|
||||
CHECK((obs.census & fl::FL_CENSUS_SL_INTERPOSER) == 0u);
|
||||
}
|
||||
@@ -5500,6 +5525,31 @@ TEST_CASE("the FSR 3.0 host facade: Fsr3 identity and the count from its upscale
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("FSR's quality mode (beta.25, D65): the mode the title asked for names the dispatch, by its size and by "
|
||||
"its ratio",
|
||||
"[guard][inject][shm][ffx]") {
|
||||
// THE TAGGED EXTENT IS QUALITY'S ANSWER. Before every UPSCALE the harness asks all five modes at the 1920x1080
|
||||
// display the descriptor states, the stub answers display / ratio as the vendor does, and 1280x720 is 1920x1080 /
|
||||
// 1.5 -- so every record that claims the params bit must carry 0x11 (0x10 + FFX_UPSCALE_QUALITY_MODE_QUALITY) and
|
||||
// none any other byte: the four answers that do not fit sit in the table beside the one that does. Through the
|
||||
// 2.x loader by size -- the loader passes the query on to the leaf's export, so the answer is kept twice, which is
|
||||
// harmless (nothing is counted) -- and through the 1.1.x monolith by ratio, within the vendor's truncation.
|
||||
{
|
||||
FfxObservation obs;
|
||||
REQUIRE(ObserveFfx(1, L"2x", /*prepare=*/true, fl::FL_UPSCALER_FSR_UNVERSIONED, obs, L"sizes"));
|
||||
AssertFfxWindow(obs, 1, /*asked=*/true);
|
||||
CHECK(obs.qualityNamed + 1 >= obs.paramsRecords);
|
||||
CHECK(obs.qualityNamed > 0u);
|
||||
}
|
||||
{
|
||||
FfxObservation obs;
|
||||
REQUIRE(ObserveFfx(1, L"1x", /*prepare=*/false, fl::FL_UPSCALER_FSR3, obs, L"ratios"));
|
||||
AssertFfxWindow(obs, 1, /*asked=*/true);
|
||||
CHECK(obs.qualityNamed + 1 >= obs.paramsRecords);
|
||||
CHECK(obs.qualityNamed > 0u);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("the UE5 shape: the two SDK 2.x leaves called directly, no loader in the process",
|
||||
"[guard][inject][shm][ffx]") {
|
||||
// Hell Is Us and Expedition 33 -- the engine plugin compiles the MIT loader in and
|
||||
|
||||
@@ -107,6 +107,9 @@
|
||||
// (ffx_fsr3_x64.dll!ffxFsr3ContextDispatchUpscale, no PREPARE,
|
||||
// no frame generation), fsr3host+mono Cyberpunk's shape: the host
|
||||
// upscales while the 1.1.x monolith prepares and generates
|
||||
// --ffx-query sizes|ratios before every UPSCALE, ask the entry module ffxQuery for all five quality modes at
|
||||
// the 1920x1080 display -- the render size each mode gives, or its ratio (beta.25, D65); the
|
||||
// tagged 1280x720 extent is Quality's answer, so the record must name Quality and nothing else.
|
||||
// --ffx-no-prepare drop the PREPARE dispatch: the frame-generation-OFF shape, where
|
||||
// the Overlay must count UPSCALE dispatches instead
|
||||
//
|
||||
@@ -2618,7 +2621,39 @@ enum class FfxTopology { Monolith, Loader, Ue, Fsr3Host, Fsr3HostMonolith };
|
||||
|
||||
using PfnFsr3DispatchUpscale = decltype(&fsr3host::ffxFsr3ContextDispatchUpscale);
|
||||
|
||||
int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTopology topology, bool prepare) {
|
||||
// What --ffx-query asks before each UPSCALE: nothing, the render size each mode gives, or each mode's ratio.
|
||||
enum class FfxQuery { None, Sizes, Ratios };
|
||||
|
||||
// Every mode, at the display the UPSCALE descriptor states -- the way a settings menu enumerates them. The answers
|
||||
// are written through the descriptors' own pointers; nothing here checks them, because the Overlay's reading of them
|
||||
// is what the test asserts.
|
||||
void AskQuality(PfnFfxQuery query, FfxQuery what) {
|
||||
for (uint32_t mode = FFX_UPSCALE_QUALITY_MODE_NATIVEAA; mode <= FFX_UPSCALE_QUALITY_MODE_ULTRA_PERFORMANCE;
|
||||
++mode) {
|
||||
if (what == FfxQuery::Sizes) {
|
||||
uint32_t w = 0;
|
||||
uint32_t h = 0;
|
||||
ffxQueryDescUpscaleGetRenderResolutionFromQualityMode q{};
|
||||
q.header.type = FFX_API_QUERY_DESC_TYPE_UPSCALE_GETRENDERRESOLUTIONFROMQUALITYMODE;
|
||||
q.displayWidth = 1920u;
|
||||
q.displayHeight = 1080u;
|
||||
q.qualityMode = mode;
|
||||
q.pOutRenderWidth = &w;
|
||||
q.pOutRenderHeight = &h;
|
||||
query(nullptr, &q.header);
|
||||
} else if (what == FfxQuery::Ratios) {
|
||||
float ratio = 0.0f;
|
||||
ffxQueryDescUpscaleGetUpscaleRatioFromQualityMode q{};
|
||||
q.header.type = FFX_API_QUERY_DESC_TYPE_UPSCALE_GETUPSCALERATIOFROMQUALITYMODE;
|
||||
q.qualityMode = mode;
|
||||
q.pOutUpscaleRatio = ∶
|
||||
query(nullptr, &q.header);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTopology topology, bool prepare,
|
||||
FfxQuery ask) {
|
||||
HMODULE upEntry = nullptr; // where UPSCALE goes (an ffx-api module)
|
||||
HMODULE fgEntry = nullptr; // where PREPARE and FRAMEGENERATION go
|
||||
HMODULE hostEntry = nullptr; // where UPSCALE goes on the FSR 3.0 host topologies
|
||||
@@ -2689,6 +2724,14 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
|
||||
Check(false, "the entry module(s) export their dispatch entry point");
|
||||
return 1;
|
||||
}
|
||||
// The quality query goes where the UPSCALE goes: the same module a title sizes its targets through.
|
||||
const auto query = upEntry != nullptr && ask != FfxQuery::None
|
||||
? reinterpret_cast<PfnFfxQuery>(reinterpret_cast<void*>(GetProcAddress(upEntry, "ffxQuery")))
|
||||
: nullptr;
|
||||
if (ask != FfxQuery::None && query == nullptr) {
|
||||
Check(false, "the UPSCALE entry module exports ffxQuery for --ffx-query");
|
||||
return 1;
|
||||
}
|
||||
// The pre-V2 PREPARE is the 1.1.x monolith's, on both topologies that use it.
|
||||
const bool topology2x = topology == FfxTopology::Loader || topology == FfxTopology::Ue;
|
||||
const char* topologyName = topology == FfxTopology::Monolith ? "SDK 1.1.x (monolith)"
|
||||
@@ -2741,6 +2784,9 @@ int HoldPresentingFfx(Gfx& g, int seconds, bool real, int presentsPerEval, FfxTo
|
||||
uint64_t frameId = 0;
|
||||
while (GetTickCount64() < until) {
|
||||
++frameId;
|
||||
if (query != nullptr) {
|
||||
AskQuality(query, ask);
|
||||
}
|
||||
if (dispatchHost != nullptr) {
|
||||
dispatchHost(nullptr, &hostUp);
|
||||
} else {
|
||||
@@ -2930,6 +2976,7 @@ int main(int argc, char** argv) {
|
||||
// hold mode drives every combination and the tests assert one expression.
|
||||
FfxTopology ffxTopology = FfxTopology::Loader;
|
||||
bool ffxPrepare = true;
|
||||
FfxQuery ffxQuery = FfxQuery::None;
|
||||
bool slTagForFrame = false;
|
||||
bool slTagWholeResource = false;
|
||||
bool slTagDlssgInputs = false;
|
||||
@@ -2966,6 +3013,11 @@ int main(int argc, char** argv) {
|
||||
: FfxTopology::Loader;
|
||||
} else if (std::strcmp(argv[i], "--ffx-no-prepare") == 0) {
|
||||
ffxPrepare = false;
|
||||
} else if (std::strcmp(argv[i], "--ffx-query") == 0 && i + 1 < argc) {
|
||||
const char* q = argv[++i];
|
||||
ffxQuery = std::strcmp(q, "sizes") == 0 ? FfxQuery::Sizes
|
||||
: std::strcmp(q, "ratios") == 0 ? FfxQuery::Ratios
|
||||
: FfxQuery::None;
|
||||
} else if (std::strcmp(argv[i], "--sl-tag-for-frame") == 0) {
|
||||
slTagForFrame = true;
|
||||
} else if (std::strcmp(argv[i], "--sl-tag-whole-resource") == 0) {
|
||||
@@ -3007,12 +3059,13 @@ int main(int argc, char** argv) {
|
||||
std::strcmp(argv[i], "--opengl") == 0 || std::strcmp(argv[i], "--plus-ui") == 0 ||
|
||||
std::strcmp(argv[i], "--present-interval-ms") == 0 || std::strcmp(argv[i], "--presents-per-eval") == 0 ||
|
||||
std::strcmp(argv[i], "--ffx-topology") == 0 || std::strcmp(argv[i], "--ffx-no-prepare") == 0 ||
|
||||
std::strcmp(argv[i], "--sl-tag-for-frame") == 0 || std::strcmp(argv[i], "--sl-tag-whole-resource") == 0 ||
|
||||
std::strcmp(argv[i], "--ffx-query") == 0 || std::strcmp(argv[i], "--sl-tag-for-frame") == 0 ||
|
||||
std::strcmp(argv[i], "--sl-tag-whole-resource") == 0 ||
|
||||
std::strcmp(argv[i], "--sl-tag-dlssg-inputs") == 0 || std::strcmp(argv[i], "--load") == 0 ||
|
||||
std::strcmp(argv[i], "--load-after-ms") == 0) {
|
||||
if (std::strcmp(argv[i], "--plus-ui") == 0 || std::strcmp(argv[i], "--present-interval-ms") == 0 ||
|
||||
std::strcmp(argv[i], "--presents-per-eval") == 0 || std::strcmp(argv[i], "--ffx-topology") == 0 ||
|
||||
std::strcmp(argv[i], "--load") == 0) {
|
||||
std::strcmp(argv[i], "--ffx-query") == 0 || std::strcmp(argv[i], "--load") == 0) {
|
||||
++i;
|
||||
}
|
||||
if (std::strcmp(argv[i], "--load-after-ms") == 0) {
|
||||
@@ -3026,7 +3079,9 @@ int main(int argc, char** argv) {
|
||||
ok = HoldPresentingFg(g, std::atoi(argv[++i]), real, presentsPerEval) == 0 && ok;
|
||||
ranSomething = true;
|
||||
} else if (std::strcmp(argv[i], "--hold-presenting-ffx") == 0 && i + 1 < argc) {
|
||||
ok = HoldPresentingFfx(g, std::atoi(argv[++i]), real, presentsPerEval, ffxTopology, ffxPrepare) == 0 && ok;
|
||||
ok = HoldPresentingFfx(g, std::atoi(argv[++i]), real, presentsPerEval, ffxTopology, ffxPrepare, ffxQuery) ==
|
||||
0 &&
|
||||
ok;
|
||||
ranSomething = true;
|
||||
} else if (std::strcmp(argv[i], "--hold-presenting-upscaled") == 0 && i + 1 < argc) {
|
||||
ok = HoldPresentingUpscaled(g, std::atoi(argv[++i]), real, sl::kFeatureDLSS, slTagForFrame,
|
||||
|
||||
@@ -44,6 +44,9 @@ static_assert(fl::inventory::FfxLeafOfExact(FL_STUB_FFX_MODULE) >= 0,
|
||||
static_assert(fl::stub::InventoryHasRow(FL_STUB_FFX_MODULE, "ffxDispatch"),
|
||||
"fl_hook_inventory.h has no ffxDispatch row for this module, so the fixture would exercise a name the "
|
||||
"Overlay does not install (20_OPEN_QUESTIONS S29(b), with a vendor's name on it)");
|
||||
static_assert(fl::stub::InventoryHasRow(FL_STUB_FFX_MODULE, "ffxQuery"),
|
||||
"fl_hook_inventory.h has no ffxQuery row for this module (beta.25, D65), so the quality fixture would "
|
||||
"exercise a name the Overlay does not install");
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -117,9 +120,35 @@ FFX_API_ENTRY ffxReturnCode_t ffxConfigure(ffxContext* context, const ffxConfigu
|
||||
return desc != nullptr ? FFX_API_RETURN_OK : FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
|
||||
// THE QUALITY QUERY'S ANSWERS (beta.25, D65), deterministic so a test knows which size names which mode: the
|
||||
// per-dimension ratios the vendor documents (NativeAA 1.0, Quality 1.5, Balanced 1.7, Performance 2.0, Ultra
|
||||
// Performance 3.0) and render = display / ratio, truncated as the vendor does -- written through the caller's own
|
||||
// pointers, which is where the Overlay reads them after this returns. Any other query is answered OK and touched not.
|
||||
FFX_API_ENTRY ffxReturnCode_t ffxQuery(ffxContext* context, ffxQueryDescHeader* desc) {
|
||||
(void)context;
|
||||
return desc != nullptr ? FFX_API_RETURN_OK : FFX_API_RETURN_ERROR_PARAMETER;
|
||||
if (desc == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
static constexpr float kRatios[] = {1.0f, 1.5f, 1.7f, 2.0f, 3.0f};
|
||||
if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GETRENDERRESOLUTIONFROMQUALITYMODE) {
|
||||
auto* q = reinterpret_cast<ffxQueryDescUpscaleGetRenderResolutionFromQualityMode*>(desc);
|
||||
if (q->qualityMode > FFX_UPSCALE_QUALITY_MODE_ULTRA_PERFORMANCE || q->pOutRenderWidth == nullptr ||
|
||||
q->pOutRenderHeight == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
*q->pOutRenderWidth = static_cast<uint32_t>(static_cast<float>(q->displayWidth) / kRatios[q->qualityMode]);
|
||||
*q->pOutRenderHeight = static_cast<uint32_t>(static_cast<float>(q->displayHeight) / kRatios[q->qualityMode]);
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
if (desc->type == FFX_API_QUERY_DESC_TYPE_UPSCALE_GETUPSCALERATIOFROMQUALITYMODE) {
|
||||
auto* q = reinterpret_cast<ffxQueryDescUpscaleGetUpscaleRatioFromQualityMode*>(desc);
|
||||
if (q->qualityMode > FFX_UPSCALE_QUALITY_MODE_ULTRA_PERFORMANCE || q->pOutUpscaleRatio == nullptr) {
|
||||
return FFX_API_RETURN_ERROR_PARAMETER;
|
||||
}
|
||||
*q->pOutUpscaleRatio = kRatios[q->qualityMode];
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
return FFX_API_RETURN_OK;
|
||||
}
|
||||
|
||||
// THE ROW'S TARGET. Counts by head type and does nothing else -- the descriptor's
|
||||
|
||||
@@ -105,6 +105,8 @@ public sealed class FormatsTests
|
||||
.Should().Be("custom 77%");
|
||||
InEnglish(() => Formats.QualityName(new Application.Recording.ResolvedQuality(Domain.Metrics.UpscalerQualityMode.UltraQuality, Application.Recording.QualitySource.Game)))
|
||||
.Should().Be("Ultra Quality");
|
||||
InEnglish(() => Formats.UpscalerOf(Row("fsr3", "17", null, null, null))).Should().Be("FSR 3 Quality", "beta.25 (D65): the mode FSR's query named");
|
||||
InEnglish(() => Formats.UpscalerOf(Row("fsr", "16", null, null, null))).Should().Be("FSR Native AA");
|
||||
}
|
||||
|
||||
private static Application.Persistence.SessionRow Row(string? upscaler, string? quality, string? driverReported, string? words, string? profile) => new()
|
||||
|
||||
@@ -123,6 +123,20 @@ public sealed class SessionProgressCalculatorTests
|
||||
e.UpscalerQuality.Should().BeNull("0xFF is the hook's 'could not tell', which the card would print as 'DLSS 255'");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheLiveCardReadsFsrsByteByTheSessionsRule()
|
||||
{
|
||||
FlMeasured claims = FlMeasured.OutputRes | FlMeasured.PresentArgs | FlMeasured.Upscaler | FlMeasured.UpscalerParams;
|
||||
List<FlFrameRecord> told = [.. SessionFixtures.Stream(1000, claims, upscaler: FlUpscaler.FsrUnversioned)
|
||||
.Select(static r => r with { UpscalerQuality = 0x13, RenderW = 960, RenderH = 540 })];
|
||||
List<FlFrameRecord> dynamic = [.. told.Select(static (r, i) => i % 2 == 0 ? r : r with { UpscalerQuality = 0xFF, RenderW = 900, RenderH = 506 })];
|
||||
|
||||
SessionProgressCalculator.Compute(_guid, Progress(told), SessionFixtures.QpcFrequency, 12.5, gpu: null)
|
||||
.UpscalerQuality.Should().Be("19", "beta.25 (D65): 0x10 + FFX_UPSCALE_QUALITY_MODE_PERFORMANCE");
|
||||
SessionProgressCalculator.Compute(_guid, Progress(dynamic), SessionFixtures.QpcFrequency, 12.5, gpu: null)
|
||||
.UpscalerQuality.Should().BeNull("a size no answer gave: QualityByte withholds the mode, live as in the row");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AMeasuredFrameGenerationFactorSplitsNativeFromDisplayed()
|
||||
{
|
||||
|
||||
@@ -94,6 +94,8 @@ public sealed class QualityResolverTests
|
||||
QualityResolver.Of("dlss", "3", null, Words(_plainSr, 0), driverProfileJson: null).Should().Be(new ResolvedQuality(UpscalerQualityMode.Quality, QualitySource.Game));
|
||||
QualityResolver.Of("dlss", "9", null, null, null).Should().Be(new ResolvedQuality(null, QualitySource.Game, Stored: "9"), "a number nobody can name is still what was measured");
|
||||
QualityResolver.Of("fsr3", "2", null, Words(_expeditionSr, 2), null).Should().Be(new ResolvedQuality(null, QualitySource.Game, Stored: "2"), "a DLSS override does not apply to FSR");
|
||||
QualityResolver.Of("fsr3", "17", null, Words(_expeditionSr, 2), null).Should().Be(new ResolvedQuality(UpscalerQualityMode.Quality, QualitySource.Game),
|
||||
"beta.25 (D65): FSR's byte, the mode its query answer named");
|
||||
QualityResolver.Of("dlss", null, null, null, null).Should().BeNull();
|
||||
QualityResolver.Of("unknown", "3", null, null, null).Should().BeNull("a quality without a name to hang it on");
|
||||
QualityResolver.Of(null, null, "dlss", Words(_plainSr, 0), null).Should().BeNull("the driver's word alone is identity");
|
||||
|
||||
@@ -263,6 +263,36 @@ public sealed class SessionAggregatorTests
|
||||
m.Segments[0].UpscalerQuality.Should().Be("3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FSR's byte (beta.25, D65): a session rendered at the size the vendor's query gave for Quality names Quality, and a
|
||||
/// dynamic-resolution session — most frames at sizes no answer gave, the top of the range still matching — names
|
||||
/// nothing, as <c>legal/ACCURACY.md</c> promises, in the row and in its segment alike.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void FsrNamesTheModeItsQueryGaveAndNoneAtADynamicResolution()
|
||||
{
|
||||
FlMeasured claims = _presentOnly | FlMeasured.Upscaler | FlMeasured.UpscalerParams;
|
||||
var writer = new FlWriterState { Status = 1, HooksInstalledMask = 0x7 };
|
||||
List<FlFrameRecord> fixedQuality = [.. SessionFixtures.Stream(500, claims, upscaler: FlUpscaler.Fsr3)
|
||||
.Select(static r => r with { UpscalerQuality = 0x11, RenderW = 1280, RenderH = 720 })];
|
||||
|
||||
AggregationResult q = SessionAggregator.Aggregate(SessionFixtures.Skeleton(), SessionFixtures.Hooked(fixedQuality, writer));
|
||||
|
||||
q.Row.Upscaler.Should().Be("fsr3");
|
||||
q.Row.UpscalerQuality.Should().Be("17", "0x10 + FFX_UPSCALE_QUALITY_MODE_QUALITY");
|
||||
q.Segments.Should().ContainSingle().Which.UpscalerQuality.Should().Be("17");
|
||||
|
||||
List<FlFrameRecord> dynamic = [.. SessionFixtures.Stream(500, claims, upscaler: FlUpscaler.Fsr3)
|
||||
.Select(static (r, i) => i % 3 == 0
|
||||
? r with { UpscalerQuality = 0x11, RenderW = 1280, RenderH = 720 }
|
||||
: r with { UpscalerQuality = 0xFF, RenderW = (ushort)(1100 + (i % 7)), RenderH = (ushort)(619 + (i % 7)) })];
|
||||
|
||||
AggregationResult d = SessionAggregator.Aggregate(SessionFixtures.Skeleton(), SessionFixtures.Hooked(dynamic, writer));
|
||||
|
||||
d.Row.UpscalerQuality.Should().BeNull("the game rendered at sizes no answer gave: a dynamic resolution names no mode");
|
||||
d.Segments.Should().ContainSingle().Which.UpscalerQuality.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnUpscalerHookThatSawOnlyUnknownIsUnknownNotNull()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Domain.Metrics;
|
||||
|
||||
namespace FrameLedger.Domain.Tests.Metrics;
|
||||
|
||||
/// <summary>One quality rule for the row, its segments and the live card (beta.25, D65): the told modal, and FSR's withheld at a dynamic resolution.</summary>
|
||||
public sealed class QualityByteTests
|
||||
{
|
||||
private const MeasuredFields _claims = MeasuredFields.Upscaler | MeasuredFields.UpscalerParams;
|
||||
|
||||
private static FrameSample Sample(byte quality, ushort renderW, ushort renderH, UpscalerKind upscaler = UpscalerKind.Fsr3,
|
||||
MeasuredFields measured = _claims) => new()
|
||||
{
|
||||
SwapchainId = 1,
|
||||
RenderW = renderW,
|
||||
RenderH = renderH,
|
||||
OutputW = 1920,
|
||||
OutputH = 1080,
|
||||
Upscaler = upscaler,
|
||||
UpscalerQuality = quality,
|
||||
UpscalerSharpness = 0xFF,
|
||||
Measured = measured,
|
||||
};
|
||||
|
||||
private static List<FrameSample> Repeat(int count, FrameSample s) => [.. Enumerable.Repeat(s, count)];
|
||||
|
||||
[Fact]
|
||||
public void NothingToldIsNoByte()
|
||||
{
|
||||
QualityByte.Of([]).Should().BeNull();
|
||||
QualityByte.Of(Repeat(40, Sample(FrameSample.QualityNotTold, 1280, 720))).Should().BeNull("0xFF is not a mode");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ADlssByteIsTheModalOfTheToldAndATieGoesToTheLower()
|
||||
{
|
||||
List<FrameSample> dlss = [.. Repeat(10, Sample(3, 1485, 835, UpscalerKind.Dlss)), .. Repeat(20, Sample(FrameSample.QualityNotTold, 1485, 835, UpscalerKind.Dlss))];
|
||||
QualityByte.Of(dlss).Should().Be(3, "the frames that told are the only ones that count");
|
||||
|
||||
List<FrameSample> tie = [.. Repeat(5, Sample(2, 1485, 835, UpscalerKind.Dlss)), .. Repeat(5, Sample(1, 1280, 720, UpscalerKind.Dlss))];
|
||||
QualityByte.Of(tie).Should().Be(1, "a tie goes to the lower byte, as the modal always has");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FsrAtTheSizeItsQueryGaveIsNamedEvenBesideNotToldRecordsAtThatSize()
|
||||
{
|
||||
// 0xFF at the named size: a present that drained a frame-generation PREPARE alone, or a frame before the title
|
||||
// asked. Neither is a size no answer gave.
|
||||
List<FrameSample> fixedQuality = [.. Repeat(30, Sample(0x11, 1280, 720)), .. Repeat(10, Sample(FrameSample.QualityNotTold, 1280, 720))];
|
||||
|
||||
QualityByte.Of(fixedQuality).Should().Be(0x11);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FsrAtADynamicResolutionIsWithheld()
|
||||
{
|
||||
List<FrameSample> dynamic = [.. Repeat(30, Sample(0x11, 1280, 720)), Sample(FrameSample.QualityNotTold, 1180, 664)];
|
||||
|
||||
QualityByte.Of(dynamic).Should().BeNull("one FSR frame at a size no answer gave is a resolution the mode does not name");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AModeChangeMidRunKeepsTheLongerModeWhileEachSizeIsNamed()
|
||||
{
|
||||
List<FrameSample> change = [
|
||||
.. Repeat(10, Sample(0x11, 1280, 720)),
|
||||
.. Repeat(25, Sample(0x13, 960, 540, UpscalerKind.FsrUnversioned)),
|
||||
.. Repeat(5, Sample(FrameSample.QualityNotTold, 960, 540, UpscalerKind.FsrUnversioned)),
|
||||
];
|
||||
|
||||
QualityByte.Of(change).Should().Be(0x13, "Quality then Performance, both asked: every size is one a named record has");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OnlyFsrRecordsCanWithholdFsrsMode()
|
||||
{
|
||||
List<FrameSample> others = [
|
||||
.. Repeat(30, Sample(0x14, 640, 360, UpscalerKind.Fsr4)),
|
||||
.. Repeat(5, Sample(FrameSample.QualityNotTold, 1485, 835, UpscalerKind.Dlss)),
|
||||
.. Repeat(5, Sample(FrameSample.QualityNotTold, 999, 555, UpscalerKind.Unknown)),
|
||||
.. Repeat(5, Sample(FrameSample.QualityNotTold, 777, 444, measured: MeasuredFields.UpscalerParams)),
|
||||
];
|
||||
|
||||
QualityByte.Of(others).Should().Be(0x14, "another upscaler's sizes are its own, and a record that does not claim the upscaler names none");
|
||||
|
||||
List<FrameSample> fsr2 = [.. Repeat(30, Sample(0x10, 1920, 1080)), Sample(FrameSample.QualityNotTold, 1600, 900, UpscalerKind.Fsr2)];
|
||||
QualityByte.Of(fsr2).Should().BeNull("an FSR record of any version at a size no answer gave");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0x0F, false)]
|
||||
[InlineData(0x10, true)]
|
||||
[InlineData(0x14, true)]
|
||||
[InlineData(0x15, false)]
|
||||
[InlineData(0xFF, false)]
|
||||
public void FsrsBytesAreTheFiveFromNativeAaToUltraPerformance(byte value, bool fsr) =>
|
||||
QualityByte.IsFsr(value).Should().Be(fsr);
|
||||
|
||||
[Fact]
|
||||
public void ANullListIsRefused() =>
|
||||
FluentActions.Invoking(static () => QualityByte.Of(null!)).Should().Throw<ArgumentNullException>();
|
||||
}
|
||||
@@ -6,7 +6,10 @@ using FrameLedger.Domain.Metrics;
|
||||
|
||||
namespace FrameLedger.Domain.Tests.Metrics;
|
||||
|
||||
/// <summary>Three numberings, one table each (beta.24, D63): the hooked byte, the driver's report and the App's profile value.</summary>
|
||||
/// <summary>
|
||||
/// Four numberings, one table each: the hooked DLSS byte, the driver's report and the App's profile value (beta.24, D63),
|
||||
/// and FSR's byte (beta.25, D65).
|
||||
/// </summary>
|
||||
public sealed class UpscalerNamesTests
|
||||
{
|
||||
[Theory]
|
||||
@@ -22,7 +25,6 @@ public sealed class UpscalerNamesTests
|
||||
[Theory]
|
||||
[InlineData("dlss", "7")]
|
||||
[InlineData("dlss", "0")]
|
||||
[InlineData("fsr3", "2")]
|
||||
[InlineData("xess", "3")]
|
||||
[InlineData(null, "2")]
|
||||
[InlineData("dlss", null)]
|
||||
@@ -31,6 +33,23 @@ public sealed class UpscalerNamesTests
|
||||
public void AValueNoTableNamesIsNoMode(string? upscaler, string? stored) =>
|
||||
UpscalerNames.Mode(upscaler, stored).Should().BeNull("the App prints a stored number nobody can name as it is");
|
||||
|
||||
[Theory]
|
||||
[InlineData("fsr3", "16", UpscalerQualityMode.NativeAa)]
|
||||
[InlineData("fsr3", "17", UpscalerQualityMode.Quality)]
|
||||
[InlineData("fsr", "18", UpscalerQualityMode.Balanced)]
|
||||
[InlineData("fsr", "19", UpscalerQualityMode.Performance)]
|
||||
[InlineData("fsr4", "20", UpscalerQualityMode.UltraPerformance)]
|
||||
public void AnFsrByteIsTheModeItsQueryAnswerNamed(string upscaler, string stored, UpscalerQualityMode mode) =>
|
||||
UpscalerNames.Mode(upscaler, stored).Should().Be(mode, "0x10 + FfxApiUpscaleQualityMode, beta.25 (D65)");
|
||||
|
||||
[Theory]
|
||||
[InlineData("fsr3", "15")]
|
||||
[InlineData("fsr3", "21")]
|
||||
[InlineData("fsr3", "1")]
|
||||
[InlineData("fsr2", "17")]
|
||||
public void AnFsrByteNoTableNamesIsNoMode(string upscaler, string stored) =>
|
||||
UpscalerNames.Mode(upscaler, stored).Should().BeNull("FSR 2 has no query hook, and a value outside 16..20 is no FSR mode");
|
||||
|
||||
[Theory]
|
||||
[InlineData(0u, UpscalerQualityMode.Performance)]
|
||||
[InlineData(1u, UpscalerQualityMode.Balanced)]
|
||||
|
||||
Reference in new issue
Block a user