checkDeterminismGate (Gate 6: DETERMINISM) asserts that two Get calls on the same input+path return byte-identical (value, type, offset) and the same error PRESENCE. SYS-REQ-086 / SYS-REQ-080 explicitly require this. A non-determinism bug here would surface as flaky callers and is almost always a ma
(t *testing.T, data []byte, path []string)
| 1104 | // Size-capped to avoid O(n) overhead on huge fuzz inputs (the DoS regression |
| 1105 | // gate TestDoSPerformance covers scale separately). |
| 1106 | func checkDeterminismGate(t *testing.T, data []byte, path []string) { |
| 1107 | t.Helper() |
| 1108 | if len(data) > fuzzGateSizeCap { |
| 1109 | return |
| 1110 | } |
| 1111 | v1, t1, o1, e1 := Get(data, path...) |
| 1112 | v2, t2, o2, e2 := Get(data, path...) |
| 1113 | if !bytes.Equal(v1, v2) || t1 != t2 || o1 != o2 { |
| 1114 | t.Errorf("Get non-deterministic (DETERMINISM violation): "+ |
| 1115 | "call1=(%q,%v,%d) call2=(%q,%v,%d) data=%q path=%v", |
| 1116 | v1, t1, o1, v2, t2, o2, data, path) |
| 1117 | } |
| 1118 | if (e1 == nil) != (e2 == nil) { |
| 1119 | t.Errorf("Get error presence non-deterministic (DETERMINISM violation): "+ |
| 1120 | "e1=%v e2=%v data=%q path=%v", e1, e2, data, path) |
| 1121 | } |
| 1122 | } |
| 1123 | |
| 1124 | // checkSliceAliasingGate (Gate 7: ALIASING) asserts that the value bytes Get |
| 1125 | // returns appear as a sub-slice of the input data. Per Get's documentation, |
no test coverage detected