Repository navigation
Conversation
…ve/load DataLoaderSpec.to_json sorted every key, so a loaded artifact reordered batch.inputs alphabetically while fingerprints (which hash a sorted copy) and equality did not notice. Positional consumers got the wrong inputs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
Artifact.savewrotecontract.jsonwithsort_keys=True, so afterArtifact.loadbatch.inputscame back in alphabetical order instead of declaration order. Models that read inputs by position (torch.cat(list(batch.inputs.values())), zipping aModuleList) silently received the wrong inputs. Fingerprints and==did not notice, because the fingerprint hashes its own sorted copy.DataLoaderSpec.to_jsonnow keeps declaration order. Fingerprints are unchanged. Artifacts saved earlier have sorted keys on disk and load in that stored order.Tracks CONTRACT-40 (rdl-platform#157).
Test plan
test_saved_artifact_keeps_input_declaration_order: declares inputsz_input, a_input, m_input, saves and loads, and asserts declaration order on the loaded contract, a batch-inference batch, andServingAssembler.assemble. It fails before the change and passes after; it also checks the fingerprint is unchanged.test_contract_serialization.pyandtest_api_reference.pypass.docs/api/lifecycle.mdis regenerated from the updated docstring.diskgraphcannot be built on this machine, and the same 232 tests fail with and without this change.🤖 Generated with Claude Code