[codex] Unify GPU renderer FMA detection#72
Merged
Conversation
Move the duplicated ADD(MUL(a, b), c) scan into render::detect_fma_pattern while keeping renderer-specific dtype narrowing and source rendering in CUDA/HIP/MSL/OpenCL/WGSL. This lands the hand-picked signal from the stale PR71 branch without its merge-history baggage. Proof: git diff --check rc=0; tools/check_rustfmt.py --changed rc=0; proof queue 20260706T160717-pr71-clean-molt-gpu-clippy-20260706-9c2e0b62796b46fb cargo clippy -p molt-gpu --all-targets --all-features -- -D warnings rc=0 elapsed=43.8s.
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.
Clean signal-only cherry-pick from stale PR #71. This branch is current origin/main plus one exact commit (749a706) touching only the six renderer files.\n\nWhat changed:\n- Adds render::detect_fma_pattern as the single shared ADD(MUL(a, b), c) detector.\n- Keeps target-specific dtype admission and source rendering in CUDA, HIP, MSL, OpenCL, and WGSL.\n- Deletes the five duplicated local detector scans.\n\nProof:\n- git diff --check: rc=0\n- uv run --active --no-sync --project . --python 3.12 python tools/check_rustfmt.py --changed: rc=0\n- proof queue 20260706T160717-pr71-clean-molt-gpu-clippy-20260706-9c2e0b62796b46fb: cargo clippy -p molt-gpu --all-targets --all-features -- -D warnings rc=0 elapsed=43.8s\n\nSupersedes stale draft PR #71 without force-updating that branch.