Repository navigation
hf: --hf takes a revision, <repo>@<rev>[:<quant>]; its listing, files and cache directory are that revision's - #963
Conversation
… and cache directory are that revision's
f2a1530 to
f314f99
Compare
There was a problem hiding this comment.
Verdict: CLEAN: No blocking defect was found in revision selection, cache isolation, or companion fetches.
Non-blocking
⚠ FAIL-first evidence: crates/hf/src/fetch.rs:1805. The body gives passing results without a failing run. Force Client::hub_at to select main, run the revision test, and paste the failure followed by the restored passing run. This confirms the regression is caught before users populate revision caches.
Checked
Duplicates: 5 new functions checked; no duplicate owner or unused addition found. dryer reported 0 candidate pairs.
Complexity: crapper flagged no function. Growth consists of revision parsing and revision-conflict branches. The changes affect startup and tools, with no decode or prefill work added.
Silent failure: 3 changed default expressions followed to their consumers. They select the client revision or main when no revision is supplied. Malformed revisions return HfError::Repo.
Tests, static mutation checks: dropping revision storage at crates/hf/src/lib.rs:225 fails the parse assertion; storing Some("main") for an omitted revision there fails the source and Metal struct assertions. Ignoring the explicit revision at crates/hf/src/fetch.rs:380 fails the downloaded-content assertion; using the unqualified repo in offline_set fails the cached-path assertion. Dropping the base revision at crates/gpu-gates/src/model_file/fetch.rs:300 fails the sentence-prefix assertion and its parent process check. Removing the refusal at crates/model-hf/src/bin/fixture.rs:475 fails the duplicate-revision assertion, including @main.
Gates: no pin, tolerance, lint level, test, or case removed or relaxed.
Escape catalog: C1–C4 do not match the changes. Invalid revisions, an uncached revision beside cached main, and revision-qualified checkpoint/projector paths were traced through their guards and consumers.
Notes
dryer skipped crates/gpu-gates; its changes were searched manually. Tests were reviewed statically and were not rerun. The body supplies no just gate-* card run with the required evidence.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/model_file/fetch.rs, crates/gpu-gates/src/side_seat/flags.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
--hf가<repo>@<rev>[:<quant>]형식으로 브랜치, 태그, 커밋 hash를 받고, 그 revision의 목록, 파일, cache 디렉터리를 함께 따르게 합니다.Part of #565.
What and why
--hf <repo>[:<quant>]always read the repo'smainbranch. This adds--hf <repo>@<rev>[:<quant>], whererevis a branch, tag or commit hash. The file listing, every downloaded file and the cache directory all use that revision, so a pinned model does not move whenmaindoes. Without@<rev>nothing changes: the repo is read atmainand the cache path stays<owner>/<name>/, so existing caches are not downloaded again.@mainis the same as no revision.crates/hf/src/lib.rs):RepoRef::parsereadsowner/name[@rev][:quant]. The revision follows the same character rule as the owner and the name. An empty revision,.., a second@, a/or a space is a namedHfError::Repo.RepoRef::id()returnsowner/nameorowner/name@rev; the hub URLs and the cache both take that one name.crates/hf/src/fetch.rs): the listing readstree/<rev>and each download readsresolve/<rev>.Client::hub_at(id)gives the repo and the revision for both: the revisionidnames, else the client's--revisionpin. An explicit@<rev>wins over the pin. Cache paths, the offline check and the fetch events useid(), so offline start never serves another revision's verified files. A branch that moves during one start is refused by the existing digest check (HfError::Hash).crates/gpu-gates/src/model_file/fetch.rs): the read of a repo's architecture before the download lists and reads the file header at the same revision, where it readmainbefore.--hfwith--revisionis still refused; the message now points to--hf <repo>@<rev>.mainis stored under<owner>/<name>@<rev>/. The same commit given once as a branch and once as a hash has two directories.crates/gpu-gates/src/model_file/fetch.rs,crates/gpu-gates/src/bin/bloomery_serve.rs,crates/gpu-gates/src/side_seat/flags.rs): the image projector, the sentence-transformers config, the decide seat's model card and the--embd-hfprojector are fetched from the same revision as the model. Abase_model: org/base@revline in a model card reads the base's sentence-transformers config at that revision, not atmain.fixture fetch <repo>@<rev>:<quant>(crates/model-hf/src/bin/fixture.rs) uses the revision and refuses it together with--rev, also when the target says@main.docs/serving.md, thebloomery-serveusage text, theBLOOMERY_CACHEdescription incrates/levers/src/registry.rsand theAsk::hfdoc.Release notes: Added:
--hf <repo>@<rev>[:<quant>]fetches a model at a branch, tag or commit; without@<rev>it readsmainas before.Code shape
RepoRef::parsewithRepoRef::id, and the serve, fixture, projector and Metal paths all go through it.hfcrate and its callers; no model file gained a branch.fixture fetchnames the conflict when the revision is given twice.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line): none. The duplicate scan reported no candidates.What I ran
Head
f2a15308f818a383a28a30974080eddd97a49a75, one commit on main516e758a2267650a865a7d585e6fd123ad3277c7.The new test
fetch::tests::a_revision_names_the_listing_the_files_and_the_cacheserves two listings from a local fixture. It checks thata/b@v1downloads thev1listing and files intocache/a/b@v1/, that no revision and@mainsharecache/a/b/without mixing contents, and thatresolve_exactfinds thev1directory. Offline,@v1uses its verified files and@v2is refused withHfError::Offlineeven when themainset is cached. The parse test gained accepted and refused revision spellings.bloomery-serve, built and started on a DGX Spark (GB10) with an empty cache:/v1/modelsanswersggml-org/lev-GGUF@2ef3b3c3ab3defcab1058ab34cac52c467fa9304, and the file is cached underggml-org/lev-GGUF@2ef3b3c3ab3defcab1058ab34cac52c467fa9304/.ggml-org/lev-GGUF/, the existing cache path, and/v1/modelsanswersggml-org/lev-GGUF. The two directories do not share files.The sentence-prompts gate and the
fixture fetchrefusals ran on a DGX Spark (GB10), see Hardware:The new
base-revcase puts different prefixes at the base'smainandv1on a local hub fixture and requires thev1prefix. The other 20 sentence-prompts cases (base, own, no-card, no-base-config, malformed) pass as well.The architecture read against the real hub, on an RTX 5090 machine,
bloomery-servebuilt with--features glm5next,clef,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf --release. Acurlwrapper onPATHlets only listing and Range requests through and records each hub URL; no model file is downloaded:With
@766911a6b7369840a91dbcd95f9f997acaab6cd6the listing and the header reads go to that commit; without a revision they go tomain.Hardware (if the change is for a machine)
DGX Spark (GB10):
bloomery-servewith the two--hfforms above, the sentence-prompts gate and thefixture fetchrefusals. RTX 5090: the architecture read above.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.