Skip to content

[Rust Frontend] Share SchemaRoot between argument coercion and grammars - #59408

Merged
BugenZhao merged 4 commits into
mainfrom
bz/tool-schema-view
Oct 7, 2026
Merged

BugenZhao merged 4 commits into
mainfrom
bz/tool-schema-view

Conversation

@BugenZhao

@BugenZhao BugenZhao commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Purpose

Rust tool parsers coerce raw parameter text by the tool's JSON schema (tool/parameters.rs), and argument grammars (#59395) constrain the same parameters by it, but each interpreted the schema on its own. Coercion ignored $ref: a parameter whose schema is {"$ref": "#/$defs/Place"} came back as the JSON text string "{\"city\": \"Paris\"}" instead of an object. Pydantic v2 model_json_schema(), which most SDKs use to build tool schemas, emits exactly this for nested models, enums, and Optional[Model]:

{"$defs": {"Place": {...}, "Unit": {"enum": ["celsius", "fahrenheit"], "type": "string"}},
 "properties": {"place": {"$ref": "#/$defs/Place"},
                "unit": {"$ref": "#/$defs/Unit", "default": "celsius"},
                "backup": {"anyOf": [{"$ref": "#/$defs/Place"}, {"type": "null"}], "default": null}}}

This affects every schema-coercing parser: Qwen Coder and MiMo, GLM, MiniMax M2/M3, Hy. DeepSeek DSML and Kimi K3 decode by their string=/type= labels instead. Coercion and grammars also disagreed on nullable, const, single-schema allOf, and type-name aliases such as "int", so a grammar could admit a value that the parser then decodes as another type.

The open-PR search found #50933, which resolves $ref/$defs for the Python Qwen3-Coder path; there is no Rust counterpart. Python parity is not a goal here. #59190 (the Kimi K3 full-output grammar) is stacked on this PR.

  • New schema::SchemaRoot, the tool's parameters schema that references resolve against, owns how a parameter's schema is read:
    • resolved returns the root after following local $ref chains and single-schema allOf; unresolvable, cyclic, and remote references accept any value and are never fetched;
    • options expands each reference target at most once per value, as the argument grammar walker from [Rust Frontend] Split argument grammars into schema resolution and per-model rendering #59395 already did, so shared definitions cannot blow up exponentially;
    • options splits a value schema into typed options: const/enum literals, one option per anyOf/oneOf/type-array alternative, object/array inferred from properties/items, nullable: true adding null, and aliases such as int or dict parsed to the canonical type;
    • JsonType gains Integer, since coercion distinguishes integers.
  • Argument grammars read value options from SchemaRoot instead of their own walker.
  • Coercion reads the schema one level at a time. ToolSchema keeps the parameters schema, and object and array types resolve their fields and items only when a structured value reaches them. A recursive schema therefore costs only as deep as the value; expanding it ahead of time is exponential in its branching, and a tree with two recursive children took over 60 s to build that way.
  • Kimi K3 labels values through its own xtml_type mapping, which follows _xtml_type in the checkpoint's encoding_k3.py; integers and floats are both number. Its grammar is unchanged.

Behavior changes in coercion:

  • $ref resolves at the parameter level, in nested fields and items, and inside anyOf.
  • const and single-schema allOf are understood, and enum values coerce by their own type, so "2" under {"enum": [1, 2, 3]} becomes 2.
  • Text that spells a non-string const or enum value as JSON decodes to that value before any type is tried, so 1 under {"enum": ["fast", 1]} becomes the number 1, as the argument grammar already constrains it, instead of the string "1". Text matching no literal converts as before.
  • anyOf/oneOf whose alternatives all have unknown types now falls back to the raw string, like an unknown type, instead of being treated as an object.

Behavior changes in argument grammars (Kimi K3): nullable: true admits type="null", an aliased type such as "int" constrains its value instead of dropping the parameter, and a schema with properties or items but no type admits only objects or arrays.

Test Plan

cd rust
cargo nextest run -p vllm-parser -p vllm-chat
cargo clippy --workspace --all-targets --all-features -- -D warnings
  • schema unit tests: the Pydantic schema above, unresolvable, cyclic, and remote references, aliases in type arrays, nullable, mixed enums, single allOf, and items without type.
  • Coercion tests: Pydantic-style references (including Optional taking null), recursive and branching recursive schemas converted from structured values, and integer enums.
  • Qwen Coder parse_complete with referenced parameters returns an object and an integer.

Test Result

  • vllm-parser + vllm-chat: 940 tests passed, including all 36 XGrammar replay cases; the roundtrip grammar files are unchanged.
  • Workspace Clippy and pre-commit passed.

AI assistance: implementation and validation assisted by Claude Code.

🤖 Generated with Claude Code

@BugenZhao
BugenZhao force-pushed the bz/tool-schema-view branch 2 times, most recently from 0fa9e16 to 6dc430f Compare October 1, 2026 08:33
@BugenZhao
BugenZhao changed the base branch from bz/k3-full-output-grammar to main October 1, 2026 08:33
@BugenZhao
BugenZhao added this pull request to stack #59574 October 1, 2026 08:48
@BugenZhao BugenZhao changed the title [Rust Frontend] Share tool schema views between argument coercion and grammars [Rust Frontend] Share SchemaRoot between argument coercion and grammars Oct 1, 2026
@BugenZhao
BugenZhao marked this pull request as ready for review October 1, 2026 11:53
@BugenZhao
BugenZhao requested a review from njhill as a code owner October 1, 2026 11:53

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@BugenZhao
BugenZhao force-pushed the bz/tool-schema-view branch from 74fc44b to 18790cb Compare October 7, 2026 07:07
@BugenZhao

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93249 for commit 18790cba2fa7.

@vllm-agent

vllm-agent commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

CI selector (shadow): no narrower answer, every step runs: 193 test steps (269 jobs) instead of 7 (7 jobs)

Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works.

Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.

steps (jobs) Today's rules Selector Would skip Would add
NVIDIA, CPU and others 7 (7) 193 (269) 0 (0) 186 (262)
AMD mirrors 5 (5) 161 (225) 0 (0) 156 (220)

Why: rust: rust/src/parser/src/lib.rs: root crate bucket; 16 gate-env steps + 12 hardware-image steps; + the PyO3 bridge claim (vllm/tool_parsers/rust_tool_parser.py)

Selector would run (193)
  • amd-fp8-moe-kernels-mi355
  • amd-kernels-mi355
  • amd-lm-eval-small-models-harness
  • amd-native-quantization-kernels-mi355
  • amd-qwen3-next-mtp-async-eplb-accuracy
  • arm-cpu-test ×3
  • ascend-npu-test
  • async-engine-inputs-utils-worker
  • basic-correctness ×2
  • basic-correctness-cpu-offload
  • basic-correctness-cumem
  • basic-correctness-prefetch-offload
  • basic-correctness-sleep-mode
  • basic-models-test-other-cpu
  • basic-models-tests-extra-initialization ×14
  • basic-models-tests-initialization
  • basic-models-tests-other
  • batch-invariance-b200
  • batch-invariance-h100
  • benchmarks-cli-test
  • cpu-distributed-tests-dp-tp
  • cpu-distributed-tests-pp-tp
  • cpu-kernel-tests ×2
  • cpu-language-generation-and-pooling-model-tests ×3
  • cpu-multi-modal-model-tests-n ×4
  • cpu-multimodal-config
  • cpu-params-env-tokenizers-parser
  • cpu-quantization-model-tests
  • cpu-qwen2-5-vl-multimodal-tests
  • cpu-reasoning-renderers
  • cpu-spec-decode-tests
  • cpu-tool-parsers
  • crcr-report
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • cudagraph
  • deepseek-v4-kernel-test-b200
  • deepseek-v4-kernel-test-h100
  • distributed-comm-ops
  • distributed-compile-comm-4-gpus
  • distributed-compile-rpc-tests-2-gpus
  • distributed-compile-unit-tests-2xh100
  • distributed-dp-tests-2-gpus
  • distributed-dp-tests-4-gpus
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus
  • distributed-model-tests-2-gpus ×3
  • distributed-mooncakeconnector-pd-accuracy-4-gpus
  • distributed-nixlconnector-pd-accuracy-4-gpus
  • distributed-tests-8xh100
  • distributed-torchrun-examples-4-gpus
  • distributed-torchrun-shutdown-tests-2-gpus
  • docker-build-metadata
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • e2e-core-1-gpu
  • e2e-core-large-memory
  • e2e-scheduling-1-gpu
  • e2e-scheduling-accuracy-1-gpu
  • elastic-ep-scaling-test
  • engine
  • engine-1-gpu
  • entrypoints-integration-api-server ×4
  • entrypoints-integration-api-server-generate
  • entrypoints-integration-api-server-openai-chat_completion
  • entrypoints-integration-api-server-openai-completion
  • entrypoints-integration-llm
  • entrypoints-integration-multimodal
  • entrypoints-integration-pooling
  • entrypoints-integration-responses-api
  • entrypoints-integration-speech_to_text
  • entrypoints-unit-tests
  • eplb-algorithm
  • eplb-execution
  • examples
  • extract-hidden-states-integration
  • extract-hidden-states-integration-2-gpus
  • fault-tolerance-e2e-2xh100
  • fusion-and-compile-unit-tests-2xb200
  • fusion-e2e-config-sweep-h100
  • fusion-e2e-quick-h100
  • fusion-e2e-tp2-ar-rms-config-sweep-h100
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd
  • fusion-e2e-tp2-asynctp-config-sweep-h100
  • fusion-e2e-tp2-b200
  • fusion-e2e-tp2-quick-h100
  • gemm-rs-ar-2xb200
  • glm5next-unit-tests
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus
  • inkling-unit-tests-b200
  • intel-hpu-test
  • jit-monitor-no-runtime-jit
  • kernels-attention-diffkv-test-h100
  • kernels-attention-test ×7
  • kernels-b200 ×3
  • kernels-core-operation-test ×3
  • kernels-deepgemm-test-h100
  • kernels-fla-ops-test-b200
  • kernels-flashmla-test-h100
  • kernels-fusedmoe-layer-test-2-b200s
  • kernels-fusedmoe-layer-test-2-h100s
  • kernels-helion-test ×5
  • kernels-mamba-test
  • kernels-mhc-test-b200
  • kernels-minimax-reduce-rms-test-2-gpus
  • kernels-moe-test ×5
  • kernels-quantization-test ×6
  • kernels-root-misc-test-b200
  • kimi-k3-prefix-cache-4xb200 ×2
  • kimi-k3-unit-tests-b200
  • kv-offload-large
  • kv-offload-medium
  • kv-offload-small
  • language-models-tests-extra-standard ×2
  • language-models-tests-granite-l4-compatibility
  • language-models-tests-hybrid ×2
  • language-models-tests-standard
  • lm-eval-dspark-watermark-2xh100
  • lm-eval-small-models
  • lm-eval-turboquant-k3v4nc
  • lm-eval-turboquant-k8v4
  • lm-eval-turboquant-t3nc
  • lm-eval-turboquant-t4nc
  • lm-eval-watermarking
  • lora ×4
  • lora-tp-distributed ×4
  • metrics-tracing-2-gpus
  • model-executor
  • mooncake-ec-tcp-e2e-2-gpus
  • mrcr-eval-small-models
  • multi-modal-accuracy-eval-small-models
  • multi-modal-models-standard-1-qwen2
  • multi-modal-models-standard-2-qwen3-gemma
  • multi-modal-models-standard-3-llava-qwen2-vl
  • multi-modal-models-standard-4-other-whisper
  • multi-modal-processor ×4
  • multi-modal-processor-cpu ×4
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus
  • nixlconnector-pd-edge-cases-2-gpus
  • openai-api-correctness
  • pipeline-context-parallelism-4-gpus
  • platform-tests
  • plugin-tests-2-gpus
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus
  • pytorch-compilation-dynamic-shapes
  • pytorch-compilation-passes-unit-tests
  • pytorch-compilation-unit-tests
  • pytorch-compilation-unit-tests-h100
  • pytorch-fullgraph-cudagraph-l4-compatibility
  • pytorch-fullgraph-test
  • pytorch-nightly-dependency-override-check
  • quantization ×4
  • quantized-fusions
  • quantized-models-test
  • quantized-moe-test-b200
  • qwen4-exp-unit-tests
  • qwen4-exp-unit-tests-cpu
  • ray-dependency-compatibility-check
  • rayexecutorv2-4-gpus
  • regression
  • replayssm-e2e
  • rust-frontend-cargo-style-clippy
  • rust-frontend-cargo-tests
  • rust-frontend-core-correctness
  • rust-frontend-distributed
  • rust-frontend-openai-coverage
  • rust-frontend-serve-admin-coverage
  • rust-frontend-tool-use
  • samplers-multimodal-beam-search
  • samplers-test
  • scale-out-ec-e2e-2-gpus
  • sharded-rdt-weight-transfer
  • spec-decode-draft-model ×4
  • spec-decode-eagle-1-deepseek-qwen
  • spec-decode-eagle-2-llama3-qwen-vl-other
  • spec-decode-mtp-deepseek-mimo
  • spec-decode-mtp-gemma4
  • spec-decode-mtp-qwen3-5
  • spec-decode-ngram-suffix
  • spec-decode-speculators
  • torch-stable-abi-audit
  • v1-attention-b200 ×2
  • v1-attention-h100-mi300 ×2
  • v1-core
  • v1-executor-worker
  • v1-kv-connectors ×4
  • v1-kv-offload
  • v1-logits-oracle
  • v1-metrics-lmeval
  • v1-others-cpu
  • v1-sample
  • v1-spec-decode
  • vllm-ir-tests
Would skip (today's rules run them) (0)

none

Would add (today's rules do not run them) (186)
  • amd-fp8-moe-kernels-mi355 (code map)
  • amd-kernels-mi355 (code map)
  • amd-lm-eval-small-models-harness (code map)
  • amd-native-quantization-kernels-mi355 (code map)
  • amd-qwen3-next-mtp-async-eplb-accuracy (code map)
  • arm-cpu-test ×3 (code map)
  • ascend-npu-test (code map)
  • async-engine-inputs-utils-worker (code map)
  • basic-correctness ×2 (code map)
  • basic-correctness-cpu-offload (code map)
  • basic-correctness-cumem (code map)
  • basic-correctness-prefetch-offload (code map)
  • basic-correctness-sleep-mode (code map)
  • basic-models-test-other-cpu (code map)
  • basic-models-tests-extra-initialization ×14 (code map)
  • basic-models-tests-initialization (code map)
  • basic-models-tests-other (code map)
  • batch-invariance-b200 (code map)
  • batch-invariance-h100 (code map)
  • benchmarks-cli-test (code map)
  • cpu-distributed-tests-dp-tp (code map)
  • cpu-distributed-tests-pp-tp (code map)
  • cpu-kernel-tests ×2 (code map)
  • cpu-language-generation-and-pooling-model-tests ×3 (code map)
  • cpu-multi-modal-model-tests-n ×4 (code map)
  • cpu-multimodal-config (code map)
  • cpu-params-env-tokenizers-parser (code map)
  • cpu-quantization-model-tests (code map)
  • cpu-qwen2-5-vl-multimodal-tests (code map)
  • cpu-reasoning-renderers (code map)
  • cpu-spec-decode-tests (code map)
  • cpu-tool-parsers (code map)
  • crcr-report (code map)
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • cudagraph (code map)
  • deepseek-v4-kernel-test-b200 (code map)
  • deepseek-v4-kernel-test-h100 (code map)
  • distributed-comm-ops (code map)
  • distributed-compile-comm-4-gpus (code map)
  • distributed-compile-rpc-tests-2-gpus (code map)
  • distributed-compile-unit-tests-2xh100 (code map)
  • distributed-dp-tests-2-gpus (code map)
  • distributed-dp-tests-4-gpus (code map)
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus (code map)
  • distributed-model-tests-2-gpus ×3 (code map)
  • distributed-mooncakeconnector-pd-accuracy-4-gpus (code map)
  • distributed-nixlconnector-pd-accuracy-4-gpus (code map)
  • distributed-tests-8xh100 (code map)
  • distributed-torchrun-examples-4-gpus (code map)
  • distributed-torchrun-shutdown-tests-2-gpus (code map)
  • docker-build-metadata (code map)
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • e2e-core-1-gpu (code map)
  • e2e-core-large-memory (code map)
  • e2e-scheduling-1-gpu (code map)
  • e2e-scheduling-accuracy-1-gpu (code map)
  • elastic-ep-scaling-test (code map)
  • engine (code map)
  • engine-1-gpu (code map)
  • entrypoints-integration-api-server ×4 (code map)
  • entrypoints-integration-api-server-generate (code map)
  • entrypoints-integration-api-server-openai-chat_completion (code map)
  • entrypoints-integration-api-server-openai-completion (code map)
  • entrypoints-integration-llm (code map)
  • entrypoints-integration-multimodal (code map)
  • entrypoints-integration-pooling (code map)
  • entrypoints-integration-responses-api (code map)
  • entrypoints-integration-speech_to_text (code map)
  • entrypoints-unit-tests (code map)
  • eplb-algorithm (code map)
  • eplb-execution (code map)
  • examples (code map)
  • extract-hidden-states-integration (code map)
  • extract-hidden-states-integration-2-gpus (code map)
  • fault-tolerance-e2e-2xh100 (code map)
  • fusion-and-compile-unit-tests-2xb200 (code map)
  • fusion-e2e-config-sweep-h100 (code map)
  • fusion-e2e-quick-h100 (code map)
  • fusion-e2e-tp2-ar-rms-config-sweep-h100 (code map)
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd (code map)
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd (code map)
  • fusion-e2e-tp2-asynctp-config-sweep-h100 (code map)
  • fusion-e2e-tp2-b200 (code map)
  • fusion-e2e-tp2-quick-h100 (code map)
  • gemm-rs-ar-2xb200 (code map)
  • glm5next-unit-tests (code map)
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus (code map)
  • inkling-unit-tests-b200 (code map)
  • intel-hpu-test (code map)
  • jit-monitor-no-runtime-jit (code map)
  • kernels-attention-diffkv-test-h100 (code map)
  • kernels-attention-test ×7 (code map)
  • kernels-b200 ×3 (code map)
  • kernels-core-operation-test ×3 (code map)
  • kernels-deepgemm-test-h100 (code map)
  • kernels-fla-ops-test-b200 (code map)
  • kernels-flashmla-test-h100 (code map)
  • kernels-fusedmoe-layer-test-2-b200s (code map)
  • kernels-fusedmoe-layer-test-2-h100s (code map)
  • kernels-helion-test ×5 (code map)
  • kernels-mamba-test (code map)
  • kernels-mhc-test-b200 (code map)
  • kernels-minimax-reduce-rms-test-2-gpus (code map)
  • kernels-moe-test ×5 (code map)
  • kernels-quantization-test ×6 (code map)
  • kernels-root-misc-test-b200 (code map)
  • kimi-k3-prefix-cache-4xb200 ×2 (code map)
  • kimi-k3-unit-tests-b200 (code map)
  • kv-offload-large (code map)
  • kv-offload-medium (code map)
  • kv-offload-small (code map)
  • language-models-tests-extra-standard ×2 (code map)
  • language-models-tests-granite-l4-compatibility (code map)
  • language-models-tests-hybrid ×2 (code map)
  • language-models-tests-standard (code map)
  • lm-eval-dspark-watermark-2xh100 (code map)
  • lm-eval-small-models (code map)
  • lm-eval-turboquant-k3v4nc (code map)
  • lm-eval-turboquant-k8v4 (code map)
  • lm-eval-turboquant-t3nc (code map)
  • lm-eval-turboquant-t4nc (code map)
  • lm-eval-watermarking (code map)
  • lora ×4 (code map)
  • lora-tp-distributed ×4 (code map)
  • metrics-tracing-2-gpus (code map)
  • model-executor (code map)
  • mooncake-ec-tcp-e2e-2-gpus (code map)
  • mrcr-eval-small-models (code map)
  • multi-modal-accuracy-eval-small-models (code map)
  • multi-modal-models-standard-1-qwen2 (code map)
  • multi-modal-models-standard-2-qwen3-gemma (code map)
  • multi-modal-models-standard-3-llava-qwen2-vl (code map)
  • multi-modal-models-standard-4-other-whisper (code map)
  • multi-modal-processor ×4 (code map)
  • multi-modal-processor-cpu ×4 (code map)
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus (code map)
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus (code map)
  • nixlconnector-pd-edge-cases-2-gpus (code map)
  • openai-api-correctness (code map)
  • pipeline-context-parallelism-4-gpus (code map)
  • platform-tests (code map)
  • plugin-tests-2-gpus (code map)
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus (code map)
  • pytorch-compilation-dynamic-shapes (code map)
  • pytorch-compilation-passes-unit-tests (code map)
  • pytorch-compilation-unit-tests (code map)
  • pytorch-compilation-unit-tests-h100 (code map)
  • pytorch-fullgraph-cudagraph-l4-compatibility (code map)
  • pytorch-fullgraph-test (code map)
  • pytorch-nightly-dependency-override-check (code map)
  • quantization ×4 (code map)
  • quantized-fusions (code map)
  • quantized-models-test (code map)
  • quantized-moe-test-b200 (code map)
  • qwen4-exp-unit-tests (code map)
  • qwen4-exp-unit-tests-cpu (code map)
  • ray-dependency-compatibility-check (code map)
  • rayexecutorv2-4-gpus (code map)
  • regression (code map)
  • replayssm-e2e (code map)
  • samplers-multimodal-beam-search (code map)
  • samplers-test (code map)
  • scale-out-ec-e2e-2-gpus (code map)
  • sharded-rdt-weight-transfer (code map)
  • spec-decode-draft-model ×4 (code map)
  • spec-decode-eagle-1-deepseek-qwen (code map)
  • spec-decode-eagle-2-llama3-qwen-vl-other (code map)
  • spec-decode-mtp-deepseek-mimo (code map)
  • spec-decode-mtp-gemma4 (code map)
  • spec-decode-mtp-qwen3-5 (code map)
  • spec-decode-ngram-suffix (code map)
  • spec-decode-speculators (code map)
  • torch-stable-abi-audit (code map)
  • v1-attention-b200 ×2 (code map)
  • v1-attention-h100-mi300 ×2 (code map)
  • v1-core (code map)
  • v1-executor-worker (code map)
  • v1-kv-connectors ×4 (code map)
  • v1-kv-offload (code map)
  • v1-logits-oracle (code map)
  • v1-metrics-lmeval (code map)
  • v1-others-cpu (code map)
  • v1-sample (code map)
  • v1-spec-decode (code map)
  • vllm-ir-tests (code map)
AMD mirrors: would skip (0)

none

AMD mirrors: would add (156)
  • async-engine-inputs-utils-worker (code map)
  • basic-correctness ×2 (code map)
  • basic-correctness-cpu-offload (code map)
  • basic-correctness-cumem (code map)
  • basic-correctness-prefetch-offload (code map)
  • basic-correctness-sleep-mode (code map)
  • basic-models-tests-extra-initialization ×14 (code map)
  • basic-models-tests-initialization (code map)
  • basic-models-tests-other (code map)
  • batch-invariance-h100 (code map)
  • benchmarks-cli-test (code map)
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • cudagraph (code map)
  • deepseek-v4-kernel-test-b200 (code map)
  • deepseek-v4-kernel-test-h100 (code map)
  • distributed-comm-ops (code map)
  • distributed-compile-comm-4-gpus (code map)
  • distributed-compile-rpc-tests-2-gpus (code map)
  • distributed-compile-unit-tests-2xh100 (code map)
  • distributed-dp-tests-2-gpus (code map)
  • distributed-dp-tests-4-gpus (code map)
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus (code map)
  • distributed-model-tests-2-gpus ×3 (code map)
  • distributed-mooncakeconnector-pd-accuracy-4-gpus (code map)
  • distributed-nixlconnector-pd-accuracy-4-gpus (code map)
  • distributed-tests-8xh100 (code map)
  • distributed-torchrun-examples-4-gpus (code map)
  • distributed-torchrun-shutdown-tests-2-gpus (code map)
  • docker-build-metadata (code map)
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • e2e-core-1-gpu (code map)
  • e2e-core-large-memory (code map)
  • e2e-scheduling-1-gpu (code map)
  • e2e-scheduling-accuracy-1-gpu (code map)
  • engine (code map)
  • engine-1-gpu (code map)
  • entrypoints-integration-api-server ×4 (code map)
  • entrypoints-integration-api-server-generate (code map)
  • entrypoints-integration-api-server-openai-chat_completion (code map)
  • entrypoints-integration-api-server-openai-completion (code map)
  • entrypoints-integration-llm (code map)
  • entrypoints-integration-multimodal (code map)
  • entrypoints-integration-pooling (code map)
  • entrypoints-integration-responses-api (code map)
  • entrypoints-integration-speech_to_text (code map)
  • entrypoints-unit-tests (code map)
  • eplb-algorithm (code map)
  • eplb-execution (code map)
  • examples (code map)
  • extract-hidden-states-integration (code map)
  • extract-hidden-states-integration-2-gpus (code map)
  • fault-tolerance-e2e-2xh100 (code map)
  • fusion-and-compile-unit-tests-2xb200 (code map)
  • fusion-e2e-config-sweep-h100 (code map)
  • fusion-e2e-quick-h100 (code map)
  • fusion-e2e-tp2-ar-rms-config-sweep-h100 (code map)
  • fusion-e2e-tp2-asynctp-config-sweep-h100 (code map)
  • fusion-e2e-tp2-b200 (code map)
  • fusion-e2e-tp2-quick-h100 (code map)
  • gemm-rs-ar-2xb200 (code map)
  • glm5next-unit-tests (code map)
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus (code map)
  • inkling-unit-tests-b200 (code map)
  • jit-monitor-no-runtime-jit (code map)
  • kernels-attention-diffkv-test-h100 (code map)
  • kernels-attention-test ×7 (code map)
  • kernels-b200 ×3 (code map)
  • kernels-core-operation-test ×3 (code map)
  • kernels-fla-ops-test-b200 (code map)
  • kernels-flashmla-test-h100 (code map)
  • kernels-fp4-moe-test-b200 (code map)
  • kernels-fusedmoe-layer-test-2-b200s (code map)
  • kernels-fusedmoe-layer-test-2-h100s (code map)
  • kernels-helion-test ×5 (code map)
  • kernels-mamba-test (code map)
  • kernels-mhc-test-b200 (code map)
  • kernels-minimax-reduce-rms-test-2-gpus (code map)
  • kernels-moe-test ×5 (code map)
  • kernels-quantization-test ×6 (code map)
  • kernels-root-misc-test-b200 (code map)
  • kimi-k3-unit-tests-b200 (code map)
  • kv-offload-large (code map)
  • kv-offload-medium (code map)
  • kv-offload-small (code map)
  • language-models-tests-extra-standard ×2 (code map)
  • language-models-tests-granite-l4-compatibility (code map)
  • language-models-tests-hybrid ×2 (code map)
  • language-models-tests-standard (code map)
  • lm-eval-dspark-watermark-2xh100 (code map)
  • lm-eval-small-models (code map)
  • lm-eval-turboquant-k3v4nc (code map)
  • lm-eval-turboquant-k8v4 (code map)
  • lm-eval-turboquant-t3nc (code map)
  • lm-eval-turboquant-t4nc (code map)
  • lm-eval-watermarking (code map)
  • lora ×4 (code map)
  • lora-tp-distributed ×4 (code map)
  • metrics-tracing-2-gpus (code map)
  • model-executor (code map)
  • mooncake-ec-tcp-e2e-2-gpus (code map)
  • mrcr-eval-small-models (code map)
  • multi-modal-accuracy-eval-small-models (code map)
  • multi-modal-models-standard-1-qwen2 (code map)
  • multi-modal-models-standard-2-qwen3-gemma (code map)
  • multi-modal-models-standard-3-llava-qwen2-vl (code map)
  • multi-modal-models-standard-4-other-whisper (code map)
  • multi-modal-processor ×4 (code map)
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus (code map)
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus (code map)
  • nixlconnector-pd-edge-cases-2-gpus (code map)
  • nixlconnector-pd-spec-decode-acceptance-2-gpus (code map)
  • openai-api-correctness (code map)
  • pipeline-context-parallelism-4-gpus (code map)
  • platform-tests (code map)
  • plugin-tests-2-gpus (code map)
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus (code map)
  • pytorch-compilation-dynamic-shapes (code map)
  • pytorch-compilation-passes-unit-tests (code map)
  • pytorch-compilation-unit-tests (code map)
  • pytorch-compilation-unit-tests-h100 (code map)
  • pytorch-fullgraph-cudagraph-l4-compatibility (code map)
  • pytorch-fullgraph-test (code map)
  • pytorch-nightly-dependency-override-check (code map)
  • quantization ×4 (code map)
  • quantized-fusions (code map)
  • quantized-models-test (code map)
  • quantized-moe-test-b200 (code map)
  • qwen4-exp-unit-tests (code map)
  • ray-dependency-compatibility-check (code map)
  • rayexecutorv2-4-gpus (code map)
  • regression (code map)
  • samplers-multimodal-beam-search (code map)
  • samplers-test (code map)
  • scale-out-ec-e2e-2-gpus (code map)
  • sharded-rdt-weight-transfer (code map)
  • spec-decode-draft-model ×4 (code map)
  • spec-decode-eagle-1-deepseek-qwen (code map)
  • spec-decode-eagle-2-llama3-qwen-vl-other (code map)
  • spec-decode-mtp-deepseek-mimo (code map)
  • spec-decode-mtp-gemma4 (code map)
  • spec-decode-mtp-qwen3-5 (code map)
  • spec-decode-ngram-suffix (code map)
  • spec-decode-speculators (code map)
  • torch-stable-abi-audit (code map)
  • v1-attention-b200 ×2 (code map)
  • v1-attention-h100-mi300 ×2 (code map)
  • v1-core (code map)
  • v1-executor-worker (code map)
  • v1-kv-connectors ×4 (code map)
  • v1-kv-offload (code map)
  • v1-logits-oracle (code map)
  • v1-metrics-lmeval (code map)
  • v1-sample (code map)
  • v1-spec-decode (code map)
  • vllm-ir-tests (code map)

6 changed files · base 7436a7f119 · head 793e407dac · Python record: build 93039 at 1e5d0ea888 · kernel record: table 385d86a (build 93187), map 385d86a · not counted: 10 build steps, 5 A100 steps the generator no longer emits, 138 optional steps the selector would also run

BugenZhao and others added 4 commits October 7, 2026 07:46
… grammars

Tool parsers coerce raw parameter text by the tool's JSON schema, and
argument grammars constrain the same parameters, but each interpreted the
schema separately. Coercion ignored `$ref`, so Pydantic-generated nested
models, `Optional[Model]`, and referenced scalars came back as JSON text
strings. The two also disagreed on `nullable`, `const`, single-schema
`allOf`, and type-name aliases.

Add `schema::SchemaView`, which resolves local references on demand and
splits a value schema into typed options, expanding each reference target
at most once per value as the argument grammar walker did. Argument grammars and coercion
both read schemas through it. Coercion now normalizes one level at a time
as a structured value reaches it, so a recursive schema costs only as deep
as the value; expanding it ahead of time is exponential in its branching.

Kimi K3 labels values through its own `xtml_type` mapping, which follows
the checkpoint's `encoding_k3.py`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
`SchemaView` is the tool's parameters schema that references resolve
against, so call it `SchemaRoot`. Its callers only resolved that root
itself, which they had to pass again; `resolved()` returns it, and
resolving another schema stays private. `typed` takes the parsed type, so
inferred object and array options no longer round-trip through a type
name, and `ToolSchema::from_schema` takes the schema by value, leaving the
copy to the caller that owns the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Coercion tried a mixed enum's types in schema order, so under
`{"enum": ["fast", 1]}` the string type took `1` before the integer did,
although the enum has no string "1" and the argument grammar already
constrains that text to the number. Non-string `const` and `enum` values
are now tried first, and text that spells one as JSON decodes to it. The
types still follow, so text matching no literal converts as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
The test builds a `Tool` literal, which no longer compiles after `defer_loading` was added to `Tool` on main.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao
BugenZhao force-pushed the bz/tool-schema-view branch from 18790cb to 793e407 Compare October 7, 2026 07:48
@BugenZhao

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93256 for commit 793e407dac31.

@BugenZhao
BugenZhao merged commit bc8dd4a into main Oct 7, 2026
35 checks passed
@BugenZhao
BugenZhao deleted the bz/tool-schema-view branch October 7, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants