fix(ec2-worker): correct c6in.metal NetworkCards fixture (2×8=16, not 4×5/4/3/3=15)#77
Merged
skullcrushercmd merged 1 commit intomainfrom Apr 28, 2026
Merged
Conversation
… 4x5/4/3/3=15) PR #74 mocked NetworkCards as 4 cards distributed 5/4/3/3=15, but actual AWS DescribeInstanceTypes for c6in.metal returns 2 cards x 8 = 16 (anygpt-48 live bench, PR #65 issuecomment-4338158487). The launch path code is fine - distribute_enis_across_cards handles any card layout - but the synthetic test fixture and the docstring example encoded a shape that doesn't match production AWS. Refresh the fixture, the docstring, and every test that hardcoded 15-derived numbers. Add a new RecordedDescribeInstanceTypesIntegrityTests class that anchors the fixture against tools/c6in_metal_describe_instance_types.json (a real `aws ec2 describe-instance-types` capture) so future drift gets caught at unit-test time instead of bench time. Effect on capacity claim: c6in.metal has 2 PCIe trees, not 4, so the multi-NIC headroom caps at ~2x single-tree, not ~4x.
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
PR #74's c6in.metal NetworkCards fixture mocked AWS as returning 4 cards distributed 5/4/3/3=15. The anygpt-48 live bench (PR #65 issuecomment-4338158487) showed AWS actually returns 2 cards × 8 = 16:
The launch path code itself is fine —
distribute_enis_across_cardshandles any per-card layout — but the synthetic mock encoded a shape that doesn't match production. The 40-test unit suite passed against the wrong shape, so the bug only surfaced at bench time.What changed
tools/ec2_worker_manager.py— docstring + comment now describe the real 2×8 layouttools/test_ec2_worker_manager.py::_c6in_metal_describe()— fixture refreshed to 2 cards × 8 = 16, withNetworkPerformancestrings included for parity with the AWS shape15against c6in.metal updated to16;test_c6in_metal_15_eni_layout_respects_per_card_capsrenamed and rewritten for the 8/8 split;test_partial_count_round_robins_across_cardsupdated for the 2-card round-robin pattern[0, 1, 0, 1]tools/c6in_metal_describe_instance_types.json— verbatim recordedaws ec2 describe-instance-typespayloadRecordedDescribeInstanceTypesIntegrityTests— 5 tests that load the recorded JSON and assert the synthetic fixture agrees with it on every load-bearing field. Future AWS-side drift gets caught at unit-test time, not after a 36-min metal launch.Effect on capacity claims
The "more PCIe trees" justification in PR #74's commit body now matches reality: c6in.metal has 2 trees, not 4 — so multi-NIC headroom caps at ~2× single-tree, not ~4×. (Live bench in anygpt-48 confirmed this empirically: 15-NIC at drv+copy regressed vs 8-NIC because the bottleneck is per-NIC CPU descriptor copy, not NIC count.)
Test plan
python3 -m unittest tools.test_ec2_worker_manager -v→ 45 tests pass (40 existing + 5 new integrity tests)🤖 Generated with Claude Code