Repository navigation
strata_pack.py build: refuse an output directory that already holds a pack, naming the file - #634
Closed
Avicennasis wants to merge 1 commit into
Closed
Avicennasis wants to merge 1 commit into
Avicennasis wants to merge 1 commit into
Conversation
… pack, naming the file build did mkdir(exist_ok=True) and then wrote experts.bin, dense.bin, embd.bin and manifest.json over whatever pack the directory held, with nothing said. Now a manifest.json, index.txt or native_experts.txt in --out (the files the engine reads a pack's identity from) stops build before it opens the GGUF or writes a byte, naming the directory and the file; it returns 1 like the other refusals. An empty or absent directory proceeds as before, and so does experts.bin without manifest.json: build writes the manifest last, so that is a build that did not finish, not a pack. tools/test_shards.py: each marker is refused with the path and the file named and nothing in the directory touched; an empty and an absent directory go on into the build; an unfinished build is rebuilt.
Owner
|
Fixed in 0.1.40: strata_pack build refuses an output directory that already holds a pack, naming the file. build --force rebuilds into it, and setup passes --force when it rebuilds a pack that lost its index.txt or experts.bin. |
anon761
pushed a commit
to anon761/Strata-upstream
that referenced
this pull request
Oct 6, 2026
…iko1221#634) Co-authored-by: Léon Avic Simmons <Avicennasis@gmail.com>
sskver
pushed a commit
to sskver/Strata
that referenced
this pull request
Oct 7, 2026
…iko1221#634) Co-authored-by: Léon Avic Simmons <Avicennasis@gmail.com>
MistVVK
added a commit
to MistVVK/XeStrata
that referenced
this pull request
Oct 8, 2026
…iko1221#634) 取り込んだ strata_pack.py は、pack のあるフォルダーへの build を --force なしでは断る。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One fail-closed change on the packer, with a test that runs without a model or a GPU.
strata_pack.py build: an occupied--outis refused before anything is writtenbuild()didout_dir.mkdir(parents=True, exist_ok=True)(tools/strata_pack.py:207) and then wroteexperts.bin(:229, throughpack_layer.build, which opens it"wb"),dense.bin,embd.binandmanifest.jsonover whatever the directory held, with nothing said. A--outpointed at a finished pack - this tool's, oriq_pack.py's, whosedense.binandexperts.binshare names with this tool's - was overwritten in place, and a build that stopped partway left the oldmanifest.jsondescribing the new, half-written files.Now a
manifest.json,index.txtornative_experts.txtin--outstopsbuildbefore it opens the GGUF or writes a byte, naming the directory and the file, and returns 1 like the other refusals inbuild:Those three are the files the engine reads a pack's identity from (
src/core/expert_source.cpp:2289, the fingerprint), so "holds a pack" means the same thing to the tool and to the engine.experts.binon its own does not count:buildwritesmanifest.jsonlast, soexperts.binwithout it is a build that did not finish, and it is rebuilt as before. An empty or absent directory proceeds as today. There is no resume to keep -pack_layer.buildhas no sidecar and rewritesexperts.binfrom the start - so none was invented. (The same rule in Swiftlet #41 and Colibri41b4544: the manifest-equivalent is refused, and only an explicit install sidecar resumes.)Where this meets setup:
setup.py:3503re-runsbuildwhenindex.txtorexperts.binis missing from the pack directory. An interrupted conversion (nomanifest.jsonyet) is rebuilt as before. A directory with a finished pack and noindex.txt(pack_index.pyinterrupted afterbuildfinished), or withexperts.bindeleted by hand, now stops setup at this message instead of rewriting the directory; deleting it and running setup again is the way through, and is what the rewrite did to it anyway.setup.pyis not touched.Test:
tools/test_shards.py(python -m unittest tools.test_shards), with the GGUF reader replaced by a sentinel so "went on into the build" is observable without the model's shards: each of the three markers is refused with the path and the file named and the directory's contents untouched; an empty and an absent directory go on into the build;experts.binwithoutmanifest.jsongoes on too.What I ran, and where
Linux x86_64 (Ubuntu 24.04, AMD Ryzen 7 5800X - no AVX-512, no NVIDIA GPU), Python 3.12.3. Nothing under
src/is touched, so nothing was built.python -m unittest tools.test_shards: 10 tests OK (the 7 from setup: name a missing or short shard with its numbers; verify reads back the manifest sha256 #92 plus 3). Againstmain'stools/strata_pack.pywith the same test file: 3 errors - every marker subtest, because the build goes on into the GGUF (the sentinel raises) instead of returning 1.python -m unittest tools.test_calibrate: 14 OK.git diff --checkclean.Branch is on
99f3dbd(0.1.38); happy to rebase if it has moved by the time you look.