Repository navigation
studiobench: do not fail UI parity on repetitions that swap two renderings - #11772
Conversation
…rings The parity verdict on #11756 (run 35949769378) failed on four stable pairs, delete_message and thread_reopen at r100K, in both repetitions. The two repetitions held the same two renderings with the arms swapped: rep0's (base, head) captures are rep1's (head, base) captures, field for field. The extra 2012 and 2022 characters of scaffold are the attachment chip image_upload leaves in the composer when it reaches its 800ms slot, and which cells reached it was a race (base missed, head ran, head missed, base ran). The null control shows one build rendering both states. corroborated() already refuses to let two one-arm failures that blame opposite arms corroborate each other, but treated a digest difference as having no direction. swapped_between_arms() now finds a differing pair whose two renderings another repetition of the same action and rung holds on the opposite arms, compared exactly on every capture field, and report() prints those as UNCORROBORATED instead of counting them. The null audit scope and the evidence step apply the same predicate so all three agree. A consistent difference, or a real change on top of the race, does not line up as a swap and still fails. Captures without a digest and --min-reps 1 are scored as before.
|
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ded45d9db5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if any(c != cell and (b, t) == (treat, base) for _j, c, b, t in group): | ||
| out.add(i) |
There was a problem hiding this comment.
Pair swapped observations one-to-one
When a run contains more than two repetitions, one reversed pair causes every matching forward pair to be classified as swapped because each satisfies this any(...). For example, with --min-reps 2, three repetitions producing (R1, R2) and one producing (R2, R1) are all removed before corroboration, so the command passes even though the same build difference appeared three times and only one observation reversed. Match swaps one-to-one, or otherwise leave enough same-direction observations for corroborated() to enforce the requested threshold.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, existence matching let one reversal excuse every same-direction repetition. Fixed in 6df3295: swaps are matched one-to-one, each reversal excusing exactly one observation in the other direction, and the rest go to corroborated() as before. Your example (three (R1, R2), one (R2, R1)) now leaves two firm repetitions; that test fails on the previous commit. Two forwards against two reversals are still all swaps. studiobench suite: 1625 passed.
A differing pair was excused whenever any other repetition held its reverse, so three repetitions of (R1, R2) against one (R2, R1) were all excused and a difference seen three times passed. Each reversal now excuses exactly one observation in the other direction; the rest go to corroborated() as before, so the example above leaves two firm repetitions.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6df329502d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for j, c, b, t in sorted(group, key = lambda e: (e[1], e[0])): | ||
| if j not in used and j != i and c != cell and (b, t) == (treat, base): | ||
| used.update((i, j)) |
There was a problem hiding this comment.
Deduplicate reversal observations before matching
When the input contains the same reversed repetition in multiple shards, this loop can consume each duplicate as a separate partner. For example, three distinct (R1, R2) repetitions plus (R2, R1) for rep3 duplicated in two shards marks four rows as swapped, leaving only one forward repetition, so corroborated(..., 2) passes instead of retaining two firm differences. The fresh evidence after the one-to-one fix is that matching is one-to-one by row index rather than by the distinct cell labels that corroborated() treats as observations; deduplicate or otherwise consume each (cell, direction) only once.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, matching went by row while corroborated() counts distinct repetitions. Fixed in 36dce57: swaps are matched on distinct (repetition, direction) observations, and all rows of a matched observation are excused together. Your example (three forward repetitions, one reversal carried by two shards) now excuses the reversal and one forward repetition and leaves two firm; a forward repetition in two shards is excused whole. Both tests fail on the previous commit. studiobench suite: 1627 passed.
One-to-one by row let a reversed repetition carried by two shards partner two forward repetitions, while corroborated() counts it once. Swaps are now matched on distinct (repetition, direction) observations, and every row of a matched observation is excused together, so the duplicate leaves two firm forward repetitions in Codex's example.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36dce5799b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| observations: dict[tuple[str, str, str], list[int]] = collections.defaultdict(list) | ||
| for i, cell, base, treat in group: | ||
| observations[(cell, base, treat)].append(i) |
There was a problem hiding this comment.
Match each repetition at most once
When one cell appears in multiple shards with opposite outcomes, keying observations by (cell, base, treat) allows that single repetition to participate in two swap matches. For example, rep0 recorded as both A→B and B→A, plus rep1 A→B and rep2 B→A, marks all four rows swapped and the gate passes, even though corroborated() treats rep0 as only one observation and one direction should remain firm across two distinct cells. The fresh evidence beyond the prior duplicate-shard fix is this contradictory-direction duplicate: deduplicate or reject ambiguity by cell before matching so a repetition can be consumed only once.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, a repetition could still join two matches through opposite-direction duplicates. Fixed in f135d38: the repetition is now the unit. It takes part in at most one swap, and a repetition that holds more than one outcome pair (shards that disagree, as in your example) is never excused. Your example now excuses only rep1 and rep2 and leaves rep0 as a difference; that test fails on the previous commit. studiobench suite: 1629 passed.
Keying observations on (repetition, direction) let a repetition recorded by two shards in opposite directions join two swaps, excusing a difference seen in two other repetitions. A repetition is now the unit: it takes part in at most one swap, and one that holds more than one outcome pair (shards that disagree) is never excused.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…rings (unslothai#11772) * studiobench: do not fail UI parity on repetitions that swap two renderings The parity verdict on unslothai#11756 (run 35949769378) failed on four stable pairs, delete_message and thread_reopen at r100K, in both repetitions. The two repetitions held the same two renderings with the arms swapped: rep0's (base, head) captures are rep1's (head, base) captures, field for field. The extra 2012 and 2022 characters of scaffold are the attachment chip image_upload leaves in the composer when it reaches its 800ms slot, and which cells reached it was a race (base missed, head ran, head missed, base ran). The null control shows one build rendering both states. corroborated() already refuses to let two one-arm failures that blame opposite arms corroborate each other, but treated a digest difference as having no direction. swapped_between_arms() now finds a differing pair whose two renderings another repetition of the same action and rung holds on the opposite arms, compared exactly on every capture field, and report() prints those as UNCORROBORATED instead of counting them. The null audit scope and the evidence step apply the same predicate so all three agree. A consistent difference, or a real change on top of the race, does not line up as a swap and still fails. Captures without a digest and --min-reps 1 are scored as before. * studiobench parity: match swapped repetitions one-to-one A differing pair was excused whenever any other repetition held its reverse, so three repetitions of (R1, R2) against one (R2, R1) were all excused and a difference seen three times passed. Each reversal now excuses exactly one observation in the other direction; the rest go to corroborated() as before, so the example above leaves two firm repetitions. * studiobench parity: match swaps by observation, not row One-to-one by row let a reversed repetition carried by two shards partner two forward repetitions, while corroborated() counts it once. Swaps are now matched on distinct (repetition, direction) observations, and every row of a matched observation is excused together, so the duplicate leaves two firm forward repetitions in Codex's example. * studiobench parity: each repetition joins at most one swap Keying observations on (repetition, direction) let a repetition recorded by two shards in opposite directions join two swaps, excusing a difference seen in two other repetitions. A repetition is now the unit: it takes part in at most one swap, and one that holds more than one outcome pair (shards that disagree) is never excused.
Problem
studiobench UI parity("Parity verdict, scored against the null") failed on #11756 (run 35949769378). #11756 only touched the Images, Video and Audio model pickers, not the chat thread. Four "stable actions differing" were reported:The run's payloads show an exact swap for both actions. Every capture field of rep0 base equals rep1 head, and rep0 head equals rep1 base, with only the screenshot name differing:
delete_message9ea715e4/9ba6cced1ae73903/47d0503athread_reopen2c3f79b2/d63bc8635308ec3e/b5e3f91fThe style-probe digests swap too, and every message row is identical across the four cells.
The extra ~2000 characters come from
image_upload, which runs two actions earlier inside an 800 ms slot. In the cells where that slot was reached, its attachment chip was still in the composer, and the composer sits inside the digested thread root. The screenshots show the chip on exactly the larger side, and across all 8 cells of the result and null-control payloads the larger scaffold appears exactly whenimage_uploadran.Which cells reached the slot was a race. The arms run in ABBA order, and the result run went: base missed, head ran, head missed, base ran. Each build rendered both states, so the difference belongs to neither build.
corroborated()still counted it as one difference seen in two repetitions, because it treats a digest difference as having no direction. It already applies the opposite reasoning to one-arm failures that blame opposite arms.Fix
The changes are in
tests/studio/studiobench/sweep/ui_parity.py:rendering_of(capture)builds an exact identity for one arm's capture from every rendering field: digests, messages, overlays, styles, mount counts and run state. It returnsNonewhen a capture has no digest.compare_allkeeps each pair's two renderings.swapped_between_arms(results, min_reps)excuses a differing pair only when another repetition of the same action and rung holds the same two renderings, entire, on the opposite arms. It is an exact match, not a size-sign heuristic, so a treatment that changes anything else breaks the match and the pair is scored as before. A repetition can never be its own partner, and the check is off atmin_reps <= 1.report()prints those pairs as "swapped between arms" in an UNCORROBORATED block rather than failing on them, and still counts them as compared.actions_needing_an_excuse) andparity_shots.differing_actionsapply the same check, so the audit and the evidence screenshots agree with the verdict.The cost is stated in the docstring. A real change that makes each build render the other's state in some repetition cannot be told from this race at two repetitions, so it is reported as UNCORROBORATED instead of failing.
The underlying carry-over is not changed here: the attachment surviving past
image_uploadinto later actions' captures. It is a separate question for the harness.Tests
selftest/test_studiobench_swapped_parity.pyhas 17 tests. They use trimmed copies of the two CI payloads (testdata/pr11756_{result,null}.payload.jsonl.gz), which give the same verdict text as the full payloads.--min-reps 1, behave exactly as before.Sabotage:
pytest tests/studio/studiobench -n 8: main 1606 passed, this branch 1623 passed.