[GH-ISSUE #4088] [Other] Setup marks a shard "whole" without its SHA-256 when the previous run stopped between the rename and the hash check #1780

Closed
opened 2026-11-04 01:54:00 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @abdou-rgd on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4088

Area

[Other] (anything else, including setup and installation)

Desktop app, Terminal or source?

Desktop app (Windows, Linux or Mac)

What happened

Both IQ2_XS shards ended up with a .done mark that says whole (checked against its own tensor directory), even though their SHA-256 does not match the pinned value. The model loaded and answered normally, so nothing pointed to the problem.

The PC had faulty RAM that day (Windows Memory Diagnostic removed bad memory ranges, and five bugchecks 0x0A/0x34 in nt!Mi*, one bucketed hardware_ram). Every crash happened during the install. The two shards were written while the RAM was unstable, so the corruption itself comes from the hardware, not from Strata. The bug is that setup accepted the corrupted files.

Shard Pinned SHA-256 (ISTA_FILES, matches the Hub lfs.oid at ed59f920) SHA-256 on disk
…IQ2_XS-00001-of-00002.gguf (39,225,954,592 B) 92cee27a…0a49d7 70299200fa0704df77162ae3542aaceae64f5709a967afd10446a592c2f83ce0
…IQ2_XS-00002-of-00002.gguf (28,800,138,432 B) 316b46f3…61e113 98cbbb84abee8c3375a700f3af767d549905f2da9e6c3b0dfe8eaeda7569a0be

Hashed with Get-FileHash after the RAM was stable again (shard 2 hashed twice, same value both times). The sizes are correct. The picture reader, whose mark says sha256 b1a82259…, hashes correctly.

Where it happens (control/setup.py, 0.1.48):

download() already handles this case: a file at full size with no mark is hashed (verify_sha256(dst, *fixed, repair=again), around line 2694, "finished by an older setup (no mark yet), or stopped before the check").

But before download() runs, step 5 marks any existing, unmarked shard that passes whole_shard() (around lines 8600 and 7725, from #173, for files copied in by hand):

for s in ([] if ready else shards):
    if s.exists() and not done(s) and whole_shard(s):
        mark(s, "whole (checked against its own tensor directory)")

whole_shard() only checks that the file is as long as its tensor directory says. Once the mark exists, done() is true, download() skips the file, and the pinned hash is never checked.

Expected: a shard that has a pinned hash should be hashed before it is marked, whether it was copied in by hand or left by a stopped run. For example, the #173 pre-pass could skip files that have a pin and let download()'s existing "stopped before the check" path verify and repair them.

Side effect: deleting the .done marks is not enough to recover: the next run marks the files "whole" again. The only way out is to delete the shards and download all 68 GB again, even though repair_download() could fix the bad blocks.

Smallest steps or command that reproduce it

Observed once, not triggered on purpose. Timeline (local time):

  1. 09:57 shard 1 renamed into place → 09:58 bugcheck (during the SHA-256 check, which takes minutes on 39 GB)
  2. 10:07 next run: shard 1 .done = whole (checked against its own tensor directory)
  3. 10:12 shard 2 renamed into place → 10:12 bugcheck
  4. 10:26 next run: shard 2 .done = whole (checked against its own tensor directory)

Without a crash, the same path should be reachable by killing setup after a shard's .part is renamed and before verify_sha256 finishes, then flipping a byte in the shard and running setup again (not tried).

Reproduction status

Reproduced locally

Strata version

Strata desktop 0.2.3 · control 0.1.48 (5c8dd32) · engine 0.1.48, then 0.1.50

Graphics card, memory and system

RTX 3060 12 GB · 32 GB RAM (4×8 GB DDR4) · Ryzen 5 3600 · Windows 11 (26200)

Model, size and settings

Qwen3.8-Flash-Next IQ2_XS (GSQ-RCO) · 32K context · pictures on

Logs

The .done marks as found on disk:

C:\Users\<user>\Documents\Strata\Models\IQ2_XS\Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf.done: whole (checked against its own tensor directory)
C:\Users\<user>\Documents\Strata\Models\IQ2_XS\Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf.done: whole (checked against its own tensor directory)
C:\Users\<user>\Documents\Strata\Models\mmproj-Qwen3.8-Flash-Next-BF16.gguf.done: sha256 b1a82259702816a5330d7bd7607cd9676b11780e79ff7348c21103ff3ce49bd0
Originally created by @abdou-rgd on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4088 ### Area [Other] (anything else, including setup and installation) ### Desktop app, Terminal or source? Desktop app (Windows, Linux or Mac) ### What happened Both IQ2_XS shards ended up with a `.done` mark that says `whole (checked against its own tensor directory)`, even though their SHA-256 does not match the pinned value. The model loaded and answered normally, so nothing pointed to the problem. The PC had faulty RAM that day (Windows Memory Diagnostic removed bad memory ranges, and five bugchecks 0x0A/0x34 in `nt!Mi*`, one bucketed `hardware_ram`). Every crash happened during the install. The two shards were written while the RAM was unstable, so the corruption itself comes from the hardware, not from Strata. The bug is that setup accepted the corrupted files. | Shard | Pinned SHA-256 (`ISTA_FILES`, matches the Hub `lfs.oid` at `ed59f920`) | SHA-256 on disk | | --- | --- | --- | | `…IQ2_XS-00001-of-00002.gguf` (39,225,954,592 B) | `92cee27a…0a49d7` | `70299200fa0704df77162ae3542aaceae64f5709a967afd10446a592c2f83ce0` | | `…IQ2_XS-00002-of-00002.gguf` (28,800,138,432 B) | `316b46f3…61e113` | `98cbbb84abee8c3375a700f3af767d549905f2da9e6c3b0dfe8eaeda7569a0be` | Hashed with `Get-FileHash` after the RAM was stable again (shard 2 hashed twice, same value both times). The sizes are correct. The picture reader, whose mark says `sha256 b1a82259…`, hashes correctly. **Where it happens** (`control/setup.py`, 0.1.48): `download()` already handles this case: a file at full size with no mark is hashed (`verify_sha256(dst, *fixed, repair=again)`, around line 2694, "finished by an older setup (no mark yet), or stopped before the check"). But before `download()` runs, step 5 marks any existing, unmarked shard that passes `whole_shard()` (around lines 8600 and 7725, from #173, for files copied in by hand): ```python for s in ([] if ready else shards): if s.exists() and not done(s) and whole_shard(s): mark(s, "whole (checked against its own tensor directory)") ``` `whole_shard()` only checks that the file is as long as its tensor directory says. Once the mark exists, `done()` is true, `download()` skips the file, and the pinned hash is never checked. **Expected:** a shard that has a pinned hash should be hashed before it is marked, whether it was copied in by hand or left by a stopped run. For example, the #173 pre-pass could skip files that have a pin and let `download()`'s existing "stopped before the check" path verify and repair them. **Side effect:** deleting the `.done` marks is not enough to recover: the next run marks the files "whole" again. The only way out is to delete the shards and download all 68 GB again, even though `repair_download()` could fix the bad blocks. ### Smallest steps or command that reproduce it Observed once, not triggered on purpose. Timeline (local time): 1. 09:57 shard 1 renamed into place → 09:58 bugcheck (during the SHA-256 check, which takes minutes on 39 GB) 2. 10:07 next run: shard 1 `.done` = `whole (checked against its own tensor directory)` 3. 10:12 shard 2 renamed into place → 10:12 bugcheck 4. 10:26 next run: shard 2 `.done` = `whole (checked against its own tensor directory)` Without a crash, the same path should be reachable by killing setup after a shard's `.part` is renamed and before `verify_sha256` finishes, then flipping a byte in the shard and running setup again (not tried). ### Reproduction status Reproduced locally ### Strata version Strata desktop 0.2.3 · control 0.1.48 (5c8dd32) · engine 0.1.48, then 0.1.50 ### Graphics card, memory and system RTX 3060 12 GB · 32 GB RAM (4×8 GB DDR4) · Ryzen 5 3600 · Windows 11 (26200) ### Model, size and settings Qwen3.8-Flash-Next IQ2_XS (GSQ-RCO) · 32K context · pictures on ### Logs The `.done` marks as found on disk: ``` C:\Users\<user>\Documents\Strata\Models\IQ2_XS\Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf.done: whole (checked against its own tensor directory) C:\Users\<user>\Documents\Strata\Models\IQ2_XS\Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf.done: whole (checked against its own tensor directory) C:\Users\<user>\Documents\Strata\Models\mmproj-Qwen3.8-Flash-Next-BF16.gguf.done: sha256 b1a82259702816a5330d7bd7607cd9676b11780e79ff7348c21103ff3ce49bd0 ```
Author
Owner

@XiaoBinGan commented on GitHub (Oct 27, 2026):

A fix for this is in #4318: the #173 pre-pass now leaves a file alone when the pin table names it, so download() takes its existing "finished by an older setup (no mark yet), or stopped before the check" path, hashes it, repairs the damaged parts and writes the finish mark itself.

--gguf-dir keeps the old behaviour (a person's own file is not a download and setup does not hash-check it today either way), and so does a file with no pin, so the hand-copied case #173 was written for still works. Both flows that had the loop copy-pasted (main() and mac_control_setup()) now call one helper.

Verified: python -m unittest tools.test_setup_download is 32 tests with 1 failure with the change, and 1 failure + 3 errors without it (the errors are the new tests not finding the helper). The one failure is ParallelDownload.test_a_big_file_comes_over_several_connections, a parallel-ranged-download timing assertion that fails the same way on this Windows checkout without the change, three runs out of three.

One trade worth naming: after a crash the next run now spends the hash time (minutes on 39 GB) that the faulty mark used to skip. That is the point of the issue — the mark skipped the only check that can find a damaged shard — but it is a real cost for a large model on a slow disk.

Not run: the crash scenario end to end (kill setup between the rename and the hash, flip a byte, run again). The tests drive the decision function and assert the resulting on-disk state; your report is the evidence that the state occurs.

<!-- gh-comment-id:6443911434 --> @XiaoBinGan commented on GitHub (Oct 27, 2026): A fix for this is in #4318: the #173 pre-pass now leaves a file alone when the pin table names it, so download() takes its existing "finished by an older setup (no mark yet), or stopped before the check" path, hashes it, repairs the damaged parts and writes the finish mark itself. --gguf-dir keeps the old behaviour (a person's own file is not a download and setup does not hash-check it today either way), and so does a file with no pin, so the hand-copied case #173 was written for still works. Both flows that had the loop copy-pasted (main() and mac_control_setup()) now call one helper. Verified: python -m unittest tools.test_setup_download is **32 tests with 1 failure** with the change, and **1 failure + 3 errors** without it (the errors are the new tests not finding the helper). The one failure is ParallelDownload.test_a_big_file_comes_over_several_connections, a parallel-ranged-download timing assertion that fails the same way on this Windows checkout without the change, three runs out of three. One trade worth naming: after a crash the next run now spends the hash time (minutes on 39 GB) that the faulty mark used to skip. That is the point of the issue — the mark skipped the only check that can find a damaged shard — but it is a real cost for a large model on a slow disk. Not run: the crash scenario end to end (kill setup between the rename and the hash, flip a byte, run again). The tests drive the decision function and assert the resulting on-disk state; your report is the evidence that the state occurs.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Hello abdou-rgd,

Thank you for the exact description. In Strata 0.2.11 a shard whose SHA-256 is pinned is hashed (and repaired if needed) before it is marked finished, so a run that stopped between the rename and the hash check is no longer taken as whole. Files with no pinned hash, and --gguf-dir folders, keep the old mark. If a model still fails to load because of a bad shard on 0.2.11, delete the .done file of that shard and run setup again, and tell us if the hash differs.

The Strata project

<!-- gh-comment-id:6658449481 --> @Niko1221 commented on GitHub (Nov 5, 2026): Hello abdou-rgd, Thank you for the exact description. In Strata 0.2.11 a shard whose SHA-256 is pinned is hashed (and repaired if needed) before it is marked finished, so a run that stopped between the rename and the hash check is no longer taken as whole. Files with no pinned hash, and `--gguf-dir` folders, keep the old mark. If a model still fails to load because of a bad shard on 0.2.11, delete the `.done` file of that shard and run setup again, and tell us if the hash differs. The Strata project
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1780
No description provided.