Charles KWON OhJun
9b9f87fd88
fix: NTX B-tree — proper pageSplit from Harbour + BOF detection
NTX Build (build.go):
- pageSplit: exact port of Harbour hb_ntxPageSplit
- NewPage = LEFT half (lower keys), OldPage = RIGHT half (offset-swapped)
- Proper offset table initialization for all pages
- setKeyEntry/copyKeyEntry helpers for clean data writing
- insertKeyBTree: new root creation matches Harbour exactly
- child[0] = newPage (left), child[1] = old root (right)
NTX Traversal (ntx.go):
- prevKey: guard iKey < keyCount before checking KeyChild
(prevents infinite loop at rightmost child position)
BOF Detection (indexer.go):
- Set a.FBof AFTER GoTo returns (GoTo line 393 resets FBof=false)
- Previously: set FBof before GoTo → immediately cleared
Results: Unit tests ALL PASS, Stress test 82 items 79/82 match (96%)
Remaining 3 diffs: duplicate key count edge case + SET DELETED seek
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>