Skip to content

NEWS/test cleanup: correct the dontrun count, add a bf16 source check - #55

Merged
TroyHernandez merged 1 commit into
mainfrom
docs/news-cleanup
Aug 3, 2026
Merged

NEWS/test cleanup: correct the dontrun count, add a bf16 source check#55
TroyHernandez merged 1 commit into
mainfrom
docs/news-cleanup

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Review follow-ups, all documentation or test scope. No code changes, so no
version bump.

Doc fixes

  • NEWS.md said nine \dontrun{} examples remain while cran-comments.md
    said ten. Ten is right: the 0.2.0 review pass left nine, and
    resident_load() added one afterwards.
  • Dropped a doubled blank line left by consolidating the dev sections under
    0.2.2, and a trailing blank line at the end of test_recommend.R.
    git diff --check is clean.

bf16 coverage

The bf16 route had only structural coverage — that .flux_model_dir() routes
bf16 somewhere other than "<prefix>bf16", and that an unknown model errors.
Nothing checked what actually carries risk: whether .flux_source_dir() lands
on a directory the loader can open.

test_bf16_source.R asserts the cache layout (config.json plus a shard),
that the router resolves to exactly that directory, that every tensor in the
shard really is BF16
— read from the safetensors JSON header, so no tensors
are materialized — and that flux_open_checkpoint() opens it and reports no
format, which is what selects the "full" bf16 path in
flux_load_transformer().

Deliberately not a forward pass. bf16 names the storage dtype and reading
it is CPU work, but computing in bf16 is GPU-only here (txt2img_flux2()
upcasts to float32 when device == "cpu"), and materializing the 7.8 GB
transformer is not a test-suite job. at_home() gates the file so check
machines skip it.

Verified GPU-untouched: 11 assertions in 1.6 s with a 0 MiB delta in
nvidia-smi. Full suite with CUDA hidden: 1081 pass.

Review follow-ups, all documentation or test scope. No code changes, so
no version bump.

NEWS.md said nine \dontrun{} examples remain while cran-comments.md said
ten. Ten is right: the 0.2.0 review pass left nine, and resident_load()
added one afterwards. Also drops a doubled blank line left by
consolidating the dev sections under 0.2.2, and a trailing blank line at
the end of test_recommend.R.

The bf16 route had only structural coverage -- that .flux_model_dir()
routes bf16 somewhere other than "<prefix>bf16", and that an unknown
model errors. Nothing checked the thing that actually carries risk:
whether .flux_source_dir() lands on a directory the loader can open.
test_bf16_source.R now asserts the cache layout (config.json plus a
shard), that the router resolves to exactly that directory, that every
tensor in the shard really is BF16 (read from the safetensors JSON
header, so no tensors are materialized), and that
flux_open_checkpoint() opens it and reports no format -- which is what
selects the "full" bf16 path in flux_load_transformer().

Deliberately not a forward pass. bf16 names the storage dtype and
reading it is CPU work, but computing in bf16 is GPU-only here
(txt2img_flux2 upcasts to float32 on cpu), and materializing the 7.8 GB
transformer is not a test-suite job. at_home() gates the file, so check
machines skip it.

Verified GPU-untouched: 11 assertions in 1.6 s with a 0 MiB delta in
nvidia-smi. Full suite with CUDA hidden: 1081 pass.
@TroyHernandez
TroyHernandez merged commit c207d5b into main Aug 3, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the docs/news-cleanup branch August 3, 2026 17:04
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