Repository navigation
grammar: SparkQwen 0.4.0 literal-dispatch convergence (ported from Enntity; replaces #288) - #293
Conversation
…literal_dispatch, first_token, stop, literal_xml, template, handle_token)
The convergence left both the b1b5381 message-only escape and the 318569b messages+tools escape. The second pass re-escapes the FDD2 sentinels the first wrote, so encode_rendered unwraps them to literal sentinel bytes: live qwen4_exp prompts grew +6 tokens per <tool_call> mention and the model echoed a different tool-call dialect. 0.4.0 escapes once, before auto-compact.
…ream_for_app helpers
…0b7bd) has_partial_tool_opener trimmed the buffer for the tag-prefix probe but callers still saw the raw buffer, so ' \n<' hid the partial opener and the whitespace was dropped when the marker resolved as literal. streaming_impl's dsml_leading_whitespace arm now breaks before consuming the held bytes, matching 0.4.0. literal_markers gains the missing envelope-open arm.
|
Update at Pair results:
The streamed-fence newline is fixed. Two of our streaming hunks had kept pre-ba0b7bd08 shapes:
Also added 0.4.0's 26 literal-XML tests were silently not running, because their
|
…-only usage for Qwen (SparkQwen 0.4.0) Pair-gated (#220): probes vs SparkQwen 0.4.0's engine, rc16 identity vs parent, tools 21/21; stack top (#293) union 16/16, lp_api 13/13, api_parity 26/26, product probes identical in strict+spark, BFCL 87.54/86.85 = main. CI green except the PR benchmark gate.
|
GB10 single-Spark confirmation (sparky, post-merge): this PR was gated as part of
|
Summary
The literal-dispatch chain from SparkQwen 0.4.0 (Enntity
baa93620b,19bfc90bd,0ce591b63,6a1ccde4f,318569b87,17e5c92b0; AGPL-3.0, data-angel). It convergesgrammar/state.rs,literal_xml.rs,engine_state.rsandfirst_token.rsonto 0.4.0's versions. Stacked on #290; replaces #288.One bug found and fixed while porting:
template.rsescaped tool markup twice. 0.4.0's new call (json_messages+jinja_tools) ran alongside the older b1b5381 call that tool parsing: treat literal tool XML in prose/quotes/fences as text for qwen4_exp (ported from Enntity; replaces #253) #279 brought. The second pass re-escaped the sentinels.<tool_call>, and the model answered in a different XML dialect.Test plan (reiner + spark2; receipts in reiner's
~/code/night1027/out/core-743a9f8a4/andptok/)--tests) is clean.<tool_call>in the user text are now equal to 0.4.0's. Before the fix they were 332 vs 326.union_check15/16,lp_api_probe13/13,api_parity26/26, all equal to the parent;union_checkto 14/16.Generated with Devin