pool: one tree-wide code-images/ pool per results-dir; per-org pools stay readable - #854
Merged
Merged
Conversation
…relocation, CHECK-01/03/04 + 2.1.2 readers, reportgen href, runs gc
…stay readable Code images now live in `<results-dir>/code-images/code-<hash8>/`, one content-addressed pool shared by every organization and both divisions, instead of one pool per organization at `<results-dir>/<orgname>/`. Identical images from two submitters coincide in a merged reviewer tree, `runs gc` has one place to sweep, and the pool no longer collides with the org's own results subtree. Writer: - `capture_or_verify_code_image` captures into / reuses from `code-images/` and writes the `.mlps-image-pool` sentinel there; it never creates `<results-dir>/<orgname>/` any more. - `legacy_migration.migrate_org_pool` relocates a v3.0 per-org pool into `code-images/` (rename; copy+rename on EXDEV; duplicates dropped only after the kept copy re-hashes clean), removes the org sentinel and the empty org dir. Run leaves are never rewritten: pointers are hash-only. - `_check_and_migrate_legacy_layout` runs legacy `code/` migration (now materializing into `code-images/`), then the org-pool relocation, then the #716 sentinel self-heal. Fast path: global sentinel present and no `<orgname>/` dir means two `exists` probes and nothing else. Readers (per-org read-compat is permanent — the frozen v3.0 tree has 19 per-org pools and validates byte-for-byte as before): - `code_image.resolve_pool_image`: `code-images/` first, then the leaf's own `<org>/` pool; never another org's pool. - CHECK-01 accepts either sentinel as the org's pool root and resolves through both layouts; the not-found message names both places. - CHECK-02/03 iterate the global root plus every per-org root. CHECK-03 counts references from every org against `code-images/` and, as before, only the org's own leaves against `<org>/`. - CHECK-04 flags an unsentinelled `code-images/` as a partial migration (D-91) and warns on an empty one (D-90); a per-org pool with its sentinel is a supported layout and draws no diagnostic. - 2.1.2 treats `code-images` as a reserved top-level name. - reportgen Code/Logs hrefs point at `code-images/code-<hash8>/` when the image lives there, else `<org>/code-<hash8>/` as today. - `mlpstorage runs gc` discovers the global pool by its sentinel. Docs: Rules.md §2.1.2, §2.1.5.a/b (stale "code" subdir removed), §2.1.6 (pool location + v3.0 compat paragraph), §2.1.27 diagram; ManPage RESULTS DIRECTORY tree + FILES. Validator-diff proof on ~/MLPerfStorage/submissions_storage_v3.0 (main 58a55af vs this branch): 644 rule lines both, per-level and per-rule counts identical, summary.csv byte-identical; the only text change is the pre-existing HPE CHECK-01 message gaining "(looked in code-images/ and HPE/)". Tests: new tests/unit/test_global_code_image_pool.py (29); the per-org pool tests are rewritten for the shared pool (cross-org sharing replaces per-org isolation); D-74 source test now allows two status lines per migration routine.
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
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.
Fourth and last PR of the results-dir hygiene effort (#851 logging, #852 resolver, #853
runs). Scope was narrowed on 2026-09-18 to the pool relocation only; leaf version stamping and the per-submission manifest follow as a separate PR once their schema is settled.What changes
Code images now live in
<results-dir>/code-images/code-<hash8>/— one content-addressed pool per tree, shared by every organization and both divisions — instead of one pool per organization at<results-dir>/<orgname>/. Identical images from two submitters coincide in a merged reviewer tree,runs gchas one place to sweep, and the pool no longer sits next to the org's own results subtree.Per-organization pools remain readable permanently. The frozen v3.0 submissions tree carries 19 of them and must validate exactly as before (see proof below). Nothing ever rewrites a run leaf: pointers are hash-only, so relocation never touches
.mlps-code-image.Writer
capture_or_verify_code_imagecaptures into / reuses fromcode-images/and writes the.mlps-image-poolsentinel there. It no longer creates<results-dir>/<orgname>/.legacy_migration.migrate_org_poolrelocates a v3.0 per-org pool intocode-images/:os.renameper image (copy + rename on EXDEV), duplicates dropped only after the kept copy re-hashes clean, org sentinel removed, empty org dir removed. Idempotent, crash-resumable, two status lines (D-74)._check_and_migrate_legacy_layoutnow runs, in order: legacycode/migration (materializing intocode-images/), org-pool relocation, the [BUG]“.mlps-image-pool” sentinel never auto-created, causing validate to ERROR #716 sentinel self-heal. Fast path when the global sentinel exists and no<orgname>/dir does: twoexistsprobes, nothing else.Readers
code_image.resolve_pool_image(results_dir, hash, orgname):code-images/first, then the leaf's own<org>/pool, never another org's pool (same isolation as before).code-images/, and — as before — only the org's own leaves against<org>/.code-images/(D-91) and warns on an empty one (D-90). A per-org pool with its sentinel is a supported layout and draws no diagnostic.code-imagesas a reserved top-level name.code-images/code-<hash8>/when the image is there, else<org>/code-<hash8>/as today.mlpstorage runs gcdiscovers the global pool by its sentinel (no code change needed).Docs
Rules.md §2.1.2, §2.1.5.a/b (the stale "code" subdirectory text is gone), §2.1.6 (new location + v3.0 compatibility paragraph), §2.1.27 diagram. ManPage RESULTS DIRECTORY tree and FILES. No CLI surface changed; the
--help_allparity suite is untouched.Validator-diff proof (v3.0 tree)
main(58a55af, worktree) vs this branch on~/MLPerfStorage/submissions_storage_v3.0@ b50de9cf0:Some … checks failed forlinesThe only text change is the pre-existing HPE CHECK-01 error (
code-64104f04/, still unuploaded) gaining "(looked in code-images/ and HPE/)".An earlier draft pooled CHECK-03 references across orgs, which silently cleared two Nebius orphan errors; per-org semantics were restored for per-org pools so the frozen tree's findings are unchanged.
Smoke test (real CLI, scratch tree)
init→closed training unet3d datasizecaptured intocode-images/code-d1dd9bfcwith sentinel and pointer; second invocation reused it; moving the pool toSmokeOrg/by hand and running again relocated it back ("Relocating SmokeOrg's code-image pool into code-images/ (1 images)…");validatereports no CHECK-0x or 2.1.2 findings.Tests
RED first (cbf3eed), then GREEN (6adb19f). New
tests/unit/test_global_code_image_pool.py(29 tests). The per-org isolation tests are rewritten as cross-org sharing tests; migration/capture tests re-pointed at the new location; the D-74 source test now allows two status lines per migration routine.All four CI suites locally: tests 3641 passed, mlpstorage_py/tests 947, kv_cache 238, vdb 228.