fix(huggingface): avoid probes for selection-skipped shards#1633
Conversation
|
@codex review |
Performance BenchmarksCompared
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f7fed2f61
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 478f2395c2
ℹ️ 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".
…t13-hf-selective-skip-reads-20260610
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dab63c606
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65d88c9d29
ℹ️ 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".
|
Summary
Testing
|
|
@codex review |
|
@codex review the exact current head after preserving selected overlap routes. Recheck selected compressed/SafeTensors behavior, skipped shard reads, and malicious overlap controls. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c06226792a
ℹ️ 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".
|
@codex review |
|
@codex review the exact current head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa87d8fe3a
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c998168cd2
ℹ️ 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".
|
@codex review |
|
@codex review the exact current head |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Preserve selected noncanonical shard-shaped XGBoost routes, make Hugging Face dry runs avoid downloads/probes, and add regressions for probe budgets, direct URLs, dry-run exit codes, and sanitized failures.
|
Pushed additive follow-up at What changed:
Local verification:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbadb71d66
ℹ️ 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".
Suppress human preview text for Hugging Face dry runs when JSON is written to stdout and add direct-file/model regressions that parse the emitted JSON.
|
Pushed additive follow-up at What changed:
Local verification after this follow-up:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba3f314a9c
ℹ️ 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".
|
Current-head CI on The command now returns a valid JSON dry-run object ( Run: https://github.com/promptfoo/modelaudit/actions/runs/27342690555 |
Make the human-preview dry-run tests request text output explicitly so JSON defaults or config state cannot conflict with the JSON-stdout regressions.
|
Follow-up for the exact-head CI failure on
Local verification on the new head before push:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47fa65ece8
ℹ️ 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".
|
Independent review of exact head Filename-complete declared SafeTensors shard families can hide renamed payloads selected by other scanners. The selector skips a complete Exact-head reproductions:
Sniff content before applying the family skip unless the bytes are positively confirmed SafeTensors. Existing tests cover incomplete renamed families but not this complete-family case. Validation: focused shard/XGBoost, index/budget, gated/overlap, dry-run, resource, and reconciliation slices all passed; pinned DeepSeek-R1 metadata/text QA selected only README with zero body GETs. Ruff/format/mypy passed. Four long CI lanes were still pending at closeout. The P1 bypass blocks merge. |
|
Pushed additive follow-up at What changed:
Local verification on this head:
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…t13-hf-selective-skip-reads-20260610 # Conflicts: # modelaudit/utils/sources/huggingface.py
…t13-hf-selective-skip-reads-20260610
…t13-hf-selective-skip-reads-20260610 # Conflicts: # modelaudit/cli.py
…t13-hf-selective-skip-reads-20260610
…t13-hf-selective-skip-reads-20260610
…t13-hf-selective-skip-reads-20260610
…t13-hf-selective-skip-reads-20260610 # Conflicts: # modelaudit/cli.py # modelaudit/utils/sources/huggingface.py # tests/utils/sources/test_huggingface.py
Summary
Fixes Hugging Face streaming selection so shard-shaped
.safetensorsartifacts are skipped before any remote content probe when the SafeTensors scanner is excluded by scanner selection. This prevents metadata/text or other scanner-selective runs from issuing range/body reads against large skipped SafeTensors shards.Root Cause
_select_streamable_hf_files()correctly included files matching the selected scanner suffixes, but then the renamed-content-route loop could still call_detect_huggingface_content_route_format()on remaining files. For selected scanners such aspickle,scanner_ids_for_detected_format("safetensors")includes overlap scanners, so a large shard likemodel-00001-of-00002.safetensorsexcluded by suffix policy could still be range-read and selected after body sniffing.Security Tradeoff
The fix is intentionally narrow: it skips only shard-shaped SafeTensors filenames when
safetensorsis not selected. Unknown suffixes and non-shard.safetensorsfiles are still bounded-probed, so selected renamed malicious controls andpayload.safetensorsfiles whose bytes are pickle continue to route to the selected pickle scanner.Real-Model QA
Pinned reproduction target:
Harness behavior: forces the listed revision to
56d4cbbb4d29f4355bab4b9a39ccb717a14ad5ad, runsmodelaudit scan --stream --scanners metadata,text --quiet --format json --max-size 100MB hf://deepseek-ai/DeepSeek-R1, patchesrequests.getto fail on any artifact body/range probe, and asserts no selected.safetensorsfilenames.Observed outcome after the final fix:
EXIT 1is expected because the selected README scan records informational findings; the scan itself completed successfully and no skipped shard body/range GETs occurred.Validation