Repository navigation
test(adm): hold the ADM twins' whole decouple header to the CPU on the host and record the CUDA/HIP angle-flag corner - #2359
Merged
Conversation
…e host and record the CUDA/HIP angle-flag corner (#2359) * test(adm): hold the ADM twins' whole decouple header to the CPU on the host and record the CUDA/HIP angle-flag corner test_adm_decouple_recip_{cuda,hip} compiled only decouple_r_s0() of the twins' header, so CodeQL reported the rest unused (cpp/unused-static-function, 16 alerts). The test now also holds decouple_r_s123(), get_best15_from32() and both angle flags to the CPU's over 800000 draws and the corners of the int16 range, and each executable has its own run_tests root. The corners expose a real difference: with every band at -32768 the CUDA and HIP scale-0 angle flag adds in int32 and wraps where the CPU's int64 sum does not; a 64-bit form puts adm_cm_aim_line_kernel_4 past its register budget, so the row stays open with the measurements and the test records the count. Metal's iadm_angle_flag_s0() had the same sums and is fixed. The two include-non-header findings of the device-source tests become declared exceptions.
15 of 19 tasks
lusoris
force-pushed
the
fix/codeql-adm-twin-header-tests
branch
from
October 6, 2026 20:06
91314ff to
7660b22
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
Clears 16 open CodeQL
cpp/unused-static-functionalerts (1464-1479) in the ADM twins' decouple header test by testing the rest of the header, finds a real CUDA/HIP corner on the way, and declares the twocpp/include-non-headerfindings (1463, 1488) as exceptions.test_adm_decouple_recip_{cuda,hip}compile the twins' ownadm_decouple_inline.{cuh,hip}for the host but called onlydecouple_r_s0(), so every other function of the header was "unused" in a host database (CodeQL does not extract the.cukernels). The test now also holdsdecouple_r_s123(),get_best15_from32()and both angle flags to the CPU'sadm_decouple_band_s123()/adm_angle_flag()over 400 000 draws each and the corners of the int16 range. Each executable renamesrun_tests(c_argsandcpp_args), since CodeQL merges two variants'extern "C" run_testsand then calls the other variant's helpers unreachable. On the full local database both alerts classes are gone.T-GPU-ADM-ANGLE-FLAG-S0-INT32-CORNER-2026-10-06. With every band at -32768 the CUDA and HIPdecouple_angle_flag_s0()add int16 products in int32 and wrap (2^31) where the CPU's int64 sum does not: 17 of 256 corner combinations differ, none of the random draws. Metal'siadm_angle_flag_s0()had the same sums and is fixed here (it compiles intest_metal_integer_adm_host_replay, no Apple device on this host). CUDA/HIP are not fixed: a 64-bit form putsadm_cm_aim_line_kernel_4past the ADR-1226 register budget (216 with plain int64 sums; 209 and 210 with an unsigned- 1/+ 1form, a select, and unsigned magnitudes only; 229 foradm_cm_line_kernel_8with another). The state row is open with the measurements and a decision for the owner; the test holds the 2^31-sum corners to the measured count (17) so a fix flips it, and all other corners to the CPU..config/lint-exceptions.d/codeql-include-non-header.toml:test_adm_decouple_recip.cpp(includes the device header, named byADM_TWIN_HEADER) andmetal_integer_adm_host_replay_kernels.cpp(includes the MSL source behind a host shim): the included bytes are the object under test; one file, one rule, reason, expiry 2027-06-30. After this lands the two alerts are dismissed as "won't fix" citing the entry.Verification
build-cuda, nvcc, sm list of the default build):test_adm_decouple_recip_cudaand_hip(host builds of both headers) pass 5 of 5;test_cuda_adm_cm_register_pressurepasses with the headers unchanged (it failed in all four candidate fixes above);test_cuda_adm_parityon the RTX 4090 under the lock: 12 of 12 pass. The device headers are not modified by this PR.test_adm_decouple_recip_hip.security-and-quality, cpu build with-Dcpp_std=c++23: master reproduces the hosted alerts (107 results); the stack of the code-scanning PRs 28 with nothing new;cpp/unused-static-functionreports nothing in the touched files,cpp/include-non-headeronly the two declared files.python3 scripts/ci/lint_exceptions.py checkreports 0 findings, and withLINT_EXCEPTIONS_TODAY=2027-07-01it reports both new entries expired.adm_decouple_inline.{cuh,hip}headers are not changed.Type
fix— bug fixrefactor— no behavior changeChecklist
make format && make lintis green locally — commit hooks pass./cross-backend-diff— see the body..c/.cpp/.cu/.h/.hpp— not applicable: no new native file.Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Bug-status hygiene (ADR-0165)
docs/state.mdupdated — opened T-GPU-ADM-ANGLE-FLAG-S0-INT32-CORNER-2026-10-06 (CUDA/HIP open, Metal fixed in code).Deep-dive deliverables (ADR-0108)
AGENTS.mdinvariant note —core/src/feature/{cuda,hip}/AGENTS.d/adm.md.changelog.d/fixed/adm-angle-flag-s0-int64-sums.md.docs/rebase-notes.md, "ADM twins: host test of the device decouple header".Reproducer