Repository navigation
Conversation
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted independent documentation/arithmetic review at993eedb3. Please correct three claims before merge:
- docs/gbuffer.md:64–70: multiplication by255 does not alone demonstrate a lost bit. Exhaustive synthetic binary32 scaling→binary16 RTZ for all256byte values, then ×255: rounding-to-nearest recovers256/256; integer truncation gives b−1 for254/256 (1..254), maximum shortfall0.1240234375 byte units. The result depends on the lighting consumer's integer conversion, not established by #1891, and applies to all three byte positions. Qualify the mechanism until that conversion is measured.
- Census rows955+747=1702, not the stated1703 six-target shaders. Identify the remaining signature or correct the total. Deferred2989 and named-family807 sums agree. The2113 target4 RG-mask signatures do not independently prove disabled export operands across that population; cite an instruction-level count or keep the statement at signature scope.
- Signature types/compressed half exports establish shader-side representation, not actual RTV attachment formats. Keep the table's formats qualified until matching PSO/bound-view evidence. Producer sqrt does not establish the consumer's inverse or material meaning; #1891 treats the specular interpretation as tentative.
Normal-word packing is internally consistent and0x44fff000=2047.5. Exact-head documentation whitespace checks passed. No corpus totals or GPU behavior independently reproduced; synthetic CPU arithmetic only.
|
Checked 993eedb against my own translated 1.0.2.1 work folder, as @KoertLichtendonk asked in the coordination issue. I read Matches exactly:
Small differences. I select by
The ratios and the conclusions don't change, so I'd only ask how the Counts only, no shader names or data. AI-assisted (Claude Code). |
|
I checked The FSSM field at +0xFC differs from the color-target count in both vehicle programs. For the stock tire and rim, I followed the first
All eleven elements have component type 3 and minimum precision 0, supporting those two rows of your signature table. Please use The byte loss depends on how the lighting pass converts the scaled float to an integer. I used an isolated copy of
The same arithmetic applies to each packed byte. Please identify the consuming conversion (truncate, round, or bias before convert) when attributing a one-byte error to the game's lighting pass. This tests attachment storage on hardware and the two candidate decodes on CPU. The actual game's lighting consumer and PSO formats remain to be verified. RTZ and lighting claim Test system was an Intel Core Ultra 7 265K, NVIDIA GeForce RTX 5070, driver 621.01 (32.0.16.2101), Windows 11 Home 25H2 build 26200.9974. The native Windows Vulkan harness confirmed the RTX 5070, subgroup 32, on both draws. AI-assisted (Codex). |
|
Thanks @kacper-serewis, @mrp1no, and @jeremygold02 for the detailed reviews and the RTX 5070 hardware readback check! Updated docs/gbuffer.md in $sha3246 (rebased on 847748c):
|
993eedb to
20daca0
Compare
jeremygold02
left a comment
There was a problem hiding this comment.
Confirmed the two corrections in my earlier review at 20daca0435526645bfe274de5d0aa71573ec930d. This time the GPU ran the PR head’s translation of a hand-written gfx1013 pixel shader using v_cvt_pkrtz_f16_f32 and exp mrt0 … compr. That provides an independent check of the earlier direct-SPIR-V ramp.
| Attachment | Byte recovery at readback | Result per channel |
|---|---|---|
R8G8B8A8_UNORM |
Read the stored byte | 256/256 exact |
R16G16B16A16_SFLOAT |
Round stored half × 255 to nearest | 256/256 exact |
R16G16B16A16_SFLOAT |
Truncate stored half × 255 | 2/256 exact (0 and 255); every intermediate byte was one low |
The maximum shortfall before integer conversion was exactly 0.1240234375 byte. Two 256×1 draws exercised all 256 codes independently in each channel. For column x, RGBA input bytes were (x, x^255, x^85, (x+17)&255). Each component was converted to f32 and multiplied by the binary32 constant 0x3b808081 before the two RTZ packs and compressed export. All 1,024 channel values per format matched the earlier GPU ramp after applying those permutations. Both translated stages passed Vulkan 1.2 SPIR-V validation. The scratch harness was built from this head with attachment format and readback size selected for the two tests.
The two previously identified stock vehicle records also reproduced the corrected distinction: the tire and rim declare 5 and 6 color targets in their OSG1 signatures, while their FSSM field at +0xFC contains 16 and 18 respectively. This verifies those two examples and the format-dependent arithmetic. The production lighting consumer’s conversion, the live PSO attachment formats, and the corpus census were outside this retest.
GPU execution used NVIDIA GeForce RTX 5070, driver 621.01 (32.0.16.2101), subgroup 32, with Intel Core Ultra 7 265K on Windows 11 Home 25H2 build 26200.9974.
AI-assisted by GPT-6.2 Astra.
20daca0 to
1936a36
Compare
# Conflicts: # docs/gbuffer.md
1936a36 to
98fa503
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/gbuffer.md
The merge of ItsNotRexed#3246 (3343a45, after d9cea57) kept both the first version of the note and its revision (1936a36), so sections 2 and 3 and the "Arithmetic across all 256 byte values" section appeared twice, one copy mangled, and a leftover line said the FSSM header records the target count at +0x0FC, which the revision corrects (read it from OSG1: vehicle passes hold 16 and 18 there). Remove the 58 leftover lines; the file is now 1936a36's version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes
PROC-146(claim on #3047, findings from #1891 by @Silliana).Summary
Adds
docs/gbuffer.md(indexed indocs/README.md) documenting @Silliana's deferred G-buffer findings from #1891 (PS_DeferredTextured) and cross-checking them against the declaredOSG1/PSV0output signatures and FSSM export instructions across all 2,989*Deferred*pixel shaders (and all 1,703 six-target pixel shaders) inshaders.rpf(1.0.2.1 package; counts, masks, constants, and format requirements only — zero shader disassembly or game data):OSG1/PSV0/ FSSM+0x0FC):*Deferred*pixel shaders (including 807PS_DeferredTexturedvariants: 380 five-target, 371 six-target, 56 three-target):SV_Target0..5) with write masks0xF, 0xF, 0xF, 0xF, 0x3, 0xF(mrt4is 2-componentRG; 955 corpus-wide).SV_Target0..5) with write masks0xFon all six (747 corpus-wide).SV_Target0..4) with write masks0xF, 0xF, 0xF, 0xF, 0x3(1,168 corpus-wide).component_type = 3(float32,min_precision = 0) inOSG1/PSV0and export viav_cvt_pkrtz_f16_f32+exp mrtN, ... compr(EXP_FORMAT_FP16_ABGR).mrt0..mrt5):mrt0(R8G8B8A8_UNORM): albedorgb+ alpha/material byte (1.0 / 255.0=0x3b808081).mrt1(R8G8B8A8_UNORM): scalar inr, and a 24-bit octahedral world normal split acrossg,b,a(2047.5=0x44fff000, packed asubyte0,ubyte1,ubyte2, and multiplied by1.0 / 255.0=0x3b808081).mrt2(R8G8B8A8_UNORM): hardwaresqrt-encoded material/specular channels (rgb), squared back by the lighting pass.mrt3(R8G8B8A8_UNORM): dither-biased[0, 1]flags inxy(2.0 / 255.0=0x3c008081,-1.0 / 255.0=0xbb808081) and two 8-bit integer IDs (ubyte0,ubyte1zw.mrt4(float format, e.g.R16G16_FLOAT): screen-space motion vectors (mask = 0x3RGon 2,113 deferred PS).mrt5(R8G8B8A8_UNORM): sixth deferred target on the 1,690 6-target permutations.f16to all targets mangles the normal:OSG1declaresfloat32and the shader exports withv_cvt_pkrtz_f16_f32(RTZ, round-toward-zero) on all targets,byte * (1.0 / 255.0)truncated tof16lands slightly belowbyte / 255.0. AnR8G8B8A8_UNORMattachment restores the exact byte via ROP rounding (R16G16B16A16_FLOATcausesubyte1(straddling the 12-bit boundary betweenubyte2to drop 1 LSB when multiplied by255.0.Verification
python -I -W error tests/test_text_write_line_endings.py -vAI-assisted.