Repository navigation
Description
This one is a diagnostic-tooling problem rather than a query defect, and I'd normally not bother — except that forced-lane measurement is the instrument by which #1878 gets settled, and someone doing that work will almost certainly hit this without knowing it happened.
FLUREE_ANNOTATION_LANE=arena|enumerate|chain exists so the same query can be timed on each annotation lane. The pin is honoured at selection — chain_lane() (fluree-db-query/src/default_graph_source.rs:571) returns it before any other consideration:
fn chain_lane(&self, child: &BoxedOperator, chain_elided: bool) -> ChainLane {
if let Some(forced) = forced_chain_lane() {
return forced;
}But the gate that decides whether that lane can actually run lives downstream, at the two execution branches (:393 and :444):
if self.annotation_probe_gates_pass(ctx) && lane == ChainLane::Arena {
if self.annotation_probe_gates_pass(ctx) && lane == ChainLane::Enumerate {So when the gates fail, the lane is selected verbatim, both arena-requiring branches are skipped, and execution falls through — to the hash sidecar lane if its own gate admits, otherwise to the generic chain. (In the worked example below the driving stream is one row, under the hash lane's 256-row floor, so it lands on generic.) No warning, correct answers, entirely plausible timings. You get one lane measured three times and a table that looks like a result.
annotation_probe_gates_pass (:702) is five conditions, all of which demote silently:
ctx.active_snapshot.annotation_index.is_some()
&& ctx.active_snapshot.content_store.is_some()
&& !self.planning.is_history()
&& ctx.overlay().is_effectively_empty()
&& ctx.policy_enforcer.as_ref().is_none_or(|p| p.is_root())The two that seem most likely to be tripped by accident are the last two. A non-empty overlay demotes both lanes, and it takes exactly one commit of one flake to do it — measured, not inferred: on a freshly-indexed 60k-edge annotated ledger, committing a single unrelated triple without reindexing flips overlay_empty to false and collapses all three pins onto one lane. Since building a fixture by committing data and then querying it is the natural way to build one, you can easily measure novelty-state behaviour while believing you pinned the arena. A non-root policy does the same, which means anyone benchmarking a policy-enforced workload is measuring the generic fallthrough whatever they pinned.
The symptom is agreement, which is the problem: three pinned lanes producing the same number reads as a stable, reproducible result rather than a broken experiment. It's the opposite of the signal you'd want.
The part worth keeping, if nothing else here is acted on
We nearly published numbers off this. The measurements behind #1878 were taken with FLUREE_ANNOTATION_LANE and the review asked, fairly, whether the arena had actually run. It had — but two of the markers we reached for first would not have told us:
--explain'slane-preferenceis computed by callingchain_lane()(:986) — the same function that returns the forced value verbatim. It confirms your own input. Generalising: any marker derived before the branch it attests will report success unconditionally.lane-final(:993) is a hardcoded English sentence,"decided at open; see theannotation delegate laneDEBUG event", not a value. A harness asserting on it fails every cell; one asserting merely that it's present passes every cell, including demoted ones.
What does work, and it's cheap. Fuel (--track-fuel) is bit-identical across runs and immune to load, so the demotion signature is exact three-way equality — three pins, one number. Worked example on a 60k-edge annotated ledger, one query, three pins, with the overlay drained:
| pinned lane | fired lane | fuel |
|---|---|---|
arena |
arena | 321.03 |
enumerate |
enumerate | 61 |
chain |
generic | 662.208 |
Three distinct values — but read the third column, because distinctness alone would not have told you: arena and enumerate really ran, and chain did not. Pinning chain never produces a distinctly-executing chain lane on any shape. ChainLane::Chain means only "neither arena nor enumerate", after which control reaches the hash branch if its floor admits and otherwise falls to generic. The execution branches test lane == ChainLane::Arena (default_graph_source.rs:393) and lane == ChainLane::Enumerate (:444) and nothing else — no branch anywhere reads ChainLane::Chain.
That belongs in this issue rather than elsewhere, because it is a second and smaller instance of the same defect: FLUREE_ANNOTATION_LANE offers chain as if it were a lane, and it is a residual category rather than a dispatch target. Pinning it is not a no-op — it reliably excludes arena and enumerate — but it does not select one path: you get the hash sidecar or generic depending on driving-row count, and the tracing event reports whichever actually ran. So the pin is usable for excluding the two real lanes and unusable for naming what you measured, which is the trap, because a results table records the name you asked for rather than the path you got.
(enumerate is genuine here, and that is shape-dependent: enumeration_plan (:630) returns None unless both edge endpoints are EdgePos::Var and the child schema binds none of the subject, object, annotation or predicate variable. An anchored subject fails the first condition — which is why the same pin falls through on a bound-subject 2-hop and holds here.) Commit one flake to the same ledger without reindexing and every cell becomes 1273.688 — all three pins, one value.
Note that the collapsed value is not the drained figure of whatever path the chain pin reaches. A non-empty overlay adds work to whatever lane runs, so the tell is the three-way equality itself, not equality at any particular number.
Assert each cell against its own known value, not merely that the three differ — the two failure modes here are different in kind and only value-matching catches both:
| failure | signature | caught by distinctness? |
|---|---|---|
| gate demotion — pin honoured at selection, refused at execution | arena and enumerate collapse together; the chain pin keeps its own value |
yes |
| partial demotion — one arena-requiring lane falls through, the other holds | two values instead of three | no, reads as plausible |
| override never arrived — e.g. the variable didn't reach the process that plans | all three identical, all the shipping lane | no, indistinguishable from a correct baseline |
The third is the reason bare distinctness is not enough: three identical numbers look exactly like a correctly-varying baseline unless you know the expected triple independently.
For the runtime answer rather than an inference, the annotation delegate lane event does report it — but it needs both RUST_LOG=debug and the CLI's -v flag; with RUST_LOG alone nothing is emitted. The adjacent annotation delegate gates event prints each gate individually (arena=, store=, history=, overlay_empty=, root_policy=), which is the quickest way to see which one demoted you.
The override reaching the query process at all is incidental
Worth knowing before building a harness around this: fluree server spawns its worker via std::process::Command::new(current_exe()) (fluree-db-cli/src/commands/server.rs:299-302, and again at :405-408), and there is no env_clear, .env( or .envs( anywhere in that file — I grepped, the count is zero. The child therefore inherits the whole parent environment because nothing restricts it, not because anything arranges for the lane override to be passed down. Nothing in that file expresses that the child must inherit it.
Adding .env_clear() with an explicit allow-list is a routine hardening change somebody could make for entirely good reasons, and the day it lands every forced-lane measurement silently becomes the shipping lane wearing three labels, with no test going red. So: verify the pin in the process that actually plans the query — reading /proc/<pid>/environ for the listening socket is the direct check — rather than in the shell that set it. And if this is fixed as warn-or-refuse, the warning needs to fire in the planning process, not the one that read the variable.
A trap in the obvious remediation
The natural response to "your overlay wasn't empty" is to run fluree index and measure again. That makes it worse. On the same ledger, fluree index drained the overlay and dropped the annotation arena: arena=false overlay_empty=true, and all three pins then read 662.208 — still demoted, now with no overlay left to hint that anything is wrong. Recovering the arena took FLUREE_FORCE_ANNOTATION_BOOTSTRAP=1 fluree reindex, after which arena=true and the original 321.03 / 61 / 662.208 returned exactly.
That interaction is documented behaviour for the CLI's incremental index path rather than a new defect, but it lands squarely on anyone trying to fix a demoted measurement, so it belongs next to the rest of this.
Better still, assert each cell against its known value rather than just checking the three differ. Mere distinctness misses a partial demotion — one arena-requiring lane falling through while the other holds — which shows up as two values and could easily read as fine. The other positive marker, if you're building the ledger yourself, is that create --from prints Annotation arena sealed., and it's worth noting it prints that only for ledgers that actually carry annotations, so it discriminates rather than firing unconditionally. fluree info does not expose the arena; I looked.
Why the gate count is easy to get wrong
Two readers independently under-counted these conditions as four before the fifth was spotted, and the mechanism is worth recording because it is not a reading-comprehension failure. Both extracted the function with a fixed line range — sed -n '698,706p' — which ends one line above is_root() and, crucially, omits the closing brace without that being obvious. A truncated function body reads as a complete, shorter, entirely plausible one.
Extracting by structure rather than line count makes the truncation self-announcing: awk '/fn annotation_probe_gates_pass/,/^ }/' terminates on the function's own closing brace, so a bad range shows up as a missing brace instead of a shorter list. Cheap habit, and this gate is exactly the kind of long conjunction where it pays.
Suggested fix
A warning when the override can't be honoured, naming which of the five gates failed, would have made this a non-issue — it's diagnostic tooling, and silently doing something other than what you asked is the one behaviour it shouldn't have. I'd lean toward warn-and-continue rather than refuse, since falling through is legitimate behaviour and someone may reasonably want to see the demoted path; the problem is only that it's unannounced.
I may be wrong about which of those two is right. If there's a case where refusing is clearly better — a harness that should hard-fail rather than quietly produce a comparable-looking number — I'd be glad to hear it, because that argues for refuse-by-default with an opt-out.
Follow-up: #1878 — this is the instrument hazard for the lane work that issue asks for, not a fix for it.
Activity
bplatz commentedon Nov 20, 2026
Fixed on
nextby #2017 (merged 2026-10-06, a25d446), which removes the annotation arena and its lanes:choose_chain_laneandFLUREE_ANNOTATION_LANEno longer exist there. Ships in 5.0;main(4.2.x) keeps the old code. The PR'sFixeskeyword didn't close this because its base wasnext.