Skip to content

Notebook sync durability test: pick the abandoned-restore victims in the state's own order - #15548

Merged
danielhanchen merged 1 commit into
mainfrom
ci-nb-restore-victims-state-order
Oct 27, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-nb-restore-victims-state-order

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

tests/python/test_docker_nb_refresh_state_durability.py::test_an_abandoned_restore_puts_the_tree_back can fail on a Linux runner with no change involved, e.g. Repo tests (CPU, studio) on #15529 (job 122110779747, base ca640b8):

AssertionError: section 1b restored all 50 notebooks after deciding the state could not be written; the guard is evaluated once instead of per iteration

Cause

The test deletes 50 notebooks and caps file size so that appends to the rewritten state start failing about 488 records in, then checks that section 1b stopped restoring after the first failed append. It picked the victims by name (the 50 highest), assuming they are the last 50 records. But unsloth_sync_notebooks.sh writes the state in find order, which is directory order. On XFS that happens to be creation order, so the victims straddle the cap and about 38 are restored. On ext4 (the runner's filesystem) directory order follows a per-filesystem hash, so the 50 highest names can all sit before the cap, every one of them is restored before any append fails, and the test reports a broken guard that is not broken.

The script is right: it rewrites the state in its own order and stops restoring after the first failed append. Only the test's choice of victims depended on the filesystem.

Change

The victims are now the last 50 records in the state file's own order, so they straddle the cap whatever the directory order is. A new assert also requires at least one restore before the cap, so a setup where the victims miss the boundary fails loudly instead of passing without exercising the guard.

Verification (local)

  • Reproduced on main by putting the 50 highest names first in the state, as ext4 can: "restored all 50", the same failure as CI. With the original order: 38 restored, pass.
  • This branch with the state as written, shuffled with four seeds, and with the highest names first: 6 of 6 pass.
  • Sabotage: removing the per-iteration [ "$rs_ok" = 1 ] || continue guard from the script fails the test in every one of those orders.
  • Whole file: 11 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T12:53:28.476264Z d608456 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: d6084567c4

ℹ️ 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".

@danielhanchen
danielhanchen merged commit a4378d2 into main Oct 27, 2026
0 of 15 checks passed
@danielhanchen
danielhanchen deleted the ci-nb-restore-victims-state-order branch October 27, 2026 12:55
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.

1 participant