Repository navigation
refactor(stage1): remove Pass 2's production imports of Pass 1 (#1191) - #1212
Merged
milindsrivastava1997 merged 2 commits intoNov 4, 2026
Merged
milindsrivastava1997 merged 2 commits into
milindsrivastava1997 merged 2 commits into
Conversation
- Pass 2's rewrite helpers return a private CseError instead of Pass 1's PerComputationCandidateError, which loses TooManyCandidates (only Pass 2 produced it). Recompose wraps SchemaDerivationError directly. - column_ref, exact_family and partitions_over move to a crate-private ir_construction module both passes use. - rolled_up builds its Sum/Min/Max exact accumulator inline instead of calling Pass 1's exact_accumulator. - pass_layering walks each pass recursively and forbids pass2 -> pass1 too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
requested changes
Nov 4, 2026
Contributor
|
In the PR body, could you also list out the error enum per pass? so we can check the coverage. Thanks! |
) Review on #1212: the helpers both passes share are IR operations, and column_ref was duplicated. - Field::column_ref replaces ir_construction::column_ref and the copies in schema/topk.rs and pass1's schema_column_ref. - FieldDataType::exact replaces exact_family. - Reduction::partitions_over replaces partitions_over, with a unit test. - ir_construction is deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
approved these changes
Nov 4, 2026
milindsrivastava1997
deleted the
1191-stage-1-remove-pass-2s-production-imports-of-pass-1
branch
November 4, 2026 16:53
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.
Closes #1191. Follows #1096.
Why
Pass 1 no longer imports Pass 2 (#1192), but Pass 2 still imported Pass 1's error type and two of its helpers, so the passes were not independent modules.
What / how
asap_aware_cse) return a new crate-privateCseErrorwith the three variants they use. No code matches its variants: callers stringify it intoPass2RuleError, drop the candidate, or call.ok().PerComputationCandidateErrorlosesTooManyCandidates, which only Pass 2 produced.ErrorBuildingLogicalASAPDagsFromChosenCandidates::RecomposewrapsSchemaDerivationError, the only error it ever held.Field::column_ref,FieldDataType::exactandReduction::partitions_over.Field::column_refalso replaces two copies of the same logic: inline inschema/topk.rs, and Pass 1'sschema_column_ref.rolled_up: it builds its Sum/Min/Max exact accumulator inline (reads the value column, no item,UnknownOrSigned) and keeps Pass 1's check that the column resolves. Pass 1'sexact_accumulatorbuilds the same node for this case, but it would have pulled ~300 lines and Pass 1's error type into a shared module.tests/pass_layering.rs: walks each pass's directory recursively, matchespass1::/pass2::in production lines, and now tests both directions.Error enums per pass
PerComputationCandidateErrorStructure,AssignedPhysicalAnnotation,ContainsAsap,InvalidAccuracy,InvalidChoice,Unsupported(this PR removesTooManyCandidates)CandidatePopulationErrorRootDependenciesChanged,InvalidTarget,InvalidAbsorptionPerComputationLogicalMemoCandidatesErrorPerComputation,Population,Sizing(wraps the two above andSchemaDerivationError)Pass2RuleErrorMismatchedGroups,InvalidGroupReference,TooManyGroups,CyclicDependencies,AlreadyExpanded,ScanLabelWidening,StateConfiguration,ReuseRuleErrorBuildingLogicalASAPDagsFromChosenCandidatesNoSuchCandidate,ChildNotInCandidate,Cycle,Recompose(this PR changes its payload toSchemaDerivationError)CseError(new)Structure,Unsupported,TooManyCandidatesThe rules turn a
CseErrorinto text insidePass2RuleError(ReuseRule,StateConfiguration,ScanLabelWidening), or drop the candidate.Before this PR
After this PR
Both
pass1_does_not_import_pass2andpass2_does_not_import_pass1pass. Test modules may still use the other pass to build fixtures.Key code interfaces added / modified
PerComputationCandidateError::TooManyCandidatesremoved.ErrorBuildingLogicalASAPDagsFromChosenCandidates::Recomposenow holdsSchemaDerivationError. No caller in the workspace matched either.Field::column_ref,FieldDataType::exactandReduction::partitions_overare new.CseErroris new. Pass 1'sschema_column_refis removed.Major algorithm changes
None.
Snapshot changes
None.
Testing
partitions_over_matches_keys_by_columnin asap-types.rollup_from_a_finer_exact_sumandextrema_and_integer_counts_roll_upcover the inline accumulator. Making it returnNonefails 5 rollup tests.Out of scope
Splitting the passes into separate crates (#1209).
🤖 Generated with Claude Code