Add comprehensive spec audit results and pyMC_core issue reports
- CHANGELOG.md: Full audit findings organized by severity - PYMC_CORE_ISSUES.md: 7 evidence-based bug reports for pyMC_core (wrong constants, broken path_len decoding, wrong TRACE hash, wrong SNR calculation) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Add comprehensive spec audit results and pyMC_core issue reports - CHANGELOG.md: Full audit findings organized by severity - PYMC_CORE_ISSUES.md: 7 evidence-based bug reports for pyMC_core (wrong constants, broken path_len decoding, wrong TRACE hash, wrong SNR calculation) - Remove ERRATA.md: contents already covered by audit findings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
79 files changed
+8923
No files matched your search
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"$schema": "../../../schema/test-vector.schema.json",
|
||||
"name": "Framing - Decode Only",
|
||||
"spec_ref": "spec/01-wire-format.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests one-way decode cases where the binary is valid to decode but may not be the canonical encoding a conformant encoder would produce.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "dec-001",
|
||||
"description": "Decode-only: ACK FLOOD with trailing bytes beyond the 4-byte CRC payload",
|
||||
"type": "decode_only",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "ack",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"ack_crc": "DEADBEEF"
|
||||
}
|
||||
},
|
||||
"binary": "0D 00 DEADBEEF 00",
|
||||
"notes": "Binary has 1 trailing byte after the 4-byte ACK CRC. Decoders MUST accept this (payload_len includes the extra byte). Encoders would not produce trailing bytes."
|
||||
},
|
||||
{
|
||||
"id": "dec-002",
|
||||
"description": "Decode-only: raw_custom FLOOD with path hash_count=0 but hash_size=2",
|
||||
"type": "decode_only",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 2,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "AA"
|
||||
}
|
||||
},
|
||||
"binary": "3D 40 AA",
|
||||
"notes": "Path_len byte 0x40 encodes hash_size=2 (bits 6-7 = 01) with hash_count=0. Decoders must handle non-default hash_size even when hash_count is zero. Encoders typically default hash_size=1 when hash_count=0."
|
||||
},
|
||||
{
|
||||
"id": "dec-003",
|
||||
"description": "Decode-only: raw_custom FLOOD with path hash_size=3 and hash_count=0",
|
||||
"type": "decode_only",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 3,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "BB"
|
||||
}
|
||||
},
|
||||
"binary": "3D 80 BB",
|
||||
"notes": "Path_len byte 0x80 encodes hash_size=3 (bits 6-7 = 10) with hash_count=0. Same as dec-002 but with hash_size=3."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "Framing - Empty Payload Rejection",
|
||||
"spec_ref": "spec/01-wire-format.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Verifies that packets with zero-length payload are rejected. The reference implementation (Packet::readFrom) checks 'if (i >= len) return false' after reading header+transport+path_len+path, requiring at least 1 byte of payload.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "ep-001",
|
||||
"description": "FLOOD packet with no payload bytes (just header + path_len)",
|
||||
"type": "invalid",
|
||||
"binary": "0D 00",
|
||||
"expected_error": "empty_payload",
|
||||
"notes": "2 bytes total: header 0x0D + path_len 0x00. No payload bytes remain. readFrom returns false because i(2) >= len(2)."
|
||||
},
|
||||
{
|
||||
"id": "ep-002",
|
||||
"description": "TRANSPORT_FLOOD with no payload (header + transport + path_len only)",
|
||||
"type": "invalid",
|
||||
"binary": "0C 0000 0000 00",
|
||||
"expected_error": "empty_payload",
|
||||
"notes": "6 bytes: header(1) + transport(4) + path_len(1). i=6, len=6, so i>=len = true."
|
||||
},
|
||||
{
|
||||
"id": "ep-003",
|
||||
"description": "FLOOD packet with path but no payload",
|
||||
"type": "invalid",
|
||||
"binary": "0D 02 AABB",
|
||||
"expected_error": "empty_payload",
|
||||
"notes": "4 bytes: header(1) + path_len(1) + path(2). i=4, len=4."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "Framing - Maximum Size Packets",
|
||||
"spec_ref": "spec/01-wire-format.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests packets at or near the maximum wire size of 255 bytes (MAX_TRANS_UNIT). Verifies size calculation: total = 1 (header) + transport(0|4) + 1 (path_len) + path_bytes + payload_len.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "max-001",
|
||||
"description": "Maximum FLOOD packet: 255 bytes with empty path and 253-byte payload",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFC"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFC",
|
||||
"notes": "Total: 1 + 0 + 1 + 0 + 253 = 255 bytes. However payload exceeds MAX_PACKET_PAYLOAD (184). This is a wire-level max size test only; payload-level validation would reject this."
|
||||
},
|
||||
{
|
||||
"id": "max-002",
|
||||
"description": "Maximum valid FLOOD packet respecting MAX_PACKET_PAYLOAD: 1 + 1 + 0 + 184 = 186 bytes",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7",
|
||||
"notes": "Total: 1 + 1 + 184 = 186 bytes. Payload is exactly MAX_PACKET_PAYLOAD (184 bytes = 0x00..0xB7)."
|
||||
},
|
||||
{
|
||||
"id": "max-003",
|
||||
"description": "Large FLOOD packet with maximum path (63 bytes) and payload",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 63,
|
||||
"hashes": [
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"05",
|
||||
"06",
|
||||
"07",
|
||||
"08",
|
||||
"09",
|
||||
"0A",
|
||||
"0B",
|
||||
"0C",
|
||||
"0D",
|
||||
"0E",
|
||||
"0F",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"1A",
|
||||
"1B",
|
||||
"1C",
|
||||
"1D",
|
||||
"1E",
|
||||
"1F",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"2A",
|
||||
"2B",
|
||||
"2C",
|
||||
"2D",
|
||||
"2E",
|
||||
"2F",
|
||||
"30",
|
||||
"31",
|
||||
"32",
|
||||
"33",
|
||||
"34",
|
||||
"35",
|
||||
"36",
|
||||
"37",
|
||||
"38",
|
||||
"39",
|
||||
"3A",
|
||||
"3B",
|
||||
"3C",
|
||||
"3D",
|
||||
"3E",
|
||||
"3F"
|
||||
]
|
||||
},
|
||||
"payload": {
|
||||
"data": "DEADBEEF"
|
||||
}
|
||||
},
|
||||
"binary": "3D 3F 0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F DEADBEEF",
|
||||
"notes": "Total: 1 + 1 + 63 + 4 = 69 bytes. Max path with small payload."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "Framing - Minimal Valid Packets",
|
||||
"spec_ref": "spec/01-wire-format.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests the smallest valid packets for each route type. A valid packet must have at least header(1) + path_len(1) + payload(1+) bytes, plus 4 bytes for transport codes if applicable.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "min-001",
|
||||
"description": "Minimal FLOOD packet: 3 bytes (header + path_len + 1-byte payload)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "FF"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 FF",
|
||||
"notes": "Smallest valid FLOOD packet: 3 bytes total."
|
||||
},
|
||||
{
|
||||
"id": "min-002",
|
||||
"description": "Minimal DIRECT packet: 3 bytes",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "direct"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "FF"
|
||||
}
|
||||
},
|
||||
"binary": "3E 00 FF",
|
||||
"notes": "Smallest valid DIRECT packet: 3 bytes total."
|
||||
},
|
||||
{
|
||||
"id": "min-003",
|
||||
"description": "Minimal TRANSPORT_FLOOD packet: 7 bytes (header + 4 transport + path_len + 1-byte payload)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "transport_flood"
|
||||
},
|
||||
"transport_codes": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "FF"
|
||||
}
|
||||
},
|
||||
"binary": "3C 0000 0000 00 FF",
|
||||
"notes": "Smallest valid TRANSPORT_FLOOD packet: 7 bytes total."
|
||||
},
|
||||
{
|
||||
"id": "min-004",
|
||||
"description": "Minimal TRANSPORT_DIRECT packet: 7 bytes",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "transport_direct"
|
||||
},
|
||||
"transport_codes": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "FF"
|
||||
}
|
||||
},
|
||||
"binary": "3F 0000 0000 00 FF",
|
||||
"notes": "Smallest valid TRANSPORT_DIRECT packet: 7 bytes total."
|
||||
},
|
||||
{
|
||||
"id": "min-005",
|
||||
"description": "Minimal ACK via FLOOD: 6 bytes (header + path_len + 4-byte CRC)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "ack",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"ack_crc": "00000000"
|
||||
}
|
||||
},
|
||||
"binary": "0D 00 00000000",
|
||||
"notes": "ACK with zero CRC. 6 bytes total."
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user