Skip to content

Stop TestProbeGating asserting a tier the mapping check is meant to upgrade - #9029

Merged
danielhanchen merged 3 commits into
mainfrom
fix-probe-gating-static-tier
Aug 17, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
fix-probe-gating-static-tier

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

Two tests in TestProbeGating fail standalone on main:

tests/test_transformers_version.py::TestProbeGating::test_version_field_probe_stays_default_when_default_parses
  assert get_transformers_tier("org/new") == "default"
E AssertionError: assert '530' == 'default'

tests/test_transformers_version.py::TestProbeGating::test_version_field_probe_escalates_when_default_fails
E AssertionError: assert '530' == '550'

They are not wrong about the probe. They are wrong about the model_type.

What actually happens

get_transformers_tier consults CONFIG_MAPPING_NAMES per tier and upgrades a model_type the ambient default does not ship. That is deliberate, and it says so:

Transformers tier 530 selected for org/new (config mapping: model_type absent below)
# A model_type absent from an overlay's mapping can't load there. Parse each sidecar's
# config map and pick the lowest tier that ships it. Only upgrades default, never lowers.
_config_mapping_cache: dict[str, frozenset[str]] = {}

Both tests pinned model_type: "brandnew", which no mapping ships. Driving it directly:

mapping cache pre: {}
Transformers tier 530 selected for org/new (config mapping: model_type absent below)
tier: 530
mapping cache post: {'default': 421, '530': 1}

So the static mapping tier upgraded to 530 before the version-field probe under test ever ran. The assertions were measuring the wrong thing, and they were green only when an earlier test had left _config_mapping_cache populated in a way that skipped that path. That is why they pass in the suite's serial order and fail on their own.

Source is correct here; the tests are. Nothing about the upgrade behaviour changes.

Fix

Use a model_type the ambient default does ship, so the probe rather than the mapping upgrade is what the assertions measure.

setup_method also now clears _config_mapping_cache. It clears five caches and missed the sixth, which is exactly what let an unrelated test decide this one's answer.

I checked which half does the work rather than assuming:

standalone result
main 2 failed, 5 passed
cache clear only (old model_type) 3 failed, 4 passed
model_type only (no clear) 7 passed
both (this PR) 7 passed

The clear is not the fix, and on its own it makes things worse: a third test was leaning on the same stale mapping. It is kept because with the corrected model_type all seven pass and the class stops depending on what ran before it.

Whole file: 5 failed -> 3 failed. The remaining three are a pre-existing TestDamagedLatestSidecarRepairHandoff group, unrelated to this change and failing identically on unmodified main.

Which PR, and which side is wrong

these two tests #6550 (2026-06-22)
the CONFIG_MAPPING_NAMES tier #7043 (2026-07-11)

#7043 is right and is not reverted. Routing by the real mapping beats the hardcoded tables it replaced, and raising a model_type the ambient default does not ship is the point of it. What #7043 missed is that it now answers before the version-field probe, so the two tests written against that probe stopped reaching it. They were correct when written and became wrong under a later, correct source change.

Robustification, and the real gap

Nothing pinned the ordering #7043 introduced. Had it been pinned, #7043 would have had to update these two tests instead of silently changing what they measure.

A new test asserts that a model_type the default lacks is answered by the mapping and never reaches the probe. Both halves were mutation-checked:

mutation failure
mapping short-circuit disabled a model_type the default lacks must be raised, got 'default'
probe moved above the mapping the mapping check must answer before any sidecar probe runs

Standalone: 2 failed, 5 passed -> 8 passed.

One consequence worth stating: after #7043 the version-field probe is only reachable for a model_type the default mapping does ship, because a brand-new one is caught by the branch above it. So llama is not a weakening of the original scenario, it is the only input domain where the code under test is still live.

Found while measuring whether the backend suite can run under pytest-xdist: these two fail on a runner under -n 4 and pass serially, for exactly this reason.

…pgrade

Two tests in TestProbeGating fail standalone on main:

  assert get_transformers_tier("org/new") == "default"
  AssertionError: assert '530' == 'default'

Which PR introduced it, and which side is wrong:

  #6550 (2026-06-22) added these two tests, pinning model_type "brandnew"
  #7043 (2026-07-11) added the CONFIG_MAPPING_NAMES tier, three weeks later

#7043 is right, and is not reverted here. Routing by the real mapping beats the
hardcoded tables it replaced, and raising a model_type the ambient default does
not ship is the point of it. What #7043 missed is that it now answers BEFORE the
version-field probe, so the two tests written against that probe stopped reaching
it. "brandnew" is in no mapping, so the mapping check returns 530 and the probe
never runs. They were correct when written and became wrong under a later,
correct source change.

They kept passing because _config_mapping_cache is module-global and other tests
populate it, so in the suite's serial order the mapping check found a state that
skipped the upgrade. Alone, or on an xdist worker, it does not.

Fixed by pinning a model_type the ambient default does ship, which is the only
input domain where the probe is still reachable, so the assertions measure the
probe again rather than the branch above it.

setup_method also now clears _config_mapping_cache: it cleared five caches and
missed the sixth. That is not the fix; with it and the old model_type the class
goes from two failures to three, because a third test leaned on the same stale
mapping.

Robustification, and the real gap: NOTHING pinned the ordering #7043 introduced.
Had it been pinned, #7043 would have had to update these two tests instead of
silently changing what they measured. A new test asserts that a model_type the
default lacks is answered by the mapping and never reaches the probe. Both halves
were mutation-checked:

  mapping short-circuit disabled -> "a model_type the default lacks must be raised"
  probe moved above the mapping  -> "the mapping check must answer before any
                                     sidecar probe runs"

  before (standalone): 2 failed, 5 passed
  after  (standalone): 8 passed

Whole file: 5 failed -> 3 failed, the remaining 3 a pre-existing
TestDamagedLatestSidecarRepairHandoff group unrelated to this.
@danielhanchen
danielhanchen force-pushed the fix-probe-gating-static-tier branch from 18e5e9f to bd51a7d Compare August 17, 2026 01:10
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 895ad2f8a8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member Author

CI triage for this PR: the one real failure is not from this change.

Repo tests (CPU) fails on tests/studio/test_multi_chat_prompt_queue_contract.py::test_composer_only_queues_behind_the_current_chat, which is the identical single failure on main and on every other PR in this batch. #9026 repairs that test against the queueing refactor and touches nothing else, so this goes green once that merges.

Everything else reported as failing is cancelled, not failed: superseded runs under concurrency.cancel-in-progress, which gh pr checks renders as a failure.

@danielhanchen
danielhanchen merged commit b46cc90 into main Aug 17, 2026
32 of 35 checks passed
@danielhanchen
danielhanchen deleted the fix-probe-gating-static-tier branch August 17, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant