From d4278b1cc9eec7b9415312de04efc9c9a5328b5d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2026 21:37:26 +0000 Subject: [PATCH 1/6] xgrammar: Add versions 0.2.5, 0.2.5.post1, 0.2.6, 0.2.7 Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- docs/packages/xgrammar.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/packages/xgrammar.yaml b/docs/packages/xgrammar.yaml index cc4a3766bc..f47d124d75 100644 --- a/docs/packages/xgrammar.yaml +++ b/docs/packages/xgrammar.yaml @@ -17,3 +17,7 @@ versions: - filename: xgrammar-0.2.4-cp314-cp314t-manylinux_2_39_riscv64.whl sha256: 91dc671fc07eb89bf5640b4c63c102b3e9390f7e81ad9b10a008e9cef39d0530 requires-python: <4,>=3.8 +- version: 0.2.5 +- version: 0.2.5.post1 +- version: 0.2.6 +- version: 0.2.7 From cecdb1f79a460bdeef9fa46505acd5ba655c2bfc Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 18 Sep 2026 13:04:29 +0000 Subject: [PATCH 2/6] xgrammar: fix test install failing on cohere_melody (no riscv64 wheel) The test extra pulls in cohere_melody==0.13.0, a Rust/maturin package with no riscv64 wheel anywhere; its sdist also fails to build (needs a working cargo toolchain), so `pip install [test]` fails outright and every cp312/cp313/cp314 job dies before running a single test. Only cp314t passed because CIBW_TEST_SKIP already skips its test phase. Drop CIBW_TEST_EXTRAS in favor of listing the rest of upstream's test extra by hand (minus cohere_melody), and deselect the MELODY-tagged parametrized cases that need it via `-k "not MELODY"`. --- .github/workflows/build-xgrammar.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-xgrammar.yml b/.github/workflows/build-xgrammar.yml index 544494953c..d4d803ca97 100644 --- a/.github/workflows/build-xgrammar.yml +++ b/.github/workflows/build-xgrammar.yml @@ -100,9 +100,19 @@ jobs: # (pytest {project}/tests -m "not hf_token_required"), but omit the # hf_token_required marker filter: conftest.py already auto-skips those # tests when no HF_TOKEN is present, so it's redundant here and we get - # a cleaner "SKIP" record instead of "not collected". - CIBW_TEST_COMMAND: pytest {project}/tests -vvs - CIBW_TEST_EXTRAS: test + # a cleaner "SKIP" record instead of "not collected". Deselect the + # MELODY-tagged cases: they need cohere_melody, dropped below. + CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY" + # Override test-extras = ["test"]: that pulls in cohere_melody, a + # Rust/maturin package with no riscv64 wheel anywhere and an sdist + # that itself fails to build (needs a working cargo toolchain in the + # build venv). An empty CIBW_TEST_EXTRAS does cancel test-extras + # (unlike CIBW_BEFORE_TEST, gotcha 336), so list the rest of the + # test extra by hand instead; sentencepiece unconditionally, since + # pyproject's python_version < '3.10' branch never applies to this + # matrix. + CIBW_TEST_EXTRAS: '' + CIBW_TEST_REQUIRES: "huggingface-hub[cli] protobuf pytest sentencepiece tiktoken" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: From 7abd2d6366be78a9f86fc4335f4646e6b1a22af4 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sat, 19 Sep 2026 06:08:24 +0000 Subject: [PATCH 3/6] xgrammar: deselect test_json_schema_style_deepseek_xml_format on 0.2.5/0.2.5.post1 CI failed all interpreters for both versions with 21 identical AssertionErrors comparing generated grammar strings. Diffing tests/python/test_structural_tag_converter.py between v0.2.5 and v0.2.6 upstream shows the test's expected_grammar fixture was corrected in 0.2.6 (root_0 is missing a whitespace-token pair around a TagDispatch field at 0.2.5/0.2.5.post1's pinned tags) - a deterministic mismatch between the tag's own converter output and its own test fixture, unrelated to riscv64. Deselect just that test for those two versions, mirroring the existing MELODY deselection. --- .github/workflows/build-xgrammar.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-xgrammar.yml b/.github/workflows/build-xgrammar.yml index d4d803ca97..21ded5aa59 100644 --- a/.github/workflows/build-xgrammar.yml +++ b/.github/workflows/build-xgrammar.yml @@ -101,8 +101,15 @@ jobs: # hf_token_required marker filter: conftest.py already auto-skips those # tests when no HF_TOKEN is present, so it's redundant here and we get # a cleaner "SKIP" record instead of "not collected". Deselect the - # MELODY-tagged cases: they need cohere_melody, dropped below. - CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY" + # MELODY-tagged cases: they need cohere_melody, dropped below. On + # 0.2.5/0.2.5.post1 only, also deselect + # test_json_schema_style_deepseek_xml_format: its expected_grammar + # fixture doesn't match what that tag's own converter emits (an + # extra pair of whitespace tokens around a TagDispatch field is + # missing), independent of platform; the fixture was corrected in + # v0.2.6 (see tests/python/test_structural_tag_converter.py diff + # between those tags). + CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format' || '' }}" # Override test-extras = ["test"]: that pulls in cohere_melody, a # Rust/maturin package with no riscv64 wheel anywhere and an sdist # that itself fails to build (needs a working cargo toolchain in the From 240c88c33a38b0de100336b9312fcbe582335221 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sat, 19 Sep 2026 10:21:59 +0000 Subject: [PATCH 4/6] xgrammar: also deselect test_json_schema_style_minimax_xml_format on 0.2.5/0.2.5.post1 Same fixture-mismatch class as test_json_schema_style_deepseek_xml_format (a missing pair of whitespace tokens around a TagDispatch field), fixed upstream in v0.2.6. CI on 0.2.5.post1 cp312 failed with this AssertionError. --- .github/workflows/build-xgrammar.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-xgrammar.yml b/.github/workflows/build-xgrammar.yml index 21ded5aa59..dd3147a9a1 100644 --- a/.github/workflows/build-xgrammar.yml +++ b/.github/workflows/build-xgrammar.yml @@ -103,13 +103,14 @@ jobs: # a cleaner "SKIP" record instead of "not collected". Deselect the # MELODY-tagged cases: they need cohere_melody, dropped below. On # 0.2.5/0.2.5.post1 only, also deselect - # test_json_schema_style_deepseek_xml_format: its expected_grammar - # fixture doesn't match what that tag's own converter emits (an + # test_json_schema_style_deepseek_xml_format and + # test_json_schema_style_minimax_xml_format: their expected_grammar + # fixtures don't match what those tags' own converters emit (an # extra pair of whitespace tokens around a TagDispatch field is - # missing), independent of platform; the fixture was corrected in + # missing), independent of platform; the fixtures were corrected in # v0.2.6 (see tests/python/test_structural_tag_converter.py diff # between those tags). - CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format' || '' }}" + CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format and not test_json_schema_style_minimax_xml_format' || '' }}" # Override test-extras = ["test"]: that pulls in cohere_melody, a # Rust/maturin package with no riscv64 wheel anywhere and an sdist # that itself fails to build (needs a working cargo toolchain in the From 7666858870f7fef14bcfbf1bf505b0a0e459176e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sat, 19 Sep 2026 17:29:14 +0000 Subject: [PATCH 5/6] xgrammar: also deselect qwen xml-format tests on 0.2.5/0.2.5.post1 test_json_schema_style_qwen_xml_format and test_qwen_parameter_xml_format hit the same expected_grammar fixture bug as the deepseek/minimax cases (missing whitespace tokens around a TagDispatch field), fixed upstream in v0.2.6. Confirmed via diff of tests/python/test_structural_tag_converter.py between the v0.2.5.post1 and v0.2.6 tags, and against the actual CI failure in run 35437211313 (all six 0.2.5/0.2.5.post1 legs). --- .github/workflows/build-xgrammar.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-xgrammar.yml b/.github/workflows/build-xgrammar.yml index dd3147a9a1..ec7733204f 100644 --- a/.github/workflows/build-xgrammar.yml +++ b/.github/workflows/build-xgrammar.yml @@ -103,14 +103,16 @@ jobs: # a cleaner "SKIP" record instead of "not collected". Deselect the # MELODY-tagged cases: they need cohere_melody, dropped below. On # 0.2.5/0.2.5.post1 only, also deselect - # test_json_schema_style_deepseek_xml_format and - # test_json_schema_style_minimax_xml_format: their expected_grammar - # fixtures don't match what those tags' own converters emit (an - # extra pair of whitespace tokens around a TagDispatch field is - # missing), independent of platform; the fixtures were corrected in - # v0.2.6 (see tests/python/test_structural_tag_converter.py diff - # between those tags). - CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format and not test_json_schema_style_minimax_xml_format' || '' }}" + # test_json_schema_style_deepseek_xml_format, + # test_json_schema_style_minimax_xml_format, + # test_json_schema_style_qwen_xml_format and + # test_qwen_parameter_xml_format: their expected_grammar fixtures + # don't match what those tags' own converters emit (an extra pair + # of whitespace tokens around a TagDispatch field is missing), + # independent of platform; the fixtures were corrected in v0.2.6 + # (see tests/python/test_structural_tag_converter.py diff between + # those tags). + CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format and not test_json_schema_style_minimax_xml_format and not test_json_schema_style_qwen_xml_format and not test_qwen_parameter_xml_format' || '' }}" # Override test-extras = ["test"]: that pulls in cohere_melody, a # Rust/maturin package with no riscv64 wheel anywhere and an sdist # that itself fails to build (needs a working cargo toolchain in the From 8dd9cd437af2efc31d6e70b5c1f5b9e3337e59fc Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 20 Sep 2026 07:19:02 +0000 Subject: [PATCH 6/6] xgrammar: also deselect test_any_order_qwen_xml on 0.2.5/0.2.5.post1 test_any_order_qwen_xml (test_json_schema_converter.py) hits the same expected_grammar fixture bug as the deepseek/minimax/qwen structural-tag cases already deselected: its root_part_0/root_item fixtures place whitespace tokens around the bare xml_string TagDispatch field that the 0.2.5/0.2.5.post1 converter doesn't actually emit there, fixed upstream in v0.2.6. Confirmed via the actual CI failure in run 35461372110 (job 105946014837). To stop this whack-a-mole pattern, did a full sweep instead of another single-test patch: shallow-cloned mlc-ai/xgrammar at v0.2.5.post1 and v0.2.6 and diffed every tests/python/*.py file referencing "qwen_xml" or "TagDispatch" grammar fixtures for hunks touching qwen_xml/TagDispatch/ xml_string. Every other diff in those files traces to either the v0.2.6 converter rewrite adding \r to the whitespace char class (unrelated, cosmetic) or the general "direct AST construction" rewrite loosening exact-match assertions to structural ones (also unrelated) -- none of it is this same missing/misplaced-whitespace-around-xml_string bug. So the five tests now deselected (the four already there plus test_any_order_qwen_xml) are the complete set affected by this bug; no further tests should need adding for it. --- .github/workflows/build-xgrammar.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-xgrammar.yml b/.github/workflows/build-xgrammar.yml index ec7733204f..4c515c0dcf 100644 --- a/.github/workflows/build-xgrammar.yml +++ b/.github/workflows/build-xgrammar.yml @@ -105,14 +105,20 @@ jobs: # 0.2.5/0.2.5.post1 only, also deselect # test_json_schema_style_deepseek_xml_format, # test_json_schema_style_minimax_xml_format, - # test_json_schema_style_qwen_xml_format and - # test_qwen_parameter_xml_format: their expected_grammar fixtures - # don't match what those tags' own converters emit (an extra pair - # of whitespace tokens around a TagDispatch field is missing), - # independent of platform; the fixtures were corrected in v0.2.6 - # (see tests/python/test_structural_tag_converter.py diff between - # those tags). - CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format and not test_json_schema_style_minimax_xml_format and not test_json_schema_style_qwen_xml_format and not test_qwen_parameter_xml_format' || '' }}" + # test_json_schema_style_qwen_xml_format, + # test_qwen_parameter_xml_format and test_any_order_qwen_xml: their + # expected_grammar fixtures don't match what those tags' own + # converters emit (a pair of whitespace tokens around a + # TagDispatch xml_string field is missing or misplaced), + # independent of platform; the fixtures were corrected in v0.2.6. + # This is the full set of test functions affected by this fixture + # bug: confirmed exhaustively by diffing tests/python/*.py between + # the v0.2.5.post1 and v0.2.6 tags of mlc-ai/xgrammar and checking + # every hunk that touches qwen_xml/TagDispatch/xml_string fixtures + # (see tests/python/test_structural_tag_converter.py and + # tests/python/test_json_schema_converter.py diffs between those + # tags) -- no other test function has this bug. + CIBW_TEST_COMMAND: pytest {project}/tests -vvs -k "not MELODY${{ (matrix.version == '0.2.5' || matrix.version == '0.2.5.post1') && ' and not test_json_schema_style_deepseek_xml_format and not test_json_schema_style_minimax_xml_format and not test_json_schema_style_qwen_xml_format and not test_qwen_parameter_xml_format and not test_any_order_qwen_xml' || '' }}" # Override test-extras = ["test"]: that pulls in cohere_melody, a # Rust/maturin package with no riscv64 wheel anywhere and an sdist # that itself fails to build (needs a working cargo toolchain in the