OpenFlowLM-Next icon indicating copy to clipboard operation
OpenFlowLM-Next copied to clipboard

Open engine: a model-adjacent kernel set silently outranks FLM_OPEN_KERNELS_DIR, so a rebuilt kernel set never runs

Open vegah opened this issue 2 months ago • 2 comments

Engine::find_kernels() prefers <model_dir>/open_kernels unconditionally over the environment variables, whenever that directory exists and is complete. So once a model is installed with a kernel set beside it, FLM_OPEN_KERNELS_DIR and FLM_XCLBIN_PATH are silently ignored, and any locally rebuilt kernel set never runs.

Why it is worth fixing rather than documenting

It fails open. There is no error, no warning, and no line in the log saying which kernel directory was chosen — the engine loads a valid set and produces valid output, just not from the kernels you built.

Found while measuring a change to the kernels: an A/B came back at 71.19 s against 70.39 s, i.e. a clean "no measurable effect". Both runs had in fact loaded the same stale set and were byte-for-byte the same configuration. The real difference, once the right kernels were actually loaded, was 1.7×. A null result that is really "the experiment did not run" is the expensive kind, because it terminates an investigation instead of prompting one.

Reproduce

  1. Install a model so that <model_dir>/open_kernels exists and is complete.
  2. Build a modified kernel set somewhere else.
  3. Point FLM_OPEN_KERNELS_DIR (or FLM_XCLBIN_PATH) at it and run.
  4. The model-adjacent set is used. Nothing says so.

Suggested fix

Two parts, either useful alone:

  • Order: an explicitly-set environment variable should outrank the model-adjacent directory. Explicit beats implicit; that is the reason the variable exists.
  • Say which: log the resolved kernel directory once at load, unconditionally. This project has a general habit of reporting the value read rather than the value intended, and this is a place with none of it — a single line would have turned the failure above into a five-second diagnosis.

The second is worth doing even if the first is judged too disruptive to change: the silence is what made this expensive, not the precedence order itself.

Found while working on #32.

vegah avatar Sep 09 '26 11:09 vegah

Was this fixed with #40?

Atomic-Germ avatar Sep 11 '26 14:09 Atomic-Germ

Yes — #40 added the log line, which was the part that mattered. Closing.

vegah avatar Sep 13 '26 21:09 vegah