Repository navigation
fix(qualify): render native JSON schema instructions in frozen prompts - #164
Merged
original-el8 merged 1 commit intoNov 13, 2026
Merged
Conversation
The authored JSON-schema HTTP cases freeze prompts before native request processing adds its schema system instruction. On the dense Qwen native path, json-incident therefore compares 28 expected tokens with 115 actual tokens, even though the response is valid and the wire request is unchanged. Apply the same schema instruction while constructing CPU prompt references, including preserving an existing leading system message. Keep request bytes, seeds, budgets, expected output semantics and strict stream checks unchanged. Previously frozen references need regeneration; failed runs remain failures. Validation: 25 CPU workload tests pass, including insertion/append and wire immutability. An isolated CPU tool calls Helios prepare_request on complete frozen payloads: old dense references fail at json-incident; corrected all-NVFP4, official and thinking datasets pass exact rendered text and token IDs for all 56 requests. Only 4/4/1 schema references change; all wire bytes are retained. The separate normalized-template tool also passes 65 fixture cases. Scope: authored json_schema text cases and string-valued system instructions. No serving, sampling, model arithmetic or runtime contract changes. This does not establish statistical quality equivalence or complete MoE qualification. Design-Signed-Off-By: Codex (GPT-6); design-review=6aeb Signed-off-by: Maxrio9 <70799635+Maxrio9@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #19: rebased onto main
6fa01a49and the commit now carries the DCO sign-off that CONTRIBUTING.md requires. The change itself is unchanged. Re-run on this tree:python -m pytest tests/reference/test_speculative_workload.pypasses 25/25, and the two new schema-instruction cases fail on current main without this change (2 failed, 23 passed).Problem (demonstrated defect)
response_format: json_schema, Heliosprepare_request(helios/src/server/request.rs~136-152) appends asystem instruction containing the schema before rendering the chat template.
qualify/speculative_workload.template_inputfreezes prompt references without it. The strict analyzer'sexact_prompt_ids/prompt_ids_first_eventchecks therefore fail on valid responses: one case expects 28 prompttokens and the server uses 115.
json_schemacases (speculative_workload.py~174-183), so its frozenreferences are affected too.
Change
Apply the same instruction when constructing CPU prompt references:
json_schema.schema;preserve_order), raw UTF-8;"\n\n"to a leading string system message, or inserted as a new first system message.Request bytes, seeds, budgets, expected semantics and analyzer checks are unchanged. Previously frozen references need
regeneration.
Validation
prepare_requeston complete frozen payloads. Old references fail at theJSON-schema case. Corrected references match exact rendered text and token IDs for all 56 requests across 3
datasets.
Retested on this exact branch, based on
5f37bd1, with the full CPU suite run side by side against unmodified5f37bd1on the same host:tests/reference: 341 → 343 passed.test_tuning_replicastests.Scope (stated in the commit)
json_schema on the Chat protocol with string-valued system content. These aren't covered:
json_objecton the legacy prompt path;Disclosure
Written by an AI coding agent (Codex, GPT-6) with a staged design-review acknowledgement, and validated on my hardware (RTX PRO 4500 Blackwell, SM120, driver 615.78.08 open module, CUDA 13.4). Claude Code reviewed the storage-contract, CPU harness and reporting aspects and prepared this PR; it did not author or review kernel code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BJmfhfkwQM1xjdQVaUKwns