Skip to content

fix(#894): actionable diagnostic when --model gets a non-RVF file#919

Merged
ruvnet merged 1 commit into
mainfrom
fix/894-model-load-diagnostic
Jun 2, 2026
Merged

fix(#894): actionable diagnostic when --model gets a non-RVF file#919
ruvnet merged 1 commit into
mainfrom
fix/894-model-load-diagnostic

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented Jun 2, 2026

Problem (#894)

Users download ruvnet/wifi-densepose-pretrained, pass a file to --model, and get:

Progressive loader init failed: invalid magic at offset 0: expected 0x52564653, got 0x77455735

…then the server silently falls back to signal heuristics (which over-count — "10 persons when 1 present" — exactly what feeds "is it fake" reports). The cryptic magic error gives no path forward.

Root cause (unchanged): the HF files (model.safetensors, model-q{2,4,8}.bin, model.rvf.jsonl) are a different format and encoder architecture than the RVF binary container (RVFS magic 0x52564653) the --model progressive loader expects. They can't load directly — a format-only convert would load-but-emit-garbage.

Fix (scoped, honest)

This PR doesn't claim to make the HF model loadable (that needs a matching-architecture RVF export, tracked separately). It makes the failure actionable: the load-error path now detects the common cases and explains plainly —

  • safetensors (8-byte LE header + {)
  • .rvf.jsonl manifest
  • quantized .bin blob (model-q4.bin)
  • unknown → generic guidance

…naming the format, stating what --model actually expects (an RVF container from wifi-densepose-train), that the HF files are a different format/architecture, that the server is continuing on heuristics, and linking #894.

Tests

Pure diagnose_model_load_error(path, data, err) + 4 unit tests under a plain #[cfg(test)] module (so they run in the default --no-default-features CI):
safetensors_is_named_and_points_at_894, quantized_bin_is_identified, jsonl_manifest_is_identified, unknown_format_still_gives_guidance.

Verification

cargo test -p wifi-densepose-sensing-server --no-default-features → new tests pass; full crate unit suite 429 + 114 passed, 0 failed.

🤖 Generated with claude-flow

Users who downloaded ruvnet/wifi-densepose-pretrained and passed
model.safetensors / model-q4.bin / model.rvf.jsonl to --model hit a bare
"Progressive loader init failed: invalid magic at offset 0: expected
0x52564653, got 0x77455735" and were stuck — the server then silently fell
back to signal heuristics (which over-count, feeding "is it fake" reports).

The HF files are a different *format* and encoder architecture than the RVF
binary container the progressive loader expects, so they can't load directly.
Now the load-failure path detects the common cases (safetensors header,
JSONL manifest, quantized .bin blob) and emits a plain explanation naming the
format, what --model actually expects (RVF `RVFS` container from
wifi-densepose-train), and that it's continuing with heuristics — with a
pointer to #894.

Pure, testable `diagnose_model_load_error()` + 4 unit tests (run under the
default `--no-default-features` CI). Full crate unit suite: 429 + 114 passed,
0 failed.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit f5d0e1e into main Jun 2, 2026
20 checks passed
@ruvnet ruvnet deleted the fix/894-model-load-diagnostic branch June 2, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant