Conversation
…LT-1048) Adds TestListStructNullableInnerField with 3 tests covering the edge case where a LargeList<Struct>'s item field has nullable=True vs nullable=False. Golden values (0000012c... and 000001713f...) are verified byte-exact against the Rust starfix crate via cargo test list_struct_nullable_inner_field_parity. This completes the cross-implementation parity verification for PLT-1048: all 129 Python tests and 67 Rust tests pass, and all golden values are confirmed consistent between the two implementations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds golden parity regression coverage to ensure the Python starfix implementation matches Rust for an uncovered LargeList<Struct> edge case where the list item field’s nullable flag changes the structural hashing behavior.
Changes:
- Extend
test_golden_parity_r2.pywith a new parity test class coveringLargeList<Struct>withinner_field.nullable=TruevsFalseusing Rust-verified golden hashes. - Update the module-level “coverage” summary list to include the new edge case.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/test_golden_parity_r2.py
Outdated
| @@ -899,6 +900,79 @@ def test_multi_batch_list(self): | |||
| # --------------------------------------------------------------------------- | |||
|
|
|||
|
|
|||
| # --------------------------------------------------------------------------- | |||
There was a problem hiding this comment.
The section headers around here are now out of order/duplicated: the "Float special values" banner appears before the newly inserted LargeList tests, and then the float banner is repeated again later. This makes navigation confusing—please remove the earlier float header or move this new LargeList block above the float section so each section header matches the tests that follow.
The new LargeList<Struct> test block was inserted between the float section banner and the float test class, leaving a stray orphaned header. Remove the duplicate so each section header correctly precedes its own test class. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Replying to the inline review comment about duplicate section headers (comment #2964555208): Fixed in the latest commit ( |
Review round summaryOne issue was raised and has been addressed in commit Duplicate/orphaned When All 129 tests still pass. |
Summary
Closes PLT-1048. Verifies that the Rust (
nauticalab/starfix) and Python (nauticalab/starfix-python) implementations are logically consistent with the design spec instarfix/docs/and with each other.Parity status: ✅ All tests pass, byte-exact hashes confirmed
Findings
1. Implementations are logically consistent ✅
A thorough line-by-line comparison of both implementations against the design spec (
starfix/docs/design-spec.md,byte-layout-spec.md) found that:BitVec<u8, Lsb0>, AND-propagation of struct-level nulls) is consistent0x000001, 3 bytes) is applied identicallytest_golden_parity.pyandtest_golden_parity_r2.py) confirm byte-exact agreement across all primitive types, temporal types, decimals, nested structs, list types, and float special values2. Edge case:
LargeList<Struct>withinner_field.nullable=TrueUncovered by existing tests: all prior
List<Struct>tests usedinner_field.nullable=False.Behavior: When
inner_field.nullable=True, the structural-only BTreeMap entry for the list gets an allocated (but never populated)BitVec. At finalisation this contributes 8 zero bytes (bit_count=0) before the structural SHA-256 — a minor deviation from the spec table which shows structural-only entries have nonull_bits. Both Rust and Python handle this identically.Verified: New Rust test
list_struct_nullable_inner_field_parity(added tonauticalab/starfix) and new Python test classTestListStructNullableInnerField(added here) confirm byte-exact parity:nullable=True:0000012c2b1c1d5b4c3dc46ed5335834dbf0d7386c38e607a398a2897fdaf1df387e1cnullable=False:000001713fa0e500c9aebea61039b30371fd84c0dff8cd3b96b4266978658bf73e4d8c3. Minor behavioral difference (intentional)
The Python
update()does not validate batch schema compatibility (Rust panics if schemas don't match). This is tested and appears intentional per the existing test suite.Changes
tests/test_golden_parity_r2.py: addsTestListStructNullableInnerField(3 tests) covering theList<Struct nullable_element>edge case with golden values verified against RustTest plan
uv run pytest tests/ -q→ 129 passedcargo testinnauticalab/starfix→ 67 passed (including newlist_struct_nullable_inner_field_parity)🤖 Generated with Claude Code