REQ-INFER-024: Backends declare capabilities and expose state and log-probability introspection¶
What it requires
- Given a base backend, Then no capability is reported and info carries only the name; given an overriding backend, Then declared capabilities and populated info are reported and the capability count matches the enum.
- Given state operations on a backend without support or not loaded, Then they return false.
- Given fewer than 2 tokens or a non-ACTIVE model, Then evaluate_logprobs is rejected; given a valid sequence, Then perplexity equals exp(-mean(logprobs)), total_logprob equals the sum, and repeated calls agree.
- tier
- NOT_RUN
How it is met
Implemented by
clear_statesrc/inference/backend.cpp:675entropic_compute_perplexitysrc/facade/entropic.cpp:5076entropic_get_logprobssrc/facade/entropic.cpp:5034evaluate_logprobssrc/inference/backend.cpp:459infosrc/inference/backend.cpp:610restore_statesrc/inference/backend.cpp:650save_statesrc/inference/backend.cpp:625supportssrc/inference/backend.cpp:575
Tests (9)
Reached through calls
9 tests: 9 absent
| test | result | linked by | implementers exercised | calls away |
|---|---|---|---|---|
LlamaCppBackend lifecycle on a small real model (one load) | absent | inferred | 6 of 8 | 1 |
entropic_compute_perplexity on configured handle without tier fails | absent | inferred | 1 of 8: entropic_compute_perplexity | 1 |
entropic_compute_perplexity on unconfigured handle returns INVALID_STATE | absent | inferred | 1 of 8: entropic_compute_perplexity | 1 |
entropic_get_logprobs on NULL handle returns INVALID_HANDLE | absent | inferred | 1 of 8: entropic_get_logprobs | 1 |
entropic_get_logprobs on configured handle without active tier fails | absent | inferred | 1 of 8: entropic_get_logprobs | 1 |
entropic_get_logprobs on unconfigured handle returns INVALID_STATE | absent | inferred | 1 of 8: entropic_get_logprobs | 1 |
entropic_get_logprobs with n_tokens<2 returns INVALID_ARGUMENT | absent | inferred | 1 of 8: entropic_get_logprobs | 1 |
gh#100 floor: default f16 KV path on E4B QAT Q4 is unchanged | absent | inferred | 1 of 8: save_state | 2 |
gh#100: q8_0 KV halves per-seq bytes and stays valid on | absent | inferred | 1 of 8: save_state | 2 |