Skip to content

Restore global fiber workflows and native GPU/chunk tracing - #2231

Merged
hendrikschilling merged 15 commits into
mainfrom
main-fiber-layout-benchmark
Oct 22, 2026
Merged

hendrikschilling merged 15 commits into
mainfrom
main-fiber-layout-benchmark

Conversation

@hendrikschilling

@hendrikschilling hendrikschilling commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

In one sentence: Restore reusable global fiber-layout workflows and native CPU/GPU chunk tracing, including their evaluation, cache and prediction-pooling interfaces.

One real example: Re-evaluating supplied saved fiber-layout checkpoints with the restored tools reproduced their scores and all recorded objective terms, without rerunning optimization.

Before: Global-layout workflows were missing from the extracted package, and native tracing recovery was being reviewed separately in #2233.

After this PR: Shared CLIs and Python/native APIs expose both sets of functionality. Stage choices, dataset identity, projection scale and experiment settings are explicit inputs. Documentation contains minimal usage examples, not historical runs or tuned configurations. This PR incorporates the complete branch history of #2233; that PR is superseded by this combined review.

Proof: On the combined branch: 966 Python tests passed (9 skipped, one unchanged socket-dependent test deselected), plus three real-checkpoint checks including full-objective recomputation. The rebuilt native chunk/reverse-consistency/pooling tests passed 24 cases; native Python API tests passed 16 with one opt-in real-data test skipped. No fresh GPU solve or CUDA validation was run for this merge; #2233 records the original GPU and real-data tracing validation.

Why / where this is useful: Enables reproducible fiber-layout experiments through shared implementations rather than private experiment scripts.

  • I personally verified that the example and proof above were produced by this PR on the stated data.

Parts included

1. Global fiber-layout workflows (vesuvius)

  • Restores preparation, GT integration, neighbor expansion, parameter tuning, diagnostics, reference comparisons, visualization and surface export through reusable package entrypoints.
  • Preserves shared solver algorithms and loss semantics while making workflow configuration explicit.
  • Removes embedded experiment names, snapshot references, trial grids, reference IDs and stage presets; adds caller-setting regression tests and guards against embedded run identities.
  • Usage and configuration contracts: vesuvius/docs/fiber_workflows.md and vesuvius/docs/fiber_layout_benchmark.md.

2. Native CPU/GPU chunk tracing (incorporated from #2233)

  • Adds the optional CUDA chunk beam-tracing/refinement path and shared portable trace math while retaining CPU-only builds.
  • Restores chunk seed fitting, joining and normal-oriented conflict filtering, along with immutable unfiltered path caches and cache-only operation.
  • Extends seed/restart, width-validation, forward-presence and reverse-consistency handling, with native and Python regression coverage.
  • Design and usage: volume-cartographer/docs/fiber_chunk_tracing.md and volume-cartographer/docs/trace_recovery.md.

3. Prediction pooling and tracing evaluation integration

  • Adds read-only, RAM-cached pooled prediction views with explicit source/channel metadata and no scratch-volume writes.
  • Connects recovered tracing to the existing evaluation queue/cache interfaces and Python bindings.
  • Adds reusable chunk construction/filter benchmarks and explicit, verified legacy cache import.
  • Keeps data and run-specific configurations outside shared implementations; public docs provide usage examples rather than individual experiment recipes.

Merge verification

Current main was merged first. Conflicts were resolved in the archive ignore rules and benchmark documentation, retaining the generic docs and local archive exclusions. The #2233 branch then merged cleanly. The final integration cleanup changes documentation/test descriptions only, not numerical code.

python -m pytest -o pythonpath=vesuvius/src -q \
  vesuvius/tests/test_fiber_*.py vesuvius/tests/test_paired_*.py \
  -k 'not two_rank_sparse_adam_equivalence'

cmake --build volume-cartographer/build/fiber-evaluation \
  --target test_fiber_chunk_trace test_fiber_reverse_consistency \
  test_prediction_pooling vc_fiber_trace_metric vc_fiber_trace vc_volume -j 8

volume-cartographer/build/fiber-evaluation/bin/test_fiber_chunk_trace
volume-cartographer/build/fiber-evaluation/bin/test_fiber_reverse_consistency
volume-cartographer/build/fiber-evaluation/bin/test_prediction_pooling

python -m pytest -q \
  volume-cartographer/python/tests/test_fiber_recovery.py \
  volume-cartographer/python/tests/test_fiber_chunk_trace.py \
  volume-cartographer/python/tests/test_fiber_evaluation.py \
  --vc-build-python volume-cartographer/build/fiber-evaluation/python

Read-only checkpoint verification uses FIBER_LAYOUT_REFERENCE_SPEC with vesuvius/tests/test_fiber_workflows_real_data.py. Native merge verification used the existing Linux RelWithDebInfo CPU build; macOS/arm64 and CUDA were not rerun here. CPU/GPU bit identity is not claimed.

Automated verification was performed by Codex; the personal-verification checkbox is left for human review.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
scrollprize-org Ignored Ignored Preview Oct 22, 2026 4:28pm UTC

Request Review

@hendrikschilling

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T13:57:36.113853Z ba5e34e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba5e34e4de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ob=s['u_offsets'][s['v_offset_b'][edge]]
hu=torch.as_tensor(np.where(reverse,ob,oa),dtype=torch.float64)
vu=torch.as_tensor(np.where(reverse,oa,ob),dtype=torch.float64)
c=candidates(state[h],state[v],torch.as_tensor(dh),torch.as_tensor(dv),widths,sigma_h,hu,vu,**sigma_args)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve shared geometry when applying U offsets

When a checkpoint combines u_offsets with shared_curve_geometry or shared_curve_hypothesis_mapping, the initial call correctly evaluates the event-specific sh/sv geometry, but this second call restarts from raw state[h]/state[v]. It therefore drops the saved shared-curve positions while computing the corrected matches, producing incorrect match counts and U/V loss metrics for deformed shared-curve checkpoints; pass the already-prepared sh and sv here.

Useful? React with 👍 / 👎.

Comment on lines +73 to +75
l1=float(error.mean()),correct_percent=float(100*correct.mean()),median=float(np.median(error)),
p95=float(np.quantile(error,.95)),max=float(error.max()),sign_violations=int((signed&(order<0)).sum()),
signed_events=int(signed.sum()),sign_violation_percent=float(100*(signed&(order<0)).sum()/signed.sum()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle empty enabled cohorts in the inpainting report

If a solve rejects every event in either class, or the dataset contains no parallel or perpendicular events, error is empty and np.quantile(error, .95)/error.max() raises after the optimization has completed. Rejection is a valid model outcome, so this reporting path should emit None metrics for empty cohorts (and guard the zero signed-event denominator) rather than losing the completed workflow.

Useful? React with 👍 / 👎.

Comment on lines +45 to +46
manifest=root/'download_manifest.json';previous={}
if manifest.exists():previous={entry['key']:entry for entry in json.loads(manifest.read_text())['objects']}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove stale objects when refreshing a reference prefix

When an existing output_root is refreshed after an object is removed from the S3 prefix—or is reused for a different prefix—the old local file is never rejected or deleted, while the new manifest simply omits it. A required file missing from the new source can therefore be silently supplied by the previous download, yielding a mixed reference surface whose on-disk contents do not match the recorded source; verify the manifest source and prune or reject local files absent from the current listing.

Useful? React with 👍 / 👎.

hashes=validate_sources(cfg,doc)
path=Path(settings['output_root'])/item['label'].lower()
meta=json.loads((path/'meta.json').read_text());stats=json.loads((path/'surface_statistics.json').read_text())
assert meta['scale']==[1/settings['grid_step']]*2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the surface exporter's default grid step in audits

construct() treats grid_step as optional and defaults it to 100, so a surface can be successfully generated from a valid configuration that omits this setting. Auditing that same configuration then raises KeyError here instead of validating the artifact; use the same default as the exporter or read the recorded step from the surface statistics.

Useful? React with 👍 / 👎.

@hendrikschilling hendrikschilling changed the title Restore global fiber workflows, diagnostics, and regression tests Restore global fiber workflows and native GPU/chunk tracing Oct 22, 2026
@hendrikschilling
hendrikschilling enabled auto-merge (squash) October 22, 2026 15:25
@hendrikschilling
hendrikschilling merged commit 72600fe into main Oct 22, 2026
33 of 34 checks passed
@hendrikschilling
hendrikschilling deleted the main-fiber-layout-benchmark branch October 22, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants