v2.14.6: the Gemma 4 REQUIRED grammar forces one call, then EOG¶
Tests › tests/model/test_v2146_gemma4_required_grammar.cpp
What this test is for
Why it exists
The test says nothing about why.
tests/model/test_v2146_gemma4_required_grammar.cpp:203 · its file's page
What it checks (13)
REQUIRE(std::filesystem::exists(e4b_path()))observese4b_pathREQUIRE(m.vocab != nullptr)not attributedREQUIRE(r.format == COMMON_CHAT_FORMAT_PEG_GEMMA4)observesrender_requiredviarREQUIRE_FALSE(r.grammar_lazy)observesrender_requiredviarREQUIRE(g.grammar != nullptr)observesmake_grammarviagCHECK(first_rejected(g.grammar, tokenize(m.vocab, kGoodBlock)) == -1)observesfirst_rejectedREQUIRE_FALSE(next.empty())observesallowed_setvianextCHECK(non_eog == 0)not attributedREQUIRE(g.grammar != nullptr)observesmake_grammarviagREQUIRE(at >= 0)observesfirst_rejectedviaatCHECK(piece(m.vocab, toks[static_cast<size_t>(at)]).rfind(":\"", 0) == 0)observespieceREQUIRE(g.grammar != nullptr)observesmake_grammarviagCHECK(first_rejected(g.grammar, tokenize(m.vocab, kRunaway)) >= 0)observesfirst_rejected
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
v2.14.6: the Gemma 4 REQUIRED grammar forces one call, then EOG→REQUIRE→e4b_path→render_required→patch_gemma4_required_root→gbnf_root_line→make_grammar→first_rejected→tokenize→allowed_set→pieceWhat it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-INFER-006 inferred
- REQ-INFER-008 inferred