fix(gpu): stop the float_adm twins applying adm_csf_scale in Watson mode, and align its aliases with the CPU - #1373
Draft
lusoris wants to merge 6 commits into
Draft
Conversation
lusoris
pushed a commit
that referenced
this pull request
Sep 6, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/float-adm-csf-scale-mode0-and-aliases
branch
from
September 7, 2026 06:54
4c50030 to
da88e82
Compare
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/float-adm-csf-scale-mode0-and-aliases
branch
from
September 7, 2026 09:14
da88e82 to
f0658ff
Compare
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/float-adm-csf-scale-mode0-and-aliases
branch
from
September 7, 2026 09:17
f0658ff to
a023cac
Compare
lusoris
pushed a commit
that referenced
this pull request
Sep 7, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/float-adm-csf-scale-mode0-and-aliases
branch
from
September 7, 2026 10:18
a023cac to
9bc52d0
Compare
…ode, and align its aliases with the CPU In the only CSF mode the CUDA/SYCL/HIP/Metal float_adm twins support (adm_csf_mode == 0, Watson-97), the CPU reference adm_tools.c::adm_csf_rfactor_s sets rfactor = 1 / dwt_quant_step(...) and does not consult adm_csf_scale / adm_csf_diag_scale at all — those two options only enter the Barten branch (mode 1). All four twins multiplied them into the rfactor anyway, so a non-default scale changed the GPU score while the CPU ignored it; the CUDA comment asserted the opposite of what adm_tools.c does. The CUDA, SYCL and HIP option tables also declared the two options under the aliases "cs" / "cds" with max 100, where the CPU float_adm (and Metal) use "scf" / "scfd" with max 50. Because ADR-1183 derives feature names from the alias when an option is non-default, the CPU emitted *_scf_2 while the GPU emitted *_cs_2 for the same request — different keys for one feature. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…derived feature name Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s base Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the derived feature name Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…lias invariant Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lusoris
force-pushed
the
fix/float-adm-csf-scale-mode0-and-aliases
branch
from
September 7, 2026 11:13
9bc52d0 to
db53586
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related drifts in the CUDA/SYCL/HIP/Metal
float_admtwins, found by the twin-drift sweep (ids 58–61, 67, 94–97) and confirmed against the source before any code was touched.Semantics (ADR-1214). The only CSF mode the twins support is
adm_csf_mode == 0(Watson-97). In that mode the CPU referenceadm_tools.c::adm_csf_rfactor_scomputesrfactor = 1 / dwt_quant_step(...)and never readsadm_csf_scale/adm_csf_diag_scale— they're arguments of the Barten branch (mode 1) only. All four twins multiplied them into every rfactor:The CUDA comment beside it claimed this "matches the CPU Watson-mode path" — the opposite of what
adm_tools.cdoes. Soadm_csf_scale=2.0doubled the GPU's CSF weights while the CPU ignored it.Naming. CUDA/SYCL/HIP aliased the options
cs/cdswithmax 100; the CPU (and Metal) usescf/scfd,max 50. ADR-1183 derives feature names from aliases, so one request producedadm2_scf_2on the CPU andadm2_cs_2on the GPU — two keys for one feature.Verified, Netflix 576x324 pair,
adm_csf_scale=2.0:adm2scf=2adm2_scf_2adm2_scf_2(wasadm2_cs_2)adm2_scf_2adm2_scf_2i.e. the option is now a no-op on the twins exactly as on the CPU, under the CPU's key.
Gates added: each backend's
float_admparity test gains a_csf_scalecase that setsadm_csf_scale=2.0, adm_csf_diag_scale=0.5and reads the scores back under the derived keyadm2_scfd_0.5_scf_2(options sorted by name,%gvalues) — so both the arithmetic and the naming are asserted. CUDA 2/2, SYCL 2/2, HIP 3/3 on RTX 4090 / Arc A380 / gfx1030.Type
fix— bug fixtest— test-only (new gates)sycl/cuda/simd— backend-specificChecklist
make format && make lintis green locally (pre-commit run --filesclean;check-state-md-rowsOK; ADR index in sync).meson test -C build— the touched targets on all three local backends, listed above./cross-backend-diffand the worst ULP is ≤ 2 — equivalent done directly: CPU vs each twin at the option value is identical to the default-path delta each twin already had..c/.h— no new source files.cs=/cds=now gets an unknown-option error; those aliases never matched the CPU, so no model that worked on both backends can be affected.docs/adr/_index_fragments/— in sync.Bug-status hygiene (ADR-0165)
docs/state.mdupdated —T-GPU-FLOAT-ADM-CSF-SCALE-WATSON-MODE-2026-09-07closed.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Deep-dive deliverables (ADR-0108)
## Alternatives consideredin ADR-1214 (including changing the CPU instead, dropping the options from the twins, and porting Barten).AGENTS.mdinvariant note — added tocore/src/feature/AGENTS.md.changelog.d/fixed/float-adm-csf-scale-watson-mode-and-aliases.md.docs/rebase-notes.md, "ADR-1214 — Watson-mode CSF rfactors and the float-ADM option aliases".Reproducer
On
masterthe CUDA line prints a different value than its default under the keyadm2_cs_2; on this branch it prints its default value underadm2_scf_2, matching the CPU's key.Known follow-ups
adm_p_normis accepted but hard-coded to 3 in the kernels, and thatadm_bypass_cm/adm_skip_scale0are advertised but not honoured (ids 98–104). Separate defects, separate PR.🤖 Generated with Claude Code