Repository navigation
tract-harvest-probe: check run inputs against resolved facts; Pow exponent must not grow the base - #1851
Merged
Conversation
…onent must not grow the base Codex P2 (#1850): run() bound caller inputs without checking the facts the WHEN guards held on, so X as [2,3] reached the rank-1 ReduceSum DO and was summed flat. Inputs are now refused unless they are graph inputs with the resolved dtype, rank and known dims. Codex P2: guard_pow2 checked only the exponent's values; do_pow2 ignores the exponent, so a broadcasting exponent ([1] ^ [2]) gave the wrong output shape. WHEN now also requires broadcasting e against x to leave x's shape unchanged (FALSE, or UNKNOWN for a symbolic base dim). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMMjKnig6MXTd41Lf2v
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
October 30, 2026 07:47
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Fixes the two Codex P2 findings on #1850. The fix was pushed a few minutes after #1850 merged, so it never reached
main. This PR carries only that commit (a093d65d2): 3 files incrates/tract-harvest-probe.Plan::runused to accept any value as input. A caller could passXshaped[2,3]; it reached the rank-1ReduceSumDO, which admits only rank 1, and was summed flat into a wrong scalar.runnow refuses an input unless it is a graph input with the dtype, rank and known dimensions the plan was resolved for (a symbolic dimension accepts any size). It also refuses an attempt to overwrite an initializer.Powexponent must not grow the base.guard_pow2checked only that every exponent element was 2.0.do_pow2ignores the exponent and returnsMul(x, x), so an exponent that broadcasts wider than the base ([1] ^ [2]) produced the wrong output shape. The WHEN now also requires that broadcasting the exponent against the base leaves the base shape unchanged. It is FALSE otherwise, and UNKNOWN against a symbolic base dimension.Test plan
cargo fmt,cargo clippy --release --all-targets -D warningscargo test --release --no-fail-fast -- --include-ignored: 22 passed. New:inputs_outside_the_resolved_facts_are_refusedandregistry::tests::pow2_requires_the_exponent_not_to_grow_the_base.Generated by Claude Code