Shaders: second rows of packed 16-bit pixel inputs #592

Closed
github-bot wants to merge 1 commit from gh-pr/592/head into gh-pr/592/base
Owner

@⁠SAitken91 on GitHub · 2026-11-24 05:15 UTC · original
SAitken91:shader/packed-input-partner-rows → main · +87 −1 · 1 files · 1 commits · closed without merging

Pixel inputs that pack two 16-bit rows per dword (pack2) failed when their metadata leaves the second row out (row2 = row). With no second row, reading any of its halves failed with "a packed input half no element holds". That blocked 172 programs in shaders.rpf, mostly ped and mirror-reflection pixel shaders.

Change

  • New half_input_partners. It finds the missing second row the way the output side already does (half_outputs): the next 16-bit row of the input signature that no input entry names, taken in row order. Rows the metadata does give are taken first, so they aren't handed out twice.
  • The partner is used only when pack2 is set and row2 = row. An explicit row2 is used as before.

Why not just read 0

I tried that first, and it would have validated more programs. A diagnostic showed the failing reads were halves 4–7 with a 4-channel first row, which is the second row's data, not padding. Reading 0 would have hidden real values, so I didn't do it.

Results

victory translate --validate shaders.rpf: vertex/pixel validated 12172 → 12289. 6 programs whose metadata does name a second row still stop at this error. That looks like a separate case, and it's left as is.

Testing

  • cargo test -p victory-shader: 70 passed, including the new packed_pixel_inputs_find_their_second_row. Clippy and rustfmt are clean.
  • Not exercised at runtime. The pairing rule assumes the pixel signature lists 16-bit rows in the order the vertex side packs them, as the output side already assumes.

This is independent of #539, #554, #563, #565, #569 and #571.

Written with the help of Claude (AI).

🤖 Generated with Claude Code

**@⁠SAitken91** on GitHub · 2026-11-24 05:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/592) `SAitken91:shader/packed-input-partner-rows` → `main` · +87 −1 · 1 files · 1 commits · closed without merging Pixel inputs that pack two 16-bit rows per dword (`pack2`) failed when their metadata leaves the second row out (`row2` = `row`). With no second row, reading any of its halves failed with "a packed input half no element holds". That blocked 172 programs in shaders.rpf, mostly ped and mirror-reflection pixel shaders. ## Change - New `half_input_partners`. It finds the missing second row the way the output side already does (`half_outputs`): the next 16-bit row of the input signature that no input entry names, taken in row order. Rows the metadata does give are taken first, so they aren't handed out twice. - The partner is used only when `pack2` is set and `row2` = `row`. An explicit `row2` is used as before. ## Why not just read 0 I tried that first, and it would have validated more programs. A diagnostic showed the failing reads were halves 4–7 with a 4-channel first row, which is the second row's data, not padding. Reading 0 would have hidden real values, so I didn't do it. ## Results `victory translate --validate shaders.rpf`: vertex/pixel validated 12172 → 12289. 6 programs whose metadata does name a second row still stop at this error. That looks like a separate case, and it's left as is. ## Testing - `cargo test -p victory-shader`: 70 passed, including the new `packed_pixel_inputs_find_their_second_row`. Clippy and rustfmt are clean. - **Not exercised at runtime.** The pairing rule assumes the pixel signature lists 16-bit rows in the order the vertex side packs them, as the output side already assumes. This is independent of #539, #554, #563, #565, #569 and #571. Written with the help of Claude (AI). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pixel inputs packing two 16-bit rows per dword (pack2) whose metadata
leaves the second row out (row2 = row) had no second row, so reading
its halves failed: "a packed input half no element holds". The second
row is now found as the output side finds it (half_outputs): the next
16-bit row of the input signature that no input entry names, taken in
row order, after the rows the metadata does give.

translate --validate on shaders.rpf: vertex/pixel 12172 -> 12289
validated; 6 programs whose metadata names a second row still stop
there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:09:29 +00:00
github-bot closed this pull request 2026-11-26 04:09:29 +00:00
Author
Owner

@⁠Halfect on GitHub · 2026-11-24 05:33 UTC · original

I have the same local v1.0.2.1 shader archive and will investigate the 6 remaining explicit-row2 cases as a follow-up to this PR, rather than changing this branch. I’ll first reproduce them on 7139712 and inspect only the signature metadata and failing half indices needed to distinguish the case.

If the cause is separable, I’ll add a focused synthetic regression test and open a small follow-up PR stacked on this head. I’ll report counts and metadata only, without shader contents or extracted data. AI-assisted (Kimi).

**@⁠Halfect** on GitHub · 2026-11-24 05:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7123066612) I have the same local v1.0.2.1 shader archive and will investigate the **6 remaining explicit-`row2` cases** as a follow-up to this PR, rather than changing this branch. I’ll first reproduce them on `7139712` and inspect only the signature metadata and failing half indices needed to distinguish the case. If the cause is separable, I’ll add a focused synthetic regression test and open a small follow-up PR stacked on this head. I’ll report counts and metadata only, without shader contents or extracted data. AI-assisted (Kimi).
Author
Owner

@⁠Halfect on GitHub · 2026-11-24 05:44 UTC · original

Opened the follow-up as #621, stacked on this head: #621

The explicit-row2 padding fix turns all 6 remaining failures into validated modules: VS/PS emitted 12,389 → 12,395, validated 12,289 → 12,295, with 6 gained and 0 lost across 25,889 matched labels. The inferred-partner case remains strict, and the new synthetic test covers that distinction. AI-assisted (Kimi).

**@⁠Halfect** on GitHub · 2026-11-24 05:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7123236525) Opened the follow-up as **#621**, stacked on this head: https://git.gtahub.st/github/Marvisak--VIctory/pulls/621 The explicit-`row2` padding fix turns all 6 remaining failures into validated modules: VS/PS emitted **12,389 → 12,395**, validated **12,289 → 12,295**, with **6 gained and 0 lost** across 25,889 matched labels. The inferred-partner case remains strict, and the new synthetic test covers that distinction. AI-assisted (Kimi).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 05:48 UTC · original · edited 2026-11-24 05:56 UTC

Hardware readback on 7139712 with a synthetic full-screen draw. The VS supplies three distinct TEXCOORD rows, and the translated PS reads both halves of packed channels 0 and 2. The VS and emitted PS passed the Windows SDK DXIL validator (1.8.2502.11).

Build Implicit row2 = row Explicit row2 = 2
d2a4bae Translation refused with a packed input half no element holds 16/16 pixels matched [0.125, 0.25, -5, -4]
7139712 16/16 pixels matched the adjacent row, [0.125, 0.25, 1.25, 2.5] 16/16 pixels matched [0.125, 0.25, -5, -4]

The results matched on the RTX 5090 (32.0.16.1656) and Radeon iGPU (32.0.21042.62). This covers the inferred pairing and the explicit control for this constant-varying fixture. The explicit padding cases are tracked in #621.

The same fixture also passed on #176 at f0e7745 after the triage comparison. Both adapters matched 16/16 pixels for the inferred row and the explicit control.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 05:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7123290560) · edited 2026-11-24 05:56 UTC Hardware readback on `7139712` with a synthetic full-screen draw. The VS supplies three distinct `TEXCOORD` rows, and the translated PS reads both halves of packed channels 0 and 2. The VS and emitted PS passed the Windows SDK DXIL validator (1.8.2502.11). | Build | Implicit `row2 = row` | Explicit `row2 = 2` | | --- | --- | --- | | `d2a4bae` | Translation refused with `a packed input half no element holds` | 16/16 pixels matched `[0.125, 0.25, -5, -4]` | | `7139712` | 16/16 pixels matched the adjacent row, `[0.125, 0.25, 1.25, 2.5]` | 16/16 pixels matched `[0.125, 0.25, -5, -4]` | The results matched on the RTX 5090 (32.0.16.1656) and Radeon iGPU (32.0.21042.62). This covers the inferred pairing and the explicit control for this constant-varying fixture. The explicit padding cases are tracked in #621. The same fixture also passed on #176 at `f0e7745` after the [triage comparison](https://git.gtahub.st/github/Marvisak--VIctory/issues/366). Both adapters matched 16/16 pixels for the inferred row and the explicit control.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 06:17 UTC · original

Tested offline against main d2a4bae with victory translate --list --validate over the title's shaders.rpf + executable (26,096 programs), dxil.dll 1.9.2602.17:

  • Translation failures: 3,733 on main -> 3,616 with this PR (-117, all pixel). "a packed input half no element holds" drops 172 -> 6. The freed programs mostly stop next at "a lane mask read as data" (206 -> 227) and "a 64-bit image atomic" (653 -> 663).
  • Emitted: vertex+pixel 12,284 -> 12,401 (+117, all validated), matching your count; compute and mesh unchanged.
  • Validation: 185 modules rejected on both; no program that validated on main fails now.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 06:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7123773648) Tested offline against main `d2a4bae` with `victory translate --list --validate` over the title's `shaders.rpf` + executable (26,096 programs), dxil.dll 1.9.2602.17: - Translation failures: 3,733 on main -> 3,616 with this PR (-117, all pixel). "a packed input half no element holds" drops 172 -> 6. The freed programs mostly stop next at "a lane mask read as data" (206 -> 227) and "a 64-bit image atomic" (653 -> 663). - Emitted: vertex+pixel 12,284 -> 12,401 (+117, all validated), matching your count; compute and mesh unchanged. - Validation: 185 modules rejected on both; no program that validated on main fails now. AI-assisted.
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 08:43 UTC · original

Measured on the full retail shader pack (26,503 containers) with victory translate --validate --pipelines (pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main 1f858b0. Counts are emitted / validated / pipelines.

VS/PS "packed input half no element holds"
main 12272 / 12172 / 12272 172
#621 12395 / 12295 / 12395 0
#176 12389 / 12289 / 12389 6
#592 12389 / 12289 / 12389 6

#621 clears all 172 (+123 validated pixel programs); #176 and #592 give identical results (+117, 6 left). CS and MS unchanged in all three.

**@⁠slint6614-dev** on GitHub · 2026-11-24 08:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7126492468) Measured on the full retail shader pack (26,503 containers) with `victory translate --validate --pipelines` (pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main 1f858b0. Counts are emitted / validated / pipelines. | | VS/PS | "packed input half no element holds" | |---|---|---| | main | 12272 / 12172 / 12272 | 172 | | #621 | 12395 / **12295** / 12395 | 0 | | #176 | 12389 / 12289 / 12389 | 6 | | #592 | 12389 / 12289 / 12389 | 6 | #621 clears all 172 (+123 validated pixel programs); #176 and #592 give identical results (+117, 6 left). CS and MS unchanged in all three.
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 11:04 UTC · original

Heads-up on the stack: #621 is stacked on this PR — its body says "Stacked on #592 at 35bf153; only 7e5c7c8 is new here", and since its base is main with 2 commits, merging #621 as-is would land both this change and the explicit-padding follow-up together.

I reviewed and approved #621 after rebasing it onto current main locally: merges cleanly, cargo test -p victory-shader --locked → 98 passed / 0 failed (macOS arm64). The combined diff keeps this PR's pairing logic (packed_input_half/half_input_partners) intact.

Also noting #176 (Yaekai) is an independent implementation of the same root fix (pairing pack2 fp16 inputs whose metadata leaves row2 == row), with several reviews already. So the maintainer has two routes: merge #592+#621 as a stack, or compare against #176. Either way this PR's content is covered by my #621 approval if the stack lands first.

**@⁠catminou4** on GitHub · 2026-11-24 11:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7129630933) Heads-up on the stack: **#621 is stacked on this PR** — its body says "Stacked on #592 at 35bf153; only 7e5c7c8 is new here", and since its base is `main` with 2 commits, merging #621 as-is would land both this change and the explicit-padding follow-up together. I reviewed and approved #621 after rebasing it onto current main locally: merges cleanly, `cargo test -p victory-shader --locked` → 98 passed / 0 failed (macOS arm64). The combined diff keeps this PR's pairing logic (`packed_input_half`/`half_input_partners`) intact. Also noting **#176** (Yaekai) is an independent implementation of the same root fix (pairing `pack2` fp16 inputs whose metadata leaves `row2 == row`), with several reviews already. So the maintainer has two routes: merge #592+#621 as a stack, or compare against #176. Either way this PR's content is covered by my #621 approval if the stack lands first.
Author
Owner

@⁠dpalacios69 on GitHub · 2026-11-24 15:07 UTC · original

Independent check on Linux, merged onto current main (ffe310e) in a scratch branch: textually clean, cargo test -p victory-shader --locked passes (97 passed, 0 failed, 1 ignored, the new test included), cargo clippy -p victory-shader --lib has no warnings. --all-targets shows only the two unused-import warnings in emit/mod.rs that main already has on Linux. No GPU run. AI-assisted; no game data.

**@⁠dpalacios69** on GitHub · 2026-11-24 15:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7135510020) Independent check on Linux, merged onto current `main` (`ffe310e`) in a scratch branch: textually clean, `cargo test -p victory-shader --locked` passes (97 passed, 0 failed, 1 ignored, the new test included), `cargo clippy -p victory-shader --lib` has no warnings. `--all-targets` shows only the two unused-import warnings in `emit/mod.rs` that `main` already has on Linux. No GPU run. AI-assisted; no game data.
Author
Owner

@⁠pablogonz12 on GitHub · 2026-11-24 16:20 UTC · original

Measured on Linux (RX 9070 XT, RADV/Mesa 26.3.1, GE-Proton11-14, vkd3d-proton master), head 35bf153 merged onto our tree:

  • full archive under Wine (26,503 containers): vertex+pixel 13144 -> 13271 (+127), compute 2228 and mesh 8395 unchanged; "a packed input half no element holds" 166 -> 0.
  • the released programs fail later (a lane mask read as data 281 -> 310 and similar), which looks like the expected next class, not a regression.
  • offline world set (751) unchanged at 684; all 684 SPIR-V valid (dxil-spirv + spirv-val); cargo test -p victory-shader --lib 114 pass, only the known failure.
    Not tested: in-game on this branch; native Windows.
**@⁠pablogonz12** on GitHub · 2026-11-24 16:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7137516420) Measured on Linux (RX 9070 XT, RADV/Mesa 26.3.1, GE-Proton11-14, vkd3d-proton master), head 35bf153 merged onto our tree: - full archive under Wine (26,503 containers): vertex+pixel 13144 -> 13271 (+127), compute 2228 and mesh 8395 unchanged; "a packed input half no element holds" 166 -> 0. - the released programs fail later (`a lane mask read as data` 281 -> 310 and similar), which looks like the expected next class, not a regression. - offline world set (751) unchanged at 684; all 684 SPIR-V valid (dxil-spirv + spirv-val); `cargo test -p victory-shader --lib` 114 pass, only the known failure. Not tested: in-game on this branch; native Windows.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 16:28 UTC · original

An independent count of what this blocks, measured on main ffe310e with my own copy of package 1.0.2.1 (title build b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93), on a second machine. Command: victory translate <shaders.rpf> --validate --list.

  • 166 distinct pixel programs carry this reason (167 report lines: 1 program's report prints across two physical lines, which repeat a count by lines without meaning 167 programs). No other stage is affected.
  • By family: 49 PS_MirrorPedTextured_Eight, 45 PS_PedTextured_Eight_Decals, 28 PS_PedTexturedCutOutTint_Zero, 12 PS_DeferredPedTexturedNC_Packed, 10 PS_PedAlphaPrepass_Fire, 10 PS_PedAlphaTransmission_Fire, 10 PS_Textured_Eight_Fire, 1 PS_DeferredTexturedStdFireColor, 1 PS_DeferredTexturedStdFireNC. Your "mostly ped and mirror-reflection pixel shaders" matches the top of this list.
  • I do not get 172, and I can't close the 6-program difference. Two candidates: the line-vs-program counting above, and main having moved since you measured. Worth settling before a fix lands so the before/after number means the same thing twice.

What the code path allows, reading emit/lower.rs: the reason is produced at exactly one place, lower.rs:5543, reached only through the _f16 branch (lower.rs:5511, lower.rs:5541-5543), and every None comes from packed_half (lower.rs:291-307) or from the non-packed branch at lower.rs:5522. That gives four routes:

  1. half index >= na but < a_halves — padding inside the first row's own extent.
  2. row2 == row, so no partner row is offered (lower.rs:5508).
  3. half index >= extent(b) — the named partner row declares fewer channels than the interpolation reads.
  4. fp16 set, pack2 clear, and the attribute asks for the upper half (lower.rs:5522, high decoded at gfx10/fields.rs:565).

Routes 2 and 3 are what #176, #592 and #621 describe, and I read #176 and #592 as the same pairing fix described twice (half_inputs and half_input_partners), so I don't know which one is intended. Route 1 with an inferred partner is the one #592's "why not just read 0" argument is about. Route 4 I don't see in any of the three. I cannot tell how my 166 split across the routes without printing each program's declared rows and channels.

One thing that may help whoever implements #621: this same function already reads a missing half as zero for a flat input. In the mode == 1 branch, lower.rs:5547-5549 builds self.s.m.i32(0) and applies half(self, h)?.unwrap_or(z) for both halves, while the _f16 branch refuses the identical None. So "the padding reads as zero" is already the behaviour of one of the two paths, and the difference between them is only which one the program asks for. Also measured on the same run: the neighbouring refusals of this function never fire on this package — a 16-bit read of a 32-bit input, 32-bit interpolation of a 16-bit input, one input interpolated two ways, an input the signature lacks, a non-provoking vertex value and pull-model interpolation are all 0 — while the first half of an interpolation (lower.rs:5555) is 29, which is a separate gap.

If any of #176, #592 or #621 lands, I can run the same census before and after on a clean worktree and report which families unlock and how many, the way I did for #878.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 16:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7137713284) An independent count of what this blocks, measured on main `ffe310e` with my own copy of package 1.0.2.1 (title build `b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93`), on a second machine. Command: `victory translate <shaders.rpf> --validate --list`. - **166 distinct pixel programs** carry this reason (167 report lines: 1 program's report prints across two physical lines, which repeat a count by lines without meaning 167 programs). No other stage is affected. - By family: 49 `PS_MirrorPedTextured_Eight`, 45 `PS_PedTextured_Eight_Decals`, 28 `PS_PedTexturedCutOutTint_Zero`, 12 `PS_DeferredPedTexturedNC_Packed`, 10 `PS_PedAlphaPrepass_Fire`, 10 `PS_PedAlphaTransmission_Fire`, 10 `PS_Textured_Eight_Fire`, 1 `PS_DeferredTexturedStdFireColor`, 1 `PS_DeferredTexturedStdFireNC`. Your "mostly ped and mirror-reflection pixel shaders" matches the top of this list. - I do not get 172, and I can't close the 6-program difference. Two candidates: the line-vs-program counting above, and main having moved since you measured. Worth settling before a fix lands so the before/after number means the same thing twice. What the code path allows, reading `emit/lower.rs`: the reason is produced at exactly one place, `lower.rs:5543`, reached only through the `_f16` branch (`lower.rs:5511`, `lower.rs:5541-5543`), and every `None` comes from `packed_half` (`lower.rs:291-307`) or from the non-packed branch at `lower.rs:5522`. That gives four routes: 1. half index `>= na` but `< a_halves` — padding inside the first row's own extent. 2. `row2 == row`, so no partner row is offered (`lower.rs:5508`). 3. half index `>= extent(b)` — the named partner row declares fewer channels than the interpolation reads. 4. `fp16` set, `pack2` clear, and the attribute asks for the upper half (`lower.rs:5522`, `high` decoded at `gfx10/fields.rs:565`). Routes 2 and 3 are what #176, #592 and #621 describe, and I read #176 and #592 as the same pairing fix described twice (`half_inputs` and `half_input_partners`), so I don't know which one is intended. Route 1 with an inferred partner is the one #592's "why not just read 0" argument is about. Route 4 I don't see in any of the three. I cannot tell how my 166 split across the routes without printing each program's declared rows and channels. One thing that may help whoever implements #621: this same function already reads a missing half as zero for a flat input. In the `mode == 1` branch, `lower.rs:5547-5549` builds `self.s.m.i32(0)` and applies `half(self, h)?.unwrap_or(z)` for both halves, while the `_f16` branch refuses the identical `None`. So "the padding reads as zero" is already the behaviour of one of the two paths, and the difference between them is only which one the program asks for. Also measured on the same run: the neighbouring refusals of this function never fire on this package — `a 16-bit read of a 32-bit input`, `32-bit interpolation of a 16-bit input`, `one input interpolated two ways`, `an input the signature lacks`, `a non-provoking vertex value` and `pull-model interpolation` are all 0 — while `the first half of an interpolation` (`lower.rs:5555`) is 29, which is a separate gap. If any of #176, #592 or #621 lands, I can run the same census before and after on a clean worktree and report which families unlock and how many, the way I did for #878. Written with an AI assistant.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 16:41 UTC · original

Following up on my count with a probe that says which missing-half case each read actually hits. The probe is local and small: a guarded eprintln! at the one failure site (emit/lower.rs:5543, enabled by an environment variable) that prints the row, channel, high flag, the half index being asked for, pack2, the partner row, and the extent of both rows as the signature was built. Same commit (ffe310e), same copy of the package, nothing else changed. As a control I re-ran the whole pack with the probe in place: the census's own totals are byte-for-byte the same as without it (emit 3436, I/O 207, resources 360, validator 162, this reason 166), so the probe is not changing what gets refused.

First, a correction to my own note. The 167th line is not a wrapped report. The census ends with one line per reason, shaped <count> <label>: <reason> (e.g. <one example program>), and that line itself matches a search for the reason text. The census publishes its own table: it states 166 for this reason, which is the figure I gave. Per-reason numbers are best read from that footer; counting lines for a reason comes out one higher for every reason.

With the probe, the 166 programs make 1048 failing half-reads, and they land on exactly two of the four routes I listed:

  • 828 — the partner is a real second row: the metadata names one, and the read asks for a half beyond what that row covers. That is the case #621 describes.
  • 220 — partner = None: the metadata names no second row for that input at all. That is the case the inferred pairing in this PR and in #176 supplies.

Nothing landed on the other two routes. No read asked for a half in the padding of its own row (want >= na and want < a_halves), no read referenced an input row missing from the built signature, and no read was the upper half of an fp16 input without pack2. So on this package there are only two shapes, and by reads the named-but-short partner is about four times as common as the absent partner.

Two limits, stated plainly. These are reads, not programs: a program makes several such reads, and the lowering has no program name in scope, so I cannot say how the 166 split between the two cases or which families sit on which side. And this is a pre-fix number. My reading of the three changes is that once this PR lands, the 220 should disappear and the 828 should be what is left standing - which would make the remaining question exactly #621's. I can measure that on the merged result the same way I did for #878 and #877, on a clean worktree, before and after.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 16:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7138052917) Following up on my count with a probe that says which missing-half case each read actually hits. The probe is local and small: a guarded `eprintln!` at the one failure site (`emit/lower.rs:5543`, enabled by an environment variable) that prints the row, channel, `high` flag, the half index being asked for, `pack2`, the partner row, and the extent of both rows as the signature was built. Same commit (`ffe310e`), same copy of the package, nothing else changed. As a control I re-ran the whole pack with the probe in place: the census's own totals are byte-for-byte the same as without it (emit 3436, `I/O` 207, resources 360, validator 162, this reason 166), so the probe is not changing what gets refused. First, a correction to my own note. The 167th line is not a wrapped report. The census ends with one line per reason, shaped `<count> <label>: <reason> (e.g. <one example program>)`, and that line itself matches a search for the reason text. The census publishes its own table: it states **166** for this reason, which is the figure I gave. Per-reason numbers are best read from that footer; counting lines for a reason comes out one higher for every reason. With the probe, the 166 programs make **1048 failing half-reads**, and they land on exactly two of the four routes I listed: - **828** — the partner is a real second row: the metadata names one, and the read asks for a half beyond what that row covers. That is the case #621 describes. - **220** — `partner = None`: the metadata names no second row for that input at all. That is the case the inferred pairing in this PR and in #176 supplies. Nothing landed on the other two routes. No read asked for a half in the padding of its own row (`want >= na` and `want < a_halves`), no read referenced an input row missing from the built signature, and no read was the upper half of an `fp16` input without `pack2`. So on this package there are only two shapes, and by reads the named-but-short partner is about four times as common as the absent partner. Two limits, stated plainly. These are reads, not programs: a program makes several such reads, and the lowering has no program name in scope, so I cannot say how the 166 split between the two cases or which families sit on which side. And this is a pre-fix number. My reading of the three changes is that once this PR lands, the 220 should disappear and the 828 should be what is left standing - which would make the remaining question exactly #621's. I can measure that on the merged result the same way I did for #878 and #877, on a clean worktree, before and after. Written with an AI assistant.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:25 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Second rows of packed 16-bit pixel inputs: superseded by main's first-fit packing rule (packed_half in emit/lower.rs, 13091f6e), which needs no partner row.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/592#issuecomment-7148503696) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Second rows of packed 16-bit pixel inputs: superseded by main's first-fit packing rule (packed_half in emit/lower.rs, 13091f6e), which needs no partner row. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/Marvisak--VIctory!592
No description provided.