Skip to content

docs(agc): correct five stale statements in the HTILE and multisampled target entries - #9077

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:docs/debt-agc-htile-msaa-stale
Oct 24, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:docs/debt-agc-htile-msaa-stale

Conversation

@thuanquang

@thuanquang thuanquang commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Five sentences in docs/dev/debt/libSceAgcDriver.md describe code that has since changed. Each is replaced with what main does now; nothing else in the entries changes.

  • HTILE depth fast clears: "The address match is exact, so a clear of a different HTILE range does not hit." fix(agc): give each slice of a depth array its own HTILE #5111 (8fec47a) replaced the exact address comparisons with HtileFillCovers (DepthSurface.cpp:2417-2420 on main), which accepts any cleared range that contains the surface's HTILE start and reaches HtileMetadataBytes past it; takeClearedHtile (:1565-1572) uses it. Now: "A clear hits a surface only when its range covers that surface's whole HTILE, which need not start where the clear does."
  • HTILE depth fast clears: "HTILE initialization, the stencil-only update, and fast clears made by the SDK's own paths, CP DMA fills or other kernels are not covered and leave the depth image as it was." Since fix(agc): take depth fast clears from HTILE written by any kernel #5627 (4ddff7c), a bind reads HTILE that was written since it was last read, whoever wrote it, and takes a whole-surface depth or stencil fast clear; the next entry, [HTILE written by other kernels], describes this and its limits (some tiles cleared, multisampled targets, native depth guards). Now: "Fast clears that other writers leave in HTILE are taken at bind as the next entry describes."
  • Multisampled CMASK state: "one with 0xffffffff marks it expanded". Since fix(agc): read a multisampled target's CMASK by its MSAA codes #6669 (12b20e1), MultisampledCmaskKeys (MultisampleTarget.cpp:901-907) returns the expanded key for the codes 0xcc, 0xdd, 0xee and 0xff, and NoteFill (:909-926) takes a whole-CMASK fill whose pattern repeats one of them. Now: "one with 0xcccccccc, 0xdddddddd, 0xeeeeeeee or 0xffffffff marks it expanded".
  • Multisampled texture no draw rendered to: "tile modes other than Standard4KB, Standard64KB and RenderTarget" throw. Since fix(agc): sample undrawn multisampled Z and D 64 KiB swizzle textures, and Z ones whose HTILE is cleared #6297 (69afb05), createFilled (MultisampleTarget.cpp:819-826) also maps kZ64KBX and kD64KBX; only the default case refuses. Now: "tile modes other than Standard4KB, Standard64KB, Z64KBX, D64KBX and RenderTarget".
  • Multisampled target guest access: the guarded memory "uses fragment-aware 64 KiB render-target blocks." Since fix(agc): sample undrawn multisampled Z and D 64 KiB swizzle textures, and Z ones whose HTILE is cleared #6297, guard (MultisampleTarget.cpp:736-746) takes the fragment-aware size for every 64 KiB mode that MultisampledBlockLog2 (:35-41) knows except Standard64KB, so Z64KBX and D64KBX as well as RenderTarget. Now: "uses fragment-aware 64 KiB blocks for the RenderTarget, Z64KBX and D64KBX tile modes."

The Storage image write-back entry also links a file that no longer exists (Draw/DrawPipeline.hpp; the file is DrawPipeline.cpp). It is left out here because open #7912 rewrites that line.

Overlap: #7803 and #7948, which add entries right next to the edited lines, have both merged; this branch is rebased on top of them, and neither changed these sentences.

Tested

Docs only; nothing was built or run. Each statement was checked by reading the code cited above on main d34da5d694, and the commits were found with git log -S on the changed lines. Rebased onto main 990f45e17d (#7803 added the 'Sample 0 of a multisampled color target' entry right after the 'Multisampled texture no draw rendered to' entry; it stays as main has it) and rechecked there: the five statements still hold, at DepthSurface.cpp:2415-2418 (HtileFillCovers) and :1563-1570 (takeClearedHtile), MultisampleTarget.cpp:901-907 (MultisampledCmaskKeys) and the fill check at :919, the tile-mode mapping at :819-826, and guard at :736-746 with MultisampledBlockLog2 at :35-41; the 'HTILE written by other kernels' entry is still the next entry. Of the 96 other open pull requests that edit this file (checked on 990f45e17d), only #9700 (EQAA color targets) edits one of these entries: it changes other sentences of the Multisampled target guest access entry and keeps the one corrected here, so the two do not conflict in content, but they edit the same line and whichever merges second rebases it. Rebased onto main e78acf4bda for the conflict with #8283 (merged) in docs/dev/debt/libSceAgcDriver.md: main's text is kept and this PR's change is unchanged; the statements were rechecked on that commit.

  • python tools/check_conventions.py --base origin/main with this title and body: 0 errors and two debt-length warnings, for entries that were already over 1000 characters: HTILE depth fast clears (2008 characters before, 1967 after) and Multisampled target guest access (1831 before, 1868 after). Multisampled CMASK state stays under 1000 (958 to 996).
  • Not tested: behaviour on any machine; this changes text only.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 8999 docs/dev/debt/libSceAgcDriver.md L176-177
PR 9700 docs/dev/debt/libSceAgcDriver.md L176
PR 9940 docs/dev/debt/libSceAgcDriver.md L169-170
PR 9941 docs/dev/debt/libSceAgcDriver.md L169-170
PR 10233 docs/dev/debt/libSceAgcDriver.md L169-170
PR 10414 docs/dev/debt/libSceAgcDriver.md L176

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6612 docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7446 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7618 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7668 docs/dev/debt/libSceAgcDriver.md
PR 7844 docs/dev/debt/libSceAgcDriver.md
PR 7910 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8223 docs/dev/debt/libSceAgcDriver.md
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8365 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9348 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9393 docs/dev/debt/libSceAgcDriver.md
PR 9431 docs/dev/debt/libSceAgcDriver.md
PR 9432 docs/dev/debt/libSceAgcDriver.md
PR 9508 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 docs/dev/debt/libSceAgcDriver.md
PR 9673 docs/dev/debt/libSceAgcDriver.md
PR 9674 docs/dev/debt/libSceAgcDriver.md
PR 9675 docs/dev/debt/libSceAgcDriver.md
PR 9676 docs/dev/debt/libSceAgcDriver.md
PR 9842 docs/dev/debt/libSceAgcDriver.md
PR 9891 docs/dev/debt/libSceAgcDriver.md
PR 9892 docs/dev/debt/libSceAgcDriver.md
PR 9893 docs/dev/debt/libSceAgcDriver.md
PR 9895 docs/dev/debt/libSceAgcDriver.md
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9904 docs/dev/debt/libSceAgcDriver.md
PR 9905 docs/dev/debt/libSceAgcDriver.md
PR 9906 docs/dev/debt/libSceAgcDriver.md
PR 9988 docs/dev/debt/libSceAgcDriver.md
PR 10193 docs/dev/debt/libSceAgcDriver.md
PR 10420 docs/dev/debt/libSceAgcDriver.md
PR 10472 docs/dev/debt/libSceAgcDriver.md
PR 10515 docs/dev/debt/libSceAgcDriver.md

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026

@harisibrar1 harisibrar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked against main:

  • HTILE address match: HtileFillCovers (DepthSurface.cpp:2119-2122) accepts any range containing the HTILE start and reaching HtileMetadataBytes past it, and takeClearedHtile (:1375-1384) uses it, so "covers that surface's whole HTILE, which need not start where the clear does" is right.
  • HTILE other writers: DepthSurfaceView calls storeBackClearedHtile (:1720-1721), which reads HTILE written since the last read (htileReads, :1503-1535) and takes the fast clear. The pointer to the next entry is accurate.
  • CMASK fill codes: MultisampledCmaskKeys (MultisampleTarget.cpp:739-744) returns a key only for 0 and for tiles 0xc to 0xf with equal nibbles, and NoteFill (:747-764) needs the 32-bit pattern to repeat that byte, so 0xcccccccc, 0xdddddddd, 0xeeeeeeee and 0xffffffff are exactly right.
  • Tile modes: createFilled (:658-663) maps Standard4KB, Standard64KB, Z64KBX, D64KBX and R64KBX; guard (:578-580) uses fragment-aware blocks for the 64 KiB modes except Standard64KB (MultisampledBlockLog2, :32-38). Both rewordings match.
  • check_conventions.py --base main --head pr-9077: 0 errors; the two debt-length warnings are on entries already over the limit, and the HTILE one gets shorter.
  • Optional nit: the sentence before the first change still says the clear applies to "the surface with that DB_HTILE_DATA_BASE address", which now reads slightly against "need not start where the clear does".

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

@github-actions github-actions Bot added the docs label Oct 21, 2026
@thuanquang
thuanquang force-pushed the docs/debt-agc-htile-msaa-stale branch from b53bfe6 to 4157678 Compare October 21, 2026 17:13
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 21, 2026
@thuanquang
thuanquang force-pushed the docs/debt-agc-htile-msaa-stale branch from 4157678 to a3f1e60 Compare October 23, 2026 04:46
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 23, 2026
@thuanquang
thuanquang force-pushed the docs/debt-agc-htile-msaa-stale branch from a3f1e60 to 8e95e2d Compare October 23, 2026 16:46
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 23, 2026
@thuanquang
thuanquang force-pushed the docs/debt-agc-htile-msaa-stale branch from 8e95e2d to 8743fc7 Compare October 23, 2026 18:46
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@adriadam10 adriadam10 self-assigned this Oct 24, 2026
…d target entries

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 24, 2026
@adriadam10
adriadam10 force-pushed the docs/debt-agc-htile-msaa-stale branch from 8743fc7 to 5536623 Compare October 24, 2026 09:47
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 24, 2026
@adriadam10
adriadam10 merged commit 672c38f into boykopovar:main Oct 24, 2026
9 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main (the CMASK clear pass entry next to the HTILE line is gone, so the two HTILE sentence edits were reapplied to main's line; the other three entries are unchanged). Rechecked the five statements against HtileFillCovers, the kZ64KBX/kD64KBX mapping in createFilled and the MSAA CMASK codes; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants