Skip to content

fix: cover patched PyTorch weight-load versions#1482

Open
mldangelo-oai wants to merge 2 commits into
mainfrom
mdangelo/codex/fix-weight-dist-pytorch-prerelease-c121
Open

fix: cover patched PyTorch weight-load versions#1482
mldangelo-oai wants to merge 2 commits into
mainfrom
mdangelo/codex/fix-weight-dist-pytorch-prerelease-c121

Conversation

@mldangelo-oai
Copy link
Copy Markdown
Contributor

Summary

  • add regression coverage for vulnerable PyTorch prerelease/dev versions before weight deserialization
  • add benign guards for final, local, post, and patch releases that should still use safe weights_only loading
  • update the root changelog

Validation

  • PYTHONPATH=/private/tmp/modelaudit-c121 PROMPTFOO_DISABLE_TELEMETRY=1 /Users/mdangelo/code/modelaudit/.venv/bin/pytest tests/scanners/test_weight_distribution_scanner.py::TestWeightDistributionScanner::test_blocks_torch_load_for_vulnerable_pytorch_prereleases tests/scanners/test_weight_distribution_scanner.py::TestWeightDistributionScanner::test_allows_torch_load_for_stable_patched_pytorch tests/scanners/test_weight_distribution_scanner.py::TestWeightDistributionScanner::test_blocks_torch_load_when_pytorch_version_unknown -q
  • /Users/mdangelo/code/modelaudit/.venv/bin/ruff check modelaudit/scanners/weight_distribution_scanner.py tests/scanners/test_weight_distribution_scanner.py
  • /Users/mdangelo/code/modelaudit/.venv/bin/ruff format --check modelaudit/scanners/weight_distribution_scanner.py tests/scanners/test_weight_distribution_scanner.py
  • PYTHONPATH=/private/tmp/modelaudit-c121 /Users/mdangelo/code/modelaudit/.venv/bin/mypy modelaudit/scanners/weight_distribution_scanner.py tests/scanners/test_weight_distribution_scanner.py
  • git diff --check

@mldangelo-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mldangelo-oai mldangelo-oai marked this pull request as ready for review May 31, 2026 12:44
@github-actions
Copy link
Copy Markdown
Contributor

Workflow run and artifacts

Performance Benchmarks

Compared 12 shared benchmarks with a regression threshold of 15%.
Status: 0 regressions, 0 improved, 12 stable, 0 new, 0 missing.
Aggregate shared-benchmark median: 769.61ms -> 774.33ms (+0.6%).

Workload Benchmark Target Size Files Baseline Current Change Status
clean-training-checkpoint tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_clean_training_checkpoint safe_large 278.2 KiB 1 19.67ms 19.97ms +1.5% stable
warm-cache-rescan tests/benchmarks/test_scan_benchmarks.py::test_scan_warm_cached_repository_rescan release-candidate 547.3 KiB 32 65.56ms 66.38ms +1.2% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_hex] nested_hex 130 B 1 428.1us 423.2us -1.1% stable
single-checkpoint-preflight tests/benchmarks/test_scan_benchmarks.py::test_scan_single_checkpoint_before_load single_checkpoint.pkl 183.0 KiB 1 41.25ms 40.79ms -1.1% stable
direct-malicious-upload tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_direct_malicious_upload malicious_reduce 52 B 1 1.47ms 1.45ms -1.1% stable
duplicate-heavy-registry tests/benchmarks/test_scan_benchmarks.py::test_scan_duplicate_registry_snapshot registry-snapshot 915.2 KiB 13 218.26ms 220.62ms +1.1% stable
mixed-model-repository tests/benchmarks/test_scan_benchmarks.py::test_scan_release_candidate_repository release-candidate 547.3 KiB 32 292.24ms 294.49ms +0.8% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_base64] nested_base64 98 B 1 422.2us 419.3us -0.7% stable
chunked-upload-stream tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_chunked_upload_stream chunked_stream 278.2 KiB 1 22.95ms 22.80ms -0.6% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_raw] nested_raw 78 B 1 410.7us 412.4us +0.4% stable
suspicious-pickle-intake tests/benchmarks/test_scan_benchmarks.py::test_scan_suspicious_pickle_intake suspicious-intake 183.8 KiB 4 105.40ms 105.04ms -0.3% stable
padded-multi-stream-upload tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_padded_multi_stream_upload multi_stream_padded 4.1 KiB 1 1.54ms 1.53ms -0.1% stable

Copy link
Copy Markdown
Contributor

@ianw-oai ianw-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

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.

2 participants