diff --git a/research/complex-jp8-diagonal-gauge/CERTIFICATE.json b/research/complex-jp8-diagonal-gauge/CERTIFICATE.json new file mode 100644 index 0000000000..3fb74265c3 --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/CERTIFICATE.json @@ -0,0 +1,313 @@ +{ + "exponents": [ + 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 1, -1, 1, 1, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, -1, 0, 2, + 0, -1, 0, 0, 0, 0, 0, -1, -1, 1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, + 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, + 1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, + 6, 1, 0, 6, 0, 0, 0, 0, 1, 0, 0, -1, 1, 1, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 1, 0, 0, 0, 0, 2, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, + 0, 0, -1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, -1, 0, + -1, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 1, 0, 1, 1, 0, 1, -1, 0, -1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, -1, 0, 0, -1, 1, 0, 1, 1, 0, 0, -1, 0, -1, -1, 0, -1, 1, 0, 1, 0, 0, 0, 0, 0, -1, -1, 0, 0, + 1, 0, 0, 1, 0, 0, -1, 0, -1, -1, -1, 0, 1, 0, 0, 2, 0, 0, 0, 0, -1, -1, 0, -1, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 0, -1, 1, 1, 1, 0, 0, 0, -1, 0, 0, -1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -2, -1, -1, -1, -1, -1, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, + 1, 1, 1, 1, -1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ], + "edge_dual": [ + -1, 0, 0, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, 1, 1, -1, + -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, + -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, + 1, -1, -1, 0, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 0, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, + -1, 1, 1, 1, -1, 1, -1, -1, -1, 0, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 0, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, + 0, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 0, -1, 1, 1, 1, + -1, 1, 1, -1, -1, 1, 0, -1, -1, -1, 0, 1, -1, 1, 0, 0, -1, 1, 1, 1, -1, -1, -1, 1, -1, 0, -1, 1, -1, 1, -1, -1, + 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 0, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, + -1, -1, 1, -1, -1, -1, 0, -1, 0, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 0, -1, 1, 1, -1, 1, -1, -1, + -1, -1, 1, 1, 1, -1, -1, -1, -1, 0, 1, 1, -1, -1, 1, 1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 0, 1, 1, + -1, -1, 0, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 0, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, + 0, -1, 0, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, + -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 0, -1, -1, -1, -1, 1, 1, 1, -1, 0, -1, 1, -1, -1, 0, -1, -1, + -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, + -1, 0, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, + 0, 1, 1, 1, -1, 1, 1, 0, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 0, 1, 0, -1, + -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 0, -1, 1, -1, -1, -1, -1, 0, -1, -1, + -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, + 0, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 0, -1, -1, -1, -1, 1, 1, 1, 0, -1, 1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1, -1, -1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 0, -1, 1, 1, -1, -1, + 1, -1, -1, 0, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, + 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 0, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 0, 1, -1, 1, -1, -1, -1, -1, 1, + 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, + -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, + 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 0, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, + -1, 1, 1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, + -1, -1, 1, -1, -1, -1, -1, 0, 1, 1, -1, 1, 0, 1, -1, 0, -1, -1, -1, -1, -1, -1, 1, 1, 1, 0, -1, 1, 1, 1, 1, 1, + 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, + 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 0, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 0, -1, -1, -1, + 1, -1, 1, -1, 1, 1, -1, 0, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, + 1, 1, 0, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, + -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, + -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 0, -1, 1, -1, 1, -1, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1, + -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 0, -1, -1, -1, + 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, -1, 1, 1, + -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 0, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 0, + 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, 1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 0, -1, -1, -1, -1, 1, -1, + -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, + 1, 1, 1, -1, -1, 1, 0, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, + 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, + -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, + -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, + -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, + -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, + -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, + 1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, + -1, -1, 0, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 0, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 0, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 0, -1, -1, 1, 1, 0, -1, 1, 1, + 1, 1, -1, 1, 0, 1, -1, 0, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 0, + -1, -1, 0, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 0, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 0, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, + -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, + -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, -1, -1, -1, 1, -1, 0, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, + 1, -1, 1, -1, 1, -1, -1, 0, -1, -1, 1, 1, -1, -1, 0, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, + 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, + -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, + -1, 0, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, + 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 0, -1, -1, 1, 1, 1, 1, 1, + -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 0, 1, 1, + 1, 0, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 0, 1, -1, 0, -1, -1, 0, -1, -1, 0, -1, 1, 1, -1, -1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, + 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, + -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, + 1, 1, 1, 1, 1, -1, 0, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 0, -1, -1, + -1, 1, 0, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 0, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 0, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, + -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 0, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 0, -1, + -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 0, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, + 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, + -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 0, -1, -1, -1, -1, 1, 1, 0, 1, 1, -1, 1, + 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, + -1, -1, -1, 1, -1, 1, -1, -1, 1, 0, 1, -1, 1, 1, 1, 1, -1, -1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, + -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 0, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, + -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 0, 1, 1, 1, -1, -1, 1, -1, 0, -1, 1, 1, -1, 1, -1, -1, 1, 1, + -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 0, 1, -1, 1, + 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 0, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, + 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 0, -1, 0, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, + -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, + 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 0, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, + 0, 0, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, + -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, + -1, -1, 1, 1, -1, -1, 1, 0, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, + 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 0, 1, -1, 1, 1, 1, -1, + 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, + -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, + 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, + 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, + 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, + 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 0, 1, 0, -1, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1, + -1, -1, -1, -1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 0, 1, 1, -1, -1, 1, 0, + -1, 1, 1, 0, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 0, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, + 1, -1, -1, 1, 0, -1, 1, -1, -1, 1, 1, 1, 1, 1, 0, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 0, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 0, + -1, 1, -1, -1, -1, -1, 0, -1, 1, 1, 0, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, + -1, 1, 1, -1, 1, -1, 1, -1, -1, 0, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 0, 1, -1, 1, -1, -1, 1, 1, -1, 1, + 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, + -1, 0, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 1, -1, 0, 1, -1, 1, 1, 1, + 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 0, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, + 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, + -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, + 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, + -1, 1, -1, 1, 1, 1, 1, -1, 0, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, + -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 0, 0, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, + -1, -1, 1, 1, -1, 1, 0, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, + -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 0, 1, 1, 1, -1, + 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, + 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, + -1, -1, 1, 1, 1, 1, 1, 0, 1, -1, -1, -1, -1, 1, -1, 0, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, + -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 0, -1, -1, + 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, + 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 0, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, + -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, + 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 0, 1, 0, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 0, 1, -1, 1, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, + 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, + -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, + 0, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 0, -1, 1, -1, 0, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, + 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 0, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, + -1, -1, 0, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 0, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, + -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 0, 1, + -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, + 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, -1, + -1, -1, 1, 1, 1, 1, 0, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, -1, -1, -1, -1, 0, + 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 0, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, + 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, + 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, + -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 0, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, + 1, -1, 1, -1, -1, -1, -1, 1, 1, 0, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, + 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, + 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, + -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 0, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 0, -1, -1, 1, + -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, + -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 0, 1, 0, + 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, + 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, + -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 0, -1, 1, -1, -1, -1, 1, -1, -1, -1, 0, -1, -1, 1, -1, + 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, + -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 0, -1, 1, -1, 1, -1, 1, 1, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, + -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, + 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 0, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, + 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, + 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, + 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, + 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 0, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, + -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, + -1, -1, 1, 1, 1, 1, -1, 1, -1, 0, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, + -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, + -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 0, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, + -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 0, -1, 1, 1, -1, + 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 0, 0, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, + 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 0, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, + 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, + -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, 1, 1, 1, 1, -1, 0, -1, -1, 1, -1, 1, -1, 0, 0, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 0, -1, -1, -1, 1, + -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, + 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, + 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, + 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, + 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 0, 1, 1, -1, -1, 1, + -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 0, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, + 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, + 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, + 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, + 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, + -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 1, + 1, 0, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, + -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, + 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, + -1, -1, -1, -1, 0, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 0, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, + 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 0, 1, -1, 1, -1, -1, -1, -1, + -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, + 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, + 1, 1, 1, 1, 1, -1, 0, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, + 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, + 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 0, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, + 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, + -1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, + -1, -1, 0, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, + -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, + -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 1, -1, 1, 1, 1, 1, 0, -1, -1, 1, 1, 1, -1, 1, 1, + 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 0, 1, -1, 1, -1, 0, -1, -1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 0, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, + -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, + 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, + -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, + 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, + 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, + 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 0, -1, 0, 0, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, + -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, + -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, + 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, + -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, + 1, 1, 1, 1, 0, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, + 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 0, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, + 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 0, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, + 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, + 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, + -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, + -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 0, + -1, -1, -1, -1, -1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 0, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, + 1, -1, 0, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, + 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, + -1, -1, -1, -1, 1, -1, 0, 1, -1, -1, -1, 0, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 0, -1, -1, -1, 1, -1, -1, -1, -1, + 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 0, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 0, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, + -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, + -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, + 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, + -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, + -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, + -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, + -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, + -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, + -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, + -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, + 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, + 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, + 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, + -1, -1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 0, 1, -1, -1 + ], + "objective": 10326, + "original_objective": 13403, + "nonzero": 203, + "l1_exponents": 229, + "schema": "jp8-diagonal-gauge-v1", + "assignment_seed": 35 +} diff --git a/research/complex-jp8-diagonal-gauge/CLAIM.json b/research/complex-jp8-diagonal-gauge/CLAIM.json new file mode 100644 index 0000000000..82922746b7 --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/CLAIM.json @@ -0,0 +1,55 @@ +{ + "status": "completed: historical finite construction and exact class optimum; branch published, PR creation blocked", + "track": "complex supplier", + "assignment_seed": 35, + "seed_source": "Python secrets.randbelow(100), OS randomness", + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "object": "Selected #626 JP8 full-frame cleanup, simultaneous restored power-of-two diagonal conjugation", + "method": "Exact dyadic valuation cost screen; exponents initially -2..2; seed-35 coordinate order; complete boundary scaling and original Horner costs; finite exact replay if profitable", + "candidates": [ + { + "task": "CK repeated-addition fusion", + "decision": "not chosen; overlaps #719" + }, + { + "task": "JP8 shared private coefficient preparation", + "decision": "not chosen; overlaps #722/#739/#751" + }, + { + "task": "JP8 restored live-register diagonal gauge", + "decision": "chosen; changes many live register coordinates jointly, distinct from #750 single-scale relocation and #739 private-work rescaling" + } + ], + "expected_deliverable": "Exact construction and verifier, or scoped negative result; no new kappa claim", + "started_utc": "2026-10-13T05:06:05.541648Z", + "claimed_utc": "2026-10-13T05:10:19.008757+00:00", + "expected_finish_utc": "2026-10-13T05:46:05Z", + "time_budget": "40 minutes; orientation <=8; final >=10 for verification/handoff", + "overlap_snapshot": "All open issue pages 1..6; only ordinary open issue #650, no coordination issue; PR metadata through #751", + "attribution": "Prepared for Luis Leon (@mythrilium) with substantial OpenAI Codex assistance; Apache-2.0", + "completed_utc": "2026-10-13T05:27:37.693518+00:00", + "result": { + "saved_real_primitives_per_orientation": 6154, + "objective": 10326, + "original_objective": 13403, + "domain": "all integer constant positive power-of-two diagonal gauges of the fixed JP8 cleanup, original Horner pricing and separate paid boundary scales", + "kappa_change": false, + "report": "README.md", + "validation": "VALIDATION.md", + "reproduce": "python3 -B research/complex-jp8-diagonal-gauge/check.py", + "branch_url": "https://github.com/mythrilium/integer-mult-bounds/tree/research/jp8-diagonal-gauge-seed35" + }, + "overlap_final": "585 open PRs through #766, then 100 recently updated through #772 at 2026-10-13T05:25:52Z; no equivalent live-register diagonal sandwich found; #750/#739/#755/#769 and other distinct mechanisms credited", + "posting": "Published as mythrilium commit 1a37df609e1267a43308a0c0f8f23280b08f691b. GitHub create-pull-request API returned 403 Resource not accessible by integration. No PR created.", + "verification_started_utc": "2026-10-13T05:21:53Z", + "publication_refresh": { + "upstream": "bce54fb3f895cbe5cd4c0eb477c3afeed100190f", + "related_prs": [ + 786, + 793, + 984, + 949 + ], + "scope": "historical PR626 scalar cleanup; no current frontier or complete supplier-cost improvement" + } +} diff --git a/research/complex-jp8-diagonal-gauge/EXPECTED.json b/research/complex-jp8-diagonal-gauge/EXPECTED.json new file mode 100644 index 0000000000..59a4c93ddf --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/EXPECTED.json @@ -0,0 +1,50 @@ +{ + "objective": 10326, + "original_objective": 13403, + "saving_per_orientation": 6154, + "boundary_real_primitives": 916, + "changed_registers": 203, + "edge_count": 8894, + "candidate_cleanup_sha256": "d7accd6e0217e6898677ea0845b9d7c91f7888c3bfc6c4b8d651d1dc8f390425", + "programs": { + "backward": { + "before": { + "real_primitives": 257280, + "scalar_macros": 22693, + "prefix_l1": "16753412757380464429924108070201913461/8388608", + "prefix_bits": 101, + "all_native_columns": 716, + "arbitrary_private_centre_columns": 8 + }, + "after": { + "real_primitives": 251126, + "scalar_macros": 23099, + "prefix_l1": "16753412757380464429924108070201913461/8388608", + "prefix_bits": 101, + "all_native_columns": 716, + "arbitrary_private_centre_columns": 8 + }, + "candidate_sha256": "02ed6e1590be0cf403484fa725f32d57bbf4fe2b8954a79f9c4d2b92095ef7b6" + }, + "forward": { + "before": { + "real_primitives": 257232, + "scalar_macros": 22693, + "prefix_l1": "4536094588619580433782972610869617/281474976710656", + "prefix_bits": 64, + "all_native_columns": 716, + "arbitrary_private_centre_columns": 8 + }, + "after": { + "real_primitives": 251078, + "scalar_macros": 23099, + "prefix_l1": "4536094588619580433782972610869617/4398046511104", + "prefix_bits": 70, + "all_native_columns": 716, + "arbitrary_private_centre_columns": 8 + }, + "candidate_sha256": "f403ae250347a1fd5a22c1d97c67b791f89991486c9c0a3105831cc5b40e9651" + } + }, + "distinct_add_coefficients_checked": 846 +} diff --git a/research/complex-jp8-diagonal-gauge/PR-DESCRIPTION.md b/research/complex-jp8-diagonal-gauge/PR-DESCRIPTION.md new file mode 100644 index 0000000000..7ace9bfd0a --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/PR-DESCRIPTION.md @@ -0,0 +1,35 @@ +## Result and scope + +**Research construction with an exact scoped optimality certificate; no new kappa or complete supplier-cost improvement.** + +On the historical PR626 JP8 cleanup, a restored power-of-two diagonal change of 203 live coordinates saves **6,154 real-component scalar primitives per orientation**, including all 406 boundary-scale macros (916 primitives). Forward/backward totals become 251,078 / 251,126 from 257,232 / 257,280. The forward positive prefix envelope grows from 64 to 70 bits; backward remains 101, within the inherited 192-bit allowance. + +The exact integer primal/dual witness certifies objective 10,326 against 13,403 at zero gauge, globally over constant positive power-of-two diagonal gauges of the **fixed chronological cleanup, original per-add Horner lowering, and separately paid boundaries**. It is not global circuit optimality. The larger macro count may worsen the generic adapter allowance; no complete supplier invoice or practical speedup is claimed. + +## Sources and overlap + +- Original research base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`; OS assignment seed **35**, complex supplier. +- Publication refresh: `bce54fb3f895cbe5cd4c0eb477c3afeed100190f`, selecting #1094 at κ = 0.001672660197076918. This package concerns frozen #626, not the current frontier. +- The original selected record is retained byte-for-byte inside the package; all six other consumed source files remain unchanged on refreshed main. Exact source hashes and PR heads are in SOURCES.json. +- Earlier local claim, candidate selection and completed coverage are in CLAIM.json. No pinned sprint issue existed during the research session. +- Credit Jeremy Kothe / #622/#623, Chafik Boukhalfa / #626, icekylinx, DreamingOfClouds, Dominik Scholz, Dugongue, Rohan Arun, eumemic and retained predecessors. +- Distinct concurrent work includes #739/#750/#755/#769 and later #786/#793/#949/#984. In particular #793 reports larger scalar savings through coefficient routes; this contribution adds a different simultaneous live-register gauge and exact unbounded-domain class optimum. No pending code is imported or savings claimed additive. + +Only `research/complex-jp8-diagonal-gauge/` is added. Selected certificates and `upstream/` remain unchanged. + +## Reproduce + +```sh +python3 -I -B research/complex-jp8-diagonal-gauge/check.py +``` + +Expected: +`PASS_JP8_GAUGE_COMPLETE saved=6154/6154 optimal_cost=10326 tests=10 inherited_controls=25 kappa=unchanged` + +The final publication replay passed: solver-free exact primal/dual check, whole scalar programs on 716 native plus eight arbitrary private-centre input columns, all 846 distinct coefficient primitive boundaries, separate integer-dyadic cleanup replay, ten tests with twelve adverse mutations, and unchanged native emitter/auditor with 25 inherited controls. The uploaded Git tree matches the locally verified tree exactly. + +Earlier verification also covered optimized-parent execution, relocated offline replay, equivalent gzip recompression, source/receipt corruption, deterministic rediscovery and the research-base selected-record check. See VALIDATION.md for exact coverage and limits. Full repository/cold frontier replay, global invoicing, hosted CI, Lean and independent human review are not claimed. + +Inherited all-size/compiler, physical/common-label realization, hosting, precision/tape/recovery, bit and analytic obligations remain. Open next questions cover complete adapter pricing and composition with coefficient reuse. + +Prepared for **Luis Leon (@mythrilium)** with substantial **OpenAI Codex assistance** in research, implementation, verification and writing. Apache-2.0; predecessor notices retained. diff --git a/research/complex-jp8-diagonal-gauge/README.md b/research/complex-jp8-diagonal-gauge/README.md new file mode 100644 index 0000000000..34d3dc3b54 --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/README.md @@ -0,0 +1,216 @@ +# Optimal restored diagonal gauge for the historical PR626 JP8 cleanup + +**Research construction / finite complex-supplier circuit improvement; no new κ.** + +The #622 JP8 provider consumed by historical #626 has a full-frame cleanup of +8,894 additions and 112 scales. A simultaneous, restored power-of-two change +of 203 live register coordinates saves **6,154 real-component scalar +primitives in each orientation**, after charging all boundary scaling. +An exact integer primal/dual certificate proves optimality within the specific +constant-diagonal class below. It does not prove circuit optimality. + +| Complete JP8 scalar program | Original | Candidate | +| --- | ---: | ---: | +| Forward real primitives | 257,232 | 251,078 | +| Inverse-transpose real primitives | 257,280 | 251,126 | +| Scalar macros, either orientation | 22,693 | 23,099 | +| Forward positive prefix bound, bits | 64 | 70 | +| Inverse-transpose positive prefix bound, bits | 101 | 101 | + +The 406 added scale macros are explicitly charged: 916 real primitives. +Adjusted addition coefficients save 7,070 real primitives, for a net 6,154. +The forward positive prefix envelope increases by exactly 64; both orientations +remain below the inherited 192-bit local allowance. There is no claim of a +practical runtime improvement or complete supplier-cost improvement. The larger +macro count can increase the generic adapter allowance; that allowance is not +included in the scalar-primitive saving. Global invoicing is not performed. + +## Reproduce + +From the repository root, with Python 3.11 or later and its standard library: + +```sh +python3 -B research/complex-jp8-diagonal-gauge/check.py +``` + +The final line is: + +```text +PASS_JP8_GAUGE_COMPLETE saved=6154/6154 optimal_cost=10326 tests=10 inherited_controls=25 kappa=unchanged +``` + +The command checks the exact certificate and all native input columns, runs a +separate integer-arithmetic cleanup replay, then feeds the candidate to the +unchanged pinned native emitter and local frame/wrapper auditor. The inherited +25 controls must reject. Generated files live only in a temporary directory. +`verify.py` alone is the read-only, solver-free arithmetic checker. + +No SciPy, SymPy, compiler, network access, or new source download is needed for +verification. Optional `discover.py` requires NumPy and SciPy and prints a new +nomination; it does not overwrite the checked certificate. It was run using +NumPy 2.3.5, SciPy 1.17.0 and `linprog(method="highs")`. Different solver versions +can nominate different equal-cost optima. Solver status is never a certificate. + +## Exact construction and restoration + +Let the original cleanup map be `A` and let +`D = diag(2**g[r])`, with integer exponents. Execute: + +1. Scale each nonzero-gauge register by `2**g[r]`. +2. Keep every cleanup gate in order. Replace each addition + `x[t] += q*x[s]` by `x[t] += q*2**(g[t]-g[s])*x[s]`. + Keep the original scale gates unchanged. +3. Scale each affected register by `2**(-g[r])`. + +The middle word is `D A D^-1`, so the complete map is exactly +`D^-1 (D A D^-1) D = A`, for arbitrary register inputs. This is not an argument +restricted to clean helpers or a reachable subspace. Applying inverse transpose +to each chronological gate gives the original inverse-transpose cleanup as well; +the corresponding diagonal basis is `D^-1`. + +All 203 affected registers already have terminal frame FULL (frame ID 1). +Neither an early-ended helper nor a target register is rescaled. The new scales +occur wholly inside the original full-frame cleanup, before its post-wrappers. +There are no new helpers, source copies, frames, recursive children or centre +operations. The 492 helpers, 716 native columns, all non-scalar events and the +paid rank histogram are unchanged. The checker verifies these facts against the +selected SPEC and the inherited auditor independently checks frame incidence, +wrapper ordering, arbitrary dirty-helper restoration and the paid profile. + +## Exact optimality certificate and its scope + +Write each nonzero addition coefficient uniquely as `q = ±o*2**e`, with positive +odd integer `o`. Under the retained original binary-Horner lowering, its complex +component cost is + +`2 + bit_length(o) + popcount(o) + abs(e)`. + +The numerator's sign is handled by signed accumulation. Every source addition, +doubling, halving, accumulation and private-work clear is included. A scale by +`2**g` costs `abs(g)` per complex component. Thus the only varying part of the +complete component cost is + +`P(g) = 2*sum_r abs(g[r]) + sum_additions abs(e + g[t] - g[s])`. + +The first term pays BOTH boundary changes. Original internal scales are +unchanged, so their costs cancel. Each real-component program costs twice this +component convention. The zero gauge has objective **13,403**; the candidate +has objective **10,326**, saving `2*(13403-10326) = 6154` in each orientation. + +For each addition the certificate supplies an integer `f` in `[-1,1]`. Define +`div[r] = sum_(t=r) f - sum_(s=r) f`. The checker verifies `abs(div[r]) <= 2` +for every register. For ANY real vector g: + +`P(g) >= sum_e f[e]*e + sum_r (2*abs(g[r]) + div[r]*g[r]) >= sum_e f[e]*e`. + +The certificate's last sum is **10,326**, exactly the candidate's cost. This +proves a global minimum for the relaxed expression and therefore for every +integer gauge, without a bounded enumeration or trust in floating arithmetic. +It remains a finite-word theorem, not a formalization of integer multiplication. + +**The class is precisely:** one constant positive power-of-two diagonal basis +throughout the entire fixed JP8 cleanup, paid separate boundary scales, +unchanged chronological additions and internal scales, and the original +Horner lowering. It excludes changing gauge mid-word, signed diagonal choices, +boundary-scale fusion, scale relocation, addition resynthesis, coefficient-work +sharing, different lowering, and altered frames or ownership. No claim of +uniqueness, optimality in those larger classes, or improved κ follows. + +## Evidence and search coverage + +`CERTIFICATE.json` gives all 716 exponents and 8,894 edge dual variables. +`EXPECTED.json` pins exact generated cleanup/program digests, both full costs, +and rational prefix envelopes. `SOURCES.json` binds every consumed source; +compressed inputs are accepted by decompressed payload, not gzip container. +`verify.py` also checks both word/program bindings against #626's SPEC. + +The exact rational interpreter checks all 716 native columns simultaneously, +plus eight arbitrary private-centre columns, in both orientations. Separately, +846 distinct original/candidate coefficients are lowered into explicit original +Horner primitives on formal target/source/arbitrary-work inputs. This proves +the macro substitution and its full clearing cost. Whole-program matrix replay +uses these verified macro semantics; it is not claimed to execute every primitive +on every full matrix row. + +`test_verify.py` implements cleanup matrix arithmetic using integer rows and +binary exponents instead of Fraction, checking all 716 arbitrary input columns +in both orientations. Its ten tests include missing entry/exit scales, a wrong +conjugation coefficient, box/divergence/gap failures in the dual, dirty work, +aliasing, illegal frames, changed source blocks, and an exact-identity excursion +that violates the prefix allowance. Fifty small integer/rational matrix replays +cross-check the second arithmetic engine. + +OS assignment seed **35** chose the complex track; odd parity selected JP8. +The first bounded screen used seed-35 shuffled coordinate descent over +`[-2,2]`, at most ten sweeps, stopping on a sweep with no strict improvement. +It completed seven sweeps and nominated a 4,840-real-primitive saving. This +positive complete budget justified replacing the bounded screen by the exact +convex-dual nomination on the SAME word/mechanism. The final exponents range +from -2 to 7. The final coverage is all integer constant gauges via the above +dual proof, not an assertion that coordinate descent exhausted its search cube. +No retired supplier search was reopened. + +## Provenance, overlap and remaining obligations + +Base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`. +Reviewed #622: `f69477f4f6d3c7eb1f740b166881bffed4ffa9f6`. +Selected #626: `660de893d27bb7abd1d5b01b1640207528a5c851`. +Retained #543: `2065fe4f72a914d907f1046603f5a36f17018535`. +At the research base, accepted κ was `51110230636731/31250000000000000`. +At publication refresh `bce54fb3f895cbe5cd4c0eb477c3afeed100190f`, the selected +record is #1094, κ = `836330098538459/500000000000000000`. This package +studies the frozen #626 circuit, not the newer frontier. `SELECTED-AT-BASE.json` +is a byte-identical copy of the original selected record; its original path and +hash are retained in SOURCES.json so future frontier updates do not break replay. + +Credit to Jeremy Kothe and the #622/#623 contributors for JP8/K-triangle +construction, Chafik Boukhalfa for #626, icekylinx for the original emitter and +direct-delivery lineage, DreamingOfClouds for cold-helper/native checks, +Dominik Scholz and Dugongue for prefix work, Rohan Arun for recurrence work, +eumemic for #543, and all predecessors retained in the maintainer review. + +Concurrent #750 (`b6d6934092c063ab2575ebee00f48bbc7b1c9d82`) optimizes one +existing CK scale's position. This adds a simultaneous JP8 diagonal sandwich +and an exact global certificate for its distinct class. #739 +(`abb9825202dba6f9bc95c7df8d12d86088fdff1a`) rescales private coefficient work; +this changes live register coordinates and preserves per-macro work clearing. +#696/#723/#734 lower individual coefficients, #722/#751 share preparation, +#769 (`e891b2b19e3185ec91bcf001e255af87f42389ce`) shares CK coefficient work +across varying-magnitude ladders, #755 +(`a1dd9f819102c40e0b5e4a75215cf69ee864f480`) extends JP8 coefficient reuse +across scalar phases, and #749 uses a restored target basis in compensation. +Those pending +implementations are not imported. Savings are measured against the accepted +base and are not asserted additive to concurrent results without a composed +recount. The local claim records the three candidates and refreshed overlap. + +Only this research package is added. The selected frontier, native production +emitter, global owners, source archives and `upstream/` are unchanged. Production +integration would need a typed diagonal-cleanup construction step, refreshed +bindings and prefix receipts, plus global invoice and outer-admission replay. +The inherited all-size compiler, common-label/mutable-basis realization, +pooled hosting, residual, precision/tape/exact recovery, bit-supplier and +analytic-transfer assumptions remain. No full repository/cold replay, remote +CI, Lean multiplication proof or new asymptotic exponent is claimed. + +Prepared for **Luis Leon (@mythrilium)** with substantial **OpenAI Codex** +assistance in research, implementation, checks and writing. No independent +human peer review is claimed. New files are under the repository's Apache-2.0 +license. No copied predecessor source or notice is replaced. + +## Publication overlap and open next questions + +The publication-time search also found #786 (quarter factoring and adapter-cost +warning), #793 (larger JP8 compensation savings through coefficient routes), +#984 (single-block scale deferral), and #949 (a different fixed 26-ADD factory +gauge census). Those results are not imported or claimed additive. This package +adds a simultaneous 716-coordinate cleanup gauge and an exact unbounded-domain +primal/dual optimum, not a best-scalar-saving headline. Search results are bounded +overlap evidence, not a novelty proof. + +- Can the same gauge fit a fixed-macro lowering? First derive the complete adapter + invoice with the 406 extra macros; it may erase the scalar saving. This blocks + any complete supplier improvement claim. +- Can one compose the gauge with #793's coefficient reuse? First reprice one + shared-source run with both boundary scales. The present dual only certifies + the original per-add lowering and does not establish an optimum for that class. diff --git a/research/complex-jp8-diagonal-gauge/SELECTED-AT-BASE.json b/research/complex-jp8-diagonal-gauge/SELECTED-AT-BASE.json new file mode 100644 index 0000000000..92a10096de --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/SELECTED-AT-BASE.json @@ -0,0 +1,123 @@ +{ + "status": "Maintainer-reviewed conditional finite construction; see the integration receipt for publication and PR resolution status", + "kappa": "51110230636731/31250000000000000", + "decimal": "0.001635527380375392", + "source_prs": [ + 626, + 623, + 622, + 620, + 617, + 615, + 604, + 601, + 596, + 592, + 591, + 593, + 599, + 588, + 543, + 584, + 586, + 583, + 582, + 579, + 576, + 575, + 574, + 571, + 569, + 568, + 567, + 564, + 562, + 561, + 559, + 558, + 552, + 550, + 548, + 541, + 535, + 510, + 503, + 531, + 523, + 493, + 514, + 507, + 484, + 496, + 505, + 522, + 520, + 472, + 458, + 445, + 442, + 425, + 433, + 370, + 361, + 315 + ], + "source_manifest": "research/community-k492-audit/SELECTED-SOURCE.json", + "certificate": "research/community-k492-audit/pr626/replay/ASSEMBLY.json", + "certificate_sha256": "6127732e2fcdd470dab349c1c51d03cd9f0787ad0309b1b4a7c811a908028f4e", + "proof": "docs/research/community-k492-review.md", + "proof_supplements": { + "research/e8-bit-r420/README.md": "9807be57c6adf26b30e4f54e2f8160075bbc05091f1a6d157e43d2a4620c1c9f", + "research/complex-571-free4fc8/NOTICE.md": "a4c084abdc1c7a9ac683eeb11124335d51cff8a6deba6ee92ba5a12bceaa2c97", + "research/complex-multicold/proof/CONSTRUCTION.md": "27ece5e1c11b90d97a808b56eff897b998c10e61016db95867f84e6e6aef132f", + "research/complex-multicold/vendor/pr559/PROOF.md": "d5d498edc56fdef8c5798af7f5ec66948bd2f66c553b9efe366cdaab01bd3453", + "research/structural-gain/frontier-composition/README.md": "70f0f791cbe3b2603f85d85bb9055aa0ee1df6dc06ba82fc1921356948312887", + "research/complex-joint-prefix/proof/CONSTRUCTION.md": "a92e610e7a598d99c612d1b63d1a03a49c0cd1e15ddd29fa55c465ddd8c18105", + "research/kernel-frame-coalescing/PROOF.md": "fa8b2f36b9590ee80ff45d3f7724f8c7de8ad29a29f366d5133010c77e41fe1b", + "research/complex-571-hpeq5/README.md": "4000b37f6c07c09d971dc4010ceb137c13340f3a8809d3272046ccaf746c3e2b", + "research/hyperplane-end-lean/PROOF.md": "1cbce5cf0ff0152f71e8ae7bef25841d1ce13010af248ff7209182d2328c21c9", + "docs/research/community-hyperplane599-review.md": "3298cd0d451541508af232cac72efbd7c10580e6c6ad493a855ab0faa01ade8c", + "research/complex-571-cold14-b3/README.md": "1945785785c153c7d0e8d4c071adabe626c1091b71721ff85d2d67191b376b96", + "research/complex-571-cold14-b3/PROOF-NOTE.md": "1cf592cbc8ab8e21d2dd8c1e945a5c64c6d5cde1216fb06e05a36c1c6ec6613d", + "scripts/verify_cold617_interface.py": "95d7a9094c05ad975fb72f5ab7605593003245a503c8456764987e512028fa6a", + "docs/research/community-cold617-review.md": "b3f2bcbae1249f1f651032022ce1e6e2bfb3f563ce580bf53671f50a074d7046", + "research/complex-k492-owner-repair/README.md": "ee5a1ace4828f7a073be97e95c2d931988774dd3a29a877e65abdf429aeec902", + "research/complex-k492-owner-repair/PROOF-NOTE.md": "337d70fe7abd9afca1d90954c23bde87f4dc27888cc1a6b4bb80506fd6fbf8c5", + "research/complex-k492-owner-repair/PROOF-NOTE-R.md": "22312bb347bdf159e6a01a45c47675e6170d33b258e2fd9ed52aee88fb92c0ed", + "docs/research/community-k492-review.md": "3b731d30e80010b15408a289b0b32192700885474c8b36d48ee3320a7a8c5c47", + "scripts/verify_frontier626.py": "2207bd0ef04a19ef276869085afdedad80a0938fa75db5e1aa7ab73fd3429444", + "scripts/verify_frontier626_bindings.py": "cda63ff41c6d6e2e352c7bf75b84e690c0ce57e4ec6c0355573bb5d9b1f98280", + "scripts/verify_frontier588_bindings.py": "6d1932eea7b1936598118ea8e607b09c29b6e31b749ec41bbe0744ea4f0b606d", + "scripts/verify_hpe_lean_binding.py": "52aa1d23641e4c716b43c98f6b883ad042087dd03a9d01369e8e6a735b07aa03", + "research/hyperplane-end-lean/HyperplaneEnd/Exact.lean": "eebf3a3982af7ab9be45777b272a6aaa523206fa7667ceb6df63ad6589fd8183" + }, + "review": "docs/research/community-k492-review.md", + "validation": "docs/research/community-k492-integration.json", + "reproduce": "make frontier626-verify", + "scope": "Finite scalar, frame, phase, whole-owner, invoice and exact assembly checks. All-size/compiler/common-label/mutable-basis/pooled-cell hosting/residual/precision/tape/analytic assumptions remain. This is not a full Lean multiplication theorem. See review for replay reuse and Linux CI status.", + "previous_kappa": "817591864627889/500000000000000000", + "previous_record": "certificates/checkpoints/cold617.json", + "audited_source_head": "660de893d27bb7abd1d5b01b1640207528a5c851", + "reviewed_dependency_heads": { + "588": "6d0e53b66c29abd17981881a09eaff41ac862d85", + "543": "2065fe4f72a914d907f1046603f5a36f17018535", + "568": "71c99ac935a33bb7b59a1b4a7af8725a939b0b90", + "569": "1424da81263a5305b35e4cf74ef686c275f03f3f", + "571": "b7bdc5a8de18fcf418cfb9c7d83a2b1097a5e4a3", + "575": "eac6f7e378ab622dac50a2fd4b7ef6eab014de44", + "583": "89be768f0157f5a3d8e4db69cf1748768605eac9", + "586": "4846fee5b06af770e9b3a10c36200f673d656725", + "591": "f622547244bf6d895a571a7b035142ba66279806", + "592": "1f471c445c06a45a32e2c47e8d74c8264b68356b", + "593": "fdb6dcc6d7bc29764c5b6b4d32b7fa050acf74a4", + "596": "7732dd5e46863ff294b5e443661cb9d99abf4e01", + "599": "bc13c8a3e000442606bd2dbe8583a17649ba6c32", + "601": "529ab7dcb59d5ea7a5798e9e06cf5b3aee8a1550", + "604": "1b795c5d7dea746ba310572585c0ef067574b4a6", + "615": "bf8a49a34350599763cced8592db81dc62c2c1c0", + "617": "904d62855723c00f8acef9a287a10768598fdeb2", + "622": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6", + "623": "e39a615ca601ce5d62abeb24f3fcdb8644ca1005", + "626": "660de893d27bb7abd1d5b01b1640207528a5c851" + } +} diff --git a/research/complex-jp8-diagonal-gauge/SOURCES.json b/research/complex-jp8-diagonal-gauge/SOURCES.json new file mode 100644 index 0000000000..58423f5d7f --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/SOURCES.json @@ -0,0 +1,34 @@ +{ + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "source_pr_heads": { + "622": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6", + "626": "660de893d27bb7abd1d5b01b1640207528a5c851", + "543": "2065fe4f72a914d907f1046603f5a36f17018535" + }, + "files": { + "docs/research/community-k492-review.md": { + "sha256": "3b731d30e80010b15408a289b0b32192700885474c8b36d48ee3320a7a8c5c47" + }, + "research/complex-k492-owner-repair/data/SPEC.json": { + "sha256": "2a2577ac526535826fed9d5f7f83f6e2e0ec058a146c64f7286720b995fa2323" + }, + "research/complex-k492-owner-repair/code/hpe_emit_local.py": { + "sha256": "7e4a6fbc38c8228157b6311457d1496bf460291393043932d2c365f004f77805" + }, + "research/complex-k492-owner-repair/code/hpe_audit_local.py": { + "sha256": "6bd9a1e279c9c9e4f3767d9f82e537b559292906feb2ddab02f380fb6523a810" + }, + "research/community-k492-audit/pr622/replay/jp8-local/CANONICAL-WORD.json.gz": { + "sha256": "7a3fec1022d3b2b1bd986302a327735ec521d17b043f4a5acb96253a56f6193c", + "payload_sha256": "fb4a8d14ed2a8048698bea6ae16f86163a1aa6c80f2eb622222eee5cdbce9b3b" + }, + "research/community-k492-audit/pr622/replay/jp8-local/LOCAL-PROGRAMS.json.gz": { + "sha256": "fa0c196f65bd6ec1424fdf7d789f6972075c7bb02bf43f573ea85eafab31be98", + "payload_sha256": "efe45ce7fb025a6f53cc9eb54e951ac2211a5ed927e689a049e4f68ca680654b" + }, + "research/complex-jp8-diagonal-gauge/SELECTED-AT-BASE.json": { + "sha256": "b3bf402f31a69bde0629936a9b569bed48281568d7b16d5fba120b5311ea1f53", + "original_path": "certificates/selected-result.json" + } + } +} diff --git a/research/complex-jp8-diagonal-gauge/VALIDATION.md b/research/complex-jp8-diagonal-gauge/VALIDATION.md new file mode 100644 index 0000000000..8379b2d9f4 --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/VALIDATION.md @@ -0,0 +1,96 @@ +# Verification and handoff + +Status: **completed finite research construction**, with a scoped exact +optimality certificate; **no new κ**. Prepared for Luis Leon (@mythrilium) +with substantial OpenAI Codex assistance. No second human reviewer is claimed. + +Research-time base and research-time refreshed upstream main both equal +`66849e1475c930fd7732b1a0067ffee7e1e95f60`. +Branch: `research/jp8-diagonal-gauge-seed35`. +Only this package changes; `upstream/` and the selected certificate are untouched. + +## Passed checks + +Environment: Linux, CPython 3.12.14. Arithmetic verification uses only the +standard library. The optional nomination used NumPy 2.3.5 / SciPy 1.17.0. + +- `python3 -I -B research/complex-jp8-diagonal-gauge/check.py`: passes the + exact zero-gap certificate, both original/candidate full scalar programs, + all 716 native plus eight arbitrary private-centre input columns, and all + 846 distinct coefficient primitive boundaries. Final output: + `PASS_JP8_GAUGE_COMPLETE saved=6154/6154 optimal_cost=10326 tests=10 inherited_controls=25 kappa=unchanged`. +- Separate integer-dyadic row implementation agrees on the entire cleanup map + in both orientations. All ten focused tests pass, including 12 distinct + adverse mutations and 50 small arithmetic cross-checks. +- The unchanged pinned `hpe_emit_local.py` emits exactly the independently + spliced candidate streams, including every boundary scale. The unchanged + `hpe_audit_local.py` accepts both streams, their unchanged paid profiles, + scalar endpoints, prefix bounds and wrapper/frame lifetimes; all 25 inherited + controls reject. +- The complete command also passes under isolated **optimized parent** Python + (`-I -O -B`). The harness explicitly runs inherited assertion-based auditors + with optimization disabled and removes `PYTHONOPTIMIZE` from their environment. +- A minimal relocated checkout in a path containing spaces, with only this + package and the seven pinned source files, passes from `/tmp`. Both gzip + inputs were recompressed at level 1 with a different timestamp. The complete + relocated check took 17.182 seconds in this environment; this is a reproduction + receipt, not a performance comparison. +- Changing the committed saving receipt is rejected. Changing a pinned cleanup + coefficient inside the source gzip is rejected. These controls ran only in + the temporary relocated checkout. +- Optional rediscovery reproduces the exact committed primal/dual certificate + in this environment, and the documented seven-sweep bounded-screen trace. +- `make selected-record-check` passes. Staged whitespace and clean-base + patch-application checks pass in the final handoff. + +One early synthetic negative test failed because its toy event stream did not +clear its arbitrary private centres, so it reached the centre guard before the +intended prefix guard. The test was fixed by explicitly clearing those centres; +the exact-identity `2**193` excursion is now rejected for the intended prefix +failure. No mathematical construction or acceptance condition was weakened. + +## Coverage limits and overlap + +The rational whole-program interpreter executes verified scalar macro semantics, +not every primitive on every full row. The separate coefficient interpreter +executes original Horner primitives on three formal inputs, including arbitrary +incoming work. The standalone cleanup integer replay tests arbitrary boundaries +rather than only states reachable from the front half of the supplier. + +No global invoice, full repository `make verify`, selected cold rebuild, +remote CI, Lean or production integration was run or claimed. All inherited +uniform, physical, precision/tape/recovery and analytic assumptions remain. +The unchanged paid recursive profile means this result does not improve κ. + +The initial complete open-issue scan found only ordinary issue #650, with no +sprint coordination issue, so the narrow claim is local. A later complete scan +covered 585 open PRs through #766. The 05:25:52 UTC refresh checked all recently +updated open PRs through #772, including #769's distinct private-work ladders. +No restored live-register JP8 diagonal sandwich or matching exact dual +certificate was found. This is an overlap check, not a claim about private work +or historical priority. Predecessors and concurrent mechanisms are credited in +README.md and no pending implementation is imported. + +The contribution is prepared for the verified Personal GitHub account +`mythrilium`. Publication status will be recorded after the fork and PR steps. +Publication refresh: main is now `bce54fb3f895cbe5cd4c0eb477c3afeed100190f`. +The six executable/construction source files remain unchanged. The historical +selected record is retained byte-for-byte inside this package, with its original +source pin. The publication branch retains the original research base. +A final focused replay checks this portable packaging before submission. + +## Apply and review + +On the exact base above, apply the supplied format-patch with `git am`, then run: + +```sh +python3 -B research/complex-jp8-diagonal-gauge/check.py +``` + +Suggested PR title: **Research: certify optimal restored JP8 diagonal gauge +(6,154 fewer primitives per orientation; no new kappa)**. + +The exact proof and class limits are in README.md; source pins are in +SOURCES.json; the complete optimality witness is in CERTIFICATE.json. +The maintainer can integrate or independently review the package without +changing the selected frontier. Production adoption remains a separate task. diff --git a/research/complex-jp8-diagonal-gauge/check.py b/research/complex-jp8-diagonal-gauge/check.py new file mode 100644 index 0000000000..762c88aa00 --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/check.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +"""One-command verification, including unchanged inherited local auditors. + +Writes only a temporary directory, which is removed on exit. Apache-2.0. +Substantial OpenAI Codex assistance for Luis Leon (@mythrilium). +""" +import copy +import gzip +import importlib.util +import json +import os +import subprocess +import sys +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location("gauge_verify", HERE / "verify.py") +V = importlib.util.module_from_spec(spec) +spec.loader.exec_module(V) + + +def main(): + V.main() + # Inherited auditors use assertions. Never inherit an optimized invocation. + env = os.environ.copy() + env.pop("PYTHONOPTIMIZE", None) + subprocess.run([sys.executable, "-I", "-B", str(HERE / "test_verify.py")], check=True, env=env) + word, programs, source_spec = V.load_inputs() + cert = json.loads((HERE / "CERTIFICATE.json").read_text()) + candidate = copy.deepcopy(word) + candidate["cleanup"] = V.transform(word["cleanup"], cert["exponents"]) + with tempfile.TemporaryDirectory(prefix="jp8-diagonal-gauge-") as work: + out = Path(work) + payload = json.dumps(candidate, sort_keys=True, separators=(",", ":")).encode() + (out / "CANONICAL-WORD.json.gz").write_bytes(gzip.compress(payload, mtime=0)) + code = V.ROOT / "research/complex-k492-owner-repair/code" + for filename in ("hpe_emit_local.py", "hpe_audit_local.py"): + subprocess.run([sys.executable, "-I", "-B", str(code / filename), str(out)], check=True, env=env) + emitted = json.loads(gzip.decompress((out / "LOCAL-PROGRAMS.json.gz").read_bytes())) + expected = json.loads((HERE / "EXPECTED.json").read_text()) + audit = json.loads((out / "INDEPENDENT-LOCAL-REPLAY.json").read_text()) + for name, stream in emitted.items(): + independent = V.splice(programs[name], word["cleanup"], candidate["cleanup"], name == "backward") + V.require(stream == independent, "inherited emitter and independent splice differ") + V.require(V.digest(stream) == expected["programs"][name]["candidate_sha256"], "emitter digest") + V.require(audit["paid_profiles"][name] == source_spec["expected_profile"], "paid profile change") + V.require(audit["local"][name]["prefix_l1_upper"] == expected["programs"][name]["after"]["prefix_l1"], "prefix audit disagreement") + V.require(len(audit["negative_controls_rejected"]) == 25, "inherited controls missing") + print("PASS_JP8_GAUGE_COMPLETE saved=6154/6154 optimal_cost=10326 tests=10 inherited_controls=25 kappa=unchanged") + + +if __name__ == "__main__": + main() diff --git a/research/complex-jp8-diagonal-gauge/discover.py b/research/complex-jp8-diagonal-gauge/discover.py new file mode 100644 index 0000000000..a3e6ab1752 --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/discover.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +"""Optional nomination using SciPy/HiGHS; exact checking is in verify.py. + +Prints a freshly nominated primal/dual certificate, without overwriting files. +Alternative optima may differ by solver version. Apache-2.0; substantial +OpenAI Codex assistance for Luis Leon (@mythrilium). +""" +import importlib.util +import json +import random +from pathlib import Path + +import numpy as np +from scipy.optimize import linprog +from scipy.sparse import coo_matrix, vstack + +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location("gauge_verify", HERE / "verify.py") +V = importlib.util.module_from_spec(spec) +spec.loader.exec_module(V) + + +def main(): + word, _, _ = V.load_inputs() + n = 2 * word["v"] + word["R"] + edges = V.native_edges(word["cleanup"]) + adjacent = [[] for _ in range(n)] + for t, s, e in edges: + adjacent[t].append((t, s, e)) + adjacent[s].append((t, s, e)) + g = [0] * n + order = [r for r in range(n) if adjacent[r]] + random.Random(35).shuffle(order) + + def local(r, x): + return 2 * abs(x) + sum(abs(e + (x if t == r else g[t]) - (x if s == r else g[s])) + for t, s, e in adjacent[r]) + + history = [] + for sweep in range(10): + changes = 0 + for r in order: + best = min(range(-2, 3), key=lambda x: (local(r, x), abs(x - g[r]), abs(x), x)) + if local(r, best) < local(r, g[r]): + g[r] = best + changes += 1 + objective = 2 * sum(map(abs, g)) + sum(abs(e + g[t] - g[s]) for t, s, e in edges) + history.append({"sweep": sweep + 1, "changed": changes, "price": objective}) + if not changes: + break + # An optimistic profitable screen motivates the same object's exact dual LP. + rows, cols, vals = [], [], [] + for i, (t, s, _) in enumerate(edges): + rows.extend([t, s]) + cols.extend([i, i]) + vals.extend([1, -1]) + incidence = coo_matrix((vals, (rows, cols)), shape=(n, len(edges))).tocsc() + result = linprog(-np.array([e for _, _, e in edges]), + A_ub=vstack([incidence, -incidence]), b_ub=np.full(2 * n, 2), + bounds=(-1, 1), method="highs") + V.require(result.success, "solver did not nominate a solution") + dual = [round(x) for x in result.x] + h = result.ineqlin.marginals + gauge = [round(h[i] - h[n + i]) for i in range(n)] + # Rounded solver output is merely a nomination: exact feasibility AND zero + # gap are mandatory, and are sufficient independently of solver status. + objective = V.check_duality(edges, gauge, dual) + certificate = {"schema": "jp8-diagonal-gauge-v1", "assignment_seed": 35, + "exponents": gauge, "edge_dual": dual, "objective": objective, + "original_objective": sum(abs(e) for _, _, e in edges), + "nonzero": sum(x != 0 for x in gauge), "l1_exponents": sum(map(abs, gauge))} + print(json.dumps({"coordinate_screen": history, "certificate": certificate}, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/research/complex-jp8-diagonal-gauge/test_verify.py b/research/complex-jp8-diagonal-gauge/test_verify.py new file mode 100644 index 0000000000..7d1585c11a --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/test_verify.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +"""Independent integer row replay and adverse controls; Apache-2.0. + +Substantial OpenAI Codex assistance for Luis Leon (@mythrilium). +Independence here means a separate arithmetic implementation, not a second +human reviewer. Does not use Fraction for its matrix arithmetic. +""" +import copy +import importlib.util +import json +import random +import unittest +from pathlib import Path + +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location("gauge_verify", HERE / "verify.py") +V = importlib.util.module_from_spec(spec) +spec.loader.exec_module(V) + + +def binary_exponent(x): + if x <= 0 or x & (x - 1): + raise ValueError("positive power of two required") + return x.bit_length() - 1 + + +def integer_replay(word, n, backward=False): + # Row r represents 2**exponents[r] * sum_j rows[r][j] x_j. + rows = [{r: 1} for r in range(n)] + exponents = [0] * n + for op in word: + if op[0] == "scale": + r, p, q = op[1:4] + e = binary_exponent(abs(p)) - binary_exponent(q) + if backward: + e = -e + exponents[r] += e + if p < 0: + rows[r] = {j: -x for j, x in rows[r].items()} + elif op[0] == "add": + t, s, p, q = op[1:5] + if backward: + t, s, p = s, t, -p + source_exp = exponents[s] - binary_exponent(q) + target_exp = exponents[t] + common = min(source_exp, target_exp) + updated = {j: x << (target_exp - common) for j, x in rows[t].items()} + for j, x in rows[s].items(): + value = updated.get(j, 0) + (p * x << (source_exp - common)) + if value: + updated[j] = value + else: + updated.pop(j, None) + rows[t], exponents[t] = updated, common + else: + raise ValueError("unknown native operation") + # Canonicalize by removing common factors of two in each integer row. + result = [] + for row, e in zip(rows, exponents): + shift = min(((abs(x) & -abs(x)).bit_length() - 1 for x in row.values()), default=0) + result.append((e + shift, {j: x >> shift for j, x in row.items()})) + return result + + +class GaugeTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.word, cls.programs, cls.spec = V.load_inputs() + cls.cert = json.loads((HERE / "CERTIFICATE.json").read_text()) + cls.g = cls.cert["exponents"] + cls.old = cls.word["cleanup"] + cls.new = V.transform(cls.old, cls.g) + cls.n = len(cls.g) + cls.edges = V.native_edges(cls.old) + + def test_all_cleanup_columns_both_orientations(self): + for back in (False, True): + self.assertEqual(integer_replay(self.old, self.n, back), integer_replay(self.new, self.n, back)) + + def test_exact_cost_from_explicit_odd_parts(self): + # Derive the invariant odd-numerator part independently. + old_total = new_total = 0 + for op in self.old: + if op[0] == "scale": + continue + t, s, p, q = op[1:5] + a = abs(p) + twos = (a & -a).bit_length() - 1 + odd = a >> twos + e = twos - binary_exponent(q) + constant = 2 + len(bin(odd)[2:]) + bin(odd).count("1") + old_total += constant + abs(e) + new_total += constant + abs(e + self.g[t] - self.g[s]) + new_total += 2 * sum(abs(e) for e in self.g) + self.assertEqual(2 * (old_total - new_total), 6154) + + def test_omitted_boundary_scales_fail(self): + reference = integer_replay(self.old, self.n) + self.assertNotEqual(reference, integer_replay(self.new[1:], self.n)) + self.assertNotEqual(reference, integer_replay(self.new[:-1], self.n)) + + def test_wrong_conjugation_sign_fails(self): + bad = copy.deepcopy(self.new) + boundary = sum(e != 0 for e in self.g) + for i, op in enumerate(self.old): + if op[0] == "add" and self.g[op[1]] != self.g[op[2]]: + # Original coefficient in one changed gate fails the map. + bad[boundary + i] = copy.deepcopy(op) + break + self.assertNotEqual(integer_replay(self.old, self.n), integer_replay(bad, self.n)) + + def test_dual_mutations_rejected(self): + dual = self.cert["edge_dual"] + bad = dual[:] + bad[0] = 2 + with self.assertRaisesRegex(ValueError, "box"): + V.check_duality(self.edges, self.g, bad) + with self.assertRaisesRegex(ValueError, "gap"): + V.check_duality(self.edges, self.g, [0] * len(dual)) + # Box-feasible flow may still violate divergence. + with self.assertRaisesRegex(ValueError, "divergence"): + V.check_duality(self.edges, self.g, [1] * len(dual)) + changed_g = self.g[:] + changed_g[0] += 100 + with self.assertRaisesRegex(ValueError, "gap"): + V.check_duality(self.edges, changed_g, dual) + + def test_duality_synthetic_enumeration(self): + # A two-node example: min 2(|g0|+|g1|)+3|2+g0-g1| = 4. + edges = [(0, 1, 2)] * 3 + self.assertEqual(V.check_duality(edges, [-2, 0], [1, 1, 0]), 4) + costs = [2 * (abs(a) + abs(b)) + 3 * abs(2 + a - b) + for a in range(-5, 6) for b in range(-5, 6)] + self.assertEqual(min(costs), 4) + + def test_private_work_and_alias_controls(self): + with self.assertRaisesRegex(ValueError, "boundary"): + V.primitive_coefficient_check(V.Q(3, 8), omit_clear=True) + with self.assertRaisesRegex(ValueError, "alias"): + V.native_edges([["add", 0, 0, 1, 1, 1]]) + + def test_frame_and_cleanup_binding_controls(self): + with self.assertRaisesRegex(ValueError, "full-frame"): + V.native_edges([["add", 0, 1, 1, 1, 0]]) + bad = copy.deepcopy(self.programs["forward"]) + pos = bad.index(["phase", "full_frame_cleanup"]) + 1 + bad[pos][1][3] *= 2 + with self.assertRaisesRegex(ValueError, "pinned contiguous"): + V.splice(bad, self.old, self.new, False) + + def test_endpoint_neutral_prefix_excursion_rejected(self): + # Exact identity but a coefficient-work payload far beyond the allowance. + events = [["scalar", ["clear", ["C", r]], 1] for r in range(8)] + events += [["scalar", ["scale", ["L", 0], 2 ** 193, 1], 1], + ["scalar", ["scale", ["L", 0], 1, 2 ** 193], 1]] + with self.assertRaisesRegex(ValueError, "prefix"): + V.replay(events, 1, 0, False) + + def test_integer_engine_against_small_rational_maps(self): + rng = random.Random(35) + for _ in range(25): + ops = [] + for _ in range(20): + t, s = rng.sample(range(4), 2) + ops.append(["add", t, s, rng.choice([-3, -1, 1, 3]), 2 ** rng.randrange(4), 1]) + for back in (False, True): + result = integer_replay(ops, 4, back) + rows = [[V.Q(i == j) for j in range(4)] for i in range(4)] + for op in ops: + t, s, p, q = op[1:5] + if back: + t, s, p = s, t, -p + rows[t] = [x + V.Q(p, q) * y for x, y in zip(rows[t], rows[s])] + for r, (e, ints) in enumerate(result): + self.assertEqual(rows[r], [V.power2(e) * ints.get(j, 0) for j in range(4)]) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/research/complex-jp8-diagonal-gauge/verify.py b/research/complex-jp8-diagonal-gauge/verify.py new file mode 100644 index 0000000000..0bcfddacdd --- /dev/null +++ b/research/complex-jp8-diagonal-gauge/verify.py @@ -0,0 +1,266 @@ +#!/usr/bin/env python3 +"""Exact JP8 diagonal-gauge certificate checker. Apache-2.0. + +Prepared for Luis Leon (@mythrilium), with substantial OpenAI Codex assistance. +Uses the credited #622/#626 word and original emitter's primitive convention. +No solver dependency, writes, network, or reliance on Python assertions. +""" +import copy +import gzip +import hashlib +import json +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +LOCAL = "research/community-k492-audit/pr622/replay/jp8-local/" +SPEC = "research/complex-k492-owner-repair/data/SPEC.json" + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def digest(obj): + return hashlib.sha256(json.dumps(obj, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + + +def load_inputs(): + sources = json.loads((HERE / "SOURCES.json").read_text()) + for path, pins in sources["files"].items(): + raw = (ROOT / path).read_bytes() + if path.endswith(".gz"): + # The compressed bytes are recorded, but equality is payload-based. + require(hashlib.sha256(gzip.decompress(raw)).hexdigest() == pins["payload_sha256"], path) + else: + require(hashlib.sha256(raw).hexdigest() == pins["sha256"], path) + word = json.loads(gzip.decompress((ROOT / LOCAL / "CANONICAL-WORD.json.gz").read_bytes())) + programs = json.loads(gzip.decompress((ROOT / LOCAL / "LOCAL-PROGRAMS.json.gz").read_bytes())) + spec = json.loads((ROOT / SPEC).read_text())["providers"]["jp8"] + for name, obj in (("CANONICAL-WORD.json.gz", word), ("LOCAL-PROGRAMS.json.gz", programs)): + require(digest(obj) == spec["artifact_semantic_sha256"][name], "selected SPEC binding: " + name) + for name, events in programs.items(): + require(digest(events) == spec["program_hashes"][name], "program binding: " + name) + return word, programs, spec + + +def power2(e): + return Q(2 ** e) if e >= 0 else Q(1, 2 ** -e) + + +def valuation(q): + require(q != 0 and q.denominator & (q.denominator - 1) == 0, "nonzero dyadic required") + a = abs(q.numerator) + return (a & -a).bit_length() - q.denominator.bit_length() + + +def native_edges(cleanup): + edges = [] + for op in cleanup: + require(op[0] in ("add", "scale") and op[-1] == 1, "full-frame add/scale cleanup required") + if op[0] == "add": + require(op[1] != op[2], "aliasing addition") + edges.append((op[1], op[2], valuation(Q(op[3], op[4])))) + return edges + + +def check_duality(edges, g, dual): + require(len(dual) == len(edges), "dual edge count") + require(all(type(x) is int for x in g), "integer gauge required") + require(all(type(x) is int and -1 <= x <= 1 for x in dual), "dual box constraint") + div = [0] * len(g) + lower = 0 + for f, (t, s, e) in zip(dual, edges): + div[t] += f + div[s] -= f + lower += e * f + require(all(abs(x) <= 2 for x in div), "dual divergence constraint") + primal = 2 * sum(map(abs, g)) + sum(abs(e + g[t] - g[s]) for t, s, e in edges) + require(primal == lower, "primal/dual gap") + return primal + + +def native_scale(r, e): + q = power2(e) + return ["scale", r, q.numerator, q.denominator, 1] + + +def transform(cleanup, g): + pre = [native_scale(r, e) for r, e in enumerate(g) if e] + middle = copy.deepcopy(cleanup) + for op in middle: + if op[0] == "add": + q = Q(op[3], op[4]) * power2(g[op[1]] - g[op[2]]) + op[3:5] = [q.numerator, q.denominator] + post = [native_scale(r, -e) for r, e in enumerate(g) if e] + return pre + middle + post + + +def scalar(op, backward=False): + if op[0] == "add": + t, s, a, b = op[1:5] + if backward: + t, s, a = s, t, -a + return ["add", ["L", t], ["L", s], a, b] + t, a, b = op[1:4] + return ["scale", ["L", t], b, a] if backward else ["scale", ["L", t], a, b] + + +def splice(events, original, candidate, backward): + start = events.index(["phase", "full_frame_cleanup"]) + 1 + end = start + len(original) + expected = [["scalar", scalar(op, backward), 1] for op in original] + require(events[start:end] == expected, "cleanup must be exactly the pinned contiguous block") + replacement = [["scalar", scalar(op, backward), 1] for op in candidate] + result = events[:start] + replacement + events[end:] + require([e for e in result if e[0] != "scalar"] == [e for e in events if e[0] != "scalar"], "non-scalar event change") + return result + + +def primitive_cost(op): + if op[0] in ("clear", "copy"): + return 1 + q = Q(op[3], op[4]) if op[0] == "add" else Q(op[2], op[3]) + a, b = abs(q.numerator), q.denominator + valuation(q) + if op[0] == "scale": + require(a & (a - 1) == 0, "scale must be signed power of two") + return abs(a.bit_length() - b.bit_length()) + int(q < 0) + return 3 + (a.bit_length() - 1) + a.bit_count() + (b.bit_length() - 1) + + +def replay(events, n, v, backward, endpoint=True): + """Sparse rational rows simultaneously represent all n arbitrary inputs. + + Positive norm propagation follows the retained audit, including the maximal + numerator-Horner work value. Private centre inputs start arbitrary, not zero. + """ + rows = {("L", r): {r: Q(1)} for r in range(n)} + norms = {r: Q(1) for r in rows} + for r in range(8): + rows["C", r] = {n + r: Q(1)} + norms["C", r] = Q(1) + prefix = Q(1) + macros = prims = 0 + for event in events: + if event[0] != "scalar": + continue + op = event[1] + tag, t = op[0], tuple(op[1]) + prims += 2 * primitive_cost(op) + macros += 1 + if tag == "clear": + rows[t], norms[t] = {}, Q(0) + elif tag == "copy": + s = tuple(op[2]) + rows[t], norms[t] = dict(rows[s]), norms[s] + elif tag == "scale": + q = Q(op[2], op[3]) + rows[t] = {j: q * x for j, x in rows[t].items()} + norms[t] *= abs(q) + elif tag == "add": + s, q = tuple(op[2]), Q(op[3], op[4]) + require(s != t, "aliased replay addition") + prefix = max(prefix, abs(q.numerator) * norms[s]) + norms[t] += abs(q) * norms[s] + row = rows[t] + for j, x in rows[s].items(): + z = row.get(j, Q(0)) + q * x + if z: + row[j] = z + else: + row.pop(j, None) + else: + raise ValueError("unknown scalar operation") + prefix = max(prefix, norms[t]) + if endpoint: + for r in range(n): + expected = {r: Q(1)} + if backward and r < v: + expected[v + r] = Q(-1) + elif not backward and v <= r < 2 * v: + expected[r - v] = Q(1) + require(rows["L", r] == expected, f"endpoint mismatch: {r}") + require(all(not row for r, row in rows.items() if r[0] == "C"), "dirty centre not cleared") + require(prefix < 2 ** 192, "192-bit positive prefix allowance exceeded") + return {"real_primitives": prims, "scalar_macros": macros, + "prefix_l1": str(prefix), "prefix_bits": prefix.numerator.bit_length() - prefix.denominator.bit_length() + 1, + "all_native_columns": n, "arbitrary_private_centre_columns": 8} + + +def primitive_coefficient_check(q, omit_clear=False): + """Independent formal (target, source, incoming work) primitive interpreter.""" + a, b = abs(q.numerator), q.denominator + # State rows in a three-dimensional rational vector space. + t, s, w = [Q(1), Q(0), Q(0)], [Q(0), Q(1), Q(0)], [Q(0), Q(0), Q(1)] + count = 0 + w = [Q(0)] * 3 + count += 1 + for i, digit in enumerate(bin(a)[2:]): + if i: + w = [2 * x for x in w] + count += 1 + if digit == "1": + w = [x + y for x, y in zip(w, s)] + count += 1 + for _ in range(b.bit_length() - 1): + w = [x / 2 for x in w] + count += 1 + t = [x + (1 if q > 0 else -1) * y for x, y in zip(t, w)] + count += 1 + if not omit_clear: + w = [Q(0)] * 3 + count += 1 + require(t == [1, q, 0] and s == [0, 1, 0] and w == [0, 0, 0], "primitive coefficient boundary") + require(count == primitive_cost(["add", ["L", 0], ["L", 1], q.numerator, q.denominator]), "primitive count mismatch") + + +def main(): + word, programs, spec = load_inputs() + cert = json.loads((HERE / "CERTIFICATE.json").read_text()) + n, v = 2 * word["v"] + word["R"], word["v"] + g, dual = cert["exponents"], cert["edge_dual"] + require(len(g) == n, "gauge dimension") + edges = native_edges(word["cleanup"]) + active = {r for t, s, _ in edges for r in (t, s)} + require(all(not e or (r in active and word["final"][r] == 1) for r, e in enumerate(g)), "illegal gauge register/frame") + objective = check_duality(edges, g, dual) + original_objective = sum(abs(e) for _, _, e in edges) + require(objective == cert["objective"] and original_objective == cert["original_objective"], "certificate objective") + require(sum(x != 0 for x in g) == cert["nonzero"] and sum(map(abs, g)) == cert["l1_exponents"], "certificate gauge census") + candidate = transform(word["cleanup"], g) + coefficients = set() + report = {"objective": objective, "original_objective": original_objective, + "saving_per_orientation": 2 * (original_objective - objective), + "boundary_real_primitives": 4 * sum(map(abs, g)), + "changed_registers": sum(x != 0 for x in g), "edge_count": len(edges), + "candidate_cleanup_sha256": digest(candidate), "programs": {}} + for name, events in programs.items(): + back = name == "backward" + changed = splice(events, word["cleanup"], candidate, back) + for stream in (events, changed): + for event in stream: + if event[0] == "scalar" and event[1][0] == "add": + coefficients.add(Q(event[1][3], event[1][4])) + before = replay(events, n, v, back) + after = replay(changed, n, v, back) + inherited = spec["complete_contract"]["local"][name] + require(before["real_primitives"] == inherited["real_component_primitives"], "original primitive binding") + require(before["prefix_l1"] == inherited["prefix_l1"], "original prefix binding") + require(before["real_primitives"] - after["real_primitives"] == report["saving_per_orientation"], "complete cost delta") + report["programs"][name] = {"before": before, "after": after, "candidate_sha256": digest(changed)} + print(f"PASS {name} primitives={before['real_primitives']}->{after['real_primitives']} prefix_bits={after['prefix_bits']}", flush=True) + for q in coefficients: + primitive_coefficient_check(q) + report["distinct_add_coefficients_checked"] = len(coefficients) + expected = json.loads((HERE / "EXPECTED.json").read_text()) + require(report == expected, "receipt mismatch") + print(f"PASS_JP8_DIAGONAL_GAUGE optimal_objective={objective} saved={report['saving_per_orientation']}/" + f"{report['saving_per_orientation']} columns={n}+8 gauge_domain=all_integer_exponents") + return report + + +if __name__ == "__main__": + main()