test(verify): sweep a configuration into the variants a parity run needs - #8388
Open
kz930 wants to merge 7 commits into
Open
test(verify): sweep a configuration into the variants a parity run needs#8388kz930 wants to merge 7 commits into
kz930 wants to merge 7 commits into
Conversation
An operator is configured by a form, and the form is generated from the descriptor's own annotations. The same annotations are enough to fill it without a human: an enum offers its constants, a column knob takes a column of the type its rule allows, a numeric knob its declared bounds, and a conditional field is filled only where the branch that shows it is taken. This is one file because it is one decision made repeatedly — what a knob may hold — and splitting it would put half of that decision on either side of a boundary. `@SampleColumn` names the column a knob means where a type cannot say it: the opening price among four numbers, the country code among several strings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A candlestick reads four prices and the day they belong to, which a type cannot tell apart; a choropleth reads a country code the same way, and a value to shade it by that a type rule does narrow. Both are what the annotation and the rule are for. These read operators that land before this change does, so they belong here rather than being added back afterwards. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The generator did two jobs in one file: derive a valid configuration for an operator from the annotations it already carries, and sweep that configuration into the variants a parity run needs. At two thousand lines it was the largest change in the export series and the only one that could not be read in one sitting. This change leaves the first job. The sweep follows as its own change on top of it, restoring the members verbatim. The two jobs share no member. The base pass reaches its values through buildObject, decide and valueFor; the sweep reaches its own through rowFills, columnFill and leafFill, and the four entry points that return variants are the only callers of either. Nothing was rewritten to make the seam: whole members moved out, and every line that stays is the line that was there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
One configuration exercises one path through an operator. A parity run wants more than that: every value an enum offers, the optional knobs a default leaves empty, and a text knob carrying a value that breaks a Python literal if it was spliced rather than escaped. This adds the sweep on top of the generator that derives the configuration. Four entry points return variants: one for an operator configured from its annotations, and three for a hand-written fixture, which needs them more, since the configuration it pins is otherwise the only one its operator ever runs. The sweep moves one knob at a time rather than crossing them, so a failure names the knob that caused it. The exceptions are the two variants that move every knob of a kind at once, where bisecting by hand costs less than a run per field: all optional knobs filled together, and all free-text knobs carrying the hostile value together, numbered so no two knobs carry the same text. The four tests read the entry points rather than the members behind them: an enum offered once per value, a boolean flipped in a variant of its own, an optional knob the base leaves empty and this fills, and two free-text knobs that come out holding different text. Every member here was in the change before this one and is restored verbatim. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8388 +/- ##
============================================
- Coverage 94.11% 94.10% -0.02%
- Complexity 4811 4858 +47
============================================
Files 1197 1203 +6
Lines 48813 48967 +154
Branches 5906 5930 +24
============================================
+ Hits 45939 46079 +140
+ Misses 1420 1419 -1
- Partials 1454 1469 +15
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`variantsOf` swept an already-configured op for its enums alone. Every caller wants the optional and hostile-text variants with them, which is the entry point beside it, so this one was never called. Its scaladoc explained itself by contrast with that one, so the explanation moves there rather than going with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The optional-scalar fill repeated, sentence for sentence, why the column fill beside it exists. It points there instead. The pointer helper's one-line description said what its one-line body says. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What changes were proposed in this PR?
One configuration exercises one path through an operator. A parity run wants
more than that: every value an enum offers, the optional knobs a default leaves
empty, and a text knob carrying a value that breaks a Python literal if it was
spliced rather than escaped.
This adds the sweep on top of the generator that derives the configuration. Four
entry points return variants: one for an operator configured from its
annotations, and three for a hand-written fixture, which needs them more, since
the configuration it pins is otherwise the only one its operator ever runs.
The sweep moves one knob at a time rather than crossing them, so a failure names
the knob that caused it. The exceptions are the two variants that move every
knob of a kind at once, where bisecting by hand costs less than a run per field:
all optional knobs filled together, and all free-text knobs carrying the hostile
value together, numbered so no two knobs carry the same text. Two knobs sharing
one value is not a smaller version of the same test. Where both name an output
column, it writes the same column twice and the run fails for a reason that has
nothing to do with escaping.
Any related issues, documentation, discussions?
Part of #8325, which lists the set in order. This is the second half of the
seventeenth entry, and #8361 is the first. The two are one Scala object, so this
branch carries that one's commit as well: the sweep does not compile without the
members it defines. Until #8361 merges the file view here shows both halves, and
once it does this narrows to the sweep on its own. The last commit is the sweep,
and it is the one to read.
How was this PR tested?
Four tests read the entry points rather than the members behind them: an enum
offered once per value with each variant labelled by the knob it moved, a
boolean flipped in a variant of its own, an optional knob the base leaves empty
and this fills, and two free-text knobs that come out holding different text.
The sweep is exercised end to end once the last pieces of the set land, when
every operator runs through the engine and through its generated script and the
two answers are compared. These four cover it in the meantime, and they name the
knob rather than the operator when they fail.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)