Skip to content

Model K: exact speedup, FP16 transfer breakpoints tabulated (-19.375 us at 1080p Q) - #286

Merged
phantoslayer21 merged 6 commits into
mainfrom
kl-K/ki-s-breakpoints
Nov 18, 2026
Merged

phantoslayer21 merged 6 commits into
mainfrom
kl-K/ki-s-breakpoints

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What changed

The three exact D3D12 tiled input shaders pack two channels directly into FP16 using transfer breakpoints. The host generates the 17,199-entry table once per process and uploads it once per context. The shaders use the existing clamp and linear calculation, with a table lookup for nonlinear rounding.

Exactness

  • The independent CPU oracle checked all 70,439,396 reachable nonlinear FP32 codes, all 65,536 FP16 inputs, and every production table entry. It caught a one-code breakpoint mutation.
  • Native D3D12 matched main and the reference across all 600 frames per shape at odd dimensions, 1080p Q, and 1440p Q. Six saved frames per shape matched byte for byte. The GPU mutant diverged on frame 0.
  • All 32 direct runs matched the reference FNV hashes. The DXIL comparison found changes in the three exact tiled input shaders. RGA reported 64 VGPRs for the direct kernel with zero scratch and spills.
  • All 20 CPU and kernel-set tests passed. The softmax source digest was current.

Timing on 841aac17 (#285)

Each shape ran four paired ABBA/BAAB blocks of 1,500 frames per run in one session.

Shape Median B−A Max A/A Timing floor
1080p Q −19.375 µs 3 µs 6 µs
1440p Q −32.5 µs 3.5 µs 7 µs

The evidence records are kept off-repo by the maintainer.

Review fixes

  • Model K checks the generated S table against the FNV-1a digest of the exhaustively proven dump. A mismatch selects the pre-breakpoint exact tiled S shaders and adds a create note. Developer builds can exercise this with k_s_breakpoints_test=mismatch.
  • Unittest now runs the exhaustive CPU proof. FP contraction controls are scoped to the generator, tiled frames require a valid table on the packed path, and the dead approximate branch was removed.
  • All 34 CPU and kernel-set tests passed. All 159 existing DXIL hashes were preserved, and the three fallback shaders matched their pre-breakpoint DXIL hashes.
  • Production and forced fallback matched all 600 native frames per shape at odd, 1080p Q and 1440p Q. Six saved frames per shape matched byte for byte. Both routes matched the direct REFS FNVs 1b975fbba17891e3 at 1080p Q and 5fb3d1ab49ad8f90 at 1440p Q.

The timing re-check used two paired ABBA/BAAB blocks per shape, with 1,500 frames per run against rt-main-841a.

Shape Median B−A Block deltas (µs) Max A/A Timing floor
1080p Q −18.5 µs −18.5, −18.5 1.5 µs 5 µs
1440p Q −32.5 µs −32.25, −32.75 1 µs 5 µs

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 18, 2026 22:44
@phantoslayer21
phantoslayer21 merged commit c4b9b0d into main Nov 18, 2026
10 checks passed
@phantoslayer21
phantoslayer21 deleted the kl-K/ki-s-breakpoints branch November 18, 2026 22:50
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.

1 participant