Cion-lab commited on
Commit
b856632
·
verified ·
1 Parent(s): 59b8c35

prep stage 4: assert on n_hub, not on the log-capped missing list

Browse files
Files changed (1) hide show
  1. kernels/phase4_prep.py +6 -3
kernels/phase4_prep.py CHANGED
@@ -269,10 +269,13 @@ with open(p, "r+b") as fh:
269
  fh.write(b)
270
  assert hubckpt.verify_checkpoint(REPO, local, SUB, repo_type="dataset")["ok"], "restoring did not help"
271
 
272
- # 2. A path that is not on the Hub at all: nothing listed means nothing verified.
 
 
273
  v3 = hubckpt.verify_checkpoint(REPO, local, "ckpt/checkpoint-99999999", repo_type="dataset")
274
- print("VERIFY_ABSENT ok", v3["ok"], "missing", len(v3["missing"]), "of", v3["n_local"], flush=True)
275
- assert not v3["ok"] and len(v3["missing"]) == v3["n_local"], v3["missing"][:3]
 
276
 
277
  # 3. A server that ignores Range and streams the whole object: the read-back must fail rather than pay
278
  # for 850 MB, because a silent full download is the thing this change exists to prevent.
 
269
  fh.write(b)
270
  assert hubckpt.verify_checkpoint(REPO, local, SUB, repo_type="dataset")["ok"], "restoring did not help"
271
 
272
+ # 2. A path that is not on the Hub at all: nothing listed means nothing verified. `missing` is capped at
273
+ # ten entries because it is a log field, so the uncapped fact (`n_hub`) is what the assertion uses --
274
+ # rehearsing this stage caught that, not a defect in the verifier.
275
  v3 = hubckpt.verify_checkpoint(REPO, local, "ckpt/checkpoint-99999999", repo_type="dataset")
276
+ print("VERIFY_ABSENT ok", v3["ok"], "n_hub", v3["n_hub"], "missing(shown)", len(v3["missing"]),
277
+ "of n_local", v3["n_local"], flush=True)
278
+ assert not v3["ok"] and v3["n_hub"] == 0 and v3["missing"], v3
279
 
280
  # 3. A server that ignores Range and streams the whole object: the read-back must fail rather than pay
281
  # for 850 MB, because a silent full download is the thing this change exists to prevent.