Skip to content

Simplify the canonical data loading boundary - #823

Merged
alxmrs merged 4 commits into
mainfrom
codex/canonical-reader-llc
Sep 1, 2026
Merged

alxmrs merged 4 commits into
mainfrom
codex/canonical-reader-llc

Conversation

@jder

@jder jder commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • rebase the canonical-reader refactor needed by Add opt-in Rust OM4 data loader #800 onto the LLC support landed in Add LLC CPU data canonicalization #670
  • replace the overlapping DatasetSpec / CanonicalDataset / OceanData abstractions with DataLayout, CanonicalSource, BatchPreprocessor, HostBatch, and ModelBatch
  • make the storage-independent reader accept explicit time indices and canonical channel names
  • push prognostic-versus-boundary selection into read requests instead of maintaining sliced source objects
  • move OM4-specific canonicalization into Om4DataSourceConfig.canonicalize_datasets
  • make OM4 and LLC canonicalizers derive their channel selections from variable keys and return the resulting DataLayout
  • keep raw source conventions such as LLC staggered masks and OM4 mask names out of DataLayout
  • preserve the grid-geometry, analysis-ready writer output, and training-progress changes currently on main

This intentionally does not add an LLC Rust loader. It establishes the narrower CanonicalReader seam that the Rust loader can implement later without exposing xarray or source-specific naming to the training pipeline.

Impact

Callers now request ordered canonical channels directly. Canonicalization owns source-specific naming, dimension, mask, and variable-selection rules, while DataLayout describes only the canonical/model-facing result. This removes repeated variable filtering and normalization wrappers from the hot data-loading path.

Validation

  • uvx pre-commit run --all-files
  • CUDA_VISIBLE_DEVICES='' uv run pytest -q -m 'not manual and not cuda'
    • 323 passed, 2 skipped, 10 xfailed

@oa-jder-bot
oa-jder-bot force-pushed the codex/canonical-reader-llc branch from 5c86eff to e19e931 Compare July 24, 2026 18:18
@oa-jder-bot
oa-jder-bot force-pushed the codex/canonical-reader-llc branch from e19e931 to 0272d29 Compare July 24, 2026 20:10
@oa-jder-bot
oa-jder-bot changed the base branch from main to fomo/delete-static-data-correctors-816 July 24, 2026 20:11
@oa-jder-bot
oa-jder-bot force-pushed the codex/canonical-reader-llc branch 2 times, most recently from adac072 to 2703fcf Compare July 24, 2026 20:33
Base automatically changed from fomo/delete-static-data-correctors-816 to main July 30, 2026 22:42
@alxmrs

alxmrs commented Aug 31, 2026

Copy link
Copy Markdown
Member

@fomo-bot will you make your best attempt to rebase in the main branch and address all outstanding merge conflicts?

@fomo-bot
fomo-bot force-pushed the codex/canonical-reader-llc branch from 2703fcf to f99a0b4 Compare August 31, 2026 23:20
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@alxmrs
alxmrs force-pushed the codex/canonical-reader-llc branch from f99a0b4 to 8a39ecb Compare August 31, 2026 23:30
@fomo-bot

Copy link
Copy Markdown
Collaborator

I fetched origin and attempted the requested rebase onto origin/main. Git reported codex/canonical-reader-llc is already up to date, so there were no merge conflicts to resolve and no commit/push was needed.

Validation completed:

  • No conflict markers found.
  • git diff --check origin/main...HEAD passed.
  • CUDA_VISIBLE_DEVICES= uv run pytest -m "not manual and not cuda" passed: 459 passed, 2 skipped, 68 deselected, 10 xfailed.
  • GitHub checks on head 8a39ecb5a944 are complete and passing/skipped as expected.

PR #823 is still MERGEABLE, but GitHub reports mergeStateStatus: BLOCKED because it is draft and still review-required, not because of merge conflicts.

Debug info

@alxmrs

alxmrs commented Sep 1, 2026

Copy link
Copy Markdown
Member

I have reviewed this change, focusing on the core parts which are data.py and dataset.py. I'm really excited to get it merged. It LGTM.

@alxmrs
alxmrs marked this pull request as ready for review September 1, 2026 00:17
@alxmrs

alxmrs commented Sep 1, 2026

Copy link
Copy Markdown
Member

@codex may I have your review?

@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: 8a39ecb5a9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/build_quickstart_notebook.py Outdated
Comment thread src/samudra/train.py
Comment thread src/samudra/train.py Outdated
@alxmrs

alxmrs commented Sep 1, 2026

Copy link
Copy Markdown
Member

@codex, my agent has attempted to address your concerns from a previous review. Will you please review this PR once again?

@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: b3d363ed92

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/samudra/config.py Outdated
Comment on lines +366 to +368
for coord in ("time", "lat", "lon"):
if coord in dataset.coords:
canonical = canonical.assign_coords({coord: dataset.coords[coord]})

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 curvilinear coordinates while expanding levels

When an OM4 source has y/x dimensions with 2-D lat/lon coordinates and grid_type: tripolar, with_lat_lon_coords preserves the real geometry as lat_2d/lon_2d, but this whitelist copies only time, lat, and lon into the new dataset. The resulting CanonicalSource.coordinates() therefore omits the real 2-D coordinates, and the save_zarr path aborts in ZarrWriter._output_coords because tripolar geometry cannot be reconstructed by broadcasting the 1-D axes. Copy the preserved curvilinear coordinates into the canonical dataset.

Useful? React with 👍 / 👎.

@alxmrs
alxmrs force-pushed the codex/canonical-reader-llc branch from b3d363e to 4399ced Compare September 1, 2026 22:31
@alxmrs

alxmrs commented Sep 1, 2026

Copy link
Copy Markdown
Member

@codex, may I have one more review?

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 4399ced28c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@alxmrs

alxmrs commented Sep 1, 2026

Copy link
Copy Markdown
Member

@fomo-bot Do you think this PR is ready to be merged? The GPU CI failures are because we can't request GPUs machines at this time, let's assume they would pass if we could. If you think this is ready, will you approve the PR?

@fomo-bot fomo-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed current head 4399ced. I did not find merge-blocking issues; CPU/pre-commit/data/container checks pass, and the GPU failure is EC2 capacity before tests run.

@fomo-bot

fomo-bot commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

I think this PR is ready to merge under the stated assumption that the GPU jobs would pass if runners could be provisioned.



I reviewed current head 4399ced28cc13d00e95b40a5fcadf2c817627c77, checked the full PR diff, review threads, current CI, and the local worktree. The remaining GPU failure is EC2 InsufficientInstanceCapacity before tests run; CPU, pre-commit, data tests, and container smoke are passing. Local validation also passed with 463 passed, 2 skipped, 68 deselected, 10 xfailed.



I approved PR #823. GitHub now reports reviewDecision: APPROVED and mergeable: MERGEABLE. mergeStateStatus is still BLOCKED because of the known GPU-capacity status failures.

Debug info

@alxmrs
alxmrs merged commit bc2624c into main Sep 1, 2026
18 of 20 checks passed
@alxmrs
alxmrs deleted the codex/canonical-reader-llc branch September 1, 2026 22:54
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Samudra Planning Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants