WIP: perf(host): narrow write tracking for streamed decoder output #1597

Draft
HumanBean wants to merge 1 commit from HumanBean/Longshot:perf/streamed-decode-write-marks into main
Owner

Type: perf · Risk: medium · Tested on: CachyOS Linux, Ryzen 9 7900X, 32 GiB, GeForce RTX 3090, NVIDIA 620.70.06

TL;DR

Reduce the guest memory that must be marked after streaming an asset. Header and checksum steps can avoid marking a large unused output buffer.

Why and what changed

Track the frame block limit on stream setup and use the decoder’s next-input type to identify operations that may write output. Successful block calls include literal scratch space and over-copy slack. An error retains conservative tracking of the potentially written output. Prefilled staging uses the maximum block bound.

Measurements

The changed host code ran in the headless Market and Field builds. It was present on both sides of subsequent capture comparisons, so their FPS numbers do not isolate this change. The added decoder fixture checks output write marks separately from frame timing.

Testing

Test coverage includes a short output room, checksum errors, staged input and writes outside the returned byte count. Matched gameplay throughput and playthroughs on other hosts are still outstanding.

Risks and remaining work

Under-marking scratch or partly written output could leave a later GPU capture stale. Decode correctness, including failures after partial output, is the main review target.

Checklist

  • The changed path was exercised locally in the game.
  • The branch is based on main at 876dc360. Measurements were taken before the cold-install packaging change on that revision.
  • Project source, tests and measurement summaries only. Third-party sources are untouched.
  • Codex assistance recorded in the commit.
  • Independent A/B timing and cross-platform checks remain open.
**Type:** perf · **Risk:** medium · **Tested on:** CachyOS Linux, Ryzen 9 7900X, 32 GiB, GeForce RTX 3090, NVIDIA 620.70.06 ## TL;DR Reduce the guest memory that must be marked after streaming an asset. Header and checksum steps can avoid marking a large unused output buffer. ## Why and what changed Track the frame block limit on stream setup and use the decoder’s next-input type to identify operations that may write output. Successful block calls include literal scratch space and over-copy slack. An error retains conservative tracking of the potentially written output. Prefilled staging uses the maximum block bound. ## Measurements The changed host code ran in the headless Market and Field builds. It was present on both sides of subsequent capture comparisons, so their FPS numbers do not isolate this change. The added decoder fixture checks output write marks separately from frame timing. ## Testing Test coverage includes a short output room, checksum errors, staged input and writes outside the returned byte count. Matched gameplay throughput and playthroughs on other hosts are still outstanding. ## Risks and remaining work Under-marking scratch or partly written output could leave a later GPU capture stale. Decode correctness, including failures after partial output, is the main review target. ## Checklist - [x] The changed path was exercised locally in the game. - [x] The branch is based on main at `876dc360`. Measurements were taken before the cold-install packaging change on that revision. - [x] Project source, tests and measurement summaries only. Third-party sources are untouched. - [x] Codex assistance recorded in the commit. - [ ] Independent A/B timing and cross-platform checks remain open.
Author
Owner

Tested in game: Linux, Ryzen 9 7900X, RTX 3090, NVIDIA 620.70.06. The decoder ran in the headless test binaries that loaded Market and Hyrule Field, including the physical crossing. These runs do not isolate its effect on FPS.

Tested in game: Linux, Ryzen 9 7900X, RTX 3090, NVIDIA 620.70.06. The decoder ran in the headless test binaries that loaded Market and Hyrule Field, including the physical crossing. These runs do not isolate its effect on FPS.
HumanBean force-pushed perf/streamed-decode-write-marks from 9fc3d26132
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 15s
CI / Conventional Commit title (pull_request) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
CI / Workflow lint (actionlint) (pull_request) Successful in 21s
Third-party parts / As their notes say (pull_request) Successful in 26s
Website / Website on Cloudflare (pull_request_target) Has been skipped
to 1a30c65123
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 20s
Third-party parts / As their notes say (pull_request) Successful in 21s
PR description / Description follows the template (pull_request_target) Successful in 12s
2026-11-18 15:14:20 +00:00
Compare
Author
Owner

Corrected author and committer attribution to HumanBean. Verified identical file contents before and after the metadata change.

Corrected author and committer attribution to HumanBean. Verified identical file contents before and after the metadata change.
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 20s
Third-party parts / As their notes say (pull_request) Successful in 21s
PR description / Description follows the template (pull_request_target) Successful in 12s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/streamed-decode-write-marks:HumanBean-perf/streamed-decode-write-marks'
git switch 'HumanBean-perf/streamed-decode-write-marks'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1597
No description provided.