Skip to content

Red Dead Redemption (01007820196A6000) on the current pin, and two rendering fixes found on it - #1000

Closed
robandstuff wants to merge 1 commit into
LNPANDY:mainfrom
robandstuff:red-dead-redemption
Closed

robandstuff wants to merge 1 commit into
LNPANDY:mainfrom
robandstuff:red-dead-redemption

Conversation

@robandstuff

@robandstuff robandstuff commented Nov 8, 2026 •

Copy link
Copy Markdown

Fix or feature

  • Fix
  • Feature

What and why

Red Dead Redemption support on main's pin c78d737, plus two engine fixes found while playing it. Fixes #999.

  • 0102: the shader split reads Rockstar RPF6 archives, RAGE rgxd effects and Double Eleven .pkdswitch packs.
  • 0103-0105: the game's profile and note, the 1.0.4 archive key (read from its key setup), and the registration of 1.0.4.
  • No audio patch: upstream already drives several audio renderers ("A game with more than one renderer", from Mario & Luigi: Brothership), and the game's second renderer, for the movies, plays through it.
  • 0106: a draw that samples the depth attachment its render pass already wrote ends the pass first. The cloud fog had read partly stored tiles, leaving flickering blocks in the sky over distant hills. DM_NVN_FB_DEPTH=0 turns it off.
  • 0107: upstream's fix for the samples-passed counter, as a backport of cfbdd93c (Samples-passed reports count from the first one when the game never resets the counter (Red Dead Redemption's missing character bodies) seedds/nxnative#1867, landed reworked: one running total in queue order, no switch). The game never resets the counter, every character occlusion query read 0, and distant characters were drawn as hats and props only.
  • 0108: the game note, updated for the above.
  • 0109: test_rpf6, synthetic bytes for the archive header, the entry table and key_from_setup.

Upstream: 0102-0105, 0108 and 0109 in seedds/nxnative#2005; 0106 in seedds/nxnative#1866; 0107 is upstream's cfbdd93c.

Checked

  • Tests:
    • python3 tools/engine.py check: the 75 patches apply cleanly to c78d737.
    • make -C dm/gfx/tests GAME=0100000000010000 run on this pin (Apple M4, Metal), with the patches and without 0107: 136 groups. With 0107, 71,647 checks; without it, 71,641. The same 10 checks fail both ways, in t_present_crop (a crash in the fixture, fixed upstream in 3b6b980), t_render_counter_overlap and t_render_enable_queue. 0107's 6 new checks pass.
    • test_rpf6 (11 checks) and the shader split's tests pass; ruff and pyright find nothing new.
  • Run on a device or Mac (Apple M4, 32 GB, macOS 27.0.1), Red Dead Redemption 1.0.4 (01007820196A6000) built from the dump through the NSP script (3,628 shaders) and replayed headless from a save in Armadillo:
    • On this pin with 0106 and 0107: no [RED] through frame 7,500, frame time p50 33.3 ms; at the saloon (frame 2,310) the distant characters have bodies and the sky over the ridge is clean.
    • On seedds/nxnative main with #2005: no [RED] through frame 5,400; bodies drawn; a few light blocks over the ridge, as expected without #1866.
  • Not checked: an iPhone or iPad, and 1.0.0 on this pin.

Screenshots

None, no visible change in the launcher.

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open
  • A change to a launcher view has before and after screenshots above (none changed)
  • No keys, game files or data extracted from a game in the change or the attachments

@v0lumehi

v0lumehi commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

@robandstuff thanks for the work. Three open points.

  1. Please link the seedds/nxnative PR for patches 0099 to 0102 and 0105, or tell us when it will be open.
  2. Please add a small test with synthetic bytes for rpf6.py (header, entry table, key_from_setup). A fuzz seed alone does not pin the format.
  3. Patch 0104 changes the samples-passed counter for every game that uses occlusion queries. Please run the gfx suite on this pin and post the result.

Please also drop the Co-Authored-By trailers and the "Generated with Claude Code" line. CI has not run yet because a maintainer has to approve the workflows for a fork PR.

…ing fixes found on it, and a test for rpf6.py

Red Dead Redemption on the current pin (c78d737). The movies' second audio renderer plays through upstream's support for several renderers, so the fork carries no audio patch for it.

0102: the shader split reads Rockstar RPF6 archives, RAGE rgxd effects and Double Eleven .pkdswitch packs.
0103-0105: the profile and note, 1.0.4's archive key (read from its key setup), and the registration of 1.0.4.
0106: a draw that samples the depth attachment its render pass already wrote ends the pass first: the cloud fog read partly stored tiles and left flickering blocks in the sky over distant hills. DM_NVN_FB_DEPTH=0 turns it off. Forwarded as seedds/nxnative#1866.
0107: upstream's fix for the samples-passed counter (cfbdd93c, from seedds/nxnative#1867) as a backport: the game never resets the counter, and its distant characters were drawn as hats and props only.
0108: the game note after the two fixes.
0109: test_rpf6, synthetic bytes for the archive header, the entry table and key_from_setup.
0102-0105, 0108 and 0109 are forwarded as seedds/nxnative#2005.

Checked: python3 tools/engine.py check (75 patches apply to c78d737). The gfx suite on this pin with 0102-0108: 136 groups, 71,647 checks, 10 failed in t_present_crop, t_render_counter_overlap and t_render_enable_queue; the same 10 fail without 0107, which adds 6 passing checks. Red Dead Redemption 1.0.4 built from the dump and replayed from a save in Armadillo: no [RED], frame time p50 33.3 ms, the distant characters have bodies and the sky is clean.

Issue: LNPANDY#999
@robandstuff

Copy link
Copy Markdown
Author

Thanks for the review. All four points are addressed; the branch is rebased onto main (e0ce357), so the patches are now 0102-0109.

  1. Upstream PR: Red Dead Redemption (01007820196A6000): profile, note, and the shader split's readers for RPF6 archives, rgxd effects and Double Eleven packs seedds/nxnative#2005 has the shader split's readers, the profile and note, the 1.0.4 key and registration, and the new test (0102-0105, 0108, 0109 here, now forwarded seedds/nxnative#2005). 0106 is A draw that samples the depth attachment its render pass already wrote ends the pass first (Red Dead Redemption's sky blocks) seedds/nxnative#1866. The occlusion fix landed upstream reworked as cfbdd93c (Samples-passed reports count from the first one when the game never resets the counter (Red Dead Redemption's missing character bodies) seedds/nxnative#1867), so 0107 is now that commit as a backport.
  2. rpf6.py test: 0109 adds dm/tools/tests/test_rpf6.py. It builds an archive from synthetic bytes: a header, an entry table with a directory, a plain file, a compressed file and an RSC5 resource, and a name table. It encrypts the tables with a made-up key (16 rounds of AES-256 ECB) and reads them back through Rpf, encrypted and in the clear. It also checks joaat, the header, and that a wrong key or a directory running past the table is an error. key_from_setup gets a synthetic key setup (adrp, four ldr q, add, two stp q): the eight words come out big-endian, and words wider than 32 bits, a setup outside the code segment, or one that stores too little give no candidate. 11 checks, no game files.
  3. gfx suite on this pin (make -C dm/gfx/tests GAME=0100000000010000 run, Apple M4, macOS 27.0.1), once with the series and once without 0107: 136 groups, 71,647 checks with 0107 and 71,641 without. The same 10 checks fail both ways: t_present_crop crashes in its fixture (upstream fixed that in 3b6b980, after this pin), and the rest are in t_render_counter_overlap and t_render_enable_queue. 0107 adds 6 checks, which pass, and changes no other result.
  4. Trailers: the Co-Authored-By trailers are gone from the commits and the patches, and the "Generated with" line from the description.

@robandstuff

Copy link
Copy Markdown
Author

Superseded: all of it landed upstream (976fbd57, 81906931, cfbdd93c), and main's pin (ccd834e0) has them.

@robandstuff
robandstuff deleted the red-dead-redemption branch November 12, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch-queue Changes the patch queue or the upstream pin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Red Dead Redemption (01007820196A6000): support, and two rendering fixes found on it

2 participants