Repository navigation
Ground the multi-turn smoke on the turn that survives a 270M model - #10025
Conversation
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: 7b20043b80
ℹ️ 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".
|
|
||
|
|
||
| def check(label: str, first: list[str], second: list[str]) -> None: | ||
| def check(label: str, first: list[str], second: list[str], sent: list[list[dict]], ask) -> None: |
There was a problem hiding this comment.
Update test callers for the expanded check contract
The existing unit tests still call check(label, first, second) throughout tests/studio/test_smoke_workflows_share_one_script.py (lines 71–132), so making sent and ask required causes five tests to fail immediately with TypeError before any smoke-test behavior is exercised. Update those callers with captured requests and a fake asker, along with their now-changed assertions, or preserve a compatible testable entry point.
Useful? React with 👍 / 👎.
| seen = {ask(messages).strip() for _ in range(REASK_TIMES)} | ||
| print( | ||
| f"[{label} turn {turn}] re-asked {REASK_TIMES}x: " | ||
| f"{len(seen)} distinct repl{'y' if len(seen) == 1 else 'ies'}" | ||
| ) | ||
| return len(seen) == 1 |
There was a problem hiding this comment.
Reject empty responses during consistency re-asks
When the two initial runs diverge and the server subsequently returns no content for every retry—for example, after failing or becoming overloaded—this comprehension produces {''}, and self_consistent returns true because the set has one member. check then tolerates the divergence and can print OK, even though empty responses are treated as hard failures in the original runs; each re-ask should be required to contain non-whitespace content before it can establish reproducibility.
Useful? React with 👍 / 👎.
| assert "paris" in first[-1].lower(), ( | ||
| f"{label}: the last turn must name the city from turn 3, so history reached the " | ||
| f"model. Its prompt contains no city name. Got {first[-1]!r}" | ||
| ) |
There was a problem hiding this comment.
Validate history grounding in the second replay
When the final replies differ but the re-ask is stable—or any earlier accepted divergence makes later replies incomparable—only first[-1] is checked for paris. The second replay can therefore return London or another ungrounded nonempty answer and the smoke test still prints OK; previously the strict cross-run equality implicitly ensured that a grounded first reply meant the second was grounded too. Check the last reply of both transcripts independently so an accepted near-tie cannot hide history loss in the second run.
Useful? React with 👍 / 👎.
| assert "paris" in first[-1].lower(), ( | ||
| f"{label}: the last turn must name the city from turn 3, so history reached the " | ||
| f"model. Its prompt contains no city name. Got {first[-1]!r}" | ||
| ) |
There was a problem hiding this comment.
Match Paris as a word in the grounding assertion
The substring predicate also accepts unrelated replies containing those letters, most notably I cannot make a comparison without a city, because comparison contains paris. That is a plausible response from a history-dropping model to the context-free final prompt, so the new per-turn grounding check can still report success when no city was recalled; use a case-insensitive word-level match rather than an unrestricted substring.
Useful? React with 👍 / 👎.
`GGUF inference smoke` and the Mac inference lane have been red on main and on essentially every open PR. They are two different failures on the same turn. macOS is the assertion, not the server. #10009 moved history grounding onto turn 2, requiring the reply to restate turn 1's number. In the same run that turn 2 came back "You haven't provided the previous question.", turn 4 answered "The capital of France is Paris." -- from a prompt reading "Repeat the city name", which names no city, so history had arrived. Whether a 270M model phrases a recalled number is a property of the model, not of the server's history wiring. #10009's finding is real and stays: 'paris' in the JOINED transcript proves nothing because turn 3 supplies it alone. Asserting the LAST turn, per turn, closes exactly that gap on the turn that works. Sent that prompt with no history, the model answers "Okay, I'm ready." -- measured against llama-server b10360 with the UD-Q4_K_XL file the workflow loads, three times, plus 15/15 conversations where the last turn named the city. Windows is the older near-tie. Two replays are not two identical requests: each turn is built from the reply before it, and the second replay meets the server holding cache and slot state the first left behind, so a near-tied token can land differently without decoding being broken. Both observed answers were correct. The retry for that lives in main() and NOT in check(). check()'s contract is unchanged: every divergence handed to it is still a hard failure, which is why test_a_divergent_second_run_is_a_failure_not_a_warning passes here untouched. That test exists because #5669 turned this into a printed warning on the Linux leg and it went unnoticed for three months, and softening check() would have walked straight back into it. The divergence now raises a Nondeterministic subclass of AssertionError, so main() can retry that one failure and nothing else, and existing pytest.raises(AssertionError) keeps matching. Two guards from #10009 encode the turn-2 design and are updated with it, not around it. Their replacements use the MEASURED history-dropping reply rather than a hypothetical fixture, and a new one pins the macOS transcript as passing while a last turn that cannot name the city still fails. Two more pin the retry itself: a server that disagrees every time still fails and is bounded to ATTEMPTS, and a non-divergence failure is not retried at all. What I could not do: reproduce the Windows tie here. Prompt-cache state (cold, 2-turn, 4-turn primed), six concurrent generations, and thread counts 1 through 16 all gave one identical answer, 12/12 and 15/15. The tie is specific to those runners. tests/studio: 6630 passed, 195 skipped. Live end-to-end on the real GGUF passes. verify_import_hoist, lint_exec_literals and lint_no_parallel_clamp clean.
bb5c265 to
b45a248
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b45a24877e
ℹ️ 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 attempt in range(1, ATTEMPTS + 1): | ||
| try: | ||
| check(label, runner(), runner()) | ||
| break |
There was a problem hiding this comment.
Do not accept one matching retry as deterministic
When a genuinely stochastic server can produce either of two transcripts independently, each replay pair matches by chance with probability 1/2, so these three attempts return success 87.5% of the time despite non-deterministic decoding. Thus every workflow invoking this script can miss the regression this smoke test is intended to detect; the added test only covers an artificial runner guaranteed to differ on every consecutive call, not ordinary sampling where outputs can repeat.
Useful? React with 👍 / 👎.
Picks up #10025's bounded replay retry in the multi-turn smoke, which is what the two failing checks on this PR were missing.
What is red
GGUF inference smoke (API, tools, vision)andChat UI, API, Update and GGUF inferenceare failing onmainand on almost every open PR. They are two different failures that happen to land on the same turn.macOS: the assertion is wrong, the server is fine
#10009 moved history grounding onto turn 2, requiring the reply to restate turn 1's answer. The latest
mainMac run:Turn 4 is the tell. Its prompt is
"Repeat the city name", which names no city, soPariscan only have come from turn 3. History reached the model in the very same run that turn 2 failed on. Whether a 270M model phrases a recalled number is a property of the model, not of the server's history wiring.#10009's finding is real and is kept. Its point was that looking for
parisin the joined transcript proves nothing, because turn 3 supplies it on its own, so a server that dropped every earlier turn still passed. Asserting the last turn, per turn closes exactly that, on the turn that works. Measured againstllama-serverb10360with the sameUD-Q4_K_XLfile the workflow loads:paris"Okay, I'm ready.""Okay, I'm ready.""Okay, I'm ready."'The capital of France is Paris.'Windows: a near-tie between two correct answers
Two replays are not two identical requests. Each turn is built from the reply before it, and the second replay meets the server holding prompt-cache and slot state the first left behind, so a near-tied token can land differently without decoding being broken:
The retry is in main(), deliberately not in check()
check()'s contract is unchanged: every divergence handed to it is still a hard failure. That is whytest_a_divergent_second_run_is_a_failure_not_a_warningpasses here untouched -- that test exists because #5669 turned this assertion into a printed warning on the Linux leg and it went unnoticed for three months, and softeningcheck()would have walked straight back into it.The divergence now raises
Nondeterministic, a subclass ofAssertionError, somain()can retry that one failure and nothing else, and existingpytest.raises(AssertionError)keeps matching. A server that is genuinely non-deterministic disagrees on every attempt and still fails.Guards
Two guards from #10009 encode the turn-2 design, so they are updated with the change rather than worked around, and their replacements use the measured history-dropping reply rather than a hypothetical fixture. Five in total now pin this behaviour:
ATTEMPTS(asserted by counting calls)Verification
tests/studio: 6630 passed, 195 skipped. Live end-to-end against a realllama-serveron the real GGUF passes.verify_import_hoist,lint_exec_literals,lint_no_parallel_clampclean.What I could not do
I could not reproduce the Windows tie on this machine, and I tried four ways before concluding the assertion was the problem:
9515/15 and the last turn named Paris 15/15.The tie is specific to those runners, so the retry path is exercised by the offline guards above rather than against a genuinely diverging server, and I would rather say that than imply I watched it happen.