Evaluation produces valid log-probabilities¶
Tests › tests/model/test_logprob_evaluation.cpp
What this test is for
Why it exists
The test says nothing about why.
tests/model/test_logprob_evaluation.cpp:21 · its file's page
What it checks (8)
REQUIRE(g_ctx.initialized)not attributedREQUIRE(backend != nullptr)not attributedREQUIRE(tokens.size() >= 4)observestokenize_textviatokensREQUIRE(result.n_logprobs == static_cast<int>(tokens.size()) - 1)observestokenize_textviatokensREQUIRE(result.logprobs.size() == static_cast<size_t>(result.n_logprobs))not attributedCHECK(lp <= 0.0f)not attributedCHECK(result.perplexity > 1.0f)not attributedCHECK(result.perplexity < 100.0f)not attributed
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
Evaluation produces valid log-probabilities→REQUIRE→start_test_log→get_backend→tokenize_text→WHEN→end_test_logWhat 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.