Skip to content

validate: --quality --json drops quality details from Rosetta JSON output #508

@noahgift

Description

@noahgift

Bug

apr validate model.gguf --quality --json outputs JSON but drops quality details (NaN count, Inf count, all-zero tensors, physics constraints) that are shown in the non-JSON output.

Root Cause

In crates/apr-cli/src/commands/validate.rs, line 100 returns early for JSON without passing quality:

if json {
    return print_rosetta_validation_json(path, &report, format);  // no quality param
}

// Non-JSON path correctly uses quality:
if quality {
    print_quality_constraints(&report);
}

print_rosetta_validation_json() at line 261 doesn't accept a quality parameter.

Expected Behavior

When --quality --json is used, the JSON output should include physics constraints:

{
  "quality": {
    "total_nan": 0,
    "total_inf": 0,
    "all_zero_tensors": [],
    "physics_constraints": "PASS"
  }
}

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