v2.14.6: the Gemma 4 REQUIRED grammar forces one call, then EOG

Tests › tests/model/test_v2146_gemma4_required_grammar.cpp

absent Not in the packaged run: no test report names it.

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)

  1. REQUIRE(std::filesystem::exists(e4b_path())) observes e4b_path
  2. REQUIRE(m.vocab != nullptr) not attributed
  3. REQUIRE(r.format == COMMON_CHAT_FORMAT_PEG_GEMMA4) observes render_required via r
  4. REQUIRE_FALSE(r.grammar_lazy) observes render_required via r
  5. REQUIRE(g.grammar != nullptr) observes make_grammar via g
  6. CHECK(first_rejected(g.grammar, tokenize(m.vocab, kGoodBlock)) == -1) observes first_rejected
  7. REQUIRE_FALSE(next.empty()) observes allowed_set via next
  8. CHECK(non_eog == 0) not attributed
  9. REQUIRE(g.grammar != nullptr) observes make_grammar via g
  10. REQUIRE(at >= 0) observes first_rejected via at
  11. CHECK(piece(m.vocab, toks[static_cast<size_t>(at)]).rfind(":\"", 0) == 0) observes piece
  12. REQUIRE(g.grammar != nullptr) observes make_grammar via g
  13. CHECK(first_rejected(g.grammar, tokenize(m.vocab, kRunaway)) >= 0) observes first_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→piece

What 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.

v2.14.6: the Gemma 4 REQUIRED grammar forces one call, then EOG · 13 checksmake_grammarcreateREQ-INFER-006 · inferredpatch_gemma4_required_rootREQ-INFER-008 · inferred
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.