Skip to content

docs/gbuffer: rebuild the page from its two merged halves - #5350

Open
evilclanker9000 wants to merge 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/1-gbuffer-splice
Open

evilclanker9000 wants to merge 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/1-gbuffer-splice

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: EGEN-GBUFFER-MERGE-SPLICE

What and why

docs/gbuffer.md carries the damage of a merge that kept both sides, and it is not only duplicated text:

  • the intro sentence is in the page twice (lines 3-6 and 7-8);
  • a ## 3. The 24-bit octahedral normal … heading sits in the middle of section 1 (line 45), directly after the
    first half of the sentence that ends at line 13, followed by the second half (semantic_index, … min_precision} per
    declared output element) and a second, richer census table (entry-name vs .dxbc-stem matching, plus the
    SV_Depth row);
  • section 2 appears twice (32-43 with the expected RTV format class, 69-82 with the older "inferred" table);
  • section 3 appears twice (45 with the f16 title, 84 with the UNORM8 title, which is the one that has the two
    measured subsections).

This rebuilds it as one page: one intro, section 1 with the richer census table and the +0x0FC caveat joined to the
sentence it belongs to, one section 2 (the one that names the expected RTV formats) and one section 3 (the f16 title,
keeping both measured subsections). 136 lines become 100; no claim, count or link is dropped.

Tested

Documentation only; no GPU needed. Python 3.12.10 on Windows 11.

git diff --stat                       →  docs/gbuffer.md | 60 ++++++-------  (12 insertions, 48 deletions)
Select-String -Pattern '^## |^### '   →  ## 1., ## 2., ## 3., ### Consequence…, ### Arithmetic…  (one each)
python -I tests/test_docs_links.py    →  Ran 6 tests, OK
python -I tests/test_docs_list_items.py →  Ran 2 tests, OK
python -I tests/test_docs_table_rows.py →  Ran 2 tests, OK

The rewrite asserts the old line contents before it touches the file (line 3, 10, 32, 45, 50, 54, 64, 69, 84, 99,
134) and checks afterwards that each remaining heading occurs once and the dropped intro is gone.

Notes

  • Section 1 keeps the richer of the two census tables (it adds the entry/stem columns and the
    5 colour + SV_Depth row) and the paragraph that explains both matching rules; the older table and the older
    "Across the 2,989 …" sentence are the ones that go.
  • For section 3 I kept the newer title ("why binding f16 targets breaks lighting") because the two subsections
    below it are exactly that analysis; the older title only described storage.
  • No new test: the check that catches this class (one section heading path per page) still fails on
    docs/shader_validation.md, which is next; the check lands with that fix.

AI-assisted.

The merge left the intro twice, a section-3 heading spliced into section 1, two census tables and two copies of sections 2 and 3. Keeps one of each: the richer census table inside section 1, the section 2 that names the expected RTV formats, and section 3 with its two measured subsections. 136 lines -> 100, nothing measured dropped.

@Kam471 Kam471 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.

Reviewed d2a2248 (docs only).

  • python -I -m pytest tests/test_docs_links.py -q -> 6 passed; python -I -m pytest tests/test_docs_list_items.py tests/test_docs_table_rows.py -q -> 4 passed.
  • Select-String '^## |^### ' -> ## 1., ## 2., ## 3. and the two ### once each.
  • Against origin/main the damage is as described (duplicated intro, the section-1 splice, sections 2/3 twice); the kept census table is the richer one, the +0x0FC caveat is joined to its sentence, and the page's one link survives.
  • git diff --check clean.

Nits, not blockers: the deleted section-2 table carried the .dxbc-stem alternates (2,109 / 737 / 1,684) that the kept table does not, so "no count is dropped" is slightly strong; and the two section-3 subsections still repeat two bullets nearly verbatim (pre-existing on main; the PR says it keeps both).

Verdict: OK to merge.

@sovljanskii

Copy link
Copy Markdown
Contributor

Fact-checked d2a2248c (merges cleanly onto main 3faac557) on macOS, Apple M4, Python 3.15.2: the rebuild is right, but the kept copy loses two qualifiers.

What I checked

  • Headings: main has ## 2. twice and two ## 3. headings. The PR has ## 1., ## 2., ## 3. and its two ### subsections, each once.
  • Numbers: every number in main's page is still in the PR except 2,109, 737 and 1,684. Those were the stem-match halves of 2,113 / 2,109, 739 / 737 and 1,690 / 1,684 in the dropped copy of section 2. They still follow from section 1's table: the SV_Target4 = 0x3 rows give 953 + 0 + 1,160 = 2,113 by entry and 949 + 0 + 1,160 = 2,109 by stem. Likewise 737 + 2 = 739 and 735 + 2 = 737, and 953 + 737 = 1,690 and 949 + 735 = 1,684.
  • The one link is unchanged. All 10 tests/test_docs_*.py files pass on the merge, and git diff --check is clean.

Two qualifiers that only the dropped copy carried

The kept section 2 is main's lines 32-43 verbatim. The dropped copy (69-82) hedged two claims that the kept one states as fact:

  1. Format column: the dropped copy said the RTV format column is "inferred from the shader-side encoding and PS_DeferredTextured gbuffer layout (normals are packed kinda weird) #1891, not declared by OSG1 or a captured PSO" (main line 71). The kept header "Expected RTV format class" no longer says so, and "inferred" no longer appears anywhere on the page.
  2. mrt2: the dropped row said "PS_DeferredTextured gbuffer layout (normals are packed kinda weird) #1891 notes that the lighting consumer squares mrt2 back (tentatively specular / $F_0$ material terms, pending lighting-consumer verification)" (main line 79). The kept row says "so the deferred lighting pass squares them back" (PR line 43). I found no measurement of the lighting consumer in docs/ that would retire the hedge.

Carrying both over, as one sentence before the table and a clause in the mrt2 row, would keep the PR's own promise that no claim changes. Non-blocking: section 2's counts are now entry-match only, which may be worth saying in the header (*Deferred* PS, entry match).

AI-assisted.

@timbot103

Copy link
Copy Markdown

Checked d2a2248c (code read + CPU tests, Windows 11, Python 3.14.7). The three numbered headings now appear once and all 10 link, list and table tests passed. I found two factual issues in the merged wording.

  1. docs/gbuffer.md:12 calls +0x0FC the exported-target count, immediately before the counterexamples of 16 and 18. Please keep the OSG1 count wording from 20daca04. Line 4 should also distinguish the 1,702 six-colour shaders from the extra five-colour-plus-depth case counted on lines 30–31.
  2. docs/gbuffer.md:48 makes lighting corruption unconditional. I recalculated all 256 byte values after binary16 round-toward-zero storage. Nearest-integer decoding recovers 256/256, truncation recovers 2/256, and the actual lighting consumer remains unverified. Please retain the earlier storage-comparison heading and mark the target formats in section 2 as inferred.

Python compilation passed. The full semantic run on both this commit and base 3faac557 returned 6245 tests, 3 failures, 3 errors, 16 skipped and 1 expected failure, with the same failing tests.

AI-assisted (Codex).

@kacper-serewis kacper-serewis 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.

AI-assisted independent census at d2a2248. Of 12,101 cached PS containers, 1,703 had six OSG1 rows, but only 1,702 had six colour targets. One had five colour targets plus SV_Depth and belongs to neither deferred selection. Case-insensitive deferred in indexed entry names yields 3,014 shaders, 1,690 with six colour targets, seven with depth, and 16,358 static MRT exports. Case-sensitive Deferred in carved stems gives 3,004, 1,684, seven and 16,306 respectively. Observed MRT sets matched declared target sets and every counted export carried compr. Please name the predicate alongside 16,306 and correct the corpus-wide depth row. The documented predicate did not reproduce 2,989; the origin of that historical count remains open.

@tupacfan04

Copy link
Copy Markdown
Contributor

Read the diff at d2a2248c (docs only; nothing run): the rebuilt page brings back wording from the first version of the note that the author's revision replaced, and one sentence now contradicts itself.

The two halves on main are the merge's two parents of #3246 (3343a45b): the first version, and the revision 1936a36f ("clarify OSG1 vs FSSM +0xFC, 1702/1703 counts, and RTZ truncation vs rounding"). main's file is exactly 1936a36f's 83 lines plus 58 lines of the first version. Against 1936a36f, this head:

To check: git diff 1936a36f d2a2248c -- docs/gbuffer.md.

#5169 (claimed in #5156 at 08:57Z, opened at 08:59Z) removes the same leftover and is rebased on 561b65a8: its file is byte for byte 1936a36f's version (git diff 1936a36f -- docs/gbuffer.md is empty there). If you'd rather keep a merged page, taking the revision's side in each of the four places above would fix it.

AI-assisted (Claude Code); no game files.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants