Roll out complex contract validation#7
Merged
Conversation
These were iteration planning documents written for implementation sessions and are not intended as user-facing design references. The PR description covers the contract and rollout summary. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- cubecl-cpp Conj: dispatch on Elem enum instead of stringified form and make the fallback unreachable so non-complex types cannot emit make_cuDoubleComplex by accident. - cubecl-cpp format_const: unreachable fallback for Complex values with non-complex element types (same rationale). - cubecl-cpp IsNan/IsInf: drop the complex branches. These ops are already rejected by the complex contract validation, and the lowering path must be unreachable for complex types to match the advertised surface. - cubecl-cpu Complex constants: switch from unimplemented! to unreachable! to make the validation-first invariant explicit. - cubecl-core validation: document why scope.properties may be unset and how test authors should handle it. - cubecl-opt constant_prop: Abs on Complex constants now returns None instead of hitting unreachable!, guarding future const-eval passes that might run before validation. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- sqrt on the negative real axis exercises the branch cut handling in cubecl_sqrt (y==0 short-circuit). - tanh with moderately large |re| exercises the cosh(2x)+cos(2y) denominator before it overflows, documenting that saturation holds within the typical ML/signal-processing range. - powf(-1, 0.5) flows through the log negative-real branch and the exp(i*pi/2) rotation, pinning the expected ~i result. Each case runs for both cf32 and cf64 through the existing testgen_complex_math! dispatcher. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Sync the
codex/add-expm1-origin-mainbranch to forkmain.Mirrors upstream PR tracel-ai#1300. See that PR for full description.
Commits included beyond current fork
main54f0cdb8feat: roll out complex contract validationb8a64579Merge upstream/main (brings in upstream miri CI job ci: add job to execute miri tests in ci.yml workflow tracel-ai/cubecl#1251)fec43cffdocs: remove internal planning notes from repo1d6a6ebffix: tighten complex validation/lowering consistency4fcc1978test: add complex math edge-case regressionsFork
maincurrently only has the PR #6 merge commit beyond the branch base; this sync is linearly mergeable with no conflicts.