fix(mft): apply snapshot/restore pattern to directory index merge#7
Merged
githubrobbi merged 1 commit intomainfrom Mar 17, 2026
Merged
fix(mft): apply snapshot/restore pattern to directory index merge#7githubrobbi merged 1 commit intomainfrom
githubrobbi merged 1 commit intomainfrom
Conversation
Fixes remaining LIVE parser parity mismatches by applying the same
snapshot/restore pattern used for $DATA to directory index sizes.
Root cause: Directory index merging used unconditional += at
direct_index_extension.rs:742-743, causing data loss when IOCP
delivered extension records before base records.
When extension arrives before base:
- Extension adds dir_index to first_stream.size (0 + ext = ext) ✓
- Base overwrites with = SizeInfo {...}, losing extension data ✗
Fix: Check if first_stream.size is empty (0, 0):
- If empty → write extension's dir_index values
- Otherwise → accumulate using saturating_add
This mirrors the proven fix from commit e90aade that reduced
mismatches from 16,517 → 422. Expected to resolve remaining
small directory size deltas (+51, +11 bytes).
Changes:
- Apply snapshot/restore to dir_index merge (direct_index_extension.rs:737-766)
- Add chaos test harness for reproducing LIVE out-of-order scenarios
- Add regression tests for extension-before-base merging
- Add CHAOS_TEST_HARNESS.md documentation
Validation:
- All 116 tests pass (OFFLINE correctness preserved)
- Code formatted and linted (ultra-strict)
- Ready for Windows LIVE validation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Fixes remaining LIVE parser parity mismatches by applying the same snapshot/restore pattern used for $DATA to directory index sizes.
Root cause identified: Directory index merging used unconditional
+=atdirect_index_extension.rs:742-743, causing data loss when IOCP delivered extension records before base records.Impact: Reduced mismatches from 16,517 → 422 with the previous $DATA fix (commit e90aade). This fix is expected to resolve the remaining 422 mismatches by applying the same proven pattern to directory index sizes.
Changes
direct_index_extension.rs:737-766)CHAOS_TEST_HARNESS.mddocumentationValidation
Technical Details
The Bug
When extension arrives before base:
= SizeInfo {...}, losing extension data ❌The Fix
Check if
first_stream.sizeis empty (0, 0):saturating_addThis is the same pattern that successfully fixed the $DATA bug in commit e90aade.
Test Plan
just fmt)just lint-prod)Related Issues
🤖 Generated with coordination from Claude Code Coordinator