Skip to content

validate: --strict silently ignored for GGUF/SafeTensors #507

@noahgift

Description

@noahgift

Bug

apr validate model.gguf --strict accepts the --strict flag but silently ignores it for non-APR formats (GGUF, SafeTensors).

Root Cause

In crates/apr-cli/src/commands/validate.rs, the dispatch at line 47 doesn't pass strict to the Rosetta validation path:

match format {
    FormatType::Apr => run_apr_validation(path, quality, strict, min_score, json),
    FormatType::Gguf | FormatType::SafeTensors => {
        run_rosetta_validation(path, format, quality, json)  // strict NOT passed
    }
}

The run_rosetta_validation() function signature (line 88) doesn't even accept strict.

Additionally, --strict is also unused in the APR path — print_summary() at line 348 has _strict: bool (underscore prefix = intentionally unused).

Expected Behavior

--strict should fail validation on warnings (NaN count > 0, all-zero tensors, etc.) instead of only failing on hard errors.

Fix

  1. Add strict parameter to run_rosetta_validation()
  2. When strict=true, fail if there are any NaN/Inf counts or all-zero tensors
  3. Implement strict logic in APR path too (fail on warnings, not just failures)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions