diff --git a/.gitattributes b/.gitattributes index 6825630198..34cef28eb3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,3 +18,7 @@ research/coordinated-frames-and-entrance-banks/** -text -whitespace # Frozen PR210 package and round-nine evidence retain their audited bytes. research/five-stage-source527-banks/** -text -whitespace research/community-round9-audit/** -text -whitespace +# E8 staged bit word in B3 with #377 complex: MANIFEST.sha256 and the git-blob pins fix exact bytes. +research/e8-kernel-bit-b3/** -text -whitespace +# #377 nine-stage component with the #378 re-timed E8 unit: MANIFEST.sha256 and the git-blob pins fix exact bytes. +research/e8-far-nine-complex/** -text -whitespace diff --git a/.github/workflows/e8-clean-padding.yml b/.github/workflows/e8-clean-padding.yml new file mode 100644 index 0000000000..98c4265311 --- /dev/null +++ b/.github/workflows/e8-clean-padding.yml @@ -0,0 +1,37 @@ +name: e8-clean-padding + +on: + pull_request: + paths: + - 'research/e8-clean-padding/**' + - '.github/workflows/e8-clean-padding.yml' + push: + paths: + - 'research/e8-clean-padding/**' + - '.github/workflows/e8-clean-padding.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Quick verification (manifest, pins, gx.check1, local-program replay, sinks, profile, kappa) + run: bash research/e8-clean-padding/verify.sh --quick "$RUNNER_TEMP/e8c-quick" + - name: Full verification (adds the sink re-search) + run: bash research/e8-clean-padding/verify.sh "$RUNNER_TEMP/e8c-full" + - name: Require an unchanged tree + run: git diff --exit-code diff --git a/.github/workflows/e8-clean-r781.yml b/.github/workflows/e8-clean-r781.yml new file mode 100644 index 0000000000..f12f8393ab --- /dev/null +++ b/.github/workflows/e8-clean-r781.yml @@ -0,0 +1,37 @@ +name: e8-clean-r781 + +on: + pull_request: + paths: + - 'research/e8-clean-r781/**' + - '.github/workflows/e8-clean-r781.yml' + push: + paths: + - 'research/e8-clean-r781/**' + - '.github/workflows/e8-clean-r781.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Quick verification (manifest, pins, gx.check1, local-program replay, sinks, profile, kappa) + run: bash research/e8-clean-r781/verify.sh --quick "$RUNNER_TEMP/e8c3-quick" + - name: Full verification (adds the sink re-search) + run: bash research/e8-clean-r781/verify.sh "$RUNNER_TEMP/e8c3-full" + - name: Require an unchanged tree + run: git diff --exit-code diff --git a/.github/workflows/e8-far-nine-complex.yml b/.github/workflows/e8-far-nine-complex.yml new file mode 100644 index 0000000000..9f5b2c78be --- /dev/null +++ b/.github/workflows/e8-far-nine-complex.yml @@ -0,0 +1,37 @@ +name: e8-far-nine-complex + +on: + pull_request: + paths: + - 'research/e8-far-nine-complex/**' + - '.github/workflows/e8-far-nine-complex.yml' + push: + paths: + - 'research/e8-far-nine-complex/**' + - '.github/workflows/e8-far-nine-complex.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Quick verification (manifest, pins, certificate checks, operator identity, #377 profile, kappa) + run: bash research/e8-far-nine-complex/verify.sh --quick "$RUNNER_TEMP/e8n-quick" + - name: Full verification (adds the m = 73 regeneration) + run: bash research/e8-far-nine-complex/verify.sh "$RUNNER_TEMP/e8n-full" + - name: Require an unchanged tree + run: git diff --exit-code diff --git a/.github/workflows/e8-kernel-bit-b3.yml b/.github/workflows/e8-kernel-bit-b3.yml new file mode 100644 index 0000000000..2c4d14ca0e --- /dev/null +++ b/.github/workflows/e8-kernel-bit-b3.yml @@ -0,0 +1,41 @@ +name: e8-kernel-bit-b3 + +on: + pull_request: + paths: + - 'research/e8-kernel-bit-b3/**' + - '.github/workflows/e8-kernel-bit-b3.yml' + push: + paths: + - 'research/e8-kernel-bit-b3/**' + - '.github/workflows/e8-kernel-bit-b3.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Install a C++17 compiler and Boost headers + run: | + sudo apt-get update + sudo apt-get install -y g++ libboost-dev + - name: Quick verification (manifest, pins, stages, legality, B3 columns, banks, guard, kappa) + run: bash research/e8-kernel-bit-b3/verify.sh --quick "$RUNNER_TEMP/e8b-quick" + - name: Full verification (adds the #370 five-stage regression) + run: bash research/e8-kernel-bit-b3/verify.sh "$RUNNER_TEMP/e8b-full" + - name: Require an unchanged tree + run: git diff --exit-code diff --git a/.github/workflows/e8-response-resynth.yml b/.github/workflows/e8-response-resynth.yml new file mode 100644 index 0000000000..055a2b1683 --- /dev/null +++ b/.github/workflows/e8-response-resynth.yml @@ -0,0 +1,37 @@ +name: e8-response-resynth + +on: + pull_request: + paths: + - 'research/e8-response-resynth/**' + - '.github/workflows/e8-response-resynth.yml' + push: + paths: + - 'research/e8-response-resynth/**' + - '.github/workflows/e8-response-resynth.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Quick verification (manifest, pins, #399 control, #401 word, re-synthesis, replay, banks, kappa) + run: bash research/e8-response-resynth/verify.sh --quick "$RUNNER_TEMP/e8r-quick" + - name: Full verification (adds every regeneration) + run: bash research/e8-response-resynth/verify.sh "$RUNNER_TEMP/e8r-full" + - name: Require an unchanged tree + run: git diff --exit-code diff --git a/certificates/joint-dual-kappa.json b/certificates/joint-dual-kappa.json index b7f7b89bc2..1f35b89221 100644 --- a/certificates/joint-dual-kappa.json +++ b/certificates/joint-dual-kappa.json @@ -842,7 +842,7 @@ "scripts/experiments/pin_joint_dual_sources.py": "4d31cc0e38b7902709ca5f8f714cba109760d2592346dd7f8dc0b900a2d9fe00", "scripts/experiments/verify_joint_dual.py": "7a31bba1e9c0ded32ae285df2ca9bc91ef20c330f6789fdba361876f3c7a1985" }, - "source_manifest_sha256": "4f3c15b82a2d97335d4fe95fb8bcb96bd2a921087da289d9da16c68213a17f17", + "source_manifest_sha256": "698fe862a620e5b80b85fbc6034c9456fa0fa9aea638dbbbcb3f9edd24c0415e", "sources": [ { "files": { diff --git a/certificates/joint-dual-validation.json b/certificates/joint-dual-validation.json index 194861d3c3..61a8d41622 100644 --- a/certificates/joint-dual-validation.json +++ b/certificates/joint-dual-validation.json @@ -226,7 +226,7 @@ } }, "bit_saving": "2382370177/50000000000000", - "certificate_sha256": "9801147b1502cf1e43d5fa39aa37f5291f03b48c30c4dd4f272e0877894a1c24", + "certificate_sha256": "6f684fa7f747073a132e8d0b5652cf12a8afa389f2a16ff6ade8e080d786dd22", "kappa": "4764513337/100000000000000", "margins": 7, "producer_words_regenerated_and_matched": true, diff --git a/research/e8-clean-padding/.gitattributes b/research/e8-clean-padding/.gitattributes new file mode 100644 index 0000000000..84f541f91d --- /dev/null +++ b/research/e8-clean-padding/.gitattributes @@ -0,0 +1 @@ +data/pr390/* -text diff --git a/research/e8-clean-padding/LICENSE b/research/e8-clean-padding/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-padding/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-padding/MANIFEST.sha256 b/research/e8-clean-padding/MANIFEST.sha256 new file mode 100644 index 0000000000..f8824ca96b --- /dev/null +++ b/research/e8-clean-padding/MANIFEST.sha256 @@ -0,0 +1,30 @@ +dfdd8e15408ed8764682c9be217a4c9ead96afbf61fd896d7f2cd625dc36397d .gitattributes +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE +03f922c1079dab70e50a9c677dfaa7ba156c9ebfe467a4174f752c2a8a9110d5 NOTICE.md +cf334ab21d6d5b21eeda8ad1531afb271a39c3213845473027d044a4307f8d1e PROOF.md +0ce0fd74e09a4c819fce1d472b28cdc88ac2ee2d233131846358e80b21be5b3c README.md +274f57d3f3bb7b7610b9552290def1757d999da89a02efb6e870a0105bd51a27 code/clean.py +97b461509656798d30b2610b4755ce825b1f84ae8772b9b4efd5c84d7404385b code/cxcheck.py +8fc2a43e70fa8c1ce3f3025c9568b562accc5cf25b2ed53d7c0a1cbf954a0599 code/cxkernel.py +2655e1e9ec94fb39512329ec86d261959ccd7c635c7535238f254a82861c2db1 code/cxop.py +e7e06595c12fbafb707a6846719c54b85e0c2bb105927e7e7ee20f028a37438b code/cxretime.py +1cb286196c1530d06f50f0997febc5993b388f33464e295611b920ba30a24eeb code/e8core.py +574c91ed87c32282209dd9986afb6c50284666ad64659cf94f97b4f93b1bab00 code/emit.py +aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098 code/engines/base_two_moment.py +81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482 code/engines/moment.py +c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c code/engines/outer.py +e650d16538db8d80495fda5109cdfa0775e1d5f3b56b0aa39e5c1efc660877e7 code/layout_bk.py +43a57d720f634c1b3f1b8660d0505d0085c50b7c814607461c3aa3ede6f41b4e code/sinks.py +63c02f96767435dd44f721148a483960bc4a966ef23de0f42a9f1614232a0f2c code/word.py +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 complex/LICENSE-wht-power-saving-lean +557c9ad4660eebd14a00583736c4d12d2c45f3fc9bc148845f9f3efec72c9434 complex/NOTICE-wht-power-saving-lean +6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95 complex/gx/gx.py +eb972c06fe8c322db2d9a8d9a7d05596e8f40c4ca8e5f42eb6df3c7361b5d517 complex/gx/gxcore.py +947f6e1266f009c6c54647e0b348b1e2076bb584b54fae19016bc8086741876a data/bit/bitE8-kernel.json.gz +f2664ee7bcdfb55893abe9f1be8ee6a394a602e8262e611de2a0328bbd508aa7 data/gcert1-e8-r783-far.json.gz +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 data/pr390/LICENSE-pr390 +fe21bb4af91552196e938baf693c22c72a5071dbe857f772b2600b3a2d2cc94c data/pr390/prefix18.json.gz +be5fa48b48491d7b3587e3df22f7d7f8f767dcb48817c4f49f4be87c7cc87519 data/pr390/prewhite.json +a8023406955b9f7b529ec578c8b311f8ccac729c4f33b1d0f8f8fbe960d99edf data/pr390/sink-audit.json +c4398318f38abc0f180ab07d9a54e8683c7b4749100e5c31d97e9dbf9dcf4df1 data/sinks-e8clean.json +7f35d4481bdda6748ff78cc25261218774313fe4a3fbd3696aeca438c8c0f758 verify.sh diff --git a/research/e8-clean-padding/NOTICE.md b/research/e8-clean-padding/NOTICE.md new file mode 100644 index 0000000000..edcf3e98ff --- /dev/null +++ b/research/e8-clean-padding/NOTICE.md @@ -0,0 +1,13 @@ +# Notice + +Apache-2.0 (`LICENSE`). Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. + +- `data/pr390/prefix18.json.gz`, `sink-audit.json`, `prewhite.json` are Dugongue's PR #390 (`research/e8-prefix-restoration/data/`, head 0e790f2), byte-identical (git blobs 51f3ea73, ef2b6f9e, 527a2ea4), Apache-2.0 (`data/pr390/LICENSE-pr390`). + - `prewhite.json` is used only as a regression target. + - #390's scripts (`complex-hetero-compose.py`, `root-global.py`, `root-heterobanks.cpp`) were read as data. Their bracket rule and bank assignment are re-implemented in `code/emit.py` and `code/clean.py`. None of #390's scripts were run. +- `complex/gx/gx.py`, `gxcore.py` are by Jacob Sussman (wht-power-saving-lean `9c94857`, Apache-2.0); upstream LICENSE/NOTICE are kept in `complex/`. +- `data/gcert1-e8-r783-far.json.gz` is our #378 word, and `data/bit/bitE8-kernel.json.gz` is our #382 bit word (derived from utcorvusvolat-dotcom's #370). Both are byte-identical. +- `code/engines/*` are PR #315's engines (DreamingOfClouds; eumemic; the #144/#23 lineage), as in our earlier packages. +- `code/e8core.py`, `cxkernel.py`, `cxretime.py`, `cxcheck.py`, `cxop.py` and `layout_bk.py` (DaysSky's B_K rule, #363) are copied unchanged from our `research/e8-far-nine-complex`. +- New here: `code/word.py`, `code/sinks.py`, `code/emit.py`, `code/clean.py` and `data/sinks-e8clean.json`. +- #352 (`complex_splice.emit`), #363 and #377 (`PROOF.txt`, `global_nine.py`, `RECIPE-9.json`) were read as data only. diff --git a/research/e8-clean-padding/PROOF.md b/research/e8-clean-padding/PROOF.md new file mode 100644 index 0000000000..0ef50ee3fd --- /dev/null +++ b/research/e8-clean-padding/PROOF.md @@ -0,0 +1,43 @@ +# Why the fused program computes #390's operator, and what is re-opened + +Notation: x (120 sources), h (783 helpers), y (120 targets). The main word is the gcert/1 word (A, scatter, B), here #390's prefix18 word with its two sink uncomputes and our nine new helper → helper gates. + +**1. The bracket (#390, re-implemented and regression-checked).** The main acts on scalar values as x' = x, h' = N·x + A·h, y' = y + M·x + B·h. Here A is the product of the literal helper → helper shears. The bracket has three parts: +- **Before the main**, at the common old frame: y −= (B·A⁻¹)·h, then h ← A⁻¹·h, where A⁻¹ is the reversed, negated helper → helper subword. +- **The main** now yields (x, N·x + h, y + M·x). +- **After the final climbs**, at FULL: for every non-sink helper, h_r −= N_r·x. + +`emit.prewhite` computes these lists. On #390's word it reproduces #390's `prewhite.json` exactly, in the same order. On ours, `emit.validate` replays all 1,023 live columns exactly in both orientations. The backward orientation is the same chronological sequence with each t += a·s replaced by s −= a·t. The replay confirms (x, h, y) → (x, h, y + x) forward and (x, h, y) → (x − y, h, y) backward, private work zero, and every main scalar at a common exact frame label. + +**2. Our gates keep everything but the sink rows.** Each new gate is helper → helper at a frame where all three registers already sit, so no climb is added and the paid histogram is unchanged. Each is inserted after the sink's last influence on any y or retained total. The adjoint of the main from all y outputs, including the scatter, is identically zero on the sink from that point on. The x and y rows of the full rational operator and the retained totals are therefore unchanged, as `clean.py` checks against #378. `gx.check1` (E0–E7, exact scalar E5) and the gxcore mirror (sixths units) accept the word. The sinks' clean rows N_r are exactly zero. + +**3. A zero-row sink needs no cleanup.** With N_r = 0, the bracket leaves h_r equal to its input value up to its frame walk. The emitted program has no event on the sink after its final climb except its rank-0 new → old adapter, which acts on the local factor. `validate` enforces this, and a control that adds a FULL repair on a fused sink is rejected. + +**4. Fusing the padding.** The sink's final climb from frame f to FULL is compiled as M₁·C_[d]·M₂ (d = 2 for all three sinks, and these are existing audited edges 731→1, 744→1, 759→1). On the bank stream we apply instead (climb) ⊗ C₇₂ = (M₁⊗I)·(C_[d]⊗C₇₂)·(M₂⊗I). This is one C child of rank d + 1 on a coordinate set (d local coordinates plus window coordinate 72) between the same monomials, so the paid profile changes by rank 2 + rank 1 → rank 3. + +Since no event touches the stream afterwards in this invocation, the fused invocation equals the unfused invocation followed by C₇₂ on that stream. The arbitrary-dirt property of #377 says each invocation acts on a helper stream as C_block ⊗ I_exterior, and its y output is independent of the helper value. So C₇₂ commutes with every other invocation on that bank stream, and with all data-family operations, which use disjoint families. Hence the result equals #377/#390's schedule, where the padding is a separate sweep before the X_δ(g) cover correction. + +The routes of #390's ordinary banks are coordinate permutations that fix coordinate 72 (`clean.py` rebuilds them from #390's rule). The fused C on invocation coordinate 72 is therefore P_g·C₇₂·P_g⁻¹ at the bank class g = d·A⁻¹, exactly #377's padding. Each fused occurrence (3 helpers × 32 replicas per stage) lies in a distinct ordinary bank, so every such bank class receives C₇₂ exactly once. The 8 heterogeneous banks of #390 keep their rank-8 endpoints and have no padding. + +**5. Price.** The profile is 288 × (validated paid local events) + 2vT idle children at 16, 8, 32, 8, 48, 8, 48, 32, 16 + 9·(3131 − 8 − 96) paddings. Its values are m = 73, live 58,899, rank mass 4,289,643, deficit 9,984, max child 48 and halving degree 2 (73² > 2·48²). The same pipeline on #390's own emitted program returns #390's b exactly. Both PR #315 engines admit b = 40055507598519/4·10¹⁶ and exclude the next grid point. The outer assembly with our #382 c gives κ = 125048239231783/1.25·10¹⁷ (complex-bound, 47 strict constraints). The same call with #390's b returns #390's κ. + +## Re-opened arguments + +- **#352's emitter/validator chronology** (old_response, cleanup after adF of every non-y gate) is not used. It is replaced by #390's bracket (§1), which #390 already introduced. Our extra rule is §3. +- **#377's padding as an end-of-schedule paid rank-1 cover sweep**, for 96 banks per stage. It is replaced by §4. That argument relies on the arbitrary-dirt invocation property (#377/#352, retained) and on the general compiler admitting a C child whose coordinate set mixes local coordinates with an exterior window coordinate. The latter is the same kind of child the compiler emits, up to a coordinate permutation, but #377's window-lift lemma is stated for transitions that cancel the exterior factor. For stage 8, where E₈ already contains coordinate 72, the canonical label T_U ⊗ C_{E_s} is not the right bookkeeping. The argument above is at the operator level and does not use labels. + +## Re-proved by our checks + +- the word's labels, nesting and exact scalar replay (`gx.check1`, gxcore); +- x/y operator rows and retained totals; +- sink zero rows; +- #390's bracket (regression) and ours in both orientations on all 1,023 columns, with lifetimes and common labels; +- the fused-sink rule; +- bank distinctness and coordinate-72 fixing; +- the profile from events, b, c and κ. + +## Not re-run (inherited obligations) + +- #390's rank-8 endpoint phase adapters (sinks 355/403), its Clifford audit of new edges, and its finite invoice. Our changes add 9 scalar gates per invocation and change the bracket sizes slightly (pre-helper 1,550 → 1,556, post-repair 7,800 → 7,776). No new local edge is used. +- #377/#352's retained interfaces: window lift, arbitrary-dirt banks, X_δ(g), injective routes, halving, rows, precision. +- #382's bit-side admissions. diff --git a/research/e8-clean-padding/README.md b/research/e8-clean-padding/README.md new file mode 100644 index 0000000000..a02f6eec21 --- /dev/null +++ b/research/e8-clean-padding/README.md @@ -0,0 +1,94 @@ +κ = 1.000385913854264e-3 + +# Bank padding fused into clean-sink helper climbs, on #390's dirty-preconditioned E8 complex program + +A conditional finite construction with **κ = 125048239231783/1.25·10¹⁷ ≈ 1.000385913854264 × 10⁻³**. +That is +1.65691·10⁻⁷ (+0.0166 %) over Dugongue's #390 (125027527861191/1.25·10¹⁷ ≈ 1.000220222889528e-3). + +The complex side binds. Its coarse saving rises from #390's b = 40048866680681/4·10¹⁶ to **b = 40055507598519/4·10¹⁶ ≈ 1.001387690e-3** (+1.66023·10⁻⁷). +The bit side is our #382 word, unchanged, with c ≈ 1.006907e-3 > b. Because κ is complex-bound, #390's larger bit c would give the same κ. + +## The mechanism + +In #377's nine-stage component, every bank holds eight 9-dimensional helper residuals plus one **paid rank-1 padding child** on coordinate 72 (m = 73). #390 keeps 3,123 such paddings per stage. + +Fusing a padding into the final climb of a helper of the same bank replaces two children (rank d and rank 1) by one child of rank d + 1. The fused child is exact: if the compiled climb is M₁·C_[d]·M₂ (two monomials around one C child), then the climb tensored with C on window coordinate 72 is (M₁⊗I)·(C_[d]⊗C₇₂)·(M₂⊗I). That is one rank-(d+1) C child between the same monomials, so no new phase or edge appears. + +The fusion is legal only if **nothing touches the helper after that climb**. Otherwise a later addition would mix a C₇₂-transformed stream with an untransformed one, and no common exact label exists. + +- **Under #352's bracket it is impossible.** Its cleanup runs after all final climbs and reverses every non-y gate, both x → helper and helper → helper. In #378's word every one of the 775 lifting helpers is the target of at least one x → helper gate, so every helper is touched after its final climb. + + Re-scheduling cannot help. The undo of an x → helper gate needs the helper and that x at one exact label. The x roles are at FULL from gate 768 (in A) on, and the undo must follow the helper's last read, which feeds y in B. Our scan of every helper confirms this: no helper can be cleaned at its pre-climb frame, even when the undo is allowed anywhere after the helper's last influence on y. +- **Under #390's bracket it works for zero-row sinks.** #390 precancels the targets (y −= B·A⁻¹·h) and prewhitens the helpers (h ← A⁻¹h) before the main. Afterwards a helper holds N_r·x + h_r, and the only cleanup is "subtract N_r·x at FULL". A helper with N_r = 0 (a sink) needs no cleanup, so its final climb is its last event and can carry the padding. + +## The three new sinks + +We searched every lifting helper of #390's word for a **free** sink. The search looks for an exact rational combination of other helpers that, at the same time, sit at the helper's exact frame (no donor advance), applied after the helper's last influence on any y or retained total, that zeroes its clean x-row. It finds exactly three: 301, 324 and 387. Each has final lift rank 2. + +For 301, at cut 1254 and frame 731, the gates are + + h276 += h1021/2; h301 −= h276/2; h276 −= h1021/2 + +(324: cut 1284, frame 744, donors 311 and 1020; 387: cut 1318, frame 759, donors 316 and 1022.) The temporary donor shear keeps every entry in sixths, as gxcore's E5 requires, and uses coefficients ±1/2 only. The paid local histogram is unchanged. + +Allowing paid donor advances gives 16 more candidates, the same count #390 reports. Every one lowers b, so none is used. + +Per invocation, three rank-2 lifts become rank-3 fused children. Over 9 stages × 32 replicas, 96 fused occurrences per stage sit in 96 distinct ordinary banks of #390's own assignment, and each of those routes fixes coordinate 72. Paddings per stage drop from 3,123 to 3,027: + + profile delta = {1: −864, 2: −864, 3: +864} (rank mass, live 58,899, deficit 9,984 and max child 48 unchanged) + +## Verify + + bash research/e8-clean-padding/verify.sh --quick /tmp/e8c-q # ~1 min + bash research/e8-clean-padding/verify.sh /tmp/e8c-full # adds the free-sink regeneration (~3 min) + +This needs Python 3.11+ and the standard library only. The script: + +1. Checks `MANIFEST.sha256` and the git-blob pins of every input: #390's `prefix18.json.gz`, `sink-audit.json` and `prewhite.json`; #378's word; Sussman's `gx.py`/`gxcore.py`; #382's bit word. +2. On #390's prefix18 word, runs Sussman's `gx.check1` and the gxcore mirror, rejects a flipped-sign control, checks the source-span rule, and confirms the full operator identity with #378. +3. Rebuilds #390's main word (prefix18 plus the 355/403 uncomputes) and ours. For both it runs `gx.check1` and the gxcore mirror, and for ours also `cxcheck` (flipped-sign control, source-span rule). It then checks: + - the paid local histogram is unchanged; + - the five sinks' clean rows are exactly zero; + - the x and y rows of the full rational operator and the retained totals equal #378's; + - full mode only: the free-sink search over all 773 lifting helpers of #390's word regenerates exactly our gates. +4. Runs our reimplementation of #390's bracket compiler. On #390's word it reproduces `prewhite.json` gate for gate (1,660 / 1,550 / 7,800). On ours it emits both orientations, and an independent replay checks: + - all 1,023 live columns: x, h restored; y += x forward, x −= y backward; + - private work erased, and every scalar at a common exact label; + - no event on a fused sink after its padded climb. + + Five mutation controls are rejected. +5. Rebuilds #390's bank assignment and checks the distinct-bank and coordinate-72 conditions. +6. Builds the profile from the validated paid events. It re-derives #390's b from its own emitted program as a regression, and prices ours with both PR #315 engines (10⁻¹⁶ fallback, adjacent grid point excluded). It re-derives c from #382's word and runs PR #315's outer assembly: 47 strict constraints, adjacent κ rejected, and #390's κ reproduced exactly. + +## Admitted conditions and open obligations + +See `PROOF.md`. In short: +- **Re-opened, with the replacement argument in PROOF.md:** + - #352's emitter chronology and validator; + - #377's bank padding as a separate end-of-schedule cover sweep, for the 96 fused banks per stage; + - the general compiler's admission of a child whose coordinate set spans local and exterior window coordinates. +- **Re-proved here:** the items in Verify steps 3–6. +- **Inherited and not re-run:** + - #390's rank-8 endpoint adapters for its sinks 355/403, its Clifford edge audits and its finite invoice. Our word adds 9 scalar gates per invocation, and the bracket changes from 1,550/7,800 to 1,556/7,776 pre-helper/post-repair gates; + - all of #377's and #352's retained interfaces (window lift, arbitrary-dirt banks, cover correction X_δ(g), halving degree 2, rows, precision); + - #382's bit-side claims. + +This is a conditional finite construction, not a formal verification of the multiplication theorem. + +## Credits + +- **Dugongue (#390):** + - the 18 target-prefix rewrites; + - the dirty-preconditioned bracket (target precancellation, helper prewhitening, FULL repair) that makes sinks cleanup-free; + - sinks 355/403; + - the heterogeneous T = 32 banks. + + This package changes only which ordinary banks pay a separate padding. +- **jacklightChen (#377):** the nine-stage compressed component, banks and padding. +- **#352:** the local invocation, Clifford compiler and original emitter. +- **Jacob Sussman:** the E8 unit, `gx`/`gxcore`. +- **DaysSky** (#363, #373, #375) and **utcorvusvolat-dotcom** (#370): the bit-side lineage. +- **PR #315** (DreamingOfClouds): the engines and outer assembly. +- **Ours:** #378 (far retiming), #382 (bit word), and here the padding fusion, the free-sink search and the checks. + +Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. Apache-2.0 (`LICENSE`). diff --git a/research/e8-clean-padding/code/clean.py b/research/e8-clean-padding/code/clean.py new file mode 100644 index 0000000000..ad4acacd48 --- /dev/null +++ b/research/e8-clean-padding/code/clean.py @@ -0,0 +1,166 @@ +"""e8clean: bank-padding fusion on top of PR #390's dirty-preconditioned E8 complex program. +usage: clean.py PKGDIR GXDIR OUT.json [--regen] +Steps (all exact, standard library only): + A. rebuild #390's main word (prefix18 + its two sink uncomputes, from #390's sink-audit.json) and ours (+ our three + free-sink uncomputes); gx.check1 + gxcore mirror on both; paid local histogram unchanged by our gates; our three + sinks have exactly zero clean x-row; x/y operator rows and retained totals unchanged; (--regen) the free-sink search + from #390's word finds exactly our three gates. + B. our reimplementation of #390's bracket reproduces #390's prewhite.json gate for gate (regression); our bracket; + both orientations of the full local program replayed on all 1023 live columns, private work erased, every + scalar at a common exact label, no event on a fused sink after its padded climb; mutation controls rejected. + C. #390's bank assignment rebuilt; every fused occurrence lies in a distinct ordinary (padded) bank whose route fixes + coordinate 72. + D. global profile from the validated paid events; b by both PR #315 engines; #390's own b reproduced; bit c of our + #382 word; PR #315 outer assembly -> kappa.""" +import sys, os, json, gzip, copy +from collections import Counter +from fractions import Fraction as Q +HERE = os.path.dirname(os.path.abspath(__file__)); sys.path.insert(0, HERE) +PKG, GXD, OUT = sys.argv[1], sys.argv[2], sys.argv[3]; REGEN = '--regen' in sys.argv +sys.path.insert(0, GXD); import gx, gxcore +from word import insert, origmap, sixths +import sinks as SK +from emit import prewhite, emit, validate, N, V +from e8core import coarse, kappa, price_word, load_word +from layout_bk import layout +ld = lambda p: json.load(gzip.open(p)) if p.endswith('.gz') else json.load(open(p)) +base = ld(PKG + '/data/pr390/prefix18.json.gz'); a390 = ld(PKG + '/data/pr390/sink-audit.json')['accepted'] +ours = ld(PKG + '/data/sinks-e8clean.json'); pw390 = ld(PKG + '/data/pr390/prewhite.json') +far = ld(PKG + '/data/gcert1-e8-r783-far.json.gz') +H390 = {a['sink_helper']: a['frame'] for a in a390}; FUSED = sorted({s['sink_helper'] for s in ours}) +assert FUSED == [301, 324, 387] and set(H390) == {355, 403} +R = {} + +def hist(c): + H = Counter() + for w in c['blocks'].values(): + for r, n in w.items(): H[int(r)] += n + return H + +def gxok(c, name): + st = {}; gx.check1(copy.deepcopy(c), scalar=True, stats=st) + assert gxcore.mirror(gxcore.normal(copy.deepcopy(c)))['hist'] == dict(hist(c)) + c2 = copy.deepcopy(c); print(' %s: gx.check1 PASS (E0-E7 incl. exact scalar E5), gxcore mirror histogram PASS, gates A/B %d/%d' % (name, len(c['A']), len(c['B']))) + return st + +print('== A. words') +w390 = insert(base, a390); wour = insert(base, a390 + ours) +gxok(w390, '#390 main word (prefix18 + sinks 355/403)'); st = gxok(wour, 'ours') +wour_out = dict(wour, derived_from=wour['derived_from'] + ' | PR #390 (Dugongue) sinks 355/403 | e8clean free sinks 301/324/387 (chafreaky)') +json.dump(wour_out, gzip.open(os.path.join(os.path.dirname(os.path.abspath(OUT)), 'gcert1-e8clean.json.gz'), 'wt')) +d = hist(wour); d.subtract(hist(w390)); assert not any(d.values()); print(' paid local histogram of ours == #390 word (our uncomputes need no climb)') +d = hist(w390); d.subtract(hist(base)); assert dict(+d) == {1: 4, 3: 4} and dict(-d) == {4: 4} +an = SK.analyse(wour); val = an[7]; fin = an[5] +for r in FUSED + list(H390): assert not val[r], r +print(' clean x-rows of helpers 301, 324, 387 (ours) and 355, 403 (#390) are exactly zero; final lifts of ours:', [fin[r] for r in FUSED]) +# operator: x and y rows and retained totals identical to #378's far word (helper rows are garbage and change) +sys.argv_save = sys.argv +import importlib.util +spec = importlib.util.spec_from_file_location('cxop_lib', HERE + '/cxop.py') +src = open(HERE + '/cxop.py').read().split('\na, ta = op(')[0]; ns = {}; exec(compile(src, 'cxop.py', 'exec'), ns) +oa, ta = ns['op'](far); ob, tb = ns['op'](wour) +assert ta == tb and all(oa[r] == ob[r] for r in range(2 * V)); print(' x and y rows of the full rational operator (all 1023 inputs variable) and retained totals == #378 far word') +if REGEN: + cur = w390; found = []; an0 = SK.analyse(cur) + cands = [r for r in range(2 * V, N) if an0[5][r] > 0 and r not in H390] + for r in cands: + gs = SK.find(cur, r, exclude=set(H390) | {s['sink_helper'] for s in found}, an=SK.analyse(cur) if found else an0) + if not gs: continue + om = origmap(base, a390 + found) + for g in gs: g['cut_group'] = om[g['cut_group']] + trial = insert(base, a390 + found + gs); at = SK.analyse(trial) + dd = hist(trial); dd.subtract(hist(w390)) + if all(not at[7][s['sink_helper']] for s in a390 + found + gs) and not any(dd.values()): + found += sixths(gs); cur = insert(base, a390 + found) + assert found == ours, found + print(' regeneration: free-sink search over all %d lifting helpers of #390\'s word finds exactly our three uncomputes' % len(cands)) + +print('== B. local program (both orientations)') +pw = prewhite(w390, set(H390)) +for mine, key in zip(pw, ['pre_target_dirty_cancellation_gates', 'pre_helper_inverse_gates', 'post_full_helper_clean_repair_gates']): + assert [(t, s, q) for t, s, q in mine] == [(t, s, Q(a, b)) for t, s, a, b in pw390[key]], key +print(' regression: our bracket compiler reproduces #390 prewhite.json exactly (%d/%d/%d gates)' % tuple(map(len, pw))) +pw = prewhite(wour, set(H390) | set(FUSED)); paid = {}; res = {} +for ori in ['forward', 'backward']: + ev = list(emit(wour, ori, H390, set(FUSED), pw)); r = validate(ev, wour, ori, H390, set(FUSED)); paid[ori] = r['paid_hist']; res[ori] = r + print(' %s: PASS all 1023 live columns, private work erased, common exact labels, %d events, fused padded climbs %s' % (ori, r['events'], [e[1:] for e in ev if e[0] == 'climb_pad72'])) + def reject(name, mut): + x = list(ev); mut(x) + try: validate(x, wour, ori, H390, set(FUSED)) + except (AssertionError, KeyError) as e: return name + raise SystemExit('control accepted: ' + name) + ctr = [] + i = next(i for i, e in enumerate(ev) if e[0] == 'scalar' and e[1] == 'cleanup') + def m1(x): # cleanup touching a fused sink after its padded climb + e = x[i]; op = e[2]; x[i] = (e[0], e[1], (op[0], ('L', FUSED[0]) if ori == 'forward' else op[1], op[2] if ori == 'forward' else ('L', FUSED[0]), op[3]), e[3]) + ctr.append(reject('cleanup_on_fused_sink', m1)) + def m2(x): # padded climb moved before the sink's last main use + j = next(j for j, e in enumerate(x) if e[0] == 'climb_pad72'); e = x.pop(j) + k = max(j for j, y in enumerate(x) if y[0] == 'scalar' and y[1] == 'main' and ('L', e[1]) in y[2][1:3]); x.insert(k, e) + ctr.append(reject('padded_climb_before_last_use', m2)) + def m3(x): # drop one of our uncompute adds + j = next(j for j, e in enumerate(x) if e[0] == 'scalar' and e[1] == 'main' and e[2][0] == 'add' and e[2][1 if ori == 'forward' else 2] == ('L', 301) and e[2][2 if ori == 'forward' else 1] == ('L', 276)); x.pop(j) + ctr.append(reject('drop_uncompute_add', m3)) + def m4(x): # flip the sign of one target precancellation + j = next(j for j, e in enumerate(x) if e[0] == 'scalar' and e[1] == 'old_response'); e = x[j]; op = e[2]; x[j] = (e[0], e[1], op[:3] + (-op[3],), e[3]) + ctr.append(reject('flip_precancellation', m4)) + def m5(x): # padded climb priced without the padding coordinate + j = next(j for j, e in enumerate(x) if e[0] == 'climb_pad72'); e = x[j]; x[j] = e[:5] + (e[4],) + ctr.append(reject('padding_not_paid', m5)) + print(' controls rejected:', ctr) +assert paid['forward'] == paid['backward'] and res['forward']['edges'] == res['backward']['edges'] + +print('== C. banks (#390 assignment, T = 32)') +full = [(rep, h) for rep in range(32) for h in range(2 * V, N) if h not in H390] +small = [(rep, h) for rep in range(32) for h in range(2 * V, N) if h in H390] +assign = {}; fi = 0 +for bank in range(8): + assign[full[fi]] = (bank, 0); fi += 1 +for bank in range(8, 3131): + for j in range(8): assign[full[fi]] = (bank, 9 * j); fi += 1 +assert fi == len(full) == 24992 and len(small) == 64 +def perm(off): # #390's perm(src=0..8, offset): local i -> off+i, remaining coordinates in increasing order + p = [-1] * 73; used = set(range(off, off + 9)) + for i in range(9): p[i] = off + i + z = 0 + for i in range(73): + if p[i] < 0: + while z in used: z += 1 + p[i] = z; used.add(z) + return p +fb = [assign[(rep, h)][0] for rep in range(32) for h in FUSED] +assert len(set(fb)) == len(fb) == 96 and min(fb) >= 8 +assert all(perm(assign[(rep, h)][1])[72] == 72 for rep in range(32) for h in FUSED) +print(' 96 fused occurrences per stage in 96 distinct ordinary banks; each route fixes coordinate 72; paddings per stage 3123 -> %d' % (3123 - 96)) + +print('== D. price') +T, L, m, banks = 32, 9, 73, 3131; live = 8 * V * T + 9 * banks +def profile(ph, nfused): + H = Counter({int(r): 288 * n for r, n in ph.items()}) + for r in [16, 8, 32, 8, 48, 8, 48, 32, 16]: H[r] += 2 * V * T + H[1] += L * (banks - 8 - T * nfused); return H +H = profile(paid['forward'], len(FUSED)); mass = sum(r * n for r, n in H.items()) +assert (live, m * live - mass, max(H)) == (58899, 9984, 48) and m ** 2 > 2 * 48 ** 2 +# regression: #390's own program (no fusion) through the same pipeline +pwb = prewhite(w390, set(H390)); pb = validate(list(emit(w390, 'forward', H390, set(), pwb)), w390, 'forward', H390, set())['paid_hist'] +b390 = coarse(profile(pb, 0), m, live); assert b390 == Q(40048866680681, 4 * 10**16), b390 +print(' regression: #390 b = %s = %.15e reproduced from its emitted program' % (b390, float(b390))) +b = coarse(H, m, live) +print(' b = %s = %.15e (+%.6e over #390)' % (b, float(b), float(b - b390))) +def bit_c(word, K=3): + p = price_word(word); h, v = 8, 120; s = 2 * K + 1; mm = s * h; resid = p['resid'] + T8 = 1 if resid % h == 0 else h; lay = layout(K, h) + Hb = Counter({r: T8 * s * c for r, c in p['H'].items()}) + for r in lay['blocks']: Hb[r] += T8 * 2 * v + W = (2 * K * v * h + resid) * T8 // h + assert mm * W - sum(r * c for r, c in Hb.items()) == T8 * (2 * K * v - s * 72) + return coarse(Hb, mm, W) +c = bit_c(load_word(PKG + '/data/bit/bitE8-kernel.json.gz')); assert c == Q(251726760077483, 25 * 10**16) +print(' bit c (our #382 word, B3 unsplit) = %s = %.15e' % (c, float(c))) +k, bind = kappa(c, b); k390, _ = kappa(c, b390) +assert k390 == Q(125027527861191, 125 * 10**15) +print(' kappa (#390 b, same assembly) = %s = %.15e [= #390]' % (k390, float(k390))) +print(' kappa = %s = %.15e (%s-bound), +%.6e over #390' % (k, float(k), bind, float(k - k390))) +json.dump(dict(b=str(b), b_float=float(b), b_390=str(b390), c=str(c), kappa=str(k), kappa_float=float(k), binding=bind, kappa_390=str(k390), + profile={str(r): n for r, n in sorted(H.items())}, live=live, m=m, deficit=m * live - mass, local_paid=paid['forward'], + fused_sinks=FUSED, gx_stats=st), open(OUT, 'w'), indent=1) diff --git a/research/e8-clean-padding/code/cxcheck.py b/research/e8-clean-padding/code/cxcheck.py new file mode 100644 index 0000000000..4973f511e5 --- /dev/null +++ b/research/e8-clean-padding/code/cxcheck.py @@ -0,0 +1,23 @@ +"""Complex certificate checks: Jacob Sussman's gx.check1 (E0-E7: sizes, labels/nesting, equal frames at gates, scatter +cut, gate shapes, bracket rule, exact scalar x-content replay E5, price data E6, exterior gauges E7) and his gxcore +mirror histogram, a flipped-sign control (must fail E5), and the source-span rule (our check: the x-content support of +every non-y operand, and of a slot destination after the gate, lies in the gate frame). +usage: cxcheck.py CERT.json.gz GXDIR""" +import sys, os, gzip, json, copy +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxretime import CX +c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx, gxcore +st = {}; gx.check1(c, scalar=True, stats=st) +Hinv = Counter() +for w in c['blocks'].values(): + for r, n in w.items(): Hinv[int(r)] += n +assert gxcore.mirror(gxcore.normal(copy.deepcopy(c)))['hist'] == dict(Hinv), 'gxcore histogram' +c2 = copy.deepcopy(c) +for g in c2['A']: + if g[0] in ('out', 'in') and g[3]: t, a, b = g[3][0]; g[3][0] = [t, -a, b]; break +try: gx.check1(c2, scalar=True); raise SystemExit('flipped sign accepted') +except AssertionError as e: assert str(e).startswith('E5'), str(e) +sv = CX(c).span_ok(); assert sv == 0, sv +print(' %s: gx.check1 PASS (E0-E7, exact scalar), gxcore mirror PASS, flipped sign rejected (E5), source-span violations 0 | h %d v %d R %d cst %d N %d, gates A/B %d/%d, frames %d' + % (os.path.basename(sys.argv[1]), c['h'], c['v'], c['R'], c['cst'], c['N'], len(c['A']), len(c['B']), len(c['frames']))) diff --git a/research/e8-clean-padding/code/cxkernel.py b/research/e8-clean-padding/code/cxkernel.py new file mode 100644 index 0000000000..32b26a1755 --- /dev/null +++ b/research/e8-clean-padding/code/cxkernel.py @@ -0,0 +1,222 @@ +"""Shared-donor response kernel on a gcert/1 complex program (Sussman's format), via exterior gauges (rule E7/Q2). +Entry: pivot slot p, entrance E (a frame inside p's first frame and inside every donor's first frame), donors d with +rational coefficients c_d such that resp(p) + sum c_d resp(d) = 0, where resp(s) in Q^v = the column of slot s's +initial value in the y rows of the product (A, scatter, B). Transform: p starts at E (ext gauge [p, E]); at the start +of A each donor climbs to E and takes d += c_d p ('in' gate at E). Then Q2 holds for p. +Price (entrance-residual rule, as the bit side's #320/#329 lineage): W = 2Kv + sum_slots (h - dim ext)/h, deficit fixed. +usage: cxkernel.py CERT.json.gz GXDIR OUT.json.gz [K]""" +import sys, os, gzip, json, math, copy +from fractions import Fraction as Fr +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from e8core import coarse +from layout_bk import layout + + +def reduce(u, basis): + for b in basis: + if u >> (b.bit_length() - 1) & 1: u ^= b + return u +def inside(a, b): return all(reduce(u, b) == 0 for u in a) +def echelon(vecs): + """reduced echelon (descending pivots) of the F2 span of vecs""" + B = [] + for u in vecs: + u = reduce(u, B) + if u: + B = [b ^ u if b >> (u.bit_length() - 1) & 1 else b for b in B] + [u] + B.sort(reverse=True) + return B + + +def responses(c): + v, R = c['v'], c['R']; n = 2 * v + R + reg = [dict() for _ in range(n)] + for r in range(2 * v, n): reg[r] = {r: Fr(1)} + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: d[k] = w + else: d.pop(k, None) + def run(gates): + for g in gates: + if g[0] == 'neg': reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == 'out': + src = dict(reg[g[2]]) + for t, a, b in g[3]: axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: axpy(g[2], reg[s], Fr(a, b)) + run(c['A']) + tot = {k: dict(reg[s]) for k, s, _ in c['ret']} + for t in range(v): + for k, a, b in c['scat']['table'][t]: axpy(v + t, tot[k], Fr(a, b)) + run(c['B']) + resp = {s: {} for s in range(2 * v, n)} + for t in range(v): + for s, co in reg[v + t].items(): resp[s][t] = co + return resp + + +def first_frames(c): + v, R = c['v'], c['R']; n = 2 * v + R; first = {} + for ph in ('A', 'B'): + for g in c[ph]: + regs = [g[2]] + ([t for t, _, _ in g[3]] + list(g[4]) if g[0] == 'out' else [s for s, _, _ in g[3]] if g[0] == 'in' else []) + for r in regs: + if r >= 2 * v and r not in first and g[1] != 0: first[r] = g[1] + return first + + +class QBasis: + """incremental rational basis over Q^v with combination tracking (donor slots)""" + def __init__(self): self.rows = [] # (pivot, vec dict, combo dict) + def reduce(self, x): + x = dict(x); cm = {} + for p, vec, co in self.rows: + if p in x: + f = x[p] / vec[p] + for k, u in vec.items(): + w = x.get(k, 0) - f * u + if w: x[k] = w + else: x.pop(k, None) + for k, u in co.items(): + w = cm.get(k, 0) - f * u + if w: cm[k] = w + else: cm.pop(k, None) + return x, cm + def add(self, x, slot): + r, cm = self.reduce(x) + cm = {k: u for k, u in cm.items()}; cm[slot] = cm.get(slot, 0) + 1 + p = min(r); self.rows.append((p, r, cm)) + + +def select(c, a, K=3): + h, v, R = c['h'], c['v'], c['R']; m = (2 * K + 1) * h + fr = [tuple(f) for f in c['frames']]; dim = [len(f) for f in fr] + chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + resp = responses(c); first = first_frames(c) + ret = {s for _, s, _ in c['ret']} + H = [s for s in range(2 * v, 2 * v + R) if s not in ret and s in first and c['start'][s] == 0] + # candidate entrances: frames of the table inside some first frame, plus pairwise intersections not in table skipped + fset = sorted(set(first[s] for s in H)) + cand = [E for E in range(2, len(fr)) if dim[E] > 0 and dim[E] < h and any(inside(fr[E], fr[f]) for f in fset)] + ins = {} + def isin(E, f): + k = (E, f) + if k not in ins: ins[k] = inside(fr[E], fr[f]) + return ins[k] + groups = {E: [s for s in H if isin(E, first[s])] for E in cand} + avail_p = set(H); avail_d = set(H); donor_at = {} + def plan(E): + e = dim[E]; G = groups[E]; mem = [] + for s in G: + d1 = dim[first[s]] + dc = (0.0 if donor_at.get(s) == E else (chi(e) + chi(d1 - e) - chi(d1)) if s in avail_d else None) + if s in donor_at and donor_at[s] != E: dc = None + pg = chi(d1) - chi(d1 - e) if s in avail_p else None + if dc is None and pg is None: continue + mem.append((s, dc, pg)) + mem.sort(key=lambda t: (t[1] if t[1] is not None else 1e9, t[2] if t[2] is not None else -1)) + B = QBasis(); slots = {}; piv = [] + for s, dc, pg in mem: + r, cm = B.reduce(resp[s]) + if not r and pg is not None and pg > 0: piv.append((s, cm, pg)) + elif r and dc is not None: B.add(resp[s], s); slots[s] = dc + if not piv: return None + keep = list(piv) + def users(): + u = Counter() + for _, cm, _ in keep: + for k in cm: u[k] += 1 + return u + while keep: + u = users(); best = None + for i, (s, cm, pg) in enumerate(keep): + freed = sum(slots[k] for k in cm if u[k] == 1) + if freed > pg and (best is None or freed - pg > best[0]): best = (freed - pg, i) + if best is None: break + keep.pop(best[1]) + u = users(); gain = sum(pg for _, _, pg in keep) - sum(slots[k] for k in u) + if gain <= 1e-15: return None + # coefficients: resp(p) = sum cm_k resp(k) -> donor gate d += (-cm_d) p + return gain, [(s, {k: -x for k, x in cm.items()}) for s, cm, _ in keep] + plans = {E: plan(E) for E in cand} + chosen = []; total = 0.0 + while True: + live = [(p[0], E) for E, p in plans.items() if p] + if not live: break + g, E = max(live); _, ents = plans[E] + touched = set() + for p, cm in ents: + chosen.append((E, p, cm)); avail_p.discard(p); avail_d.discard(p); touched.add(p) + for d in cm: donor_at[d] = E; avail_p.discard(d); avail_d.discard(d); touched.add(d) + total += g + for E2 in cand: + if plans.get(E2) and any(s in touched for s in groups[E2]): plans[E2] = plan(E2) + plans[E] = plan(E) + return chosen, total + + +def apply(c, chosen): + c = copy.deepcopy(c); head = [] + ext = [] + for E, p, cm in chosen: + ext.append([p, E]); c['start'][p] = E + byd = {} + for E, p, cm in chosen: + for d, co in cm.items(): byd.setdefault((d, E), []).append([p, co.numerator, co.denominator]) + for (d, E), lst in sorted(byd.items()): head.append(['in', E, d, sorted(lst)]) + c['A'] = head + c['A']; c['ext'] = sorted(ext) + return c + + +def rehist(c): + """recompute block histograms and N exactly as gx.check1 counts them (climbs per class, COPY ranks)""" + v, R = c['v'], c['R']; n = 2 * v + R; dim = [len(f) for f in c['frames']] + cls = lambda r: 'x' if r < v else 'y' if r < 2 * v else 's' + cur = list(c['start']); H = {'x': Counter(), 'y': Counter(), 's': Counter(), 'c': Counter()} + def climb(r, f): + if cur[r] != f: H[cls(r)][dim[f] - dim[cur[r]]] += 1; cur[r] = f + for ph in ('A', 'B'): + if ph == 'B': + for k, s_, f in c['ret']: H['c'][dim[f]] += 1 + for g in c[ph]: + regs = [g[2]] + ([t for t, _, _ in g[3]] + list(g[4]) if g[0] == 'out' else [x for x, _, _ in g[3]] if g[0] == 'in' else []) + for r in regs: climb(r, g[1]) + for r in range(n): climb(r, c['final'][r]) + c['blocks'] = {k: {str(r): x for r, x in sorted(w.items())} for k, w in H.items()} + c['N'] = sum(r * x for w in H.values() for r, x in w.items()) + return c + + +def price(c, K): + """returns b in B_K with the entrance-residual W""" + h, v, R, cst = c['h'], c['v'], c['R'], c['cst'] + Hinv = Counter() + for w in c['blocks'].values(): + for r, n in w.items(): Hinv[int(r)] += n + s = 2 * K + 1; m = s * h; lay = layout(K, h, split=(m - 1) // 2 if K > 2 else None) + tails = sum(len(c['frames'][f]) for _, f in c['ext']) + T = 1 if tails % h == 0 else h + H = Counter({r: T * s * n for r, n in Hinv.items()}) + for r in lay['blocks']: H[r] += T * 2 * v + W = (2 * K * v + R) * T - tails * T // h; assert tails * T % h == 0 + assert m * W - sum(r * n for r, n in H.items()) == T * (2 * K * v - s * cst), 'deficit' + assert 2 * max(H) < m + return coarse(H, m, W) + + +if __name__ == '__main__': + c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx, gxcore + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3 + b0 = price(c, K); print('start b(B_%d) =' % K, b0, float(b0)) + chosen, tot = select(c, float(b0), K) + fr = c['frames'] + print('entries', len(chosen), 'chi %.5f' % tot, 'ranks', Counter(len(fr[E]) for E, _, _ in chosen), + 'donors', len({d for _, _, cm in chosen for d in cm})) + w = rehist(apply(c, chosen)); w['derived_from'] = c['derived_from'] + ' + shared-donor kernel via exterior gauges' + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 (E0-E7 incl. exact scalar E5 and Q2) PASS', st) + for K2 in (2, 3, 4): + b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-clean-padding/code/cxop.py b/research/e8-clean-padding/code/cxop.py new file mode 100644 index 0000000000..772d6698da --- /dev/null +++ b/research/e8-clean-padding/code/cxop.py @@ -0,0 +1,32 @@ +"""Full rational operator of a gcert/1 program (A, scatter, B) on all registers, every initial value a variable; +compare two programs. usage: cxop.py CERT1 CERT2 [GXDIR]""" +import sys, gzip, json +from fractions import Fraction as Fr +def load(p): + x = json.load(gzip.open(p)); return x['cert'] if 'cert' in x else x +def op(c): + v, R = c['v'], c['R']; n = 2 * v + R + reg = [{r: Fr(1)} for r in range(n)] + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: d[k] = w + else: d.pop(k, None) + def run(G): + for g in G: + if g[0] == 'neg': reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == 'out': + src = dict(reg[g[2]]) + for t, a, b in g[3]: axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: axpy(g[2], reg[s], Fr(a, b)) + run(c['A']); tot = {k: dict(reg[s]) for k, s, _ in c['ret']} + for t in range(v): + for k, a, b in c['scat']['table'][t]: axpy(v + t, tot[k], Fr(a, b)) + run(c['B']); return reg, tot +a, ta = op(load(sys.argv[1])); b, tb = op(load(sys.argv[2])) +assert ta == tb, 'retained totals differ' +diff = [r for r in range(len(a)) if a[r] != b[r]] +print('full rational operator on all %d registers (every initial value a variable) and the retained totals: %s' % (len(a), 'IDENTICAL' if not diff else 'DIFFER at %d registers' % len(diff))) +assert not diff diff --git a/research/e8-clean-padding/code/cxretime.py b/research/e8-clean-padding/code/cxretime.py new file mode 100644 index 0000000000..06f79f8280 --- /dev/null +++ b/research/e8-clean-padding/code/cxretime.py @@ -0,0 +1,169 @@ +"""Retiming / descent on a gcert/1 complex program: move gate frames inside +[span(LB_g + prev frames of participants), AND of next frames] with the source-span rule (the x-content support of every +non-y operand, and of a slot destination after the gate, lies in the gate frame). Pins: start, scatter (y at 0, retained +slots at their ret frame), final. Greedy best-improvement with the chi ledger at m = (2K+1)h. +usage: cxretime.py CERT.json.gz GXDIR OUT.json.gz [K] [sweeps]""" +import sys, os, gzip, json, math, random, copy +from fractions import Fraction as Fr +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxkernel import reduce, inside, echelon, rehist, price + + +def regs_of(g): + if g[0] == 'neg': return [g[2]] + if g[0] == 'out': return [g[2]] + [t for t, _, _ in g[3]] + list(g[4]) + return [g[2]] + [s for s, _, _ in g[3]] + + +class CX: + def __init__(self, c): + self.c = c; v = c['v']; self.v = v; n = 2 * v + c['R']; self.n = n + self.fr = [tuple(f) for f in c['frames']]; self.key = {f: i for i, f in enumerate(self.fr)} + self.gates = [['A', g] for g in c['A']] + [['B', g] for g in c['B']] + self.gf = [g[1] for _, g in self.gates] + nA = len(c['A']) + occ = [[('p', c['start'][r])] for r in range(n)] + retf = {s: f for _, s, f in c['ret']} + for gi, (ph, g) in enumerate(self.gates): + if gi == nA: + for t in range(v): occ[v + t].append(('p', 0)) + for s, f in retf.items(): occ[s].append(('p', f)) + for r in regs_of(g): occ[r].append(('g', gi)) + for r in range(n): occ[r].append(('p', c['final'][r])) + self.occ = occ; self.where = [dict() for _ in self.gates] + for r in range(n): + for i, (k, x) in enumerate(occ[r]): + if k == 'g': self.where[x][r] = i + self.lb = self._lb() + + def _lb(self): + c = self.c; v = self.v; ports = c['ports'] + sup = [{r} if r < v else set() for r in range(self.n)] + lb = [] + for ph, g in self.gates: + need = set() + if g[0] == 'out': + for t, _, _ in g[3]: sup[t] |= sup[g[2]] + if g[2] < v or g[2] >= 2 * v: need |= sup[g[2]] + for t, _, _ in g[3]: + if t >= 2 * v: need |= sup[t] + elif g[0] == 'in': + for s, _, _ in g[3]: + sup[g[2]] |= sup[s] + if s < v or s >= 2 * v: need |= sup[s] + if g[2] >= 2 * v: need |= sup[g[2]] + lb.append(tuple(echelon([ports[x] for x in need]))) + return lb + + def fid(self, f): + f = tuple(f) + if f not in self.key: self.key[f] = len(self.fr); self.fr.append(f) + return self.key[f] + + def F(self, r, i): + k, x = self.occ[r][i]; return x if k == 'p' else self.gf[x] + + def span_ok(self): + return sum(1 for gi in range(len(self.gates)) if not inside(self.lb[gi], self.fr[self.gf[gi]])) + + +_sv = {} +def span_vecs(B): + B = tuple(B) + if B not in _sv: + out = {0} + for b in B: out |= {x ^ b for x in out} + _sv[B] = frozenset(out) + return _sv[B] + + +def block_of(M, gi): + f = M.gf[gi]; S = {gi}; stack = [gi] + while stack: + g = stack.pop() + for r, i in M.where[g].items(): + for j in (i - 1, i + 1): + k, x = M.occ[r][j] + if k == 'g' and x not in S and M.gf[x] == f: S.add(x); stack.append(x) + return S + + +def try_move(M, S, chi, d, temp=0.0, rng=None): + """move gate set S (all at one frame) to the best feasible frame; returns gain or None""" + old = M.gf[next(iter(S))]; regs = {} + for g in S: + for r, i in M.where[g].items(): regs.setdefault(r, []).append(i) + parts = [] + for r, ii in regs.items(): + lo_i, hi_i = min(ii), max(ii) + if len(ii) != hi_i - lo_i + 1: return None + parts.append((M.F(r, lo_i - 1), M.F(r, hi_i + 1))) + loE = echelon([u for g in S for u in M.lb[g]] + [u for p, _ in parts for u in M.fr[p]]) + hiV = None + for _, q in parts: + vs = span_vecs(M.fr[q]); hiV = vs if hiV is None else hiV & vs + if not all(u in hiV for u in loE): return None + cands = {M.fid(loE), M.fid(echelon(sorted(hiV)))} | {p for p, _ in parts} | {q for _, q in parts} + for u in sorted(hiV - span_vecs(loE)): cands.add(M.fid(echelon(loE + [u]))) + def ok(F): + return all(inside(M.fr[p], M.fr[F]) and inside(M.fr[F], M.fr[q]) for p, q in parts) and inside(loE, M.fr[F]) + def score(F): return sum(chi(d(F) - d(p)) + chi(d(q) - d(F)) for p, q in parts) + base = score(old); opts = [(score(F), F) for F in cands if F != old and ok(F)] + if not opts: return None + if temp > 0: + sc, F = rng.choice(opts) + if sc < base - 1e-12 or rng.random() < math.exp(-(sc - base) / temp): + for g in S: M.gf[g] = F + return base - sc + return None + sc, F = min(opts) + if sc < base - 1e-12: + for g in S: M.gf[g] = F + return base - sc + return None + + +def subblocks(M, S): + T = sorted(S); out = [S] + for k in range(1, len(T)): out.append(set(T[:k])); out.append(set(T[k:])) + out += [{g} for g in T] if len(T) > 1 else [] + return out + + +def sweep(M, a, m, rng, temp=0.0): + d = lambda f: len(M.fr[f]); chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + moved = 0; gain = 0.0; idx = list(range(len(M.gates))); rng.shuffle(idx); done = set() + for gi in idx: + if gi in done: continue + S = block_of(M, gi); done |= S + subs = subblocks(M, S) if len(S) <= 12 else [S] + if temp > 0: subs = [rng.choice(subs)] + for sub in subs: + g = try_move(M, sub, chi, d, temp, rng) + if g is not None: moved += 1; gain += g; break + return moved, gain + + +def to_cert(M): + c = copy.deepcopy(M.c); c['frames'] = [list(f) for f in M.fr] + A = []; B = [] + for gi, (ph, g) in enumerate(M.gates): + g2 = copy.deepcopy(g); g2[1] = M.gf[gi]; (A if ph == 'A' else B).append(g2) + c['A'] = A; c['B'] = B + return rehist(c) + + +if __name__ == '__main__': + c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3; sw = int(sys.argv[5]) if len(sys.argv) > 5 else 20 + h = c['h']; m = (2 * K + 1) * h + M = CX(c); print('span violations on input', M.span_ok()) + b0 = price(c, K); print('start b', b0, float(b0)); rng = random.Random(1) + for s in range(sw): + mv, g = sweep(M, float(b0), m, rng); print('sweep', s, 'moved', mv, 'chi/a %.4f' % (g / float(b0)), flush=True) + if not mv: break + w = to_cert(M); print('span violations', M.span_ok()) + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 PASS') + for K2 in (2, 3): b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-clean-padding/code/e8core.py b/research/e8-clean-padding/code/e8core.py new file mode 100644 index 0000000000..78983b3687 --- /dev/null +++ b/research/e8-clean-padding/code/e8core.py @@ -0,0 +1,203 @@ +"""Our own engine for bitE8/1 words (E8 root-line labels, h = 8): frame algebra over Q via root-line masks, +legality/F2 replay, five-stage histogram, exact bit coarse saving and PR #315 outer assembly (our engine copies). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +import gzip, json, os, importlib.util +from fractions import Fraction as Q +from collections import Counter + +HERE = os.path.dirname(os.path.abspath(__file__)) +def _load(n): + s = importlib.util.spec_from_file_location('e8_' + n, os.path.join(HERE, "engines", n + ".py")) + m = importlib.util.module_from_spec(s); s.loader.exec_module(m); return m +moment = _load('moment'); other = _load('base_two_moment'); outer = _load('outer') + +B2 = Q(876248285600677, 10**18) # Sussman E8 five-stage (PR #352) +B3 = Q(932783231884153, 10**18) # DaysSky seven-stage B_3 (PR #363; no Lean proof) + + +def load_word(p): + with (gzip.open(p, 'rt') if p.endswith('.gz') else open(p)) as f: + return json.load(f) + + +def save_word(c, p): + with gzip.open(p, 'wt') as f: + json.dump(c, f, separators=(',', ':')) + + +def rank(vecs): + rows = [[Q(x) for x in r] for r in vecs]; rk = 0 + n = len(rows[0]) if rows else 0 + for col in range(n): + p = next((i for i in range(rk, len(rows)) if rows[i][col] != 0), None) + if p is None: continue + rows[rk], rows[p] = rows[p], rows[rk] + for i in range(len(rows)): + if i != rk and rows[i][col] != 0: + f = rows[i][col] / rows[rk][col]; rows[i] = [a - f * b for a, b in zip(rows[i], rows[rk])] + rk += 1 + return rk + + +class Lat: + """Root-spanned subspaces of Q^8 represented by the mask of root lines they contain.""" + def __init__(self, lines): + self.lines = [tuple(x) for x in lines]; self.v = len(lines) + self._dim = {0: 0}; self._close = {} + # Gram (form /2) for orthogonality + self.ip = [[sum(a * b for a, b in zip(x, y)) // 2 for y in self.lines] for x in self.lines] + + def close(self, mask): + """mask of all root lines in span(roots of mask)""" + if mask in self._close: return self._close[mask] + idx = [i for i in range(self.v) if mask >> i & 1] + basis = [] + for i in idx: + if rank([self.lines[j] for j in basis] + [self.lines[i]]) > len(basis): basis.append(i) + d = len(basis); out = 0 + if d == 8: out = (1 << self.v) - 1 + elif d: + B = [self.lines[j] for j in basis] + for i in range(self.v): + if rank(B + [self.lines[i]]) == d: out |= 1 << i + self._close[mask] = out; self._close[out] = out; self._dim[out] = d + return out + + def dim(self, mask): + if mask not in self._dim: self.close(mask) + return self._dim[mask] + + def basis(self, mask): + b = [] + for i in range(self.v): + if mask >> i & 1 and rank([self.lines[j] for j in b] + [self.lines[i]]) > len(b): b.append(i) + return b + + def perp(self, t): + return self.close(sum(1 << j for j in range(self.v) if self.ip[t][j] == 0)) + + +def to_masks(c, L): + return [L.close(sum(1 << i for i in fr)) for fr in c['frames']] + + +PHASES = ('D', 'A', 'B', 'C') + + +def replay(c, L=None, masks=None, check_f2=True, span=True, span_mode='z'): + """Exact legality + F2 replay + histogram of a bitE8/1 word. Returns dict(H_local, steps, ...). + Legality: each register's frames nested (mask inclusion = exact Q-subspace inclusion for root-spanned frames) and + strictly increasing at each move; every gate at one common frame; D compensation at frame 0; y at frame 0 at the + scatter; COPY of retained totals; final frames (x, helpers FULL; y_t at its cap t-perp). + Source-span: every non-target operand's x-support lies in the gate frame.""" + L = L or Lat(c['lines']); masks = masks or to_masks(c, L) + v, R, h = c['v'], c['R'], c['h']; n = 2 * v + R; FULL = (1 << v) - 1 + cur = [masks[f] for f in c['start']] + for r in range(v): assert cur[r] == L.close(1 << r), 'x start' + for r in range(v, 2 * v): assert cur[r] == 0, 'y start at 0' + sig = [L.dim(cur[r]) for r in range(n)] + H = Counter(); steps = 0; viol = [] + val = [1 << i for i in range(n)] + zsupp = [{i: 1} if i < v else {} for i in range(n)] # integer support of each register over the x columns (all ADDs are +1) + def climb(r, m): + nonlocal steps + if cur[r] == m: return + assert cur[r] & ~m == 0 and cur[r] != m, ('not nested', r) + H[L.dim(m) - L.dim(cur[r])] += 1; steps += 1; cur[r] = m + def run(gates, ph): + for k, (f, d, srcs) in enumerate(gates): + m = masks[f] + assert d >= v and d not in srcs and len(set(srcs)) == len(srcs), (ph, k) + for x in [d] + srcs: climb(x, m) + for s in srcs: + val[d] ^= val[s] + if span: + if s < v or s >= 2 * v: + ms = sum(1 << i for i in zsupp[s]) + if ms & ~m: viol.append((ph, k, s)) + zd = zsupp[d] + for i, a in zsupp[s].items(): + w = zd.get(i, 0) + a + if w: zd[i] = w + else: zd.pop(i, None) + if span_mode == 'f2': + zsupp[d] = {i: 1 for i in range(v) if val[d] >> i & 1} + if span and d >= 2 * v: + md = sum(1 << i for i in zsupp[d]) + if md & ~m: viol.append((ph, k, d)) + run(c['D'], 'D') + for r in range(v, n): assert cur[r] == masks[c['start'][r]], 'D compensation at frame 0 (helpers untouched otherwise)' + run(c['A'], 'A') + for t in range(v): assert cur[v + t] == 0, 'y at frame 0 at the scatter' + copies = [val[q] for q in c['ret']] + for q in c['ret']: + assert q >= 2 * v; H[L.dim(cur[q])] += 1 + for t, row in enumerate(c['scatter']): + for k in row: val[v + t] ^= copies[k] + run(c['B'], 'B'); run(c['C'], 'C') + for r in range(n): climb(r, masks[c['final'][r]]) + for r in range(v): assert cur[r] == FULL + for r in range(2 * v, n): assert cur[r] == FULL + for t in range(v): assert cur[v + t] == L.perp(t), 'y final at cap' + if check_f2: + for s in range(v): assert val[s] == 1 << s + for t in range(v): assert val[v + t] == (1 << (v + t)) | (1 << t), ('target', t) + for r in range(2 * v, n): assert val[r] == 1 << r, ('helper', r) + return dict(sig=sig, viol=viol, H=H, steps=steps, n=n, v=v, R=R, h=h, L=L, masks=masks, ncopy=len(c['ret'])) + + +def profile(H_local, v, h=8): + prof = Counter({j: 5 * c for j, c in H_local.items()}) + for j in (2 * h - 2, h - 1, 2 * h + 2, 4): prof[j] += 2 * v + return prof + + +def coarse(H, m, W): + grid = Q(1, 10**18) + root = moment.certify(dict(H), m, W, True); c = Q(int(Q(root['lower']) * 10**18), 10**18) + assert moment.moment(H, m, W, c, True)[1] < 1 < moment.moment(H, m, W, c + grid, True)[0] + fb = 32 * m * m * sum(H.values()) + _, up = other.moment(m, W, list(H.items()), c); _, bad = other.moment(m, W, [(1, fb)], c) + lo, _ = other.moment(m, W, list(H.items()), c + grid); blo, _ = other.moment(m, W, [(1, fb)], c + grid) + assert up + Q(1, 10**16) * bad < 1 < lo + Q(1, 10**16) * blo + return c + + +def kappa(c, b): + grid = Q(1, 10**18); eta = Q(1, 10**12); beta = Q(1, 10**9); cap = (1 - beta) * b + sv = min(c, Q(((cap - grid) * 10**18).__floor__(), 10**18)); binding = 'bit' if sv == c else 'complex' + chain = [Q(384599, 10**10)] + for _ in range(3): + a = (1 - sv) * sv + sv * chain[-1]; assert chain[-1] < a < sv < 1 - a; chain.append(a) + bit = chain[-1] + bridge = dict(proof='PROOF.md', representation='Exact powers with source-bound finite overcharges', + semantic=dict(G=dict(base=2, exponent=30000), E=dict(base=2, exponent=100000), B_upper=dict(base=2, exponent=100001), + C0=dict(base=2, exponent=210000), C1=1, strict_literal_gap=1, induction_gap_lower=1), + rows=dict(coefficient=20161, degree=10**6, suffix_slope=4 * 10**6, degree_gap=Q(10**6) - Q(51 * 20161, 25))) + q = bit * (1 - 2 * eta); mn = (1 - eta) * q / (1 + q); t = mn * 10**18; k = Q((t.numerator - 1) // t.denominator, 10**18) + asm = outer.assembly(bit, b, bridge, k, eta=eta, beta=beta) + assert len(asm['strict_constraints']) == 47 and min(asm['strict_constraints'].values()) > 0 + try: + outer.assembly(bit, b, bridge, k + grid, eta=eta, beta=beta); raise SystemExit('ADJACENT ADMITTED') + except AssertionError: pass + return k, binding + + +def price_word(c, **kw): + r = replay(c, **kw) + v, h, R = r['v'], r['h'], r['R']; m = 5 * h + resid = sum(h - r['sig'][x] for x in range(2 * v, 2 * v + R)) + T = 1 if resid % h == 0 else h + W = (4 * v * h + resid) * T // h; assert (4 * v * h + resid) * T % h == 0 + prof = Counter({j: T * k for j, k in profile(r['H'], v, h).items()}); mass = sum(a * b for a, b in prof.items()) + L_copy = h * r['ncopy'] + assert m * W - mass == T * (4 * v - 5 * L_copy), ('deficit', m * W - mass) + assert 2 * max(prof) < m + cc = coarse(prof, m, W) + return dict(c=cc, H=r['H'], prof=prof, W=W, T=T, resid=resid, m=m, deficit=m * W - mass, replay=r) + + +def phi_fn(m, W, a): + """linearized moment term per child of rank r (float), for search scoring""" + import math + return lambda r: r / (m * W) * math.exp(a * math.log(m / r)) diff --git a/research/e8-clean-padding/code/emit.py b/research/e8-clean-padding/code/emit.py new file mode 100644 index 0000000000..1b7cded9bc --- /dev/null +++ b/research/e8-clean-padding/code/emit.py @@ -0,0 +1,172 @@ +"""e8clean local program: #390's dirty-preconditioned bracket (target precancellation, helper prewhitening, main, +FULL repair of non-sink helpers only), recomputed for our word, with the bank padding C on coordinate 72 FUSED +into the final climb of each new zero-row sink helper. Own code (reads #352/#390 only as data/spec). +Events: ('phase',p) ('adapter',kind,r,f) ('climb',phase,r,old,new,rank) ('climb_pad72',r,old,new,rank_local,rank_paid) + ('center',k,old,new,rank) ('scalar',phase,op,frame). Streams: ('L',i) live, ('C',k) centre, ('W',0) coefficient.""" +import json,gzip +from fractions import Fraction as Fr +from collections import Counter +def frac(a,b): return Fr(a,b) +V,R=120,783; N=2*V+R +def role(r): return 'X' if rY block) applied: replay main from helper column u_j with x=y=0 + reg={} + cols={j:{j:Fr(1)} for j in range(2*V,N)} + st=[dict() for _ in range(N)] + for j in range(2*V,N): st[j]={j:Fr(1)} + for t,s,q in pre_helper: + for k,x in st[s].items(): + z=st[t].get(k,0)+q*x + if z: st[t][k]=z + else: st[t].pop(k,None) + # st[h] = row h of A^{-1} acting on original columns; now run main on these helper values (x=y=0) + out=replay_main(c,{h:st[h] for h in range(2*V,N)}) + pre_target=[] + for y in range(V,2*V): + for k,x in sorted(out[y].items()): pre_target.append((y,k,-x)) # y -= (B A^-1 h) + # helper part of main from preconditioned helpers must be identity: + for h in range(2*V,N): assert out[h]=={h:Fr(1)}, ('A A^-1 != I',h) + xo=replay_main(c,{t:{t:Fr(1)} for t in range(V)}) + post=[] + for h in range(2*V,N): + if h in sinks: assert not xo[h],('sink row nonzero',h); continue + for s,x in sorted(xo[h].items()): post.append((h,s,-x)) + return pre_target,pre_helper,post +def lift(t,s,q,ori): + return ('add',('L',t),('L',s),q) if ori=='forward' else ('add',('L',s),('L',t),-q) +def emit(c,ori,hetero,fused,pw): + """hetero: {helper: endpoint frame} (#390 rank-8 sinks, no final lift); fused: set of zero-row sinks whose + final climb carries the bank padding C_72.""" + pre_target,pre_helper,post=pw; fr=c['frames']; dim=[len(f) for f in fr] + final=list(c['final']) + for r,f in hetero.items(): final[r]=f + cur=list(c['start']); tab=scat_table(c) + yield ('phase','old_response') + for t,s,q in pre_target+pre_helper: yield ('scalar','old_response',lift(t,s,q,ori),'old0') + yield ('phase','ad0') + for r,f in enumerate(c['start']): yield ('adapter','old_to_new',r,f) + for ph in ['A','centers','B']: + yield ('phase',ph) + if ph=='centers': + for k,r,f in sorted(c['ret']): + C=('C',k) + yield ('scalar','main',('clear',C),f if ori=='forward' else 0) + if ori=='forward': yield ('scalar','main',('add',C,('L',r),Fr(1)),f) + else: + for t in range(V): + if k in tab[t]: yield ('scalar','main',('add',C,('L',V+t),tab[t][k]),0) + yield ('center',k,f if ori=='forward' else 0,0 if ori=='forward' else f,dim[f]) + if ori=='forward': + for t in range(V): + if k in tab[t]: yield ('scalar','main',('add',('L',V+t),C,tab[t][k]),0) + else: yield ('scalar','main',('add',('L',r),C,Fr(-1)),f) + yield ('scalar','main',('clear',C),0 if ori=='forward' else f) + continue + for g in c[ph]: + for r in gate_regs(g): + if cur[r]!=g[1]: + yield ('climb',ph,r,cur[r],g[1],dim[g[1]]-dim[cur[r]]); cur[r]=g[1] + for t,s,q in gate_adds(g): yield ('scalar','main',lift(t,s,q,ori),g[1]) + yield ('phase','final') + for r,f in enumerate(final): + if cur[r]!=f: + if r in fused: yield ('climb_pad72',r,cur[r],f,dim[f]-dim[cur[r]],dim[f]-dim[cur[r]]+1) + else: yield ('climb','final',r,cur[r],f,dim[f]-dim[cur[r]]) + cur[r]=f + yield ('phase','adF') + for r,f in enumerate(final): + yield ('adapter','canonical_to_bank_residual' if r in hetero else 'new_to_old',r,f) + yield ('phase','cleanup') + for t,s,q in post: yield ('scalar','cleanup',lift(t,s,q,ori),'old1') + yield ('phase','done') +PHASES=['old_response','ad0','A','centers','B','final','adF','cleanup','done'] +def nested(fr,a,b): + def red(u,B): + for x in B: + if u>>(x.bit_length()-1)&1: u^=x + return u + return all(red(u,fr[b])==0 for u in fr[a]) +def validate(events,c,ori,hetero,fused): + """independent exact replay on all 1023 live columns + label/lifetime/fusion rules""" + fr=c['frames']; dim=[len(f) for f in fr]; final=list(c['final']) + for r,f in hetero.items(): final[r]=f + cur=list(c['start']); reg={('L',i):{i:Fr(1)} for i in range(N)}; seen=[]; phase=None + hist=Counter(); paid=Counter(); fusedone=set(); centers=set(); counts=Counter(); edges=set() + for ev in events: + counts[ev[0]]+=1 + if ev[0]=='phase': + phase=ev[1]; seen.append(phase); assert seen==PHASES[:len(seen)],'chronology' + if phase=='adF': assert cur==final,'final climbs' + continue + if ev[0]=='adapter': + assert (phase=='ad0' and ev[1]=='old_to_new') or (phase=='adF' and ev[1] in ('new_to_old','canonical_to_bank_residual')); continue + if ev[0] in ('climb','climb_pad72'): + if ev[0]=='climb': _,p,r,o,f,d=ev; assert p==phase + else: + _,r,o,f,d,dp=ev; assert phase=='final' and r in fused and dp==d+1 and f==1; fusedone.add(r) + assert r not in fusedone or ev[0]=='climb_pad72' + assert cur[r]==o and d==dim[f]-dim[o]>0 and nested(fr,o,f),'child' + assert not centers,'centre live during child' + cur[r]=f; hist[d]+=1; paid[d if ev[0]=='climb' else d+1]+=1; edges.add((o,f)); continue + if ev[0]=='center': + _,k,o,f,d=ev; assert phase=='centers' and centers=={('C',k)}; hist[d]+=1; paid[d]+=1; continue + assert ev[0]=='scalar'; _,p,e,f=ev + assert p==('main' if phase in ('A','centers','B') else phase) + tgt=e[1]; src=e[2] if e[0]=='add' else None + for x in [tgt]+([src] if src else []): + if x[0]=='L': + i=x[1]; assert i not in fusedone,'fused sink touched after its padded climb' + if phase=='old_response': assert f=='old0' and role(i) in ('Y','S') + elif phase=='cleanup': assert f=='old1' and cur[i]==1 and role(i) in ('X','S') and i not in hetero and i not in fused + else: assert cur[i]==f,'scalar not at common exact label' + else: assert x[0]=='C' and phase=='centers' + if e[0]=='clear': reg[tgt]={}; centers.discard(tgt) + else: + q=e[3]; d=reg.setdefault(tgt,{}) + for k,x in dict(reg.get(src,{})).items(): + z=d.get(k,0)+q*x + if z: d[k]=z + else: d.pop(k,None) + if tgt[0]=='C': centers.add(tgt) + assert seen==PHASES and not centers + exp={('L',i):{i:Fr(1)} for i in range(N)} + for t in range(V): + if ori=='forward': exp[('L',V+t)][t]=Fr(1) + else: exp[('L',t)][V+t]=Fr(-1) + bad=[r for r in exp if reg[r]!=exp[r]] + assert not bad,(ori,'columns wrong',bad[:5]) + assert all(not z for r,z in reg.items() if r[0]!='L'),'private work not erased' + assert fusedone==set(fused) + return dict(events=sum(counts.values()),counts=dict(counts),local_hist=dict(sorted(hist.items())),paid_hist=dict(sorted(paid.items())),edges=sorted(edges)) diff --git a/research/e8-clean-padding/code/engines/base_two_moment.py b/research/e8-clean-padding/code/engines/base_two_moment.py new file mode 100644 index 0000000000..14a90fa0e7 --- /dev/null +++ b/research/e8-clean-padding/code/engines/base_two_moment.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Maintainer arithmetic cross-check of the pinned PR39 certificate. + +Uses no producer/checker imports. Counts are inputs, not proved by this script. +80-term rational logarithms and 12-term exponentials independently enclose +the two moments. The accompanying written review addresses their realization. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +GRID = 10**30 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def log_unit(x): + require(1 <= x <= 2, "logarithm range") + z = (x-1)/(x+1) + lo = 2*sum((z**(2*j+1)/(2*j+1) for j in range(80)), Q(0)) + return lo, lo+2*z**161/(161*(1-z*z)) + + +def log_bounds(x): + k = 0 + while x > 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/e8-clean-padding/code/engines/moment.py b/research/e8-clean-padding/code/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/e8-clean-padding/code/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/e8-clean-padding/code/layout_bk.py b/research/e8-clean-padding/code/layout_bk.py new file mode 100644 index 0000000000..57aa98085b --- /dev/null +++ b/research/e8-clean-padding/code/layout_bk.py @@ -0,0 +1,63 @@ +"""Our own check of the bridged layout B_K (Sussman's B_2, Work/Bridge/Net.lean; DaysSky's B_K generalisation, PR #363), +reimplemented from the schedule stated in PR #363's README and Sussman's coordinate-frame stage geometry: +K bank pairs, 2K+1 stages on H + 2K.H (m = (2K+1)h). Pair 1: forward, backward, forward; pair p >= 2: backward, forward, +borrowing its first forward from pair p-1 through twin gates (+-1 additions at equal frames). +Checks: frames are coordinate sets; every climb nested; twin gates at equal frames; each invocation entered at its +stage frame; final frames; m-1 moves per data role; exchange identity X_p = -y_p, Y_p = x_p (exact integer +linear algebra on symbolic coefficient vectors). Returns the idle climbs per role pair (optionally split at s). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +def layout(K, h, split=None): + s = 2 * K + 1; m = s * h; l = 0 + blk = lambda name, skip=None: {(name, j) for j in range(h) if j != skip} + B0 = blk('b0'); F = ['F%d' % i for i in range(s - 1)] + ALL = set(B0).union(*[blk(f) for f in F]); assert len(ALL) == m + def enter(t, X): + if t == 0: return {('b0', l)} if X else set() + base = set(B0) if X else B0 - {('b0', l)} + for f in F[:t - 1]: base |= blk(f, l) + return base + def leave(t, X): + return (set(B0) if X else B0 - {('b0', l)}) if t == 0 else enter(t, X) | blk(F[t - 1], l) + sched = [(0, 'F', 1), (1, 'B', 1), (2, 'F', 1)] + for p in range(2, K + 1): sched += [(2 * p - 1, 'B', p), (2 * p, 'F', p)] + fr = {(X, p): enter(0, X) for p in range(1, K + 1) for X in (True, False)} + inv = {k: 0 for k in fr}; idle = {k: [] for k in fr} + # symbolic values: vector over symbols x1..xK, y1..yK + sym = lambda nm, p: tuple(int(q == (nm, p)) for q in [(a, b) for a in 'xy' for b in range(1, K + 1)]) + val = {(True, p): sym('x', p) for p in range(1, K + 1)} | {(False, p): sym('y', p) for p in range(1, K + 1)} + add = lambda u, w, c: tuple(a + c * b for a, b in zip(u, w)) + def go(k, new, is_idle): + assert fr[k] <= new, 'climb not nested' + if new != fr[k]: + (idle[k].append(len(new) - len(fr[k])) if is_idle else None) + if not is_idle: inv[k] += len(new) - len(fr[k]) + fr[k] = set(new) + def gate(d, s_, c): + assert fr[d] == fr[s_], 'twin gate at unequal frames' + val[d] = add(val[d], val[s_], c) + for t, kind, p in sched: + for X in (True, False): + go((X, p), enter(t, X), True); go((X, p), leave(t, X), False) + if kind == 'F': val[(False, p)] = add(val[(False, p)], val[(True, p)], 1) + else: val[(True, p)] = add(val[(True, p)], val[(False, p)], -1) + for q in range(2, K + 1): + if t in (2 * q - 3, 2 * q - 2): + for X in (True, False): go((X, q), fr[(X, q - 1)], True) + if t == 2 * q - 3: gate((True, q - 1), (True, q), 1); gate((False, q), (False, q - 1), -1) + else: gate((False, q), (False, q - 1), 1); gate((True, q - 1), (True, q), -1) + for k in fr: go(k, ALL if k[0] else ALL - {('b0', l)}, True) + for q in range(K, 1, -1): gate((False, q - 1), (False, q), -1); gate((True, q), (True, q - 1), 1) + for k in fr: assert inv[k] + sum(idle[k]) == m - 1 + for p in range(1, K + 1): + assert val[(True, p)] == tuple(-a for a in sym('y', p)) and val[(False, p)] == sym('x', p), ('exchange', p) + assert idle[(True, p)] == idle[(False, p)] + blocks = [r for p in range(1, K + 1) for r in idle[(True, p)]] + if split: + out = [] + for r in blocks: + while r > split: out.append(split); r -= split + if r: out.append(r) + blocks = out + return dict(m=m, per_pair={p: idle[(True, p)] for p in range(1, K + 1)}, blocks=blocks) +if __name__ == '__main__': + print(layout(2, 9)); print(layout(3, 9)); print(layout(3, 9, split=31)) diff --git a/research/e8-clean-padding/code/sinks.py b/research/e8-clean-padding/code/sinks.py new file mode 100644 index 0000000000..9e56d6ff15 --- /dev/null +++ b/research/e8-clean-padding/code/sinks.py @@ -0,0 +1,144 @@ +"""Construct free sink uncomputes on a gcert word: for helper r, after its last Y-influence, subtract an exact rational +combination of other helpers that sit at r's exact frame (no donor advance), so the final clean x-row of r is zero.""" +import sys,json,gzip +from fractions import Fraction as Fr +from collections import Counter,defaultdict +import os +sys.path.insert(0,os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','complex','gx')); import gxcore as G +def cf(k): ng,a,b=k; return Fr(-a if ng else a,b) +def analyse(c): + D=G.normal(json.loads(json.dumps(c))) + dim=[len(x) for x in D['frames']]; v=D['v'];R=D['R'];n=2*v+R + gates=D['A']+D['B']; nA=len(D['A']); NG=len(gates) + val=[({r:Fr(1)} if r=v else ver[r].append((0,dict(val[r]))); lab[r].append((0,cur[r])) + for i,g in enumerate(gates): + t=i+1 + if i==nA: + tot=[dict(val[s]) for s,_ in D['ret']] + for tt in range(v): + for kk,cc in G.scat_row(D,tt): + for key,x in tot[kk].items(): val[v+tt][key]=val[v+tt].get(key,0)+cf(cc)*x + for r in G.regs(g): + if cur[r]!=g[1]: cur[r]=g[1]; lab[r].append((t,g[1])) + src=dict(val[g[2]]) if g[0]=='out' else None + for tg,s,k in G.adds(g): + sv=src if g[0]=='out' else val[s] + d=val[tg] + for key,x in sv.items(): + d[key]=d.get(key,0)+cf(k)*x + if d[key]==0: del d[key] + ver[tg].append((t,dict(d))) + w=defaultdict(dict) + for y in range(v): w[v+y]={y:Fr(1)} + tau={} + for t in range(NG,-1,-1): + for r in range(2*v,n): + if r not in tau and any(w[r].values()): tau[r]=t + if t==0: break + g=gates[t-1] + for tg,s,k in reversed(G.adds(g)): + cc=cf(k) + for y,x in list(w[tg].items()): w[s][y]=w[s].get(y,0)+cc*x + if t-1==nA: + for tt in range(v): + for kk,c2 in G.scat_row(D,tt): + s=D['ret'][kk][0] + for y,x in w[v+tt].items(): w[s][y]=w[s].get(y,0)+cf(c2)*x + fin=[dim[D['final'][r]]-dim[cur[r]] for r in range(n)] + return D,dim,ver,lab,tau,fin,NG,val +def ivs(L,END): + return [(fr,ts,(L[i+1][0] if i+1 (vec, combo) + def red(x,combo): + x=dict(x);combo=dict(combo) + while x: + p=min(x) + if p not in basis: return x,combo + c=x[p]; bv,bc=basis[p] + for k,vv in bv.items(): + x[k]=x.get(k,0)-c*vv + if x[k]==0: del x[k] + for k,vv in bc.items(): + combo[k]=combo.get(k,0)-c*vv + if combo[k]==0: del combo[k] + return x,combo + for key,vec in cands: + x,cb=red(vec,{key:Fr(1)}) + if x: + p=min(x);c=x[p]; basis[p]=({k:a/c for k,a in x.items()},{k:a/c for k,a in cb.items()}) + x,cb=red(target,{}) + if x: return None + return {k:-a for k,a in cb.items()} # target - sum(...)=0 => target = sum(-cb) +def find(c,r,exclude=(),an=None): + D,dim,ver,lab,tau,fin,NG,val=an or analyse(c) + t0=tau.get(r,-1)+1; target=val[r] + if not target: return [] + Lr=[(fr,max(ts,t0),te) for fr,ts,te in ivs(lab[r],NG) if te>t0] + v=D['v'];n=2*v+D['R']; cands=[] + for u in range(2*v,n): + if u==r or u in exclude: continue + for fr,ts,te in ivs(lab[u],NG): + for frr,a,b in Lr: + if fr!=frr: continue + lo,hi=max(ts,a),min(te,b) + if lo>=hi: continue + vs=ver[u] + for j,(tv,vec) in enumerate(vs): + vend=vs[j+1][0] if j+1=1: cands.append(((u,s0,fr),vec)) + # prefer later times? keep order: fewer distinct gates -> sort by time + sol=solve(target,cands) + if sol is None: return None + gates=defaultdict(list) + for (u,s0,fr),a in sol.items(): + gates[(s0,fr)].append([u,-a.numerator,a.denominator]) # r -= a*u => coefficient -a + return [dict(sink_helper=r,cut_group=s0-1,frame=fr,uncompute=sorted(us)) for (s0,fr),us in sorted(gates.items())] +def nested(fr,a,b): return all(G.reduce(u,fr[b])==0 for u in fr[a]) +def find_adv(c,r,exclude=(),noadv=()): + """as find, but donors may also be advanced early along their own walk (fu < L_r < fn); returns (gates, splits)""" + D,dim,ver,lab,tau,fin,NG,val=analyse(c) + fr=D['frames']; t0=tau.get(r,-1)+1; target=val[r] + if not target: return [],[] + Lr=[(f,max(ts,t0),te) for f,ts,te in ivs(lab[r],NG) if te>t0] + v=D['v'];n=2*v+D['R'] + touch=defaultdict(list) + for i,g in enumerate(D['A']+D['B']): + for x in G.regs(g): touch[x].append(i+1) + free=[];adv=[] + for u in range(2*v,n): + if u==r or u in exclude: continue + I=ivs(lab[u],NG) + for j,(fu,ts,te) in enumerate(I): + fn=I[j+1][0] if j+1=hi: continue + vs=ver[u] + for k,(tv,vec) in enumerate(vs): + vend=vs[k+1][0] if k+1=s1 or not vec or s0<1: continue + if fu==f: free.append(((u,s0,f),vec)); continue + if u in noadv: continue + # advance: need fu=s1 or s<1: continue + if dim[fu] original cut index""" + by = {} + for s in sinks: by.setdefault(s['cut_group'], []).append(s) + m = [] + for i in range(len(c['A']) + len(c['B'])): + m.append(i); m.extend(i for _ in by.get(i, [])) + return m + + +def sixths(gs): + """Rewrite a two-donor uncompute r += a*p + (a/2)*q (quarter coefficient) as three same-frame gates + p += q/2; r += a*p; p -= q/2, so every intermediate entry stays in sixths (gxcore E5 units) and every + coefficient has denominator <= 2. The donor p is restored immediately; the net scalar map is identical.""" + from fractions import Fraction as F + out = [] + for g in gs: + u = g['uncompute'] + if all(b in (1, 2, 3, 6) for _, _, b in u): out.append(g); continue + assert len(u) == 2 + (p, a1, b1), (q, a2, b2) = sorted(u, key=lambda x: x[2]) + a, bq = F(a1, b1), F(a2, b2); h = bq / a + assert h.denominator <= 2 and a.denominator <= 2 + base = dict(sink_helper=g['sink_helper'], cut_group=g['cut_group'], frame=g['frame']) + out += [dict(base, target=p, uncompute=[[q, h.numerator, h.denominator]]), + dict(base, uncompute=[[p, a.numerator, a.denominator]]), + dict(base, target=p, uncompute=[[q, -h.numerator, h.denominator]])] + return out diff --git a/research/e8-clean-padding/complex/LICENSE-wht-power-saving-lean b/research/e8-clean-padding/complex/LICENSE-wht-power-saving-lean new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-padding/complex/LICENSE-wht-power-saving-lean @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-padding/complex/NOTICE-wht-power-saving-lean b/research/e8-clean-padding/complex/NOTICE-wht-power-saving-lean new file mode 100644 index 0000000000..7008ce01c1 --- /dev/null +++ b/research/e8-clean-padding/complex/NOTICE-wht-power-saving-lean @@ -0,0 +1,489 @@ +Walsh-Hadamard power saving (wht-power-saving-lean) +Copyright 2026 Jacob Sussman + +Repository: https://github.com/jacobalansussman/wht-power-saving-lean + +This repository is not a project of OpenAI. OpenAI did not write, review or +endorse it. The package name "OAI" and the namespace "OAI.PowerSaving" are +those of openai/math and are kept only because the new files extend that +development. + +This repository is not a project of CrocSwap/integer-mult-bounds either. Its +authors did not write, review or endorse it. Section 6 says what is taken +from their repository. + +This repository contains files from, and files derived from, the repository +"openai/math" (https://github.com/openai/math), family 130, "Exact Fourier +transforms below n log n", at commit fd4aeeb2ee4fc729c18d98444fed42fd0529eeeb. +That repository is published under the Apache License, Version 2.0. A copy of +the licence is in the file LICENSE. The upstream repository has no NOTICE file +and its licence text names no copyright holder; the files are attributed here +to the authors of openai/math (OpenAI). + +1. Unmodified upstream files. + The 89 files under OAI/Computability/ are byte-for-byte copies of the files + with the same paths under lean/ in openai/math at the commit above. They + have not been changed. Modified copies of some of them are under + Work/Fourier/ and Work/FourierE8/ and are listed in section 7. + One more file of openai/math is here unchanged, outside the Lean build: + third-party/openai-math/lean/ComparatorChallenges/UniformFourier.lean is a + byte-for-byte copy of lean/ComparatorChallenges/UniformFourier.lean at the + commit above (the statement of OpenAI's Fourier challenge). It is included + so that the modified copy named in section 2 can be compared with it. + +2. Files that contain upstream text. + - Work/CarrierCheck/ChallengeB2Ke16x.lean, + Work/CarrierCheck/ChallengeB2Ke16xR.lean, + Work/GCert/Data/ChallengeB2Gp193x.lean, + Work/GCert/Data/ChallengeB2Ge8x.lean and the text template + tools/gen/templates/ChallengeB2L16x.lean.txt each contain, as their + lines 22-270, lines 9-257 of + lean/ComparatorChallenges/UniformFourier.lean of openai/math (the RAM cost + model), unchanged. Everything else in these files was written for this + repository. + - Work/Fourier/UniformFourierChallenge.lean is a modified copy of + lean/ComparatorChallenges/UniformFourier.lean of openai/math (the + statement of OpenAI's Fourier challenge, 336 lines). Changes: a comment + was added at the top; the exponent 1 - 1/(10^(13:ℕ)) was replaced by + 1 - 7474546/(10^(10:ℕ)); seven names received the suffix "Z" + (decimalExponent, decimalTime, TimeBounds, DFTGoal, ConvGoal, + transform_main, convolution_main). Everything else in the file is the + upstream text, unchanged. See section 7. + - Work/FourierE8/UniformFourierChallenge.lean is a second modified copy + of the same upstream file, for the fourth result, with the same three + kinds of change: a comment added at the top; the exponent replaced by + 1 - 8762478/(10^(10:ℕ)); the suffix "E8" on the same seven names. + Everything else in the file is the upstream text, unchanged. See + section 7. + - Work/Scratch/Engine.lean and Work/Block/Engine.lean contain copies of + proofs of openai/math, changed for this repository: sections 1, 2 and 5 + of Work/Scratch/Engine.lean are upstream proofs with the batch layout + renamed, and both files contain a copy of the private upstream theorem + "hills_project" (lean/OAI/Computability/FourierTransform/ + TensorProgram.lean) with its envelope generalised. The comments in the + two files mark these places. + - lakefile.lean is adapted from lean/lakefile.lean of openai/math: the same + package name, toolchain, package option and Mathlib pin; every other + dependency was removed and the libraries of this repository were added. + lean-toolchain is a byte-for-byte copy of lean/lean-toolchain. + lake-manifest.json lists Mathlib and its dependencies at the revisions of + lean/lake-manifest.json. + - RELATED-WORK.md reproduces the BibTeX entries of two manuscripts of + openai/math. + +3. New files that build on upstream proofs. + The other files under WHTCheck/ and Work/ were written for this + repository. They import the upstream files, and several of them generalise + or adapt proofs of upstream files (for example Work/Block/Recursion.lean, + which says so in its header). They are changes and additions made for this + repository and are not part of openai/math. + +4. How the new files were made. + Jacob Sussman made the new files on 2026-10-08, 2026-10-09 and 2026-10-10 + by directing a team of AI agents (Claude). The agents wrote the new Lean + files, the certificate data and the generator scripts. They made the + rebuild scripts under tools/rebuild/, in part by adapting programs of + CrocSwap/integer-mult-bounds (section 6): ten of the thirteen on + 2026-10-09, tidied for this repository on 2026-10-10, and three on + 2026-10-10. On 2026-10-10 they also wrote the search programs under + tools/e8/ and found with them the certificate of the fourth result + (section 8). See README.md, section 4. + +5. Ideas taken from other public work. + The network of the first result uses ideas published by others, among them + the helper circuit "NStar3" (Swapnil-jain/integer-mult-kappa, which credits + CrocSwap pull request #36 and Paureel for parts of it), its transfer to + family 130 (shea256/fourier-transform-below-nlogn), and "carrier links" and + "whole-residual batching" (pull requests to CrocSwap/integer-mult-bounds). + No file of Swapnil-jain/integer-mult-kappa or of + shea256/fourier-transform-below-nlogn is included here. One comment in + Work/Scratch/Engine.lean quotes three counts reported in + Swapnil-jain/integer-mult-kappa and names that source. The general frame + lemma that Work/GFrame proves is stated in + notes/general-clifford-frames.tex of CrocSwap/integer-mult-bounds; its Lean + proof was written for this repository. The credits, with links, are in + RELATED-WORK.md. + +6. Data derived from, and programs adapted from, + CrocSwap/integer-mult-bounds (second result). + The helper circuit of the second result is the paired-cube circuit of the + repository "CrocSwap/integer-mult-bounds" + (https://github.com/CrocSwap/integer-mult-bounds), in the state of its pull + request #193. It is the design of that community: icekylinx (pull requests + #144 and #184), eumemic (#168, and #117 behind its modules), ikeboy / + Avi Eisenberg (#191 and #193), with an664 (#128) credited there for the + workspace-sharing principle, and DaysSky (#162) and chafreaky (#163) + credited by #168 for its closure-compiled carrier arcs and for the + fusion of its single-target outputs. That repository is published under + the Apache + License, Version 2.0 (the same licence text as the file LICENSE). Its + NOTICE file begins "A sharper exponent for integer multiplication / + Copyright 2026 Douglas Colkitt" and says that the community release "is + not solely Douglas Colkitt's work". A complete copy of that NOTICE file, as + it is at the head of pull request #193, is in + third-party/CrocSwap-integer-mult-bounds/NOTICE. + + The data were taken from these files of that repository. They were loaded + as data by the programs under tools/rebuild/. No program of that + repository was run, and none is included here unchanged; six of the + programs under tools/rebuild/ are adapted from programs of that + repository ("Programs", below). + - at the head of pull request #168 (eumemic), + 4a3c769e5c5430e7114c4d3e099ff34664677f17: + references/paired-cube/sources/local_L1.json + references/paired-cube/sources/tmod_TE_TD_TB3_1_1_4_full_6.0617964e-4.json + references/paired-cube/sources/pmod_J0_full_6.0666810e-4.json + references/paired-cube/sources/qmod_climb3u_best.json + references/paired-cube/selected-module/matching-arcs.json + references/paired-cube/physical/frames.json + - at the head of pull request #193 (ikeboy), + 187e1010ac8b259af8e9b5166f68b64bc27b4b47: + research/source-assisted-v4/data/physical-pairs.json + + Two more files at the head of pull request #168 are read for comparison + only: the programs print whether their graph and their counts agree + with them. Nothing in the certificate is taken from them: + references/paired-cube/selected-module/SOURCE.json + certificates/paired-cube-complex-input.json + + One more file is fetched and read only on request. No certificate and + no Lean module of this repository is made from it; the documentation + gives its sha256 and the price that tools/gx/gxdry.py computes for + the certificate that the rebuild makes from it: + - at the head of pull request #233 (chafreaky), + 109a857a329d18ed5552d5573f17ddfa886ae57f: + research/source-assisted-v4-layer/witness/physical-pairs.json + + None of these ten files is included in this repository. + tools/rebuild/fetch_inputs.py fetches them and checks their sha256. + + Files of this repository that contain data derived from them: + tools/certificate/gcert1-p11-pr193.json.gz and the Lean data modules + generated from it, Work/GCert/Data/Gen/P193*.lean and the files they import + from Work/GCert/Data/Gen/P193/; its block counts are also in the generated + modules Work/GCert/Data/P193Price.lean, RateB2Gp193.lean, RateB2Gp193x.lean + and InstB2Gp193.lean. + Changes made: the circuit was rebuilt from those data as one explicit, + renumbered list of additions with a table of frames, in the certificate + format "gcert/1" of this repository; its 1,980 in-place steps were written + as pairs of additions with rescaled coefficients; the Lean data modules + were generated from that list. No file of that repository is included + unchanged, except the copy of its NOTICE file named above. + + Programs. The Python files under tools/rebuild/ were made by the agents + (section 4), who read programs of that repository as text and ran none + of them. Six of the thirteen files are adapted from those programs: + the parts named below follow the outside program statement by statement + or method by method, with the layout changed, some names changed and + the parts that this certificate does not use left out. Each of the six + says so in its first lines. + - tools/rebuild/compile.py: the function closure follows + compile_closure of scripts/paired_cube/closure.py; the function + select follows the first part of select of + scripts/paired_cube/gauges.py. + - tools/rebuild/graphgen.py: the class Gen follows the class Graph of + scripts/paired_cube/graph.py; its method fuse follows the branch + "f8:" of merge_outputs of scripts/paired_cube/modules.py, which + fuses the three single-target outputs of a port into one. That + branch came with pull request #168 (eumemic), which says of the + fusion that it "follows #163's same-singleton fusion" and credits + it so: "Same-singleton output fusion: @chafreaky (#163); the fold + orders here come from our own search." + - tools/rebuild/aligned.py: the functions op_tags, local_values and + build follow op_tags, local_values and main of + research/source-assisted-v4/source_aligned_local_v4.py, except its + search for pairs and the records it writes. + - tools/rebuild/stage.py: the order of the events, the backward pass + (responses) and many names are those of + research/terminal-sinks/sinks_gate.py and of + scripts/paired_cube_physical.py; the event records and the exact + arithmetic were written for this repository, and the frame scan + was rewritten so that it returns every block. + - tools/rebuild/build.py: the function target_hist and the field names + of profile follow the last part of select of + scripts/paired_cube/gauges.py; the calls that make the graph and its + hash follow regenerate of scripts/paired_cube_producer.py. + - tools/rebuild/f2.py: the function perp follows perp, and the second + half of the function rref follows the second half of basis, of + scripts/paired_cube/frames.py. + The outside programs are those at the two commits named above + (source_aligned_local_v4.py at the second, the others at the first). + Of the other seven files, rebuild.py, fetch_inputs.py, rbpaths.py, + rewrite.py, phys.py and emit.py were written for this repository. + modules.py was written for this repository too; for the three module + files it checks the contract that the outside + scripts/paired_cube/modules.py states for them in its functions + triple_module_from, pair_module_from and all_but_one_from, each of + which is marked there "eumemic, Claude assistance; Apache-2.0". + + Notices and attribution sentences in the first lines of those outside + programs, quoted with the line numbers of each file at its commit. + The other lines of each header say what the program does and name no + person: + + scripts/paired_cube/closure.py, lines 4-5 (pull request #168, + eumemic; from pull request #162, DaysSky): + Copyright 2026 DaysSky (PR162, + research/extended-links/cxlinks.py), Apache-2.0; moved here + unchanged apart from this header and the imports (eumemic, Claude + assistance). + + scripts/paired_cube/graph.py, modules.py, frames.py, gauges.py and + scripts/paired_cube_producer.py (pull request #144, icekylinx; + graph.py, modules.py and paired_cube_producer.py changed in #168, + eumemic), the two comment lines at the top of each: + Copyright 2026 icekylinx. Apache-2.0. + Developed with GPT-6 Astra assistance; integrated with Codex + assistance. + graph.py, lines 6-9: + The coarse positive query modules restrict the already adopted + PR117 DAG (eumemic; Apache-2.0; Claude assistance; + cbb05ce504d571546d9b7794c186a613c659c3bf). The paired-channel + decomposition and this assembly are new work for icekylinx with + OpenAI GPT-6 Astra assistance. + modules.py, lines 6-7: + The pair-disjoint module is a specialization of the already + adopted PR117 positive DAG (eumemic, Apache-2.0, pinned + cbb05ce504d571546d9b7794c186a613c659c3bf). + modules.py, line 272, above merge_outputs: + Output merging (pmerge.py variants; eumemic, Claude assistance; + Apache-2.0). + frames.py, line 7: + New work for icekylinx, OpenAI GPT-6 Astra assistance. + paired_cube_producer.py, line 8: + Copyright 2026 icekylinx, Apache-2.0; OpenAI GPT-6 Astra + assistance, inherited PR117 notices. + + scripts/paired_cube_physical.py, lines 4-7 (pull request #168, + eumemic): + Prepared by eumemic with Anthropic Claude assistance. Apache-2.0. + The signed word, frozen arcs, gauges, chronology and shared-core + accounting are icekylinx's PR144. Frame descent under PR130's + general Clifford frames and compensated birth-cut reuse follow + PR131 and jamesyc's PR124; deadline (late) compensation reads + follow PR143. + + research/terminal-sinks/sinks_gate.py, lines 4-6 (pull request + #168, eumemic): + The substitution is the terminal-sink lemma of PR #166 by jamesyc + (closed by its author), independently audited here: this gate's + own frame scans, replay and controls carry the soundness argument + and do not use #166's checker. Gate, audit and integration by + eumemic with Anthropic Claude assistance. Apache-2.0. + + research/source-assisted-v4/source_aligned_local_v4.py, lines 4-9 + (pull requests #191 and #193, ikeboy / Avi Eisenberg): + Derived from + research/source-assisted/decision/source_aligned_local.py + (icekylinx, GPT-6 Astra assistance, Apache-2.0). Only the three + frozen query modules change: this copy reads PR168 v4's selected + modules (eumemic, Claude assistance) from + references/paired-cube/sources instead of the PR168 fd25adb7 + modules. The local configuration, arc transport, frame + inheritance and physical layer code are unchanged. + + Notices of that NOTICE file that pertain to these data, quoted: + + Paired-cube and shared-core extension, 9 October 2026 + Copyright 2026 icekylinx + + Source-assisted common-frame extension (2026-10-09) + Copyright 2026 icekylinx. Apache-2.0. + Substantial dependency: eumemic PR168, + fd25adb7fbaa12ee761d02c733c54d1d2a7687ee + + The full text of both notices, and the notices of the work they build on, + are in the copy named above. The credits, with links and with the words of + pull request #193 about its own sources, are in README.md ("Whose circuit + this is") and in RELATED-WORK.md, section 1. + +7. Modified copies of upstream files (third and fourth results). + The files listed below are copies of files of openai/math at the commit + above, changed for this repository. Each begins with a comment that names + the upstream file it is derived from and states what was changed. The + upstream originals under lean/OAI/Computability/ are in this repository + as well, unchanged (section 1), and the copies import them. The upstream + challenge file lean/ComparatorChallenges/UniformFourier.lean is in this + repository in both forms: unchanged under third-party/openai-math/ + (section 1) and modified (section 2). + + - Work/Fourier/ArbitraryLength.lean: modified copy of + lean/OAI/Computability/FourierTransform/ArbitraryLength.lean (224 + lines; 159 of them unchanged in the copy). Changes: identifiers renamed + on 64 lines (18 names: 15 with the suffix Z, 3 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/Asymptotics.lean: modified copy of + lean/OAI/Computability/FourierTransform/Asymptotics.lean (187 lines; + 112 of them unchanged in the copy). Changes: identifiers renamed on 74 + lines (32 names: 26 with the suffix Z, 6 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + - Work/Fourier/Axioms.lean: written for this repository (not a copy of an + upstream file). + - Work/Fourier/ConvolutionProgram.lean: modified copy of + lean/OAI/Computability/FourierTransform/ConvolutionProgram.lean (100 + lines; 77 of them unchanged in the copy). Changes: identifiers renamed + on 22 lines (10 names: 9 with the suffix Z, 1 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/Goal.lean: written for this repository; contains lines of + upstream files: of its 7 code lines, 6 are lines of + lean/OAI/Computability/FourierTransform/Goal.lean (original lines 35, + 75-77, 79, 81): unchanged: its lines 25; with identifiers renamed: its + lines 21, 24, 26, 28, 30. + - Work/Fourier/Main.lean: modified copy of + lean/OAI/Computability/FourierTransform/Main.lean (151 lines; 90 of + them unchanged in the copy). Changes: identifiers renamed on 59 lines + (40 names: 35 with the suffix Z, 5 with Z inserted); 1 import line + replaced by 2; 24 comment lines added; other code lines changed: 1 of + the original, 1 of the copy (copy line 59). + - Work/Fourier/Seam.lean: written for this repository; contains lines of + upstream files: of its 122 code lines, 15 are lines of + lean/OAI/Computability/FourierTransform/TensorProgram.lean (original + lines 36-37, 95-96): unchanged: its lines 93-94, 113-114, 141-142, + 163-164, 185-187, 194-196; with identifiers renamed: its lines 184; 3 + are lines of lean/OAI/Computability/FourierTransform/TensorSaving.lean + (original lines 83-84, 114): with identifiers renamed: its lines 45-46, + 59; 1 is a line of lean/OAI/Computability/FourierTransform/Main.lean + (original line 60): with identifiers renamed: its lines 213. + - Work/Fourier/SectorAlgorithm.lean: modified copy of + lean/OAI/Computability/FourierTransform/SectorAlgorithm.lean (224 + lines; 162 of them unchanged in the copy). Changes: identifiers renamed + on 61 lines (17 names: 13 with the suffix Z, 4 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/SynchronizedAlgorithm.lean: modified copy of + lean/OAI/Computability/FourierTransform/SynchronizedAlgorithm.lean (126 + lines; 94 of them unchanged in the copy). Changes: identifiers renamed + on 31 lines (12 names: 10 with the suffix Z, 1 with Z inserted, 1 + other), the other being "canopy" to "Grove.canopy" (5 lines); 1 import + line replaced by 1; 16 comment lines added; no other change to the + code. + - Work/Fourier/TransformProgram.lean: modified copy of + lean/OAI/Computability/FourierTransform/TransformProgram.lean (146 + lines; 94 of them unchanged in the copy). Changes: identifiers renamed + on 51 lines (21 names: 19 with the suffix Z, 2 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/UniformBounds.lean: modified copy of + lean/OAI/Computability/FourierTransform/UniformBounds.lean (183 lines; + 115 of them unchanged in the copy). Changes: identifiers renamed on 67 + lines (29 names: 25 with the suffix Z, 4 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + - Work/Fourier/UniformFourierChallenge.lean: modified copy of + lean/ComparatorChallenges/UniformFourier.lean (336 lines; 328 of them + unchanged in the copy). Changes: identifiers renamed on 7 lines (7 + names: 7 with the suffix Z); 12 comment lines added; other code lines + changed: 1 of the original, 1 of the copy (copy line 281). + - Work/Fourier/WorkingCompiler.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingCompiler.lean (153 + lines; 104 of them unchanged in the copy). Changes: identifiers renamed + on 48 lines (14 names: 14 with the suffix Z); 1 import line replaced by + 1; 15 comment lines added; no other change to the code. + - Work/Fourier/WorkingPreparation.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingPreparation.lean (212 + lines; 156 of them unchanged in the copy). Changes: identifiers renamed + on 55 lines (30 names: 28 with the suffix Z, 2 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/WorkingTransform.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingTransform.lean (119 + lines; 91 of them unchanged in the copy). Changes: identifiers renamed + on 27 lines (9 names: 8 with the suffix Z, 1 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + + Changes made to the eleven copied proof files: every declaration received + the letter "Z" in its name (as a suffix of its own name, or of the name + of the declaration it belongs to), so that it does not collide with the + upstream declaration of the same name; the upstream exponent "alpha" + (1 - 2/10^11) and the bound "hills" defined from it were replaced by + "alphaZ" (1 - 7474547/10^10) and "hillsZ", which are defined in + Work/Fourier/Seam.lean, and the single use of the upstream theorem + "hills_program" by "hillsZ_program"; the five definitions of the upstream + statement that contain its exponent (decimalExponent, decimalTime, + TimeBounds, DFTGoal, ConvGoal) were replaced by the versions of + Work/Fourier/Goal.lean, whose exponent is 1 - 7474546/(10^(10:ℕ)); + the import lines point to the copies; a header comment was added. + Two further changes: in the copy of Main.lean the same constant stands + once as the literal 2/10^11 and was replaced there too, and the two + final theorems of that copy received a documentation comment; in the + copy of SynchronizedAlgorithm.lean the name "canopy" was written out as + "Grove.canopy" in 5 places, because the short name is shadowed in the + larger environment of the copy. The script also renamed three names + inside upstream comments; the comments are otherwise the upstream ones + and describe the upstream network. + The proofs are those of openai/math. The copies were made by the script + tools/fourier/mkchain.py of this repository. + + Work/Fourier/Goal.lean contains copies of those five definitions of + lean/OAI/Computability/FourierTransform/Goal.lean, with the exponent + replaced and the suffix "Z" on the five names. + + Work/Fourier/Seam.lean was written for this repository. It repeats the + statement of the upstream theorem "hills_program" (TensorProgram.lean) and + the definition of "hills" (TensorSaving.lean) with the two names replaced; + its header says so. + + Fourth result. The 15 files under Work/FourierE8/ repeat the 15 files + under Work/Fourier/ for the kernel program of the fourth result, file + for file and under the same file names: ArbitraryLength.lean, + Asymptotics.lean, ConvolutionProgram.lean, Goal.lean, Main.lean, + SectorAlgorithm.lean, SynchronizedAlgorithm.lean, TransformProgram.lean, + UniformBounds.lean, UniformFourierChallenge.lean, WorkingCompiler.lean, + WorkingPreparation.lean, WorkingTransform.lean, Seam.lean and + Axioms.lean. The eleven copied proof files, + Goal.lean and UniformFourierChallenge.lean are modified copies of the + same upstream files as their namesakes above, made by the script + tools/fourier/mkchain_e8.py (a copy of tools/fourier/mkchain.py with + its constants changed). The changes are those described above with + three differences: the suffix is "E8" where the copies of the third + result have "Z"; "alphaE8" is 1 - 8762479/10^10; and the exponent of + Work/FourierE8/Goal.lean is 1 - 8762478/(10^(10:ℕ)). Each of these + files begins with a comment that names the upstream file it is derived + from and states what was changed. Work/FourierE8/Seam.lean and + Work/FourierE8/Axioms.lean were written for this repository: they are + Work/Fourier/Seam.lean and Work/Fourier/Axioms.lean with names and + numbers replaced, and the seam repeats the same upstream statement and + definition as the seam of the third result. The proofs are those of + openai/math. + + The work of others that the third result follows (danadran01, shea256, + eumemic) is credited in README.md ("Whose reduction this is") and in + RELATED-WORK.md, section 1. No file of their repositories is included + here. + +8. The certificate of the fourth result and the search programs. + tools/certificate/gcert1-e8-r783.json.gz, the Lean data modules + generated from it (Work/GCert/Data/Gen/E8*.lean, Work/GCert/Data/Gen/E8/ + and the modules of Work/GCert/Data/ with E8 or B2Ge8 in their names) and + the Python programs under tools/e8/ were made by the agents for this + repository on 2026-10-10 (section 4). The circuit in that certificate + is not the circuit of section 6, and no data file of + CrocSwap/integer-mult-bounds was loaded to make it. It uses three + devices that were published by others in pull requests to that + repository: + - the in-place pair, a + b and a - b formed on the two arrays that held + a and b: icekylinx (#184), carried in #191 and #193 (ikeboy); + - the re-use of a finished helper with a compensating read: jamesyc + (#124) and eumemic (#143); + - the late pairing rule, the choice of which finished helper a new + value takes: Chafik Boukhalfa (the account chafreaky), #200 and #233, + and pull request #2 of this repository. The search programs apply the + idea with a greedy rule of their own; his program, his pairs and his + certificate were not used. + No program of that repository is included in tools/e8/, imported or + run by it. The programs of tools/e8/ have not been compared statement + by statement with the programs of that repository, as those of + tools/rebuild/ were (section 6). The integer programme of + tools/e8/ is solved with the open-source solver HiGHS, called through + SciPy (scipy.optimize.milp), with NumPy; none of the three is included + here. The credits, with links, are in README.md ("Whose ideas the new + unit uses") and in RELATED-WORK.md, section 8. + +Not included in this repository and fetched by the build: Mathlib +(https://github.com/leanprover-community/mathlib4, Apache License 2.0) and its +dependencies. The comparator (https://github.com/leanprover/comparator) is a +separate tool and is not included. diff --git a/research/e8-clean-padding/complex/gx/gx.py b/research/e8-clean-padding/complex/gx/gx.py new file mode 100644 index 0000000000..6d14c0a976 --- /dev/null +++ b/research/e8-clean-padding/complex/gx/gx.py @@ -0,0 +1,296 @@ +#!/usr/bin/python3 -I +"""gx.py. OWN code (imports nothing of port-producer, nothing outside). +(1) convert(c0): gcert/0 (port-producer's event list) -> gcert/1, the LEAN-FACING NORMAL FORM: + only the main phase (no read0 / undo / uninj: the invocation theorem derives the dirt gate and the undo + gate from the product), every gate an elementary fan-out or fan-in add, the 4x4 K block written as three + such adds plus a sign carried by one register, the star scatter as a table. +(2) check1(c1): the local decidable conditions of EXTENDED-CERT-SPEC.md on a gcert/1 file: + E0 sizes, E1 labels (nested subspaces by containment, equal frame at a gate), E2 scatter cut, + E3 shape (kinds of gates; X1; S1), E4 bracket rule S2, E5 scalar (x-content replay: hid and X3), + E6 price data (block histograms, N), E7 exterior gauges only (Q2). Raises AssertionError(": ..."). +""" +from fractions import Fraction as Fr +from collections import Counter +from math import lcm + + +def need(c, msg): + if not c: + raise AssertionError(msg) + + +def reduce(u, basis): + """basis: reduced echelon, pivot = leading bit, descending. Returns u modulo the span.""" + for b in basis: + if u >> (b.bit_length() - 1) & 1: + u ^= b + return u + + +def echelon_ok(f): + piv = [b.bit_length() - 1 for b in f] + if any(b == 0 for b in f) or piv != sorted(piv, reverse=True) or len(set(piv)) != len(piv): + return False + return all(not (b >> p & 1) for i, b in enumerate(f) for j, p in enumerate(piv) if i != j) + + +def inside(a, b): + return all(reduce(u, b) == 0 for u in a) + + +def par(x): + return bin(x).count("1") & 1 + + +KJ = [[[1, 2] if i == j else [-1, 2] for j in range(4)] for i in range(4)] + + +def convert(c0): + need(c0["format"] == "gcert/0", "input is not gcert/0") + v, h, R = c0["v"], c0["h"], c0["R"] + ev = c0["events"] + cen = [n for n, e in enumerate(ev) if e[0] == "centre"] + need(cen == list(range(cen[0], cen[0] + len(cen))), "centres are not contiguous: no single scatter cut") + A, B, ret = [], [], [] + neg = set() # x registers currently holding MINUS their value (between the two K blocks) + openq = {} + for n, e in enumerate(ev): + k = e[0] + out = A if n < cen[0] else B + if k in ("read0", "undo", "uninj"): + continue + if k == "inj": + need(e[2] not in neg, "inj reads a negated x register") + out.append(["out", e[3], e[2], [[e[1], 1, 1]], []]) + elif k == "op": + if e[3] == -1: + out.append(["neg", e[5], e[1]]) + else: + need(e[3] == 1, "op ca") + out.append(["out", e[5], e[2], [[e[1], e[4], 1]], []]) + elif k == "centre": + ret.append([e[2], e[1], e[3]]) + elif k == "gread": + hit = set(t for t, _, _ in e[3]) + out.append(["out", e[2], e[1], [[v + t, a, b] for t, a, b in e[3]], [v + t for t in e[4] if t not in hit]]) + elif k == "rread": + out.append(["out", e[2], e[1], [[v + t, a, b] for t, a, b in e[3]], []]) + elif k == "ysh": + out.append(["out", e[4], e[2], [[e[1], e[3], 1]], []]) + elif k == "yw": + out.append(["out", e[4], e[2], [[e[1], e[3][0], e[3][1]]], []]) + elif k == "kd": + out.append(["out", e[3], e[2], [[e[1], -1 if e[2] in neg else 1, 1]], []]) + elif k == "ktr": + q = tuple(e[1]) + need(e[2] == KJ, "ktr matrix is not 1 - J/2") + x1, rest = q[0], list(q[1:]) + if q not in openq: # first block: x := M x, register x1 keeps the sign + out.append(["in", e[3], x1, [[r, 1, 1] for r in rest]]) + out.append(["out", e[3], x1, [[r, -1, 2] for r in rest], []]) + out.append(["in", e[3], x1, [[r, 1, 1] for r in rest]]) + openq[q] = n + neg.add(x1) + else: # second block: the three adds undone in reverse order + out.append(["in", e[3], x1, [[r, -1, 1] for r in rest]]) + out.append(["out", e[3], x1, [[r, 1, 2] for r in rest], []]) + out.append(["in", e[3], x1, [[r, -1, 1] for r in rest]]) + del openq[q] + neg.discard(x1) + else: + raise AssertionError("unknown event kind %r" % k) + need(not openq and not neg, "a K block is not closed") + ext = sorted([z[3], z[1]] for z in c0["gauge"] if z[5]) + c1 = dict(format="gcert/1", derived_from=c0["name"] + " (gcert/0)", p=c0["p"], h=h, v=v, R=R, cst=c0["cst"], + N=c0["N"], ports=c0["ports"], frames=c0["frames"], start=c0["start"], final=c0["final"], + ext=ext, ret=sorted(ret), scat=dict(inside=c0["scat"]["inside"], outside=c0["scat"]["outside"]), + A=A, B=B, blocks=c0["blocks"]) + return c1 + + +def scat_row(c, t): + """the scatter of target t: [(k, coefficient)], from the table or from the star rule""" + sc = c["scat"] + if "table" in sc: + return [(k, Fr(a, b)) for k, a, b in sc["table"][t]] + sin, sout = Fr(*sc["inside"]), Fr(*sc["outside"]) + return [(k, sin if c["ports"][t] >> k & 1 else sout) for k in range(c["h"])] + + +def gate_regs(g): + if g[0] == "neg": + return [g[2]], [], [] + if g[0] == "out": + return [g[2]] + [t for t, _, _ in g[3]] + list(g[4]), [(t, g[2], Fr(a, b)) for t, a, b in g[3]], g[4] + if g[0] == "in": + return [g[2]] + [s for s, _, _ in g[3]], [(g[2], s, Fr(a, b)) for s, a, b in g[3]], [] + raise AssertionError("E0: unknown gate kind %r" % (g[0],)) + + +def check1(c, scalar=True, stats=None): + need(c.get("format") == "gcert/1", "E0: format") + h, v, R = c["h"], c["v"], c["R"] + nreg = 2 * v + R + ports, fr = c["ports"], [tuple(f) for f in c["frames"]] + need(len(ports) == v == len(set(ports)) and all(par(q) and 0 < q < 1 << h for q in ports), "E0: ports") + need(fr[0] == () and fr[1] == tuple(1 << i for i in range(h - 1, -1, -1)), "E0: frames 0 and 1") + need(all(echelon_ok(f) for f in fr) and len(set(fr)) == len(fr), "E0: frame table not reduced echelon / repeats") + dim = [len(f) for f in fr] + start, final = c["start"], c["final"] + need(len(start) == len(final) == nreg, "E0: start / final") + ext = {r: f for r, f in c["ext"]} + for t in range(v): + need(fr[start[t]] == (ports[t],) and final[t] == 1, "E1: x start / final") + f = fr[final[v + t]] + need(start[v + t] == 0 and len(f) == h - 1 and all(par(u & ports[t]) == 0 for u in f), "E1: y start / final") + for r in range(2 * v, nreg): + need(start[r] == ext.get(r, 0) and final[r] == 1, "E1: slot start / final") + cls = lambda r: "x" if r < v else "y" if r < 2 * v else "s" + cur = list(start) + H = {"x": Counter(), "y": Counter(), "s": Counter(), "c": Counter()} + steps = set() + + def climb(r, f, where): + o = cur[r] + if o != f: + if (o, f) not in steps: + need(dim[o] < dim[f] and inside(fr[o], fr[f]), "E1: step not nested (%s, register %d)" % (where, r)) + steps.add((o, f)) + H[cls(r)][dim[f] - dim[o]] += 1 + cur[r] = f + okind = {("x", "s"), ("s", "s"), ("s", "y"), ("x", "y"), ("x", "x"), ("y", "y")} + ysum, piv, ytg = Counter(), set(), set() + inc = 0 + for ph, gates in (("A", c["A"]), ("B", c["B"])): + if ph == "B": # ---- E2: the scatter cut + need(sorted(k for k, _, _ in c["ret"]) == list(range(len(c["ret"]))), "E2: retained totals numbered 0..") + if "table" in c["scat"]: + need(len(c["scat"]["table"]) == v and all(0 <= k < len(c["ret"]) for row in c["scat"]["table"] for k, _, _ in row), + "E2: scatter table") + else: + need(len(c["ret"]) == h, "E2: one retained total per coordinate (star rule)") + for k, s, f in c["ret"]: + need(cls(s) == "s" and cur[s] == f, "E2: retained slot %d is not at its frame" % s) + H["c"][dim[f]] += 1 + need(all(cur[v + t] == 0 for t in range(v)), "E2: a y role left frame 0 before the scatter") + for i, g in enumerate(gates): + regs, pairs, _ = gate_regs(g) + need(all(0 <= r < nreg for r in regs) and len(set(regs)) == len(regs), "E3: registers of gate %s%d" % (ph, i)) + inc += len(regs) + for r in regs: + climb(r, g[1], "%s%d" % (ph, i)) + for t, s, co in pairs: + kd = (cls(s), cls(t)) + need(kd in okind, "E3: gate kind %s -> %s (gate %s%d)" % (kd + (ph, i))) + need(ph == "B" or kd in {("x", "s"), ("s", "s")}, "E3: bank gate before the scatter (gate A%d)" % i) + if kd == ("y", "y"): + ysum[s, t] += co + piv.add(s) + ytg.add(t) + need(ph == "B" or all(cls(r) != "y" for r in regs), "E2: y role named in phase A") + for r in range(nreg): + climb(r, final[r], "final") + need(not (piv & ytg), "E4: a pivot is the target of a gate reading y") + need(all(x == 0 for x in ysum.values()), "E4: y-reads of a (pivot, target) pair do not cancel") + Hs = {k: {str(r): n for r, n in sorted(w.items())} for k, w in H.items()} + need(Hs == c["blocks"], "E6: block histograms") + N = sum(r * n for w in H.values() for r, n in w.items()) + tails = sum(dim[f] for f in ext.values()) + need(N == c["N"] and N + tails == R * h + 2 * v * (h - 1) + c["cst"], "E6: N") + if stats is not None: + stats.update(steps=len(steps), incidences=inc, blocks=sum(sum(w.values()) for w in H.values()), + step_work=sum(dim[a] * dim[b] for a, b in steps), ysh_pairs=len(ysum)) + if scalar: + scal(c, stats) + q2(c) + return True + + +def scal(c, stats=None): + """E5: exact replay of the x-content of every register through A, scatter, B.""" + h, v, R = c["h"], c["v"], c["R"] + nreg = 2 * v + R + reg = [({r: Fr(1)} if r < v else {}) for r in range(nreg)] + den = {"x": 1, "y": 1, "s": 1} + mx = {"x": Fr(0), "y": Fr(0), "s": Fr(0)} + cls = lambda r: "x" if r < v else "y" if r < 2 * v else "s" + + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: + d[k] = w + kk = cls(t) + if w.denominator != 1: + den[kk] = lcm(den[kk], w.denominator) + if abs(w) > mx[kk]: + mx[kk] = abs(w) + else: + d.pop(k, None) + + def run(gates): + for g in gates: + if g[0] == "neg": + reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == "out": + src = dict(reg[g[2]]) + for t, a, b in g[3]: + axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: + axpy(g[2], reg[s], Fr(a, b)) + run(c["A"]) + tot = {k: dict(reg[s]) for k, s, _ in c["ret"]} + for t in range(v): + for k, co in scat_row(c, t): + axpy(v + t, tot[k], co) + run(c["B"]) + need(all(reg[t] == {t: 1} for t in range(v)), "E5: an x role is not restored (X3)") + need(all(reg[v + t] == {t: 1} for t in range(v)), "E5: a target does not receive exactly its source (hid)") + if stats is not None: + stats.update(den=dict(den), maxabs={k: str(x) for k, x in mx.items()}, + gates_A=len(c["A"]), gates_B=len(c["B"])) + + +def q2(c): + """E7 (only for files with exterior gauges, rule (2)): for every slot q that starts off the zero frame, the + column of q in the y rows of the product is zero (its dirt is removed in line, the derived dirt gate at + frame 0 does not touch it). Replay with the gauged slots as variables, x = 0.""" + h, v, R = c["h"], c["v"], c["R"] + ext = [r for r, _ in c["ext"]] + if not ext: + return True + reg = [dict() for _ in range(2 * v + R)] + for r in ext: + reg[r] = {r: Fr(1)} + + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: + d[k] = w + else: + d.pop(k, None) + + def run(gates): + for g in gates: + if g[0] == "neg": + reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == "out": + src = dict(reg[g[2]]) + for t, a, b in g[3]: + axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: + axpy(g[2], reg[s], Fr(a, b)) + run(c["A"]) + tot = {k: dict(reg[s]) for k, s, _ in c["ret"]} + for t in range(v): + for k, co in scat_row(c, t): + if tot[k]: + axpy(v + t, tot[k], co) + run(c["B"]) + need(all(not reg[v + t] for t in range(v)), "E7: the dirt of an exterior-gauged slot reaches a y role (Q2)") + return True diff --git a/research/e8-clean-padding/complex/gx/gxcore.py b/research/e8-clean-padding/complex/gx/gxcore.py new file mode 100644 index 0000000000..3e3f0a3076 --- /dev/null +++ b/research/e8-clean-padding/complex/gx/gxcore.py @@ -0,0 +1,375 @@ +"""gxcore.py: gcert/1 JSON -> normal data D, PYTHON MIRROR of the two Lean checks +(label side: E0 frames, E1 pairs, E1/E2/E6 replay in segments; scalar side: E3 kinds, E4 bracket, E5 replay +in source batches, E7), derived data (distinct climbs, cut states, block histogram) and kernel sizes. +Own code; the reference is gx.py (check1), not imported. Python 3, standard library only.""" +import json, gzip +from collections import Counter +from math import gcd + + +class Reject(Exception): + pass + + +def need(c, msg): + if not c: + raise Reject(msg) + + +def load(path): + c = json.load(gzip.open(path, "rt") if path.endswith(".gz") else open(path)) + need(c.get("format") == "gcert/1", "E0: format is not gcert/1") + return c + + +def co(num, den): + need(den > 0, "E0: denominator") + return (num < 0, abs(num), den) + + +def normal(c): + """the Lean-facing data: gates as tuples, coefficients (neg, num, den), ret by total""" + def gate(g): + if g[0] == "out": + return ("out", g[1], g[2], [(t, co(a, b)) for t, a, b in g[3]], list(g[4])) + need(g[0] == "in", "E0: unknown gate kind %r" % (g[0],)) + return ("in", g[1], g[2], [(s, co(a, b)) for s, a, b in g[3]]) + ret = sorted(c["ret"]) + need([k for k, _, _ in ret] == list(range(len(ret))), "E2: retained totals numbered 0..") + sc = c["scat"] + scat = ("table", [[(k, co(a, b)) for k, a, b in row] for row in sc["table"]]) if "table" in sc else \ + ("star", co(*sc["inside"]), co(*sc["outside"])) + return dict(h=c["h"], v=c["v"], R=c["R"], N=c["N"], cst=c["cst"], ports=list(c["ports"]), + frames=[list(f) for f in c["frames"]], start=list(c["start"]), final=list(c["final"]), + ext=[tuple(e) for e in c.get("ext", [])], ret=[(s, f) for _, s, f in ret], scat=scat, + A=[gate(g) for g in c["A"]], B=[gate(g) for g in c["B"]], + blocks={k: {int(r): n for r, n in c["blocks"][k].items()} for k in "xysc"}) + + +def regs(g): + return [g[2]] + [t for t, _ in g[3]] + (g[4] if g[0] == "out" else []) + + +def adds(g): + """single adds (tgt, src, coef) in order""" + return [(t, g[2], k) for t, k in g[3]] if g[0] == "out" else [(g[2], s, k) for s, k in g[3]] + + +def reduce(u, basis): + for b in basis: + if u >> (b.bit_length() - 1) & 1: + u ^= b + return u + + +def echelon_ok(f): + piv = [b.bit_length() - 1 for b in f] + if any(b == 0 for b in f) or any(piv[i] <= piv[i + 1] for i in range(len(piv) - 1)): + return False + return all(not (b >> p & 1) for i, b in enumerate(f) for j, p in enumerate(piv) if i != j) + + +def par(x): + return bin(x).count("1") & 1 + + +def cls(D, r): + return "x" if r < D["v"] else "y" if r < 2 * D["v"] else "s" + + +# ---- label side ------------------------------------------------------------------------------------------ +def chk_frames(D): + """E0: ports; frame table reduced echelon, no repeats, zero first, full second""" + h, v, fr = D["h"], D["v"], D["frames"] + p = D["ports"] + need(len(p) == v == len(set(p)) and all(par(q) and 0 < q < 1 << h for q in p), "E0: ports") + need(len(fr) >= 2 and fr[0] == [] and fr[1] == [1 << i for i in range(h - 1, -1, -1)], "E0: frames 0 and 1") + need(all(echelon_ok(f) and all(b < 1 << h for b in f) for f in fr), "E0: frame table not reduced echelon") + need(len(set(map(tuple, fr))) == len(fr), "E0: frame table has repeats") + return [len(f) for f in fr] + + +def derive(D): + """distinct climbs in order of first use (NOT a check: plain replay of the frame ids)""" + cur, seen, pairs = list(D["start"]), set(), [] + + def go(r, f): + o = cur[r] + if o != f: + if (o, f) not in seen: + seen.add((o, f)) + pairs.append((o, f)) + cur[r] = f + for g in D["A"] + D["B"]: + for r in regs(g): + go(r, g[1]) + for r, f in enumerate(D["final"]): + go(r, f) + return pairs + + +def chk_pairs(D, dim, pairs): + """E1, level 2: every listed pair is a nested pair of the table; returns the mask-operation count""" + fr, n, work = D["frames"], len(D["frames"]), 0 + for a, b in pairs: + need(a < n and b < n and dim[a] < dim[b], "E1: pair (%d, %d) does not climb" % (a, b)) + need(all(reduce(u, fr[b]) == 0 for u in fr[a]), "E1: pair (%d, %d) is not nested" % (a, b)) + work += dim[a] * dim[b] + return work + + +def cut_points(D, gmax, wmax=210000): + """replay segments: each phase (A, B) is cut into k pieces of equal gate count, k = the least number with at + most `gmax` gates AND at most `wmax` work per piece on average (work = sum over gates of the dimension of the + gate's frame; measured at h = 22: about 1 ms of kernel time per unit, NOTES.md). + Cut points = gate counts in A ++ B (always 0, |A| and the end).""" + nA, nB = len(D["A"]), len(D["B"]) + cuts = [0] + for off, gs in ((0, D["A"]), (nA, D["B"])): + n = len(gs) + k = max(1, -(-n // gmax), -(-sum(len(D["frames"][g[1]]) for g in gs) // wmax)) + cuts += [off + (n * i) // k for i in range(1, k + 1)] + return sorted(set(cuts)) + + +def label_data(D, dim, cuts): + """for gx-labels (gcert-interface.md LABELS v1): ordered block ranks per replay segment, the final climbs as + gates without adds (same final frame, at most 32 registers, only registers that still climb), their ranks, + the largest number of registers named by one gate. Plain replay (the mirror has accepted the file).""" + cur, G = list(D["start"]), D["A"] + D["B"] + rs, most = [], 0 + for a, b in zip(cuts, cuts[1:]): + r = [] + for g in G[a:b]: + most = max(most, len(regs(g))) + for x in regs(g): + if cur[x] != g[1]: + r.append(dim[g[1]] - dim[cur[x]]) + cur[x] = g[1] + rs.append(r) + by = {} + for x, f in enumerate(D["final"]): + if cur[x] != f: + by.setdefault(f, []).append(x) + fins, rF = [], [] + for f in sorted(by): + for i in range(0, len(by[f]), 32): + xs = by[f][i:i + 32] + fins.append(("out", f, xs[0], [], xs[1:])) + rF += [dim[f] - dim[cur[x]] for x in xs] + return dict(rs=rs, fins=fins, rF=rF, most=max(most, 32 if fins else 0)) + + +def chk_replay(D, dim, pairs, cuts): + """E1 (labels), E2 (scatter cut), E6 (price), in the segments given by `cuts`. + Returns (states at the cuts, histogram by class, visits per segment).""" + h, v, R, fr = D["h"], D["v"], D["R"], D["frames"] + n = 2 * v + R + start, final, ext = D["start"], D["final"], dict(D["ext"]) + need(len(start) == len(final) == n, "E0: start / final") + for t in range(v): + need(fr[start[t]] == [D["ports"][t]] and final[t] == 1, "E1: x start / final") + f = fr[final[v + t]] + need(start[v + t] == 0 and len(f) == h - 1 and all(par(u & D["ports"][t]) == 0 for u in f), "E1: y start / final") + for r in range(2 * v, n): + need(start[r] == ext.get(r, 0) and final[r] == 1, "E1: slot start / final") + ok = set(pairs) + need(len(ok) == len(pairs), "E1: pair list has repeats") + cur = list(start) + H = {k: Counter() for k in "xysc"} + + def climb(r, f, where): + o = cur[r] + if o != f: + need((o, f) in ok, "E1: climb (%d, %d) is not a tested pair (%s, register %d)" % (o, f, where, r)) + H[cls(D, r)][dim[f] - dim[o]] += 1 + seg[dim[f] - dim[o]] += 1 + cur[r] = f + seg, segs = Counter(), [] + G, nA = D["A"] + D["B"], len(D["A"]) + states, visits = [], [] + need(cuts[0] == 0 and cuts[-1] == len(G) and cuts == sorted(cuts), "cut points") + for a, b in zip(cuts, cuts[1:]): + states.append(list(cur)) + vs = 0 + for i in range(a, b): + if i == nA: + scatter_cut(D, cur, dim, H, seg) + g = G[i] + rs = regs(g) + need(all(0 <= r < n for r in rs) and len(set(rs)) == len(rs), "E3: registers of gate %d" % i) + need(i >= nA or all(r < v or r >= 2 * v for r in rs), "E2: y role named in phase A (gate %d)" % i) + vs += len(rs) + for r in rs: + climb(r, g[1], "gate %d" % i) + visits.append(vs) + if b < len(G): + segs.append(seg) + seg = Counter() + if nA == len(G): + scatter_cut(D, cur, dim, H, seg) + states.append(list(cur)) + for r in range(n): + climb(r, final[r], "final") + segs.append(seg) + Hb = {k: dict(sorted(w.items())) for k, w in H.items()} + need(Hb == D["blocks"], "E6: block histogram differs from `blocks`") + N = sum(r * c for w in H.values() for r, c in w.items()) + need(N == D["N"] and N + sum(dim[f] for f in ext.values()) == R * h + 2 * v * (h - 1) + D["cst"], "E6: N") + need(sum(r * c for r, c in H["c"].items()) == D["cst"], "E6: cst") + return states, Hb, visits, [[w[r] for r in range(h + 1)] for w in segs] + + +def scatter_cut(D, cur, dim, H, seg): + v = D["v"] + if D["scat"][0] == "table": + need(len(D["scat"][1]) == v and all(k < len(D["ret"]) for row in D["scat"][1] for k, _ in row), "E2: scatter table") + else: + need(len(D["ret"]) == D["h"], "E2: one retained total per coordinate (star rule)") + for s, f in D["ret"]: + need(s >= 2 * v and cur[s] == f, "E2: retained slot %d is not at its frame" % s) + H["c"][dim[f]] += 1 + seg[dim[f]] += 1 + need(all(cur[v + t] == 0 for t in range(v)), "E2: a y role left frame 0 before the scatter") + + +# ---- scalar side ----------------------------------------------------------------------------------------- +SC = 6 # all scalar entries are kept as integers in units of 1/6 +KINDS = {("x", "s"), ("s", "s"), ("s", "y"), ("x", "y"), ("x", "x"), ("y", "y")} + + +def chk_shape(D): + """E3 kinds, E4 bracket""" + ysum, piv, ytg = Counter(), set(), set() + for ph in "AB": + for i, g in enumerate(D[ph]): + for t, s, (ng, a, b) in adds(g): + kd = (cls(D, s), cls(D, t)) + need(kd in KINDS and t != s, "E3: gate kind %s -> %s (gate %s%d)" % (kd + (ph, i))) + need(ph == "B" or kd in {("x", "s"), ("s", "s")}, "E3: bank gate before the scatter (gate A%d)" % i) + if kd == ("y", "y"): + need(SC % b == 0, "E4: denominator beyond sixths") + ysum[s, t] += (-a if ng else a) * (SC // b) + piv.add(s) + ytg.add(t) + need(not (piv & ytg), "E4: a pivot is the target of a gate reading y") + need(all(x == 0 for x in ysum.values()), "E4: y-reads of a (pivot, target) pair do not cancel") + return len(ysum) + + +def scat_row(D, t): + sc = D["scat"] + if sc[0] == "table": + return sc[1][t] + return [(k, sc[1] if D["ports"][t] >> k & 1 else sc[2]) for k in range(D["h"])] + + + +def replay(D, init, count=None): + """exact replay through A, scatter, B of sparse vectors with entries in sixths; `init` = register -> {key: 6}""" + v = D["v"] + reg = [dict(init.get(r, ())) for r in range(2 * v + D["R"])] + + def axpy(t, src, k): + ng, a, b = k + d = reg[t] + for key, u in src.items(): + w = u * a + need(w % b == 0, "E5: an entry needs a denominator beyond sixths (register %d)" % t) + w = w // b + w = d.get(key, 0) + (-w if ng else w) + if count is not None: + count[key] += 1 + if w: + d[key] = w + else: + d.pop(key, None) + + def run(gates): + for g in gates: + if g[0] == "out": + src = dict(reg[g[2]]) + for t, k in g[3]: + axpy(t, src, k) + else: + for s, k in g[3]: + axpy(g[2], reg[s], k) + run(D["A"]) + afterA = sum(len(d) for d in reg) + tot = [dict(reg[s]) for s, _ in D["ret"]] + for t in range(v): + for k, cf in scat_row(D, t): + if tot[k]: + axpy(v + t, tot[k], cf) + run(D["B"]) + return reg, afterA + + +def chk_scalar(D, batches=1): + """E5 (+ E7 when `ext` is non-empty). Returns stats: denominators and largest numerators per class in the + units of the spec (x halves, y sixths, slots integers), updates per source batch, entries after A.""" + v = D["v"] + count = Counter() + reg, afterA = replay(D, {t: {t: SC} for t in range(v)}, count) + need(all(reg[t] == {t: SC} for t in range(v)), "E5: an x role is not restored (X3)") + need(all(reg[v + t] == {t: SC} for t in range(v)), "E5: a target does not receive exactly its source (hid)") + if D["ext"]: + rg, _ = replay(D, {r: {r: SC} for r, _ in D["ext"]}) + need(all(not rg[v + t] for t in range(v)), "E7: the dirt of an exterior-gauged slot reaches a y role") + step = -(-v // batches) + per = [sum(count[k] for k in range(lo, min(lo + step, v))) for lo in range(0, v, step)] + return dict(updates=sum(count.values()), per_batch=per, afterA=afterA, + batches=[(lo, min(lo + step, v)) for lo in range(0, v, step)]) + + +def digits(D): + """largest |entry| met and denominators per class, by a second replay that watches every write (slow path + kept separate from the check): returns {class: (lcm of denominators, largest |numerator| in units 1/den)}""" + v = D["v"] + den = {"x": 1, "y": 1, "s": 1} + mx = {"x": 0, "y": 0, "s": 0} + reg = [({r: SC} if r < v else {}) for r in range(2 * v + D["R"])] + + def axpy(t, src, k): + ng, a, b = k + d, kk = reg[t], cls(D, t) + for key, u in src.items(): + w = d.get(key, 0) + (-(u * a // b) if ng else u * a // b) + if w: + d[key] = w + q = SC // gcd(w, SC) + if den[kk] % q: + den[kk] = den[kk] * q // gcd(den[kk], q) + if abs(w) > mx[kk]: + mx[kk] = abs(w) + else: + d.pop(key, None) + for g in D["A"]: + for t, s, k in adds(g): + axpy(t, reg[s], k) + tot = [dict(reg[s]) for s, _ in D["ret"]] + for t in range(v): + for k, cf in scat_row(D, t): + axpy(v + t, tot[k], cf) + for g in D["B"]: + for t, s, k in adds(g): + axpy(t, reg[s], k) + return {k: (den[k], mx[k] * den[k] // SC if (mx[k] * den[k]) % SC == 0 else "%d/6" % mx[k]) for k in "xys"} + + +def mirror(D, gmax=12000, batches=1, pairs=None, cuts=None): + """both checks; returns everything the generator and the dry run need""" + dim = chk_frames(D) + pairs = derive(D) if pairs is None else pairs + work = chk_pairs(D, dim, pairs) + cuts = cut_points(D, gmax) if cuts is None else cuts + states, H, visits, segH = chk_replay(D, dim, pairs, cuts) + ysh = chk_shape(D) + S = chk_scalar(D, batches) + hist = Counter() + for k in "xysc": + for r, n in H[k].items(): + hist[r] += n + return dict(dim=dim, pairs=pairs, pair_work=work, cuts=cuts, states=states, H=H, visits=visits, ysh=ysh, + scal=S, hist=dict(sorted(hist.items())), segH=segH, + lab=label_data(D, dim, cuts)) diff --git a/research/e8-clean-padding/data/bit/bitE8-kernel.json.gz b/research/e8-clean-padding/data/bit/bitE8-kernel.json.gz new file mode 100644 index 0000000000..22141be33d Binary files /dev/null and b/research/e8-clean-padding/data/bit/bitE8-kernel.json.gz differ diff --git a/research/e8-clean-padding/data/gcert1-e8-r783-far.json.gz b/research/e8-clean-padding/data/gcert1-e8-r783-far.json.gz new file mode 100644 index 0000000000..56708f99a4 Binary files /dev/null and b/research/e8-clean-padding/data/gcert1-e8-r783-far.json.gz differ diff --git a/research/e8-clean-padding/data/pr390/LICENSE-pr390 b/research/e8-clean-padding/data/pr390/LICENSE-pr390 new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-padding/data/pr390/LICENSE-pr390 @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-padding/data/pr390/prefix18.json.gz b/research/e8-clean-padding/data/pr390/prefix18.json.gz new file mode 100644 index 0000000000..51f3ea73e0 Binary files /dev/null and b/research/e8-clean-padding/data/pr390/prefix18.json.gz differ diff --git a/research/e8-clean-padding/data/pr390/prewhite.json b/research/e8-clean-padding/data/pr390/prewhite.json new file mode 100644 index 0000000000..527a2ea461 --- /dev/null +++ b/research/e8-clean-padding/data/pr390/prewhite.json @@ -0,0 +1 @@ +{"checks":{"all_columns":1023,"clean_target_entries":14400,"helper_dirty_entries":613089,"source_entries":122760},"coefficient_bill":{"denominators":[1,2,3,4,6],"max_denominator_bits":3,"max_numerator_bits":2,"pre_post_real_primitive_upper":61161},"main_gates":3922,"n":1023,"post_full_helper_clean_repair_gates":[[240,0,-1,2],[240,1,-1,2],[240,4,-1,2],[240,5,-1,2],[240,9,-1,2],[240,14,-1,2],[240,22,-1,2],[240,23,-1,2],[240,29,1,2],[240,34,1,2],[240,40,1,2],[240,41,1,2],[240,54,1,2],[240,64,1,2],[240,74,1,2],[240,75,1,2],[241,0,-1,2],[241,99,-1,2],[241,109,-1,2],[242,0,1,2],[242,1,-1,2],[243,1,-1,2],[243,99,1,2],[243,104,-1,2],[244,2,-1,2],[244,3,-1,2],[244,4,-1,2],[244,5,-1,2],[244,13,-1,2],[244,14,-1,2],[244,15,-1,2],[244,16,-1,2],[244,29,1,2],[244,30,1,2],[244,31,1,2],[244,32,1,2],[244,49,1,2],[244,50,1,2],[244,51,1,2],[244,52,1,2],[245,2,-1,1],[245,49,1,1],[245,77,1,1],[245,110,1,1],[245,116,-1,1],[246,2,-1,1],[246,50,1,1],[246,77,-1,1],[246,110,-1,1],[246,113,-1,1],[247,2,1,2],[247,3,-1,2],[248,3,-1,1],[248,50,1,1],[248,80,1,1],[248,110,-1,1],[248,113,-1,1],[249,3,-1,1],[249,49,1,1],[249,77,1,1],[249,110,1,1],[249,113,1,1],[250,4,-1,1],[250,5,-1,1],[250,74,-1,1],[250,75,-1,1],[251,4,-1,1],[251,51,1,1],[251,74,1,1],[251,117,1,1],[251,119,-1,1],[252,4,1,2],[252,5,-1,2],[253,5,-1,1],[253,52,1,1],[253,75,1,1],[253,117,-1,1],[253,118,-1,1],[254,4,-1,1],[254,5,-1,1],[254,51,1,1],[254,52,1,1],[255,6,-1,1],[255,12,-1,1],[255,17,-1,1],[255,21,-1,1],[255,24,-1,1],[255,62,1,1],[255,72,1,1],[255,81,1,1],[255,85,-1,1],[255,86,-1,1],[255,87,-1,1],[255,88,-1,1],[255,102,-1,1],[255,107,-1,1],[255,111,-1,1],[256,6,-1,1],[256,12,-1,1],[256,38,1,1],[256,53,1,1],[257,4,-1,1],[257,5,-1,1],[257,9,-1,1],[257,14,-1,1],[257,30,-1,1],[257,35,-1,1],[257,51,1,1],[257,52,1,1],[257,78,1,1],[257,79,1,1],[257,83,1,1],[257,114,-1,1],[257,115,-1,1],[258,7,-1,2],[258,9,-1,2],[258,13,1,2],[258,18,1,2],[258,28,-1,2],[258,30,-1,2],[258,34,1,2],[258,39,1,2],[258,51,-1,2],[258,52,-1,2],[258,58,-1,2],[258,59,-1,2],[258,65,1,2],[258,66,1,2],[258,74,1,2],[258,75,1,2],[259,7,-1,2],[259,84,-1,2],[259,98,-1,2],[260,8,-1,1],[260,14,-1,1],[261,8,-1,1],[261,34,-1,1],[262,4,1,2],[262,5,1,2],[262,8,-1,2],[262,9,-1,2],[262,29,-1,2],[262,30,-1,2],[262,72,1,2],[262,73,1,2],[262,74,-1,2],[262,75,-1,2],[262,87,1,2],[262,88,1,2],[262,94,1,2],[262,95,1,2],[262,102,-1,2],[262,103,-1,2],[263,8,-1,1],[263,9,-1,1],[263,13,-1,1],[263,14,-1,1],[263,47,1,1],[263,48,1,1],[263,51,-1,1],[263,52,-1,1],[263,74,1,1],[263,75,1,1],[263,89,-1,1],[263,90,-1,1],[263,100,-1,1],[263,101,-1,1],[263,105,-1,1],[263,106,-1,1],[264,10,-1,1],[264,16,-1,1],[265,10,-1,1],[265,36,-1,1],[266,2,1,2],[266,3,1,2],[266,10,-1,2],[266,11,-1,2],[266,31,-1,2],[266,32,-1,2],[266,67,1,2],[266,70,1,2],[266,77,-1,2],[266,80,-1,2],[266,89,1,2],[266,90,1,2],[266,96,1,2],[266,97,1,2],[266,100,-1,2],[266,101,-1,2],[267,10,-1,1],[267,11,-1,1],[267,15,-1,1],[267,16,-1,1],[267,42,1,1],[267,45,1,1],[267,49,-1,1],[267,50,-1,1],[267,77,1,1],[267,80,1,1],[267,87,-1,1],[267,88,-1,1],[267,102,-1,1],[267,103,-1,1],[267,107,-1,1],[267,108,-1,1],[268,12,-1,1],[268,17,1,1],[268,33,-1,1],[268,38,1,1],[268,85,1,1],[268,86,-1,1],[268,92,1,1],[268,93,-1,1],[269,9,1,2],[269,13,-1,2],[269,29,-1,2],[269,35,-1,2],[270,7,-1,2],[270,9,1,2],[270,13,-1,2],[270,18,1,2],[270,28,-1,2],[270,30,1,2],[270,34,-1,2],[270,39,1,2],[270,51,-1,2],[270,52,-1,2],[270,58,1,2],[270,59,1,2],[270,65,-1,2],[270,66,-1,2],[270,74,1,2],[270,75,1,2],[271,4,1,2],[271,5,1,2],[271,8,-1,2],[271,13,-1,2],[271,29,-1,2],[271,34,-1,2],[271,51,-1,2],[271,52,-1,2],[271,53,-1,2],[271,81,1,2],[271,82,1,2],[271,83,1,2],[271,86,1,2],[271,92,1,2],[271,111,-1,2],[271,112,-1,2],[272,8,1,2],[272,14,-1,2],[272,30,-1,2],[272,34,-1,2],[273,7,-1,2],[273,8,1,2],[273,14,-1,2],[273,18,1,2],[273,28,-1,2],[273,29,1,2],[273,35,-1,2],[273,39,1,2],[273,51,-1,2],[273,52,-1,2],[273,55,1,2],[273,56,1,2],[273,68,-1,2],[273,69,-1,2],[273,74,1,2],[273,75,1,2],[274,4,1,2],[274,5,1,2],[274,9,-1,2],[274,14,-1,2],[274,30,-1,2],[274,35,-1,2],[274,51,-1,2],[274,52,-1,2],[274,78,1,2],[274,79,1,2],[274,83,1,2],[274,114,-1,2],[274,115,-1,2],[275,11,1,2],[275,15,-1,2],[275,31,-1,2],[275,37,-1,2],[276,7,1,2],[276,11,1,2],[276,15,-1,2],[276,25,-1,2],[276,28,1,2],[276,32,1,2],[276,36,-1,2],[276,46,-1,2],[276,49,1,2],[276,50,1,2],[276,56,1,2],[276,59,1,2],[276,65,-1,2],[276,68,-1,2],[276,77,-1,2],[276,80,-1,2],[277,2,-1,2],[277,3,-1,2],[277,6,-1,2],[277,10,-1,2],[277,15,-1,2],[277,31,-1,2],[277,36,-1,2],[277,53,1,2],[277,76,1,2],[277,79,1,2],[277,82,1,2],[277,85,-1,2],[277,86,-1,2],[277,92,-1,2],[277,93,-1,2],[277,111,1,2],[277,114,1,2],[278,10,1,2],[278,16,-1,2],[278,32,-1,2],[278,36,-1,2],[279,7,-1,2],[279,10,1,2],[279,16,-1,2],[279,25,1,2],[279,28,-1,2],[279,31,1,2],[279,37,-1,2],[279,46,1,2],[279,49,-1,2],[279,50,-1,2],[279,55,1,2],[279,58,1,2],[279,66,-1,2],[279,69,-1,2],[279,77,1,2],[279,80,1,2],[280,2,-1,2],[280,3,-1,2],[280,11,-1,2],[280,16,-1,2],[280,32,-1,2],[280,37,-1,2],[280,76,1,2],[280,78,1,2],[280,81,1,2],[280,112,1,2],[280,115,1,2],[281,6,1,2],[281,17,-1,2],[281,33,1,2],[281,53,-1,2],[282,17,-1,2],[282,33,-1,2],[282,85,1,2],[282,93,1,2],[283,7,1,1],[283,18,-1,1],[283,25,1,1],[283,84,1,1],[283,98,-1,1],[284,18,-1,1],[284,39,-1,1],[285,19,-1,1],[285,41,-1,1],[286,19,-1,1],[286,43,-1,1],[287,0,-1,1],[287,1,-1,1],[287,19,-1,1],[287,20,-1,1],[287,22,-1,1],[287,23,-1,1],[287,33,1,1],[287,38,1,1],[287,53,1,1],[287,76,1,1],[287,78,1,1],[287,79,1,1],[287,81,1,1],[287,82,1,1],[287,83,1,1],[287,85,-1,1],[287,86,-1,1],[287,104,-1,1],[287,109,-1,1],[288,0,-1,2],[288,1,-1,2],[288,19,-1,2],[288,20,-1,2],[288,40,-1,2],[288,41,-1,2],[288,60,1,2],[288,61,1,2],[288,70,1,2],[288,71,1,2],[288,89,-1,2],[288,90,-1,2],[288,96,-1,2],[288,97,-1,2],[288,100,1,2],[288,105,1,2],[289,19,-1,2],[289,21,-1,2],[289,22,-1,2],[289,24,-1,2],[289,40,-1,2],[289,42,-1,2],[289,43,-1,2],[289,45,-1,2],[289,61,1,2],[289,63,1,2],[289,71,1,2],[289,73,1,2],[289,102,1,2],[289,104,1,2],[289,107,1,2],[289,109,1,2],[290,21,-1,1],[290,45,-1,1],[290,87,1,1],[290,95,-1,1],[291,21,-1,1],[291,24,-1,1],[291,26,-1,1],[291,27,-1,1],[291,57,-1,1],[291,60,-1,1],[291,62,-1,1],[291,63,-1,1],[291,87,-1,1],[291,88,-1,1],[291,89,-1,1],[291,90,-1,1],[291,100,-1,1],[291,101,-1,1],[291,102,-1,1],[291,103,-1,1],[292,19,-1,2],[292,20,1,2],[292,22,-1,2],[292,23,1,2],[292,40,-1,2],[292,41,1,2],[292,43,-1,2],[292,44,1,2],[292,55,-1,2],[292,56,1,2],[292,58,-1,2],[292,59,1,2],[292,65,-1,2],[292,66,1,2],[292,68,-1,2],[292,69,1,2],[293,0,-1,2],[293,1,-1,2],[293,19,-1,2],[293,22,-1,2],[293,40,-1,2],[293,43,-1,2],[293,54,1,2],[293,63,1,2],[293,64,1,2],[293,73,1,2],[293,87,-1,2],[293,88,-1,2],[293,94,-1,2],[293,95,-1,2],[293,102,1,2],[293,107,1,2],[294,22,-1,1],[294,44,-1,1],[295,19,1,2],[295,23,-1,2],[295,41,1,2],[295,43,1,2],[296,0,-1,2],[296,1,-1,2],[296,20,-1,2],[296,23,-1,2],[296,41,-1,2],[296,44,-1,2],[296,54,1,2],[296,62,1,2],[296,64,1,2],[296,72,1,2],[296,87,-1,2],[296,88,-1,2],[296,94,-1,2],[296,95,-1,2],[296,103,1,2],[296,108,1,2],[297,0,-1,2],[297,1,-1,2],[297,22,-1,2],[297,23,-1,2],[297,43,-1,2],[297,44,-1,2],[297,57,1,2],[297,61,1,2],[297,67,1,2],[297,71,1,2],[297,89,-1,2],[297,90,-1,2],[297,96,-1,2],[297,97,-1,2],[297,101,1,2],[297,106,1,2],[298,24,-1,2],[298,42,-1,2],[298,88,-1,2],[298,94,1,2],[299,21,1,2],[299,24,-1,2],[299,42,1,2],[299,45,-1,2],[300,18,-1,2],[300,25,-1,2],[300,28,1,2],[300,84,-1,2],[300,91,-1,2],[301,7,1,2],[301,25,-1,2],[301,28,1,2],[301,46,-1,2],[301,49,1,2],[301,50,1,2],[301,77,-1,2],[301,80,-1,2],[302,18,1,2],[302,20,1,2],[302,22,-1,2],[302,25,-1,2],[302,39,1,2],[302,41,1,2],[302,43,-1,2],[302,46,-1,2],[302,54,1,2],[302,56,1,2],[302,58,-1,2],[302,61,-1,2],[302,64,1,2],[302,66,1,2],[302,68,-1,2],[302,71,-1,2],[303,19,-1,2],[303,20,-1,2],[303,26,-1,2],[303,27,-1,2],[303,40,-1,2],[303,41,-1,2],[303,47,-1,2],[303,48,-1,2],[303,54,1,2],[303,60,1,2],[303,64,1,2],[303,70,1,2],[303,100,1,2],[303,104,1,2],[303,105,1,2],[303,109,1,2],[304,26,-1,1],[304,48,-1,1],[304,89,1,1],[304,97,-1,1],[305,21,-1,2],[305,26,-1,2],[305,42,-1,2],[305,47,-1,2],[305,57,-1,2],[305,62,-1,2],[305,67,-1,2],[305,72,-1,2],[305,87,1,2],[305,89,1,2],[305,94,1,2],[305,96,1,2],[305,100,1,2],[305,102,1,2],[305,105,1,2],[305,107,1,2],[306,27,-1,2],[306,47,-1,2],[306,90,-1,2],[306,96,1,2],[307,55,-1,1],[307,58,-1,1],[307,65,-1,1],[307,68,-1,1],[308,7,1,2],[308,28,-1,2],[309,28,-1,2],[309,84,1,2],[309,91,-1,2],[310,0,-1,2],[310,1,-1,2],[310,4,-1,2],[310,5,-1,2],[310,9,1,2],[310,14,1,2],[310,22,1,2],[310,23,1,2],[310,29,-1,2],[310,34,-1,2],[310,40,-1,2],[310,41,-1,2],[310,54,1,2],[310,64,1,2],[310,74,1,2],[310,75,1,2],[311,8,1,2],[311,9,1,2],[311,10,1,2],[311,11,1,2],[311,13,1,2],[311,14,1,2],[311,15,1,2],[311,16,1,2],[311,29,-1,2],[311,30,-1,2],[311,31,-1,2],[311,32,-1,2],[311,34,-1,2],[311,35,-1,2],[311,36,-1,2],[311,37,-1,2],[312,29,-1,1],[312,35,-1,1],[313,8,1,2],[313,14,1,2],[313,30,-1,2],[313,34,1,2],[314,14,1,2],[314,30,-1,2],[315,26,1,1],[315,27,1,1],[315,29,-1,1],[315,30,-1,1],[315,34,-1,1],[315,35,-1,1],[315,51,1,1],[315,52,1,1],[315,74,-1,1],[315,75,-1,1],[315,96,-1,1],[315,97,-1,1],[315,100,1,1],[315,101,1,1],[315,105,1,1],[315,106,1,1],[316,0,1,2],[316,1,1,2],[316,2,1,2],[316,3,1,2],[316,11,1,2],[316,16,1,2],[316,20,1,2],[316,23,1,2],[316,31,-1,2],[316,36,-1,2],[316,40,-1,2],[316,43,-1,2],[316,61,-1,2],[316,71,-1,2],[316,77,-1,2],[316,80,-1,2],[317,15,1,2],[317,16,1,2],[317,31,-1,2],[317,32,-1,2],[318,31,-1,1],[318,37,-1,1],[319,10,1,2],[319,16,1,2],[319,32,-1,2],[319,36,1,2],[320,16,1,2],[320,32,-1,2],[321,21,1,1],[321,24,1,1],[321,31,-1,1],[321,32,-1,1],[321,36,-1,1],[321,37,-1,1],[321,49,1,1],[321,50,1,1],[321,77,-1,1],[321,80,-1,1],[321,94,-1,1],[321,95,-1,1],[321,102,1,1],[321,103,1,1],[321,107,1,1],[321,108,1,1],[322,6,1,2],[322,17,1,2],[322,33,-1,2],[322,53,-1,2],[323,12,1,2],[323,17,1,2],[323,33,-1,2],[323,38,-1,2],[323,85,1,2],[323,86,1,2],[323,92,-1,2],[323,93,-1,2],[324,8,1,2],[324,9,1,2],[324,10,1,2],[324,11,1,2],[324,34,-1,2],[324,35,-1,2],[324,36,-1,2],[324,37,-1,2],[325,30,1,2],[325,34,-1,2],[326,9,-1,2],[326,13,1,2],[326,29,-1,2],[326,35,-1,2],[327,9,1,2],[327,35,-1,2],[328,29,1,2],[328,35,-1,2],[329,10,1,2],[329,11,1,2],[329,36,-1,2],[329,37,-1,2],[330,32,1,2],[330,36,-1,2],[331,11,-1,2],[331,15,1,2],[331,31,-1,2],[331,37,-1,2],[332,11,1,2],[332,37,-1,2],[333,31,1,2],[333,37,-1,2],[334,12,-1,2],[334,38,-1,2],[334,86,-1,2],[334,92,-1,2],[335,38,-1,1],[335,53,-1,1],[335,86,1,1],[336,18,1,2],[336,39,-1,2],[337,28,1,1],[337,39,-1,1],[337,46,1,1],[337,84,-1,1],[337,91,-1,1],[338,20,1,2],[338,22,-1,2],[338,40,-1,2],[338,44,-1,2],[339,20,1,2],[339,23,1,2],[339,40,-1,2],[339,43,-1,2],[340,22,1,2],[340,23,1,2],[340,40,-1,2],[340,41,-1,2],[341,19,1,2],[341,23,-1,2],[341,41,-1,2],[341,43,-1,2],[342,19,1,2],[342,22,1,2],[342,41,-1,2],[342,44,-1,2],[343,23,1,2],[343,41,-1,2],[344,24,1,2],[344,42,-1,2],[344,88,1,2],[344,94,1,2],[345,42,-1,1],[345,45,-1,1],[345,87,1,1],[345,88,1,1],[346,19,1,2],[346,20,1,2],[346,43,-1,2],[346,44,-1,2],[347,23,1,2],[347,43,-1,2],[348,20,-1,2],[348,22,-1,2],[348,40,1,2],[348,44,-1,2],[349,20,1,2],[349,44,-1,2],[350,22,1,2],[350,44,-1,2],[351,21,1,2],[351,45,-1,2],[351,88,1,2],[351,94,-1,2],[352,25,1,2],[352,46,-1,2],[353,7,1,2],[353,39,-1,2],[353,46,-1,2],[353,84,1,2],[353,98,-1,2],[354,27,1,2],[354,47,-1,2],[354,90,1,2],[354,96,1,2],[356,26,1,2],[356,48,-1,2],[356,90,1,2],[356,96,-1,2],[357,2,-1,2],[357,49,-1,2],[357,80,1,2],[357,110,-1,2],[357,113,-1,2],[358,2,-1,1],[358,3,-1,1],[358,6,-1,1],[358,10,1,1],[358,15,1,1],[358,31,1,1],[358,36,1,1],[358,53,1,1],[358,76,-1,1],[358,79,-1,1],[358,82,-1,1],[358,85,-1,1],[358,86,-1,1],[358,92,-1,1],[358,93,-1,1],[358,111,-1,1],[358,114,-1,1],[359,3,-1,2],[359,50,-1,2],[359,77,1,2],[359,110,1,2],[359,116,-1,2],[360,49,1,2],[360,50,-1,2],[361,4,-1,2],[361,51,-1,2],[361,75,1,2],[361,117,-1,2],[361,118,-1,2],[362,51,-1,1],[362,52,-1,1],[362,74,1,1],[362,75,1,1],[363,5,-1,2],[363,52,-1,2],[363,74,1,2],[363,117,1,2],[363,119,-1,2],[364,51,1,2],[364,52,-1,2],[365,12,1,1],[365,53,-1,1],[366,33,1,2],[366,53,-1,2],[367,2,-1,1],[367,3,-1,1],[367,11,1,1],[367,16,1,1],[367,32,1,1],[367,37,1,1],[367,76,-1,1],[367,78,-1,1],[367,81,-1,1],[367,112,-1,1],[367,115,-1,1],[368,0,1,1],[368,54,-1,1],[368,61,1,1],[368,99,1,1],[368,109,-1,1],[369,54,-1,1],[369,64,-1,1],[370,0,-1,1],[370,54,-1,1],[370,71,1,1],[370,99,-1,1],[370,104,-1,1],[371,55,-1,1],[371,59,-1,1],[372,55,-1,1],[372,68,-1,1],[373,18,1,1],[373,24,1,1],[373,39,1,1],[373,45,1,1],[373,55,-1,1],[373,56,-1,1],[373,62,-1,1],[373,63,-1,1],[373,65,-1,1],[373,66,-1,1],[373,72,-1,1],[373,73,-1,1],[373,87,1,1],[373,91,1,1],[373,94,1,1],[373,98,1,1],[374,6,1,1],[374,7,1,1],[374,17,1,1],[374,28,1,1],[374,38,1,1],[374,55,-1,1],[374,56,-1,1],[374,58,-1,1],[374,59,-1,1],[374,76,-1,1],[374,78,-1,1],[374,79,-1,1],[374,81,-1,1],[374,82,-1,1],[374,83,-1,1],[374,85,1,1],[374,91,1,1],[374,92,1,1],[374,98,1,1],[375,25,1,2],[375,27,-1,2],[375,46,1,2],[375,48,-1,2],[375,55,1,2],[375,57,-1,2],[375,58,1,2],[375,60,-1,2],[375,65,1,2],[375,67,-1,2],[375,68,1,2],[375,70,-1,2],[375,89,-1,2],[375,91,1,2],[375,96,-1,2],[375,98,1,2],[376,57,-1,1],[376,70,-1,1],[376,100,1,1],[376,106,-1,1],[377,57,-1,1],[377,67,-1,1],[377,100,1,1],[377,105,1,1],[378,56,1,2],[378,58,-1,2],[378,65,-1,2],[378,69,-1,2],[379,56,1,2],[379,58,-1,2],[379,66,1,2],[379,68,-1,2],[380,25,1,1],[380,27,1,1],[380,46,1,1],[380,48,1,1],[380,55,-1,1],[380,57,-1,1],[380,58,-1,1],[380,60,-1,1],[380,65,-1,1],[380,67,-1,1],[380,68,-1,1],[380,70,-1,1],[380,89,1,1],[380,91,1,1],[380,96,1,1],[380,98,1,1],[381,55,1,2],[381,59,-1,2],[381,66,-1,2],[381,68,-1,2],[382,55,1,2],[382,59,-1,2],[382,65,1,2],[382,69,-1,2],[383,25,1,1],[383,26,1,1],[383,46,1,1],[383,47,1,1],[383,56,-1,1],[383,57,-1,1],[383,59,-1,1],[383,60,-1,1],[383,66,-1,1],[383,67,-1,1],[383,69,-1,1],[383,70,-1,1],[383,90,1,1],[383,91,1,1],[383,97,1,1],[383,98,1,1],[384,60,-1,2],[384,67,-1,2],[384,101,-1,2],[384,105,1,2],[385,19,-1,1],[385,20,-1,1],[385,40,-1,1],[385,41,-1,1],[386,1,1,2],[386,54,-1,2],[386,61,-1,2],[386,99,-1,2],[386,104,-1,2],[387,0,1,2],[387,1,1,2],[387,2,1,2],[387,3,1,2],[387,61,-1,2],[387,71,-1,2],[387,77,-1,2],[387,80,-1,2],[388,0,-1,1],[388,61,-1,1],[388,64,1,1],[388,99,-1,1],[388,104,-1,1],[389,18,1,2],[389,24,-1,2],[389,39,1,2],[389,45,-1,2],[389,55,1,2],[389,56,1,2],[389,62,-1,2],[389,63,-1,2],[389,65,1,2],[389,66,1,2],[389,72,-1,2],[389,73,-1,2],[389,87,-1,2],[389,91,1,2],[389,94,-1,2],[389,98,1,2],[390,62,-1,1],[390,73,-1,1],[390,102,1,1],[390,108,-1,1],[391,62,-1,1],[391,63,-1,1],[391,102,-1,1],[391,103,-1,1],[392,63,-1,2],[392,72,-1,2],[392,103,-1,2],[392,107,1,2],[393,62,1,2],[393,63,-1,2],[393,72,1,2],[393,73,-1,2],[394,54,1,2],[394,64,-1,2],[395,1,1,1],[395,64,-1,1],[395,71,1,1],[395,99,-1,1],[395,104,-1,1],[396,56,1,2],[396,59,1,2],[396,65,-1,2],[396,68,-1,2],[397,58,1,2],[397,59,1,2],[397,65,-1,2],[397,66,-1,2],[398,65,-1,1],[398,69,-1,1],[399,55,1,2],[399,59,1,2],[399,66,-1,2],[399,68,1,2],[400,59,1,2],[400,66,-1,2],[401,6,1,1],[401,7,1,1],[401,12,1,1],[401,28,1,1],[401,33,1,1],[401,65,-1,1],[401,66,-1,1],[401,68,-1,1],[401,69,-1,1],[401,76,-1,1],[401,78,-1,1],[401,79,-1,1],[401,81,-1,1],[401,82,-1,1],[401,83,-1,1],[401,86,1,1],[401,91,1,1],[401,93,1,1],[401,98,1,1],[402,60,1,2],[402,67,-1,2],[402,101,1,2],[402,105,1,2],[404,55,1,2],[404,56,1,2],[404,68,-1,2],[404,69,-1,2],[405,66,1,2],[405,68,-1,2],[406,56,-1,2],[406,58,1,2],[406,65,-1,2],[406,69,-1,2],[407,56,1,2],[407,69,-1,2],[408,65,1,2],[408,69,-1,2],[409,57,1,2],[409,70,-1,2],[409,101,1,2],[409,105,-1,2],[410,61,1,2],[410,71,-1,2],[411,0,1,2],[411,64,-1,2],[411,71,-1,2],[411,99,1,2],[411,109,-1,2],[412,63,1,2],[412,72,-1,2],[412,103,1,2],[412,107,1,2],[413,72,-1,1],[413,73,-1,1],[413,102,1,1],[413,103,1,1],[414,62,1,2],[414,73,-1,2],[414,103,1,2],[414,107,-1,2],[415,4,1,2],[415,5,1,2],[415,74,-1,2],[415,75,-1,2],[416,74,-1,2],[416,117,-1,2],[416,119,-1,2],[417,74,1,2],[417,75,-1,2],[418,75,-1,2],[418,117,1,2],[418,118,-1,2],[419,76,-1,1],[419,78,1,1],[419,82,-1,1],[419,83,1,1],[420,17,1,2],[420,21,-1,2],[420,38,1,2],[420,42,-1,2],[420,53,1,2],[420,72,1,2],[420,73,1,2],[420,76,-1,1],[420,78,-1,1],[420,79,-1,1],[420,86,-1,2],[420,87,1,2],[420,93,-1,2],[420,94,1,2],[420,107,1,2],[420,108,1,2],[420,111,-1,1],[420,112,-1,1],[421,76,-1,1],[421,111,-1,1],[421,115,-1,1],[422,2,1,2],[422,3,1,2],[422,77,-1,2],[422,80,-1,2],[423,77,-1,2],[423,110,-1,2],[423,116,-1,2],[424,78,-1,1],[424,79,1,1],[424,81,-1,1],[424,82,1,1],[424,111,1,1],[424,112,-1,1],[424,114,1,1],[424,115,-1,1],[425,6,1,2],[425,33,1,2],[425,38,1,2],[425,42,1,2],[425,45,1,2],[425,62,1,2],[425,72,1,2],[425,81,1,1],[425,92,1,2],[425,93,1,2],[425,94,1,2],[425,95,1,2],[425,102,-1,2],[425,107,-1,2],[425,111,-1,1],[426,76,1,2],[426,79,-1,2],[426,81,1,2],[426,83,-1,2],[427,79,-1,2],[427,81,-1,2],[427,111,1,2],[427,115,1,2],[428,77,1,2],[428,80,-1,2],[429,80,-1,2],[429,110,1,2],[429,113,-1,2],[430,76,1,2],[430,79,1,2],[430,81,-1,2],[430,83,-1,2],[431,78,1,2],[431,79,1,2],[431,81,-1,2],[431,82,-1,2],[431,111,1,2],[431,112,1,2],[431,114,-1,2],[431,115,-1,2],[432,78,-1,2],[432,82,-1,2],[432,112,-1,2],[432,114,-1,2],[433,81,1,2],[433,83,-1,2],[434,82,1,1],[434,83,-1,1],[435,76,1,1],[435,83,-1,1],[435,111,1,1],[435,112,1,1],[435,114,1,1],[435,115,1,1],[436,7,1,2],[436,84,-1,2],[437,28,-1,2],[437,84,-1,2],[438,17,-1,2],[438,33,-1,2],[438,85,-1,2],[438,93,-1,2],[439,6,-1,2],[439,12,-1,2],[439,38,-1,2],[439,53,-1,2],[439,85,-1,2],[439,93,1,2],[440,12,1,2],[440,38,1,2],[440,86,-1,2],[440,92,-1,2],[441,6,-1,2],[441,17,-1,2],[441,33,-1,2],[441,53,-1,2],[441,86,-1,2],[441,92,1,2],[442,21,1,2],[442,45,-1,2],[442,87,-1,2],[442,95,-1,2],[443,87,-1,1],[443,88,-1,1],[444,24,1,2],[444,42,-1,2],[444,88,-1,2],[444,94,-1,2],[445,88,-1,1],[445,95,-1,1],[446,26,1,2],[446,48,-1,2],[446,89,-1,2],[446,97,-1,2],[447,12,-1,2],[447,26,-1,2],[447,33,-1,2],[447,47,-1,2],[447,53,-1,2],[447,57,-1,2],[447,60,-1,2],[447,78,-1,2],[447,81,-1,2],[447,83,-1,2],[447,85,1,2],[447,92,1,2],[447,100,-1,2],[447,101,-1,2],[447,111,1,2],[447,114,1,2],[448,27,1,2],[448,47,-1,2],[448,90,-1,2],[448,96,-1,2],[449,90,-1,1],[449,97,-1,1],[450,91,-1,1],[450,98,-1,1],[451,0,-1,1],[451,18,-1,1],[451,19,-1,1],[451,20,-1,1],[451,22,-1,1],[451,23,-1,1],[451,25,-1,1],[451,28,2,1],[451,64,1,1],[451,65,1,1],[451,66,1,1],[451,68,1,1],[451,69,1,1],[451,71,1,1],[451,84,-2,1],[451,91,-2,1],[451,99,-1,1],[451,109,1,1],[452,38,1,2],[452,92,-1,2],[453,6,-1,2],[453,85,-1,2],[453,86,-1,2],[453,92,-1,2],[453,93,-1,2],[454,17,-1,2],[454,93,-1,2],[455,85,-1,2],[455,93,-1,2],[456,24,-1,2],[456,42,-1,2],[456,88,1,2],[456,94,-1,2],[457,94,-1,1],[457,95,-1,1],[458,87,1,2],[458,95,-1,2],[459,27,-1,2],[459,47,-1,2],[459,90,1,2],[459,96,-1,2],[460,96,-1,1],[460,97,-1,1],[461,89,1,2],[461,97,-1,2],[462,91,1,2],[462,98,-1,2],[463,7,1,2],[463,18,1,2],[463,25,-1,2],[463,84,1,2],[463,98,-1,2],[464,0,1,2],[464,99,-1,2],[465,1,-1,2],[465,99,-1,2],[466,57,1,2],[466,70,-1,2],[466,100,-1,2],[466,106,-1,2],[467,100,-1,1],[467,105,-1,1],[468,60,1,2],[468,67,-1,2],[468,101,-1,2],[468,105,-1,2],[469,101,-1,1],[469,106,-1,1],[470,62,1,2],[470,73,-1,2],[470,102,-1,2],[470,108,-1,2],[471,102,-1,1],[471,103,-1,1],[472,63,1,2],[472,72,-1,2],[472,103,-1,2],[472,107,-1,2],[473,103,-1,1],[473,108,-1,1],[474,104,-1,1],[474,109,-1,1],[475,1,1,1],[475,99,-1,1],[475,104,-1,1],[476,60,-1,2],[476,67,-1,2],[476,101,1,2],[476,105,-1,2],[477,105,-1,1],[477,106,-1,1],[478,100,1,2],[478,106,-1,2],[479,63,-1,2],[479,72,-1,2],[479,103,1,2],[479,107,-1,2],[480,107,-1,1],[480,108,-1,1],[481,102,1,2],[481,108,-1,2],[482,104,1,2],[482,109,-1,2],[483,0,1,2],[483,54,1,2],[483,61,-1,2],[483,99,1,2],[483,109,-1,2],[484,77,1,2],[484,110,-1,2],[485,80,-1,2],[485,110,-1,2],[486,79,-1,2],[486,81,-1,2],[486,111,-1,2],[486,115,-1,2],[487,76,-1,2],[487,78,-1,2],[487,82,-1,2],[487,83,-1,2],[487,111,-1,2],[487,115,1,2],[488,78,1,2],[488,82,1,2],[488,112,-1,2],[488,114,-1,2],[489,76,-1,2],[489,79,-1,2],[489,81,-1,2],[489,83,-1,2],[489,112,-1,2],[489,114,1,2],[490,113,-1,1],[490,116,-1,1],[491,2,-1,1],[491,5,-1,1],[491,8,-1,1],[491,11,-1,1],[491,13,-1,1],[491,16,-1,1],[491,29,-1,1],[491,32,-1,1],[491,34,-1,1],[491,37,-1,1],[491,49,-1,1],[491,52,-1,1],[491,74,1,1],[491,80,2,1],[491,110,-2,1],[491,113,-2,1],[491,117,1,1],[491,119,-1,1],[492,82,1,2],[492,114,-1,2],[493,76,-1,2],[493,111,-1,2],[493,112,-1,2],[493,114,-1,2],[493,115,-1,2],[494,79,-1,2],[494,115,-1,2],[495,111,-1,2],[495,115,-1,2],[496,113,1,2],[496,116,-1,2],[497,2,1,2],[497,49,-1,2],[497,77,1,2],[497,110,1,2],[497,116,-1,2],[498,74,1,2],[498,117,-1,2],[499,75,-1,2],[499,117,-1,2],[500,118,-1,1],[500,119,-1,1],[501,75,1,1],[501,117,-1,1],[501,118,-1,1],[502,118,1,2],[502,119,-1,2],[503,4,1,2],[503,51,-1,2],[503,74,1,2],[503,117,1,2],[503,119,-1,2],[504,0,-1,1],[504,1,-1,1],[504,2,-1,1],[504,3,-1,1],[504,4,-1,1],[504,5,-1,1],[504,7,-1,1],[504,8,-1,1],[504,9,-1,1],[504,10,-1,1],[504,11,-1,1],[504,13,-1,1],[504,14,-1,1],[504,15,-1,1],[504,16,-1,1],[504,18,-1,1],[504,19,-1,1],[504,20,-1,1],[504,22,-1,1],[504,23,-1,1],[504,25,-1,1],[504,33,1,1],[504,38,1,1],[504,42,1,1],[504,45,1,1],[504,47,1,1],[504,48,1,1],[504,53,1,1],[504,57,1,1],[504,60,1,1],[504,62,1,1],[504,63,1,1],[504,67,1,1],[504,70,1,1],[504,72,1,1],[504,73,1,1],[504,76,1,1],[504,78,1,1],[504,79,1,1],[504,81,1,1],[504,82,1,1],[504,83,1,1],[504,84,-1,1],[504,85,-1,1],[504,86,-1,1],[504,87,-1,1],[504,88,-1,1],[504,89,-1,1],[504,90,-1,1],[504,91,-2,1],[504,98,-1,1],[504,104,-1,1],[504,109,-1,1],[504,113,-1,1],[504,116,-1,1],[504,118,-1,1],[504,119,-1,1],[505,0,-1,1],[505,1,-1,1],[505,2,-1,1],[505,3,-1,1],[505,4,-1,1],[505,5,-1,1],[505,12,1,1],[505,17,1,1],[505,21,1,1],[505,24,1,1],[505,26,1,1],[505,27,1,1],[505,28,-1,1],[505,29,-1,1],[505,30,-1,1],[505,31,-1,1],[505,32,-1,1],[505,34,-1,1],[505,35,-1,1],[505,36,-1,1],[505,37,-1,1],[505,39,-1,1],[505,40,-1,1],[505,41,-1,1],[505,43,-1,1],[505,44,-1,1],[505,46,-1,1],[505,53,1,1],[505,57,1,1],[505,60,1,1],[505,62,1,1],[505,63,1,1],[505,67,1,1],[505,70,1,1],[505,72,1,1],[505,73,1,1],[505,76,1,1],[505,78,1,1],[505,79,1,1],[505,81,1,1],[505,82,1,1],[505,83,1,1],[505,84,1,1],[505,91,-1,1],[505,92,-1,1],[505,93,-1,1],[505,94,-1,1],[505,95,-1,1],[505,96,-1,1],[505,97,-1,1],[505,98,-2,1],[505,104,-1,1],[505,109,-1,1],[505,113,-1,1],[505,116,-1,1],[505,118,-1,1],[505,119,-1,1],[506,0,-1,1],[506,6,1,1],[506,7,-1,1],[506,8,-1,1],[506,9,-1,1],[506,10,-1,1],[506,11,-1,1],[506,17,1,1],[506,21,1,1],[506,24,1,1],[506,26,1,1],[506,27,1,1],[506,28,-1,1],[506,29,-1,1],[506,30,-1,1],[506,31,-1,1],[506,32,-1,1],[506,38,1,1],[506,42,1,1],[506,45,1,1],[506,47,1,1],[506,48,1,1],[506,49,-1,1],[506,50,-1,1],[506,51,-1,1],[506,52,-1,1],[506,54,-1,1],[506,55,-1,1],[506,56,-1,1],[506,58,-1,1],[506,59,-1,1],[506,61,-1,1],[506,67,1,1],[506,70,1,1],[506,72,1,1],[506,73,1,1],[506,76,1,1],[506,78,1,1],[506,79,1,1],[506,81,1,1],[506,82,1,1],[506,83,1,1],[506,85,1,1],[506,91,-1,1],[506,92,1,1],[506,98,-1,1],[506,99,-1,1],[506,100,-1,1],[506,101,-1,1],[506,102,-1,1],[506,103,-1,1],[506,104,-2,1],[506,109,-1,1],[506,113,-1,1],[506,116,-1,1],[506,118,-1,1],[506,119,-1,1],[507,1,-1,1],[507,6,1,1],[507,7,-1,1],[507,12,1,1],[507,13,-1,1],[507,14,-1,1],[507,15,-1,1],[507,16,-1,1],[507,21,1,1],[507,24,1,1],[507,26,1,1],[507,27,1,1],[507,28,-1,1],[507,33,1,1],[507,34,-1,1],[507,35,-1,1],[507,36,-1,1],[507,37,-1,1],[507,42,1,1],[507,45,1,1],[507,47,1,1],[507,48,1,1],[507,49,-1,1],[507,50,-1,1],[507,51,-1,1],[507,52,-1,1],[507,57,1,1],[507,60,1,1],[507,62,1,1],[507,63,1,1],[507,64,-1,1],[507,65,-1,1],[507,66,-1,1],[507,68,-1,1],[507,69,-1,1],[507,71,-1,1],[507,76,1,1],[507,78,1,1],[507,79,1,1],[507,81,1,1],[507,82,1,1],[507,83,1,1],[507,86,1,1],[507,91,-1,1],[507,93,1,1],[507,98,-1,1],[507,99,1,1],[507,104,-1,1],[507,105,-1,1],[507,106,-1,1],[507,107,-1,1],[507,108,-1,1],[507,109,-2,1],[507,113,-1,1],[507,116,-1,1],[507,118,-1,1],[507,119,-1,1],[508,2,-1,1],[508,6,1,1],[508,8,-1,1],[508,12,1,1],[508,13,-1,1],[508,17,1,1],[508,18,-1,1],[508,19,-1,1],[508,20,-1,1],[508,24,1,1],[508,26,1,1],[508,27,1,1],[508,29,-1,1],[508,33,1,1],[508,34,-1,1],[508,38,1,1],[508,39,-1,1],[508,40,-1,1],[508,41,-1,1],[508,45,1,1],[508,47,1,1],[508,48,1,1],[508,49,-1,1],[508,53,1,1],[508,54,-1,1],[508,55,-1,1],[508,56,-1,1],[508,60,1,1],[508,62,1,1],[508,63,1,1],[508,64,-1,1],[508,65,-1,1],[508,66,-1,1],[508,70,1,1],[508,72,1,1],[508,73,1,1],[508,74,-1,1],[508,75,-1,1],[508,77,-1,1],[508,81,1,1],[508,82,1,1],[508,83,1,1],[508,87,1,1],[508,91,-1,1],[508,94,1,1],[508,98,-1,1],[508,100,1,1],[508,104,-1,1],[508,105,1,1],[508,109,-1,1],[508,110,-1,1],[508,111,-1,1],[508,112,-1,1],[508,113,-2,1],[508,116,-1,1],[508,118,-1,1],[508,119,-1,1],[509,3,-1,1],[509,6,1,1],[509,9,-1,1],[509,12,1,1],[509,14,-1,1],[509,17,1,1],[509,18,-1,1],[509,21,1,1],[509,22,-1,1],[509,23,-1,1],[509,26,1,1],[509,27,1,1],[509,30,-1,1],[509,33,1,1],[509,35,-1,1],[509,38,1,1],[509,39,-1,1],[509,42,1,1],[509,43,-1,1],[509,44,-1,1],[509,47,1,1],[509,48,1,1],[509,50,-1,1],[509,53,1,1],[509,54,-1,1],[509,57,1,1],[509,58,-1,1],[509,59,-1,1],[509,62,1,1],[509,63,1,1],[509,64,-1,1],[509,67,1,1],[509,68,-1,1],[509,69,-1,1],[509,72,1,1],[509,73,1,1],[509,74,-1,1],[509,75,-1,1],[509,78,1,1],[509,79,1,1],[509,80,-1,1],[509,83,1,1],[509,88,1,1],[509,91,-1,1],[509,95,1,1],[509,98,-1,1],[509,101,1,1],[509,104,-1,1],[509,106,1,1],[509,109,-1,1],[509,110,1,1],[509,113,-1,1],[509,114,-1,1],[509,115,-1,1],[509,116,-2,1],[509,118,-1,1],[509,119,-1,1],[510,4,-1,1],[510,6,1,1],[510,10,-1,1],[510,12,1,1],[510,15,-1,1],[510,17,1,1],[510,19,-1,1],[510,21,1,1],[510,22,-1,1],[510,24,1,1],[510,25,-1,1],[510,27,1,1],[510,31,-1,1],[510,33,1,1],[510,36,-1,1],[510,38,1,1],[510,40,-1,1],[510,42,1,1],[510,43,-1,1],[510,45,1,1],[510,46,-1,1],[510,48,1,1],[510,51,-1,1],[510,53,1,1],[510,55,-1,1],[510,57,1,1],[510,58,-1,1],[510,60,1,1],[510,61,-1,1],[510,63,1,1],[510,65,-1,1],[510,67,1,1],[510,68,-1,1],[510,70,1,1],[510,71,-1,1],[510,73,1,1],[510,74,-1,1],[510,76,1,1],[510,77,-1,1],[510,79,1,1],[510,80,-1,1],[510,82,1,1],[510,89,1,1],[510,91,-1,1],[510,96,1,1],[510,98,-1,1],[510,102,1,1],[510,104,-1,1],[510,107,1,1],[510,109,-1,1],[510,111,1,1],[510,113,-1,1],[510,114,1,1],[510,116,-1,1],[510,117,-1,1],[510,118,-2,1],[510,119,-1,1],[511,5,-1,1],[511,6,1,1],[511,11,-1,1],[511,12,1,1],[511,16,-1,1],[511,17,1,1],[511,20,-1,1],[511,21,1,1],[511,23,-1,1],[511,24,1,1],[511,25,-1,1],[511,26,1,1],[511,32,-1,1],[511,33,1,1],[511,37,-1,1],[511,38,1,1],[511,41,-1,1],[511,42,1,1],[511,44,-1,1],[511,45,1,1],[511,46,-1,1],[511,47,1,1],[511,52,-1,1],[511,53,1,1],[511,56,-1,1],[511,57,1,1],[511,59,-1,1],[511,60,1,1],[511,61,-1,1],[511,62,1,1],[511,66,-1,1],[511,67,1,1],[511,69,-1,1],[511,70,1,1],[511,71,-1,1],[511,72,1,1],[511,75,-1,1],[511,76,1,1],[511,77,-1,1],[511,78,1,1],[511,80,-1,1],[511,81,1,1],[511,90,1,1],[511,91,-1,1],[511,97,1,1],[511,98,-1,1],[511,103,1,1],[511,104,-1,1],[511,108,1,1],[511,109,-1,1],[511,112,1,1],[511,113,-1,1],[511,115,1,1],[511,116,-1,1],[511,117,1,1],[511,118,-1,1],[511,119,-2,1],[512,0,-1,1],[512,1,-1,1],[512,61,-1,1],[512,71,-1,1],[513,0,-1,1],[513,1,-1,1],[513,104,-1,1],[513,109,-1,1],[514,2,-1,1],[514,3,-1,1],[514,77,-1,1],[514,80,-1,1],[515,2,-1,1],[515,3,-1,1],[515,113,-1,1],[515,116,-1,1],[516,4,-1,1],[516,5,-1,1],[516,118,-1,1],[516,119,-1,1],[517,6,-1,2],[517,10,-1,2],[517,12,-1,2],[517,15,-1,2],[517,17,-1,2],[517,31,-1,2],[517,33,-1,2],[517,36,-1,2],[517,38,-1,2],[517,53,-1,2],[517,76,1,2],[517,77,1,2],[517,79,1,2],[517,80,1,2],[517,82,1,2],[517,111,1,2],[517,113,1,2],[517,114,1,2],[517,116,1,2],[518,20,-1,2],[518,22,-1,2],[518,40,-1,2],[518,44,1,2],[519,20,-1,1],[519,22,1,1],[519,40,-1,1],[519,44,-1,1],[520,19,-1,1],[520,23,-1,1],[520,41,1,1],[520,43,-1,1],[521,19,-1,2],[521,20,-1,2],[521,22,1,2],[521,23,1,2],[521,40,-1,2],[521,41,-1,2],[521,43,1,2],[521,44,1,2],[521,55,-1,2],[521,56,-1,2],[521,58,1,2],[521,59,1,2],[521,65,-1,2],[521,66,-1,2],[521,68,1,2],[521,69,1,2],[522,18,-1,1],[522,25,-1,1],[523,26,-1,1],[523,27,-1,1],[523,96,1,1],[523,97,1,1],[524,7,-1,1],[524,25,-1,1],[524,28,-1,1],[524,46,-1,1],[525,0,-1,2],[525,1,-1,2],[525,7,-1,2],[525,20,-1,2],[525,22,1,2],[525,28,-1,2],[525,41,-1,2],[525,43,1,2],[525,56,-1,2],[525,58,1,2],[525,66,-1,2],[525,68,1,2],[525,91,-1,2],[525,98,-1,2],[525,104,-1,2],[525,109,-1,2],[526,9,-1,2],[526,13,-1,2],[526,29,-1,2],[526,35,1,2],[527,9,-1,1],[527,13,-1,1],[527,29,1,1],[527,35,-1,1],[528,8,-1,1],[528,14,1,1],[528,30,-1,1],[528,34,-1,1],[529,0,1,1],[529,1,1,1],[529,4,1,1],[529,5,1,1],[529,8,-1,1],[529,13,-1,1],[529,19,-1,1],[529,20,-1,1],[529,30,1,1],[529,35,1,1],[529,43,1,1],[529,44,1,1],[529,54,-1,1],[529,64,-1,1],[529,74,-1,1],[529,75,-1,1],[530,11,-1,2],[530,15,-1,2],[530,31,-1,2],[530,37,1,2],[531,11,-1,1],[531,15,-1,1],[531,31,1,1],[531,37,-1,1],[532,10,-1,1],[532,16,1,1],[532,32,-1,1],[532,36,-1,1],[533,0,1,1],[533,1,1,1],[533,2,1,1],[533,3,1,1],[533,10,-1,1],[533,15,-1,1],[533,19,-1,1],[533,22,-1,1],[533,32,1,1],[533,37,1,1],[533,41,1,1],[533,44,1,1],[533,61,-1,1],[533,71,-1,1],[533,77,-1,1],[533,80,-1,1],[534,4,1,2],[534,5,1,2],[534,13,-1,2],[534,14,-1,2],[534,34,-1,2],[534,35,-1,2],[534,62,1,2],[534,63,1,2],[534,74,-1,2],[534,75,-1,2],[534,87,1,2],[534,88,1,2],[534,94,1,2],[534,95,1,2],[534,107,-1,2],[534,108,-1,2],[535,8,-1,2],[535,14,-1,2],[535,30,-1,2],[535,34,1,2],[536,13,-1,1],[536,35,-1,1],[537,13,-1,1],[537,35,1,1],[538,2,1,2],[538,3,1,2],[538,15,-1,2],[538,16,-1,2],[538,36,-1,2],[538,37,-1,2],[538,57,1,2],[538,60,1,2],[538,77,-1,2],[538,80,-1,2],[538,89,1,2],[538,90,1,2],[538,96,1,2],[538,97,1,2],[538,105,-1,2],[538,106,-1,2],[539,10,-1,2],[539,16,-1,2],[539,32,-1,2],[539,36,1,2],[540,15,-1,1],[540,37,-1,1],[541,10,-1,1],[541,15,-2,1],[541,26,-1,1],[541,32,1,1],[541,37,2,1],[541,48,1,1],[541,90,-1,1],[541,96,1,1],[542,6,-1,1],[542,12,-1,1],[542,38,-1,1],[542,53,-1,1],[542,85,1,1],[542,93,-1,1],[543,18,-1,1],[543,39,-1,1],[543,91,-1,1],[543,98,-1,1],[544,21,-1,1],[544,26,1,1],[544,42,-1,1],[544,47,1,1],[544,57,-1,1],[544,62,1,1],[544,67,-1,1],[544,72,1,1],[544,87,1,1],[544,89,-1,1],[544,94,1,1],[544,96,-1,1],[544,100,1,1],[544,102,-1,1],[544,105,1,1],[544,107,-1,1],[545,21,-1,1],[545,42,-1,1],[545,88,-1,1],[545,95,-1,1],[546,24,-1,1],[546,42,1,1],[546,87,-1,1],[546,95,1,1],[547,0,-1,1],[547,1,-1,1],[547,12,1,1],[547,17,1,1],[547,40,-1,1],[547,41,-1,1],[547,43,-1,1],[547,44,-1,1],[547,53,1,1],[547,76,1,1],[547,78,1,1],[547,79,1,1],[547,81,1,1],[547,82,1,1],[547,83,1,1],[547,92,-1,1],[547,93,-1,1],[547,104,-1,1],[547,109,-1,1],[548,19,-1,2],[548,23,-1,2],[548,41,-1,2],[548,43,1,2],[549,40,-1,1],[549,44,-1,1],[550,0,1,1],[550,1,1,1],[550,7,1,1],[550,19,-1,1],[550,23,1,1],[550,28,1,1],[550,40,-2,1],[550,44,2,1],[550,55,-1,1],[550,59,1,1],[550,65,-1,1],[550,69,1,1],[550,91,1,1],[550,98,1,1],[550,104,1,1],[550,109,1,1],[551,21,-1,1],[551,45,1,1],[551,87,-1,1],[551,95,-1,1],[552,24,-1,1],[552,45,-1,1],[552,87,-1,1],[552,94,-1,1],[553,24,-1,1],[553,26,1,1],[553,45,-1,1],[553,47,1,1],[553,60,-1,1],[553,62,1,1],[553,70,-1,1],[553,72,1,1],[553,88,1,1],[553,89,-1,1],[553,95,1,1],[553,96,-1,1],[553,101,1,1],[553,102,-1,1],[553,106,1,1],[553,107,-1,1],[554,25,-1,1],[554,46,-1,1],[554,91,-1,1],[554,98,-1,1],[555,39,-1,1],[555,46,-1,1],[556,27,-1,1],[556,47,1,1],[556,89,-1,1],[556,97,1,1],[557,26,-1,1],[557,48,1,1],[557,89,-1,1],[557,97,-1,1],[558,8,-1,1],[558,9,-1,1],[558,13,-1,1],[558,14,-1,1],[559,47,-1,1],[559,48,-1,1],[559,96,-1,1],[559,97,-1,1],[560,2,-1,1],[560,49,-1,1],[561,3,-1,1],[561,50,-1,1],[562,49,-1,1],[562,50,-1,1],[562,77,1,1],[562,80,1,1],[563,49,-1,1],[563,50,-1,1],[563,113,-1,1],[563,116,-1,1],[564,4,-1,1],[564,51,-1,1],[565,5,-1,1],[565,52,-1,1],[566,51,-1,1],[566,52,-1,1],[566,118,-1,1],[566,119,-1,1],[567,21,1,1],[567,33,1,1],[567,42,1,1],[567,62,1,1],[567,63,1,1],[567,76,1,1],[567,78,1,1],[567,79,1,1],[567,85,-1,1],[567,87,-1,1],[567,94,-1,1],[567,102,1,1],[567,103,1,1],[567,111,1,1],[567,112,1,1],[568,6,1,2],[568,12,-1,2],[568,38,1,2],[568,53,-1,2],[569,21,1,2],[569,24,1,2],[569,26,1,2],[569,27,1,2],[569,57,-1,2],[569,60,-1,2],[569,62,-1,2],[569,63,-1,2],[569,87,1,2],[569,88,1,2],[569,89,1,2],[569,90,1,2],[569,100,-1,2],[569,101,-1,2],[569,102,-1,2],[569,103,-1,2],[570,57,-1,1],[570,60,-1,1],[570,105,1,1],[570,106,1,1],[571,54,-1,1],[571,61,-1,1],[572,54,-1,1],[572,64,-1,1],[572,104,-1,1],[572,109,-1,1],[573,56,-1,2],[573,58,-1,2],[573,65,-1,2],[573,69,1,2],[574,56,-1,1],[574,58,-1,1],[574,65,1,1],[574,69,-1,1],[575,55,-1,1],[575,59,1,1],[575,66,-1,1],[575,68,-1,1],[576,55,-1,1],[576,58,-1,1],[576,66,1,1],[576,69,1,1],[577,60,-1,1],[577,67,1,1],[577,100,-1,1],[577,106,1,1],[578,18,1,1],[578,21,1,1],[578,39,1,1],[578,42,1,1],[578,58,-1,1],[578,59,-1,1],[578,62,-1,1],[578,63,-1,1],[578,68,-1,1],[578,69,-1,1],[578,72,-1,1],[578,73,-1,1],[578,88,1,1],[578,91,1,1],[578,95,1,1],[578,98,1,1],[579,55,-1,2],[579,59,-1,2],[579,66,-1,2],[579,68,1,2],[580,58,-1,1],[580,69,-1,1],[581,18,-1,2],[581,21,-1,2],[581,24,-1,2],[581,28,1,2],[581,46,1,2],[581,55,-1,2],[581,58,-1,1],[581,62,-1,2],[581,66,1,2],[581,69,1,1],[581,73,1,2],[581,84,-1,2],[581,94,1,2],[581,95,1,2],[581,98,1,2],[581,103,-1,2],[581,107,1,2],[582,57,-1,1],[582,70,1,1],[582,100,-1,1],[582,106,-1,1],[583,10,-1,1],[583,11,-1,1],[583,31,-1,1],[583,32,-1,1],[584,21,1,2],[584,24,1,2],[584,26,1,2],[584,27,1,2],[584,67,-1,2],[584,70,-1,2],[584,72,-1,2],[584,73,-1,2],[584,87,1,2],[584,88,1,2],[584,89,1,2],[584,90,1,2],[584,105,-1,2],[584,106,-1,2],[584,107,-1,2],[584,108,-1,2],[585,61,-1,1],[585,71,-1,1],[585,104,-1,1],[585,109,-1,1],[586,64,-1,1],[586,71,-1,1],[587,62,-1,1],[587,72,-1,1],[587,102,1,1],[587,107,1,1],[588,62,-1,1],[588,72,-1,1],[588,103,-1,1],[588,108,-1,1],[589,63,-1,1],[589,72,1,1],[589,102,-1,1],[589,108,1,1],[590,62,-1,1],[590,73,1,1],[590,102,-1,1],[590,108,-1,1],[591,63,-1,1],[591,73,-1,1],[591,102,-1,1],[591,107,-1,1],[592,63,-1,1],[592,73,-1,1],[592,103,1,1],[592,108,1,1],[593,8,1,2],[593,9,1,2],[593,10,1,2],[593,11,1,2],[593,34,-1,2],[593,35,-1,2],[593,36,-1,2],[593,37,-1,2],[593,74,-1,1],[593,75,-1,1],[593,77,-1,2],[593,80,-1,2],[593,113,-1,2],[593,116,-1,2],[593,118,-1,1],[593,119,-1,1],[594,76,-1,1],[594,78,-1,1],[594,82,-1,1],[594,83,-1,1],[594,111,1,1],[594,115,-1,1],[595,6,-1,2],[595,7,1,2],[595,17,-1,2],[595,28,1,2],[595,38,-1,2],[595,55,1,2],[595,56,1,2],[595,58,1,2],[595,59,1,2],[595,76,-1,2],[595,78,-1,2],[595,79,-1,2],[595,81,-1,2],[595,82,-1,2],[595,83,-1,2],[595,85,-1,2],[595,91,1,2],[595,92,-1,2],[595,98,1,2],[596,13,1,2],[596,14,1,2],[596,15,1,2],[596,16,1,2],[596,29,-1,2],[596,30,-1,2],[596,31,-1,2],[596,32,-1,2],[596,74,-1,2],[596,75,-1,2],[596,77,-1,2],[596,80,-1,2],[596,113,-1,2],[596,116,-1,2],[596,118,-1,2],[596,119,-1,2],[597,82,-1,1],[597,83,-1,1],[597,112,1,1],[598,76,1,2],[598,78,1,2],[598,82,-1,2],[598,83,-1,2],[599,42,-1,1],[599,45,-1,1],[599,56,-1,1],[599,59,-1,1],[599,63,-1,1],[599,65,1,1],[599,68,1,1],[599,72,1,1],[599,87,1,1],[599,88,1,1],[599,102,-1,1],[599,108,1,1],[600,19,-1,1],[600,20,-1,1],[600,22,-1,1],[600,23,-1,1],[600,54,-1,1],[600,61,1,1],[600,64,-1,1],[600,71,1,1],[600,76,-1,1],[600,83,1,1],[600,111,-1,1],[600,112,-1,1],[600,114,-1,1],[600,115,-1,1],[601,12,-1,1],[601,26,1,1],[601,33,-1,1],[601,47,1,1],[601,53,-1,1],[601,57,-1,1],[601,60,-1,1],[601,78,1,1],[601,81,1,1],[601,83,1,1],[601,85,1,1],[601,92,1,1],[601,100,-1,1],[601,101,-1,1],[601,111,-1,1],[601,114,-1,1],[602,6,-1,1],[602,12,-2,1],[602,17,-1,1],[602,26,-1,1],[602,27,-1,1],[602,57,-1,1],[602,67,-1,1],[602,76,-1,1],[602,78,-1,1],[602,79,-1,1],[602,85,-1,1],[602,86,-2,1],[602,89,-1,1],[602,90,-1,1],[602,100,1,1],[602,105,1,1],[602,111,-1,1],[602,112,-1,1],[603,18,1,1],[603,25,-1,1],[603,39,1,1],[603,46,-1,1],[603,65,-1,1],[603,66,-1,1],[603,68,-1,1],[603,69,-1,1],[603,76,1,1],[603,83,-1,1],[603,111,1,1],[603,112,1,1],[603,114,1,1],[603,115,1,1],[604,89,-1,1],[604,90,-1,1],[605,89,-1,1],[605,90,-1,1],[605,96,-1,1],[605,97,-1,1],[606,38,-1,1],[606,92,-1,1],[607,6,-1,1],[607,33,-1,1],[607,38,-1,1],[607,42,-1,1],[607,45,-1,1],[607,62,1,1],[607,72,1,1],[607,81,2,1],[607,92,-1,1],[607,93,-1,1],[607,94,-1,1],[607,95,-1,1],[607,102,-1,1],[607,107,-1,1],[607,111,-2,1],[608,17,-1,1],[608,93,1,1],[609,17,-1,1],[609,93,1,1],[610,87,-1,1],[610,94,-1,1],[611,87,-1,1],[611,88,-1,1],[611,94,-1,1],[611,95,-1,1],[612,88,-1,1],[612,94,1,1],[613,21,-1,2],[613,45,-1,2],[613,87,-1,2],[613,95,1,2],[614,88,-1,1],[614,95,-1,1],[615,87,1,2],[615,88,-1,2],[615,94,1,2],[615,95,-1,2],[616,3,1,1],[616,10,-1,1],[616,15,-1,1],[616,26,-1,1],[616,32,1,1],[616,37,1,1],[616,48,1,1],[616,49,-1,1],[616,57,-1,1],[616,67,-1,1],[616,80,1,1],[616,90,-2,1],[616,96,2,1],[616,101,-1,1],[616,106,-1,1],[616,110,-1,1],[616,116,1,1],[617,26,-1,2],[617,48,-1,2],[617,89,-1,2],[617,97,1,2],[618,96,-1,1],[618,97,-1,1],[619,89,1,2],[619,90,1,2],[619,96,-1,2],[619,97,-1,2],[620,18,1,2],[620,39,1,2],[620,91,-1,2],[620,98,-1,2],[621,91,-1,1],[621,98,-1,1],[622,1,-1,1],[622,99,1,1],[622,109,-1,1],[623,100,-1,1],[623,101,-1,1],[624,100,-1,1],[624,101,-1,1],[624,105,-1,1],[624,106,-1,1],[625,8,-1,1],[625,14,1,1],[625,29,-1,1],[625,35,1,1],[625,57,-1,1],[625,70,1,1],[625,101,-2,1],[625,105,2,1],[626,57,-1,2],[626,70,-1,2],[626,100,-1,2],[626,106,1,2],[627,105,-1,1],[627,106,-1,1],[628,100,1,2],[628,101,1,2],[628,105,-1,2],[628,106,-1,2],[629,102,-1,1],[629,107,-1,1],[630,102,-1,1],[630,103,-1,1],[630,107,-1,1],[630,108,-1,1],[631,2,1,1],[631,10,-1,1],[631,16,1,1],[631,21,1,1],[631,31,-1,1],[631,37,1,1],[631,42,1,1],[631,50,-1,1],[631,62,-1,1],[631,73,1,1],[631,80,-1,1],[631,88,1,1],[631,95,1,1],[631,103,-2,1],[631,107,2,1],[631,110,1,1],[631,116,-1,1],[632,62,-1,2],[632,73,-1,2],[632,102,-1,2],[632,108,1,2],[633,103,-1,1],[633,108,-1,1],[634,102,1,2],[634,103,-1,2],[634,107,1,2],[634,108,-1,2],[635,54,1,2],[635,64,1,2],[635,104,-1,2],[635,109,-1,2],[636,104,-1,1],[636,109,-1,1],[637,3,-1,1],[637,11,-1,2],[637,15,1,2],[637,24,-1,2],[637,32,-1,2],[637,36,1,2],[637,45,-1,2],[637,49,1,1],[637,63,-1,2],[637,72,1,2],[637,87,-1,2],[637,94,-1,2],[637,102,-1,2],[637,108,1,2],[638,80,-1,1],[638,110,1,1],[638,116,-1,1],[639,81,-1,1],[639,82,-1,1],[639,83,-1,1],[639,111,1,1],[639,112,1,1],[640,17,-1,2],[640,26,-1,2],[640,38,-1,2],[640,47,-1,2],[640,53,-1,2],[640,67,-1,2],[640,70,-1,2],[640,78,-1,1],[640,81,-1,1],[640,83,-1,1],[640,86,1,2],[640,93,1,2],[640,105,-1,2],[640,106,-1,2],[640,111,1,1],[640,114,1,1],[641,78,-1,1],[641,112,-1,1],[642,76,-1,1],[642,78,-1,1],[642,81,-1,1],[642,112,-1,1],[642,115,-1,1],[643,82,-1,1],[643,114,-1,1],[644,76,-1,1],[644,81,-1,1],[644,82,-1,1],[644,114,-1,1],[644,115,-1,1],[645,79,-1,1],[645,115,1,1],[646,79,-1,1],[646,115,1,1],[647,49,1,2],[647,50,1,2],[647,113,-1,2],[647,116,-1,2],[648,113,-1,1],[648,116,-1,1],[649,74,-1,1],[649,117,-1,1],[649,118,-1,1],[650,75,-1,1],[650,117,1,1],[650,119,-1,1],[651,51,1,2],[651,52,1,2],[651,118,-1,2],[651,119,-1,2],[652,118,-1,1],[652,119,-1,1],[653,21,-1,1],[653,24,-1,1],[653,94,1,1],[653,95,1,1],[654,7,-1,1],[654,25,-1,1],[654,39,1,1],[654,84,-1,1],[654,91,-1,1],[655,42,-1,1],[655,45,-1,1],[655,47,-1,1],[655,48,-1,1],[655,57,-1,1],[655,60,-1,1],[655,62,-1,1],[655,63,-1,1],[655,94,-1,1],[655,95,-1,1],[655,96,-1,1],[655,97,-1,1],[655,100,-1,1],[655,101,-1,1],[655,102,-1,1],[655,103,-1,1],[656,7,-1,1],[656,18,-1,1],[656,46,1,1],[656,84,-1,1],[656,91,-1,1],[657,18,-1,1],[657,28,1,1],[657,46,1,1],[657,84,-1,1],[657,98,1,1],[658,26,-1,1],[658,47,-1,1],[658,90,-1,1],[658,97,-1,1],[659,21,-1,2],[659,27,-1,2],[659,42,-1,2],[659,48,-1,2],[659,57,-1,2],[659,63,-1,2],[659,67,-1,2],[659,73,-1,2],[659,87,1,2],[659,90,1,2],[659,94,1,2],[659,97,1,2],[659,100,1,2],[659,103,1,2],[659,105,1,2],[659,108,1,2],[660,3,-1,1],[660,49,1,1],[660,80,-1,1],[660,110,1,1],[660,116,-1,1],[661,2,-1,1],[661,50,1,1],[661,80,1,1],[661,110,-1,1],[661,116,1,1],[662,5,-1,1],[662,51,1,1],[662,74,1,1],[662,117,1,1],[662,118,1,1],[663,5,-1,1],[663,51,1,1],[663,75,-1,1],[663,117,1,1],[663,119,-1,1],[664,4,-1,1],[664,52,1,1],[664,74,-1,1],[664,117,-1,1],[664,118,-1,1],[665,4,-1,1],[665,52,1,1],[665,75,1,1],[665,117,-1,1],[665,119,1,1],[666,62,-1,1],[666,63,-1,1],[666,107,1,1],[666,108,1,1],[667,1,1,1],[667,61,-1,1],[667,64,1,1],[667,99,-1,1],[667,109,1,1],[668,57,-1,1],[668,67,-1,1],[668,101,-1,1],[668,106,-1,1],[669,60,-1,1],[669,70,-1,1],[669,101,1,1],[669,106,1,1],[670,1,1,1],[670,54,-1,1],[670,71,1,1],[670,99,-1,1],[670,109,1,1],[671,72,-1,1],[671,73,-1,1],[671,107,-1,1],[671,108,-1,1],[672,87,-1,1],[672,88,-1,1],[673,94,-1,1],[673,95,-1,1],[674,89,-1,1],[674,96,-1,1],[675,90,-1,1],[675,97,-1,1],[676,102,-1,1],[676,103,-1,1],[677,100,-1,1],[677,105,-1,1],[678,101,-1,1],[678,106,-1,1],[679,107,-1,1],[679,108,-1,1],[680,28,1,2],[680,39,1,2],[680,46,-1,2],[680,84,-1,2],[680,91,-1,2],[681,7,1,1],[681,84,1,1],[681,98,-1,1],[682,1,1,2],[682,64,1,2],[682,71,-1,2],[682,99,-1,2],[682,104,-1,2],[683,0,1,1],[683,99,1,1],[683,109,-1,1],[684,3,1,2],[684,50,-1,2],[684,80,1,2],[684,110,-1,2],[684,113,-1,2],[685,77,1,1],[685,110,1,1],[685,116,-1,1],[686,5,1,2],[686,52,-1,2],[686,75,1,2],[686,117,-1,2],[686,118,-1,2],[687,74,1,1],[687,117,1,1],[687,119,-1,1],[688,18,1,1],[688,25,-1,1],[688,39,1,1],[688,46,-1,1],[688,55,-1,1],[688,56,-1,1],[688,58,-1,1],[688,59,-1,1],[688,76,1,1],[688,83,-1,1],[688,111,1,1],[688,112,1,1],[688,114,1,1],[688,115,1,1],[689,17,1,1],[689,26,-1,1],[689,38,1,1],[689,47,-1,1],[689,53,1,1],[689,67,1,1],[689,70,1,1],[689,78,-2,1],[689,81,-2,1],[689,83,-2,1],[689,86,-1,1],[689,93,-1,1],[689,105,1,1],[689,106,1,1],[689,111,2,1],[689,114,2,1],[690,47,-1,1],[690,48,-1,1],[690,58,-1,1],[690,59,-1,1],[690,60,-1,1],[690,65,1,1],[690,66,1,1],[690,67,1,1],[690,89,1,1],[690,90,1,1],[690,100,-1,1],[690,106,1,1],[691,12,2,1],[691,17,2,1],[691,40,-1,1],[691,41,-1,1],[691,43,-1,1],[691,44,-1,1],[691,53,2,1],[691,54,1,1],[691,61,-1,1],[691,64,1,1],[691,71,-1,1],[691,76,1,1],[691,83,-1,1],[691,92,-2,1],[691,93,-2,1],[691,111,1,1],[691,112,1,1],[691,114,1,1],[691,115,1,1],[692,6,-1,1],[692,33,-1,1],[692,93,-1,1],[693,28,-1,1],[693,84,1,1],[693,98,-1,1],[694,0,-1,1],[694,99,-1,1],[694,104,-1,1],[695,1,-1,1],[695,99,1,1],[695,109,-1,1],[696,76,-1,1],[696,79,-1,1],[696,82,-1,1],[696,111,-1,1],[696,114,-1,1],[697,79,1,1],[697,82,1,1],[697,83,1,1],[697,112,-1,1],[697,115,-1,1],[698,11,1,2],[698,16,1,2],[698,27,1,2],[698,31,-1,2],[698,36,-1,2],[698,47,-1,2],[698,60,-1,2],[698,70,-1,2],[698,89,1,2],[698,97,-1,2],[698,100,-1,2],[698,105,-1,2],[699,78,1,1],[699,79,1,1],[699,83,1,1],[699,114,-1,1],[699,115,-1,1],[700,76,-1,1],[700,81,-1,1],[700,115,-1,1],[701,80,-1,1],[701,110,1,1],[701,116,-1,1],[702,74,-1,1],[702,117,-1,1],[702,118,-1,1],[703,75,-1,1],[703,117,1,1],[703,119,-1,1],[704,6,-1,1],[704,17,-1,1],[704,33,-1,1],[704,53,-1,1],[704,86,1,1],[704,92,-1,1],[705,76,-1,1],[705,79,-1,1],[705,81,-1,1],[705,83,-1,1],[705,112,1,1],[705,114,-1,1],[706,12,-1,1],[706,38,1,1],[706,86,-1,1],[706,92,1,1],[707,12,-1,1],[707,38,1,1],[707,86,-1,1],[707,92,1,1],[708,17,1,1],[708,33,-1,1],[708,85,1,1],[708,93,-1,1],[709,17,1,1],[709,33,-1,1],[709,85,1,1],[709,93,-1,1],[710,78,-1,1],[710,82,1,1],[710,112,-1,1],[710,114,1,1],[711,78,-1,1],[711,82,1,1],[711,112,-1,1],[711,114,1,1],[712,79,1,1],[712,81,-1,1],[712,111,1,1],[712,115,-1,1],[713,79,1,1],[713,81,-1,1],[713,111,1,1],[713,115,-1,1],[714,5,-1,1],[714,7,-1,1],[714,8,-1,1],[714,9,-1,1],[714,13,-1,1],[714,14,-1,1],[714,18,-1,1],[714,46,1,1],[714,51,1,1],[714,55,1,1],[714,58,1,1],[714,65,1,1],[714,68,1,1],[714,74,1,1],[714,84,-1,1],[714,91,-1,1],[714,117,1,1],[714,118,1,1],[715,3,-1,1],[715,7,-1,1],[715,10,-1,1],[715,11,-1,1],[715,15,-1,1],[715,16,-1,1],[715,25,-1,1],[715,39,1,1],[715,49,1,1],[715,55,1,1],[715,56,1,1],[715,65,1,1],[715,66,1,1],[715,77,1,1],[715,84,-1,1],[715,91,-1,1],[715,110,1,1],[715,113,1,1],[716,1,-1,1],[716,18,-1,1],[716,19,-1,1],[716,20,-1,1],[716,22,-1,1],[716,23,-1,1],[716,25,-1,1],[716,28,1,1],[716,54,1,1],[716,55,1,1],[716,56,1,1],[716,58,1,1],[716,59,1,1],[716,61,1,1],[716,84,-1,1],[716,91,-1,1],[716,99,1,1],[716,104,1,1],[717,0,-1,1],[717,4,-1,1],[717,8,-1,1],[717,9,-1,1],[717,19,-1,1],[717,22,-1,1],[717,29,-1,1],[717,30,-1,1],[717,40,-1,1],[717,43,-1,1],[717,52,1,1],[717,54,-1,1],[717,71,1,1],[717,74,-1,1],[717,99,-1,1],[717,104,-1,1],[717,117,-1,1],[717,118,-1,1],[718,4,1,1],[718,13,-1,1],[718,14,-1,1],[718,17,-1,1],[718,29,1,1],[718,30,1,1],[718,33,1,1],[718,51,1,1],[718,75,-1,1],[718,76,-1,1],[718,79,-1,1],[718,82,-1,1],[718,85,-1,1],[718,93,1,1],[718,111,-1,1],[718,114,-1,1],[718,117,1,1],[718,118,1,1],[719,0,-1,1],[719,2,-1,1],[719,10,-1,1],[719,11,-1,1],[719,19,-1,1],[719,20,-1,1],[719,31,-1,1],[719,32,-1,1],[719,40,-1,1],[719,41,-1,1],[719,50,1,1],[719,61,-1,1],[719,64,1,1],[719,77,-1,1],[719,99,-1,1],[719,104,-1,1],[719,110,-1,1],[719,113,-1,1],[720,2,1,1],[720,15,-1,1],[720,16,-1,1],[720,17,-1,1],[720,31,1,1],[720,32,1,1],[720,33,1,1],[720,49,1,1],[720,80,-1,1],[720,81,-1,1],[720,82,-1,1],[720,83,-1,1],[720,85,-1,1],[720,93,1,1],[720,110,1,1],[720,111,1,1],[720,112,1,1],[720,113,1,1],[721,2,-1,1],[721,4,-1,1],[721,8,-1,1],[721,10,-1,1],[721,13,-1,1],[721,15,-1,1],[721,29,-1,1],[721,31,-1,1],[721,34,-1,1],[721,36,-1,1],[721,49,-1,1],[721,51,-1,1],[721,75,1,1],[721,80,1,1],[721,110,-1,1],[721,113,-1,1],[721,117,-1,1],[721,118,-1,1],[722,4,1,1],[722,9,-1,1],[722,14,-1,1],[722,24,-1,1],[722,29,1,1],[722,34,1,1],[722,42,1,1],[722,52,-1,1],[722,63,-1,1],[722,73,-1,1],[722,74,1,1],[722,87,-1,1],[722,95,1,1],[722,102,-1,1],[722,107,-1,1],[722,117,1,1],[722,118,1,1],[723,5,1,1],[723,9,-1,1],[723,13,1,1],[723,27,1,1],[723,30,-1,1],[723,34,1,1],[723,48,1,1],[723,51,-1,1],[723,60,-1,1],[723,67,1,1],[723,74,-1,1],[723,89,1,1],[723,96,1,1],[723,100,-1,1],[723,106,1,1],[723,117,-1,1],[723,118,-1,1],[724,5,1,1],[724,8,-1,1],[724,14,1,1],[724,27,1,1],[724,29,-1,1],[724,35,1,1],[724,48,1,1],[724,51,-1,1],[724,57,-1,1],[724,70,1,1],[724,74,-1,1],[724,89,1,1],[724,96,1,1],[724,101,-1,1],[724,105,1,1],[724,117,-1,1],[724,118,-1,1],[725,4,1,1],[725,8,-1,1],[725,13,-1,1],[725,21,-1,1],[725,30,1,1],[725,35,1,1],[725,45,1,1],[725,52,-1,1],[725,63,-1,1],[725,73,-1,1],[725,74,1,1],[725,88,-1,1],[725,94,1,1],[725,102,-1,1],[725,107,-1,1],[725,117,1,1],[725,118,1,1],[726,3,-1,1],[726,4,-1,1],[726,9,-1,1],[726,10,-1,1],[726,14,-1,1],[726,15,-1,1],[726,30,-1,1],[726,31,-1,1],[726,35,-1,1],[726,36,-1,1],[726,50,-1,1],[726,51,-1,1],[726,75,1,1],[726,77,1,1],[726,110,1,1],[726,116,-1,1],[726,117,-1,1],[726,118,-1,1],[727,4,1,1],[727,8,-1,1],[727,9,-1,1],[727,12,-1,1],[727,34,1,1],[727,35,1,1],[727,38,1,1],[727,51,1,1],[727,75,-1,1],[727,76,-1,1],[727,79,-1,1],[727,82,-1,1],[727,86,-1,1],[727,92,1,1],[727,111,-1,1],[727,114,-1,1],[727,117,1,1],[727,118,1,1],[728,1,-1,1],[728,4,-1,1],[728,13,-1,1],[728,14,-1,1],[728,19,-1,1],[728,22,-1,1],[728,34,-1,1],[728,35,-1,1],[728,40,-1,1],[728,43,-1,1],[728,52,1,1],[728,61,1,1],[728,64,-1,1],[728,74,-1,1],[728,99,1,1],[728,109,-1,1],[728,117,-1,1],[728,118,-1,1],[729,5,-1,1],[729,25,1,1],[729,28,-1,1],[729,29,-1,1],[729,30,-1,1],[729,34,-1,1],[729,35,-1,1],[729,39,-1,1],[729,51,1,1],[729,55,1,1],[729,58,1,1],[729,65,1,1],[729,68,1,1],[729,74,1,1],[729,84,1,1],[729,98,-1,1],[729,117,1,1],[729,118,1,1],[730,2,1,2],[730,4,-1,2],[730,8,1,2],[730,10,-1,2],[730,13,1,2],[730,15,-1,2],[730,29,1,2],[730,31,-1,2],[730,34,1,2],[730,36,-1,2],[730,49,1,2],[730,51,-1,2],[730,75,1,2],[730,80,-1,2],[730,110,1,2],[730,113,1,2],[730,117,-1,2],[730,118,-1,2],[731,11,-1,1],[731,16,-1,1],[731,27,-1,1],[731,31,1,1],[731,36,1,1],[731,47,1,1],[731,60,-1,1],[731,70,-1,1],[731,89,-1,1],[731,97,1,1],[731,100,-1,1],[731,105,-1,1],[732,3,2,1],[732,11,-1,1],[732,15,1,1],[732,24,1,1],[732,32,-1,1],[732,36,1,1],[732,45,1,1],[732,49,-2,1],[732,63,-1,1],[732,72,1,1],[732,87,1,1],[732,94,1,1],[732,102,-1,1],[732,108,1,1],[733,3,1,1],[733,10,-1,1],[733,16,1,1],[733,24,1,1],[733,31,-1,1],[733,37,1,1],[733,45,1,1],[733,49,-1,1],[733,62,-1,1],[733,73,1,1],[733,87,1,1],[733,94,1,1],[733,103,-1,1],[733,107,1,1],[734,2,1,1],[734,10,-1,1],[734,15,-1,1],[734,26,-1,1],[734,32,1,1],[734,37,1,1],[734,48,1,1],[734,50,-1,1],[734,60,-1,1],[734,70,-1,1],[734,77,2,1],[734,90,-1,1],[734,96,1,1],[734,100,-1,1],[734,105,-1,1],[734,110,2,1],[734,113,2,1],[735,2,1,2],[735,5,-1,2],[735,8,1,2],[735,11,-1,2],[735,13,1,2],[735,16,-1,2],[735,29,1,2],[735,32,-1,2],[735,34,1,2],[735,37,-1,2],[735,49,1,2],[735,52,-1,2],[735,74,1,2],[735,80,-1,1],[735,110,1,1],[735,113,1,1],[735,117,1,2],[735,119,-1,2],[736,2,1,1],[736,10,-1,1],[736,11,-1,1],[736,12,-1,1],[736,36,1,1],[736,37,1,1],[736,38,1,1],[736,49,1,1],[736,80,-1,1],[736,81,-1,1],[736,82,-1,1],[736,83,-1,1],[736,86,-1,1],[736,92,1,1],[736,110,1,1],[736,111,1,1],[736,112,1,1],[736,113,1,1],[737,1,-1,1],[737,2,-1,1],[737,15,-1,1],[737,16,-1,1],[737,19,-1,1],[737,20,-1,1],[737,36,-1,1],[737,37,-1,1],[737,40,-1,1],[737,41,-1,1],[737,50,1,1],[737,54,1,1],[737,71,-1,1],[737,77,-1,1],[737,99,1,1],[737,109,-1,1],[737,110,-1,1],[737,113,-1,1],[738,3,-1,1],[738,18,1,1],[738,28,-1,1],[738,31,-1,1],[738,32,-1,1],[738,36,-1,1],[738,37,-1,1],[738,46,-1,1],[738,49,1,1],[738,55,1,1],[738,56,1,1],[738,65,1,1],[738,66,1,1],[738,77,1,1],[738,84,1,1],[738,98,-1,1],[738,110,1,1],[738,113,1,1],[739,7,-1,2],[739,18,1,2],[739,27,1,2],[739,28,-1,2],[739,39,1,2],[739,48,1,2],[739,55,-1,2],[739,58,-1,2],[739,65,-1,2],[739,68,-1,2],[739,89,1,2],[739,96,1,2],[739,100,-1,2],[739,101,-1,2],[739,105,-1,2],[739,106,-1,2],[740,0,1,2],[740,2,-1,2],[740,10,1,2],[740,11,1,2],[740,19,-1,2],[740,20,-1,2],[740,31,1,2],[740,32,1,2],[740,40,-1,2],[740,41,-1,2],[740,50,1,2],[740,61,1,2],[740,64,-1,2],[740,77,-1,2],[740,99,1,2],[740,104,1,2],[740,110,-1,2],[740,113,-1,2],[741,0,1,1],[741,22,-1,1],[741,23,-1,1],[741,24,-1,1],[741,40,1,1],[741,41,1,1],[741,42,1,1],[741,54,1,1],[741,71,-1,1],[741,72,-1,1],[741,73,-1,1],[741,87,-1,1],[741,95,1,1],[741,99,1,1],[741,102,1,1],[741,103,1,1],[741,104,1,1],[742,0,1,2],[742,4,-1,2],[742,8,1,2],[742,9,1,2],[742,19,-1,2],[742,22,-1,2],[742,29,1,2],[742,30,1,2],[742,40,-1,2],[742,43,-1,2],[742,52,1,2],[742,54,1,2],[742,71,-1,2],[742,74,-1,2],[742,99,1,2],[742,104,1,2],[742,117,-1,2],[742,118,-1,2],[743,0,1,1],[743,20,-1,1],[743,23,-1,1],[743,27,-1,1],[743,40,1,1],[743,43,1,1],[743,47,1,1],[743,61,1,1],[743,64,-1,1],[743,67,-1,1],[743,70,-1,1],[743,89,-1,1],[743,97,1,1],[743,99,1,1],[743,100,1,1],[743,101,1,1],[743,104,1,1],[744,1,-1,2],[744,6,-1,2],[744,17,-1,2],[744,20,-1,2],[744,22,1,2],[744,38,-1,2],[744,41,-1,2],[744,43,1,2],[744,54,1,2],[744,61,1,2],[744,79,-1,2],[744,81,1,2],[744,85,-1,2],[744,92,-1,2],[744,99,1,2],[744,104,1,2],[744,111,-1,2],[744,115,1,2],[745,1,-1,2],[745,6,-1,2],[745,17,-1,2],[745,19,-1,2],[745,23,1,2],[745,38,-1,2],[745,40,-1,2],[745,44,1,2],[745,54,1,2],[745,61,1,2],[745,78,-1,2],[745,82,1,2],[745,85,-1,2],[745,92,-1,2],[745,99,1,2],[745,104,1,2],[745,112,-1,2],[745,114,1,2],[746,0,1,1],[746,19,-1,1],[746,22,-1,1],[746,26,-1,1],[746,41,1,1],[746,44,1,1],[746,48,1,1],[746,61,1,1],[746,64,-1,1],[746,67,-1,1],[746,70,-1,1],[746,90,-1,1],[746,96,1,1],[746,99,1,1],[746,100,1,1],[746,101,1,1],[746,104,1,1],[747,0,1,2],[747,5,-1,2],[747,8,1,2],[747,9,1,2],[747,20,-1,2],[747,23,-1,2],[747,29,1,2],[747,30,1,2],[747,41,-1,2],[747,44,-1,2],[747,51,1,2],[747,54,1,2],[747,71,-1,2],[747,75,-1,2],[747,99,1,2],[747,104,1,2],[747,117,1,2],[747,119,-1,2],[748,0,1,1],[748,19,-1,1],[748,20,-1,1],[748,21,-1,1],[748,43,1,1],[748,44,1,1],[748,45,1,1],[748,54,1,1],[748,71,-1,1],[748,72,-1,1],[748,73,-1,1],[748,88,-1,1],[748,94,1,1],[748,99,1,1],[748,102,1,1],[748,103,1,1],[748,104,1,1],[749,0,1,2],[749,3,-1,2],[749,10,1,2],[749,11,1,2],[749,22,-1,2],[749,23,-1,2],[749,31,1,2],[749,32,1,2],[749,43,-1,2],[749,44,-1,2],[749,49,1,2],[749,61,1,2],[749,64,-1,2],[749,80,-1,2],[749,99,1,2],[749,104,1,2],[749,110,1,2],[749,116,-1,2],[750,1,-1,1],[750,7,1,1],[750,39,-1,1],[750,40,-1,1],[750,41,-1,1],[750,43,-1,1],[750,44,-1,1],[750,46,-1,1],[750,54,1,1],[750,55,1,1],[750,56,1,1],[750,58,1,1],[750,59,1,1],[750,61,1,1],[750,84,1,1],[750,98,-1,1],[750,99,1,1],[750,104,1,1],[751,4,-1,2],[751,5,-1,2],[751,21,-1,2],[751,24,-1,2],[751,42,-1,2],[751,45,-1,2],[751,51,1,2],[751,52,1,2],[751,74,1,2],[751,75,1,2],[751,87,-1,2],[751,88,-1,2],[751,94,-1,2],[751,95,-1,2],[751,118,1,2],[751,119,1,2],[752,7,-1,2],[752,24,1,2],[752,25,1,2],[752,28,-1,2],[752,45,1,2],[752,46,1,2],[752,55,-1,2],[752,56,-1,2],[752,65,-1,2],[752,66,-1,2],[752,87,1,2],[752,94,1,2],[752,102,-1,2],[752,103,-1,2],[752,107,-1,2],[752,108,-1,2],[753,18,1,2],[753,25,-1,2],[753,39,1,2],[753,46,-1,2],[753,55,1,2],[753,56,1,2],[753,58,1,2],[753,59,1,2],[753,76,1,2],[753,83,-1,2],[753,111,1,2],[753,112,1,2],[753,114,1,2],[753,115,1,2],[754,10,-1,2],[754,11,-1,2],[754,26,-1,2],[754,27,-1,2],[754,31,-1,2],[754,32,-1,2],[754,47,-1,2],[754,48,-1,2],[754,49,1,2],[754,50,1,2],[754,67,1,2],[754,70,1,2],[754,100,-1,2],[754,101,-1,2],[754,113,1,2],[754,116,1,2],[755,4,-1,1],[755,5,-1,1],[755,8,-1,1],[755,13,-1,1],[755,29,-1,1],[755,34,-1,1],[755,51,1,1],[755,52,1,1],[755,53,1,1],[755,81,1,1],[755,82,1,1],[755,83,1,1],[755,86,-1,1],[755,92,-1,1],[755,111,-1,1],[755,112,-1,1],[756,1,1,2],[756,18,-1,2],[756,19,-1,2],[756,20,-1,2],[756,22,-1,2],[756,23,-1,2],[756,25,-1,2],[756,28,1,2],[756,54,-1,2],[756,55,-1,2],[756,56,-1,2],[756,58,-1,2],[756,59,-1,2],[756,61,-1,2],[756,84,-1,2],[756,91,-1,2],[756,99,-1,2],[756,104,-1,2],[757,0,-1,1],[757,1,-1,1],[757,19,1,1],[757,22,1,1],[757,40,1,1],[757,43,1,1],[757,54,1,1],[757,63,-1,1],[757,64,1,1],[757,73,-1,1],[757,87,-1,1],[757,88,-1,1],[757,94,-1,1],[757,95,-1,1],[757,102,-1,1],[757,107,-1,1],[758,3,1,2],[758,7,-1,2],[758,10,-1,2],[758,11,-1,2],[758,15,-1,2],[758,16,-1,2],[758,25,-1,2],[758,39,1,2],[758,49,-1,2],[758,55,-1,2],[758,56,-1,2],[758,65,-1,2],[758,66,-1,2],[758,77,-1,2],[758,84,-1,2],[758,91,-1,2],[758,110,-1,2],[758,113,-1,2],[759,47,1,2],[759,48,1,2],[759,58,-1,2],[759,59,-1,2],[759,60,-1,2],[759,65,1,2],[759,66,1,2],[759,67,1,2],[759,89,-1,2],[759,90,-1,2],[759,100,-1,2],[759,106,1,2],[760,5,1,2],[760,7,-1,2],[760,8,-1,2],[760,9,-1,2],[760,13,-1,2],[760,14,-1,2],[760,18,-1,2],[760,46,1,2],[760,51,-1,2],[760,55,-1,2],[760,58,-1,2],[760,65,-1,2],[760,68,-1,2],[760,74,-1,2],[760,84,-1,2],[760,91,-1,2],[760,117,-1,2],[760,118,-1,2],[761,42,1,2],[761,45,1,2],[761,56,-1,2],[761,59,-1,2],[761,63,-1,2],[761,65,1,2],[761,68,1,2],[761,72,1,2],[761,87,-1,2],[761,88,-1,2],[761,102,-1,2],[761,108,1,2],[762,18,-1,2],[762,25,-1,2],[762,28,1,2],[762,33,1,2],[762,38,1,2],[762,53,1,2],[762,56,-1,2],[762,58,1,2],[762,66,-1,2],[762,68,1,2],[762,79,-1,2],[762,81,1,2],[762,84,-1,2],[762,85,-1,2],[762,86,-1,2],[762,91,-1,2],[762,111,-1,2],[762,115,1,2],[763,18,-1,2],[763,25,-1,2],[763,28,1,2],[763,33,1,2],[763,38,1,2],[763,53,1,2],[763,55,-1,2],[763,59,1,2],[763,65,-1,2],[763,69,1,2],[763,78,-1,2],[763,82,1,2],[763,84,-1,2],[763,85,-1,2],[763,86,-1,2],[763,91,-1,2],[763,112,-1,2],[763,114,1,2],[764,7,-1,1],[764,25,-1,2],[764,39,1,2],[764,42,1,2],[764,45,1,2],[764,55,-1,2],[764,58,-1,2],[764,62,-1,2],[764,66,1,2],[764,69,1,2],[764,73,1,2],[764,84,-1,1],[764,87,-1,2],[764,88,-1,2],[764,91,-1,1],[764,103,-1,2],[764,107,1,2],[765,4,1,2],[765,7,-1,2],[765,8,-1,2],[765,9,-1,2],[765,13,-1,2],[765,14,-1,2],[765,18,-1,2],[765,46,1,2],[765,52,-1,2],[765,56,-1,2],[765,59,-1,2],[765,66,-1,2],[765,69,-1,2],[765,75,-1,2],[765,84,-1,2],[765,91,-1,2],[765,117,1,2],[765,119,-1,2],[766,7,-1,1],[766,18,-1,2],[766,46,1,2],[766,47,1,2],[766,48,1,2],[766,55,-1,2],[766,56,-1,2],[766,57,-1,2],[766,68,1,2],[766,69,1,2],[766,70,1,2],[766,84,-1,1],[766,89,-1,2],[766,90,-1,2],[766,91,-1,1],[766,101,-1,2],[766,105,1,2],[767,2,1,2],[767,7,-1,2],[767,10,-1,2],[767,11,-1,2],[767,15,-1,2],[767,16,-1,2],[767,25,-1,2],[767,39,1,2],[767,50,-1,2],[767,58,-1,2],[767,59,-1,2],[767,68,-1,2],[767,69,-1,2],[767,80,-1,2],[767,84,-1,2],[767,91,-1,2],[767,110,1,2],[767,116,-1,2],[768,0,1,2],[768,18,-1,2],[768,19,-1,2],[768,20,-1,2],[768,22,-1,2],[768,23,-1,2],[768,25,-1,2],[768,28,1,1],[768,64,-1,2],[768,65,-1,2],[768,66,-1,2],[768,68,-1,2],[768,69,-1,2],[768,71,-1,2],[768,84,-1,1],[768,91,-1,1],[768,99,1,2],[768,109,-1,2],[769,4,1,2],[769,5,1,2],[769,8,-1,2],[769,9,-1,2],[769,13,-1,2],[769,14,-1,2],[769,47,1,2],[769,48,1,2],[769,57,-1,2],[769,60,-1,2],[769,67,-1,2],[769,70,-1,2],[769,89,-1,2],[769,90,-1,2],[769,118,1,2],[769,119,1,2],[770,0,-1,1],[770,1,-1,1],[770,19,1,1],[770,20,1,1],[770,40,1,1],[770,41,1,1],[770,60,-1,1],[770,61,1,1],[770,70,-1,1],[770,71,1,1],[770,89,-1,1],[770,90,-1,1],[770,96,-1,1],[770,97,-1,1],[770,100,-1,1],[770,105,-1,1],[771,19,1,2],[771,20,1,2],[771,22,1,2],[771,23,1,2],[771,54,-1,2],[771,61,1,2],[771,64,-1,2],[771,71,1,2],[771,76,-1,2],[771,83,1,2],[771,111,-1,2],[771,112,-1,2],[771,114,-1,2],[771,115,-1,2],[772,2,1,2],[772,3,1,2],[772,10,-1,2],[772,11,-1,2],[772,15,-1,2],[772,16,-1,2],[772,42,1,2],[772,45,1,2],[772,62,-1,2],[772,63,-1,2],[772,72,-1,2],[772,73,-1,2],[772,87,-1,2],[772,88,-1,2],[772,113,1,2],[772,116,1,2],[773,4,-1,1],[773,5,-1,1],[773,8,-1,1],[773,9,-1,1],[773,29,-1,1],[773,30,-1,1],[773,72,1,1],[773,73,1,1],[773,74,1,1],[773,75,1,1],[773,87,-1,1],[773,88,-1,1],[773,94,-1,1],[773,95,-1,1],[773,102,-1,1],[773,103,-1,1],[774,8,1,2],[774,9,1,2],[774,13,1,2],[774,14,1,2],[774,47,-1,2],[774,48,-1,2],[774,51,-1,2],[774,52,-1,2],[774,74,1,2],[774,75,1,2],[774,89,1,2],[774,90,1,2],[774,100,-1,2],[774,101,-1,2],[774,105,-1,2],[774,106,-1,2],[775,2,-1,1],[775,3,-1,1],[775,10,-1,1],[775,11,-1,1],[775,31,-1,1],[775,32,-1,1],[775,67,1,1],[775,70,1,1],[775,77,1,1],[775,80,1,1],[775,89,-1,1],[775,90,-1,1],[775,96,-1,1],[775,97,-1,1],[775,100,-1,1],[775,101,-1,1],[776,10,1,2],[776,11,1,2],[776,15,1,2],[776,16,1,2],[776,42,-1,2],[776,45,-1,2],[776,49,-1,2],[776,50,-1,2],[776,77,1,2],[776,80,1,2],[776,87,1,2],[776,88,1,2],[776,102,-1,2],[776,103,-1,2],[776,107,-1,2],[776,108,-1,2],[777,6,-1,1],[777,12,-1,1],[777,17,-1,1],[777,21,-2,1],[777,24,-2,1],[777,63,1,1],[777,73,1,1],[777,79,1,1],[777,82,1,1],[777,83,1,1],[777,85,-1,1],[777,86,-1,1],[777,87,-2,1],[777,88,-2,1],[777,103,-1,1],[777,108,-1,1],[777,112,-1,1],[777,115,-1,1],[778,7,2,1],[778,25,1,1],[778,39,-1,1],[778,42,-1,1],[778,45,-1,1],[778,55,-1,1],[778,58,-1,1],[778,62,-1,1],[778,66,1,1],[778,69,1,1],[778,73,1,1],[778,84,2,1],[778,87,1,1],[778,88,1,1],[778,91,2,1],[778,103,-1,1],[778,107,1,1],[779,6,-1,1],[779,12,-2,1],[779,17,-1,1],[779,26,-2,1],[779,27,-2,1],[779,60,-1,1],[779,70,-1,1],[779,76,-1,1],[779,81,-1,1],[779,82,-1,1],[779,85,-1,1],[779,86,-2,1],[779,89,-2,1],[779,90,-2,1],[779,101,1,1],[779,106,1,1],[779,114,-1,1],[779,115,-1,1],[780,7,2,1],[780,18,1,1],[780,46,-1,1],[780,47,-1,1],[780,48,-1,1],[780,55,-1,1],[780,56,-1,1],[780,57,-1,1],[780,68,1,1],[780,69,1,1],[780,70,1,1],[780,84,2,1],[780,89,1,1],[780,90,1,1],[780,91,2,1],[780,101,-1,1],[780,105,1,1],[781,21,-1,2],[781,33,1,2],[781,42,-1,2],[781,62,1,2],[781,63,1,2],[781,76,-1,2],[781,78,-1,2],[781,79,-1,2],[781,85,-1,2],[781,87,1,2],[781,94,1,2],[781,102,1,2],[781,103,1,2],[781,111,-1,2],[781,112,-1,2],[782,3,-1,2],[782,10,-1,2],[782,16,1,2],[782,24,-1,2],[782,31,-1,2],[782,37,1,2],[782,45,-1,2],[782,49,1,2],[782,62,-1,2],[782,73,1,2],[782,87,-1,2],[782,94,-1,2],[782,103,-1,2],[782,107,1,2],[783,19,-1,1],[783,20,-1,1],[783,21,-2,1],[783,43,1,1],[783,44,1,1],[783,45,2,1],[783,88,-2,1],[783,94,2,1],[784,24,-1,1],[784,42,1,1],[784,87,-1,1],[784,95,1,1],[785,2,-1,2],[785,10,-1,2],[785,16,1,2],[785,21,-1,2],[785,31,-1,2],[785,37,1,2],[785,42,-1,2],[785,50,1,2],[785,62,-1,2],[785,73,1,2],[785,80,1,2],[785,88,-1,2],[785,95,-1,2],[785,103,-1,1],[785,107,1,1],[785,110,-1,2],[785,116,1,2],[786,24,-1,2],[786,33,1,2],[786,45,-1,2],[786,62,1,1],[786,63,1,1],[786,76,-1,2],[786,81,-1,2],[786,82,-1,2],[786,85,-1,2],[786,88,1,2],[786,95,1,2],[786,102,1,1],[786,103,1,1],[786,114,-1,2],[786,115,-1,2],[787,18,-1,1],[787,21,-1,1],[787,24,-1,1],[787,28,1,1],[787,46,1,1],[787,55,1,1],[787,58,2,1],[787,62,1,1],[787,66,-1,1],[787,69,-2,1],[787,73,-1,1],[787,84,-1,1],[787,94,1,1],[787,95,1,1],[787,98,1,1],[787,103,1,1],[787,107,-1,1],[788,6,-1,1],[788,33,-1,1],[788,38,-1,1],[788,42,-2,1],[788,45,-2,1],[788,63,1,1],[788,73,1,1],[788,79,1,1],[788,82,1,1],[788,83,1,1],[788,92,-1,1],[788,93,-1,1],[788,94,-2,1],[788,95,-2,1],[788,103,-1,1],[788,108,-1,1],[788,112,-1,1],[788,115,-1,1],[789,87,-1,1],[789,88,-1,1],[789,94,-1,1],[789,95,-1,1],[790,5,-1,2],[790,8,-1,2],[790,14,1,2],[790,27,-1,2],[790,29,-1,2],[790,35,1,2],[790,48,-1,2],[790,51,1,2],[790,57,-1,2],[790,70,1,2],[790,74,1,2],[790,89,-1,2],[790,96,-1,2],[790,101,-1,2],[790,105,1,2],[790,117,1,2],[790,118,1,2],[791,26,-1,1],[791,48,1,1],[791,90,-1,1],[791,96,1,1],[792,27,-1,1],[792,47,1,1],[792,89,-1,1],[792,97,1,1],[793,4,-1,2],[793,8,-1,2],[793,14,1,2],[793,26,-1,2],[793,29,-1,2],[793,35,1,2],[793,47,-1,2],[793,52,1,2],[793,57,-1,2],[793,70,1,2],[793,75,1,2],[793,90,-1,2],[793,97,-1,2],[793,101,-1,2],[793,105,1,2],[793,117,-1,2],[793,119,1,2],[794,12,-1,2],[794,27,-1,2],[794,33,-1,2],[794,48,-1,2],[794,53,-1,2],[794,57,-1,1],[794,60,-1,1],[794,79,-1,2],[794,82,-1,2],[794,83,-1,2],[794,85,1,2],[794,90,1,2],[794,92,1,2],[794,97,1,2],[794,100,-1,1],[794,101,-1,1],[794,112,1,2],[794,115,1,2],[795,25,-1,1],[795,26,-1,1],[795,27,-1,1],[795,28,1,1],[795,39,1,1],[795,55,1,1],[795,56,1,1],[795,57,2,1],[795,68,-1,1],[795,69,-1,1],[795,70,-2,1],[795,84,-1,1],[795,96,1,1],[795,97,1,1],[795,98,1,1],[795,101,2,1],[795,105,-2,1],[796,6,-1,1],[796,33,-1,1],[796,38,-1,1],[796,47,-2,1],[796,48,-2,1],[796,60,-1,1],[796,70,-1,1],[796,76,-1,1],[796,81,-1,1],[796,82,-1,1],[796,92,-1,1],[796,93,-1,1],[796,96,-2,1],[796,97,-2,1],[796,101,1,1],[796,106,1,1],[796,114,-1,1],[796,115,-1,1],[797,89,-1,1],[797,90,-1,1],[797,96,-1,1],[797,97,-1,1],[798,7,-1,1],[798,28,-1,1],[798,91,-1,1],[798,98,-1,1],[799,2,-1,2],[799,3,-1,2],[799,11,-1,2],[799,15,1,2],[799,18,-1,2],[799,32,-1,2],[799,36,1,2],[799,39,-1,2],[799,56,-1,2],[799,59,-1,2],[799,65,1,2],[799,68,1,2],[799,91,-1,2],[799,98,-1,2],[799,113,-1,2],[799,116,-1,2],[800,4,-1,2],[800,5,-1,2],[800,9,-1,2],[800,13,1,2],[800,25,-1,2],[800,30,-1,2],[800,34,1,2],[800,46,-1,2],[800,58,-1,2],[800,59,-1,2],[800,65,1,2],[800,66,1,2],[800,91,-1,2],[800,98,-1,2],[800,118,-1,2],[800,119,-1,2],[801,12,-1,1],[801,27,1,1],[801,33,-1,1],[801,48,1,1],[801,53,-1,1],[801,57,-2,1],[801,60,-2,1],[801,79,1,1],[801,82,1,1],[801,83,1,1],[801,85,1,1],[801,90,-1,1],[801,92,1,1],[801,97,-1,1],[801,100,-2,1],[801,101,-2,1],[801,112,-1,1],[801,115,-1,1],[802,0,1,2],[802,19,1,2],[802,22,1,2],[802,26,1,2],[802,41,-1,2],[802,44,-1,2],[802,48,-1,2],[802,61,1,2],[802,64,-1,2],[802,67,-1,2],[802,70,-1,2],[802,90,1,2],[802,96,-1,2],[802,99,1,2],[802,100,1,2],[802,101,1,2],[802,104,1,2],[803,24,-1,1],[803,33,-1,1],[803,45,-1,1],[803,62,-2,1],[803,63,-2,1],[803,76,-1,1],[803,81,-1,1],[803,82,-1,1],[803,85,1,1],[803,88,1,1],[803,95,1,1],[803,102,-2,1],[803,103,-2,1],[803,114,-1,1],[803,115,-1,1],[804,0,1,2],[804,19,1,2],[804,20,1,2],[804,21,1,2],[804,43,-1,2],[804,44,-1,2],[804,45,-1,2],[804,54,1,2],[804,71,-1,2],[804,72,-1,2],[804,73,-1,2],[804,88,1,2],[804,94,-1,2],[804,99,1,2],[804,102,1,2],[804,103,1,2],[804,104,1,2],[805,6,1,2],[805,12,1,1],[805,17,1,2],[805,26,1,2],[805,27,1,2],[805,57,-1,2],[805,67,-1,2],[805,76,-1,2],[805,78,-1,2],[805,79,-1,2],[805,85,1,2],[805,86,1,1],[805,89,1,2],[805,90,1,2],[805,100,1,2],[805,105,1,2],[805,111,-1,2],[805,112,-1,2],[806,2,1,2],[806,10,1,2],[806,15,1,2],[806,26,1,2],[806,32,-1,2],[806,37,-1,2],[806,48,-1,2],[806,50,-1,2],[806,60,-1,2],[806,70,-1,2],[806,77,1,1],[806,90,1,2],[806,96,-1,2],[806,100,-1,2],[806,105,-1,2],[806,110,1,1],[806,113,1,1],[807,25,-1,2],[807,26,-1,2],[807,27,-1,2],[807,28,1,2],[807,39,1,2],[807,55,-1,2],[807,56,-1,2],[807,57,-1,1],[807,68,1,2],[807,69,1,2],[807,70,1,1],[807,84,-1,2],[807,96,1,2],[807,97,1,2],[807,98,1,2],[807,101,-1,1],[807,105,1,1],[808,60,-1,1],[808,67,1,1],[808,100,-1,1],[808,106,1,1],[809,3,1,2],[809,10,1,2],[809,15,1,2],[809,26,1,2],[809,32,-1,2],[809,37,-1,2],[809,48,-1,2],[809,49,-1,2],[809,57,-1,2],[809,67,-1,2],[809,80,1,2],[809,90,1,1],[809,96,-1,1],[809,101,-1,2],[809,106,-1,2],[809,110,-1,2],[809,116,1,2],[810,6,1,2],[810,12,1,1],[810,17,1,2],[810,26,1,1],[810,27,1,1],[810,60,-1,2],[810,70,-1,2],[810,76,-1,2],[810,81,-1,2],[810,82,-1,2],[810,85,1,2],[810,86,1,1],[810,89,1,1],[810,90,1,1],[810,101,1,2],[810,106,1,2],[810,114,-1,2],[810,115,-1,2],[811,1,1,2],[811,19,1,2],[811,22,1,2],[811,26,1,2],[811,41,-1,2],[811,44,-1,2],[811,48,-1,2],[811,54,-1,2],[811,57,-1,2],[811,60,-1,2],[811,71,1,2],[811,90,1,2],[811,96,-1,2],[811,99,-1,2],[811,105,1,2],[811,106,1,2],[811,109,1,2],[812,17,1,1],[812,27,-1,1],[812,38,1,1],[812,48,-1,1],[812,53,1,1],[812,79,-1,1],[812,82,-1,1],[812,83,-1,1],[812,86,-1,1],[812,90,1,1],[812,93,-1,1],[812,97,1,1],[812,112,1,1],[812,115,1,1],[813,100,-1,1],[813,101,-1,1],[813,105,-1,1],[813,106,-1,1],[814,6,-1,2],[814,12,-1,2],[814,17,-1,2],[814,21,-1,2],[814,24,-1,2],[814,62,-1,2],[814,72,-1,2],[814,81,-1,2],[814,85,-1,2],[814,86,-1,2],[814,87,-1,2],[814,88,-1,2],[814,102,1,2],[814,107,1,2],[814,111,1,2],[815,4,1,2],[815,8,1,2],[815,13,1,2],[815,21,1,2],[815,30,-1,2],[815,35,-1,2],[815,45,-1,2],[815,52,-1,2],[815,63,-1,2],[815,73,-1,2],[815,74,1,2],[815,88,1,2],[815,94,-1,2],[815,102,-1,2],[815,107,-1,2],[815,117,1,2],[815,118,1,2],[816,55,-1,1],[816,58,-1,1],[816,62,-2,1],[816,66,1,1],[816,69,1,1],[816,73,2,1],[816,103,-2,1],[816,107,2,1],[817,63,-1,1],[817,72,1,1],[817,102,-1,1],[817,108,1,1],[818,5,1,2],[818,8,1,2],[818,13,1,2],[818,21,1,2],[818,30,-1,2],[818,35,-1,2],[818,45,-1,2],[818,51,-1,2],[818,62,-1,2],[818,72,-1,2],[818,75,1,2],[818,88,1,2],[818,94,-1,2],[818,103,-1,2],[818,108,-1,2],[818,117,-1,2],[818,119,1,2],[819,6,-1,2],[819,12,-1,2],[819,17,-1,2],[819,21,-1,1],[819,24,-1,1],[819,63,-1,2],[819,73,-1,2],[819,79,-1,2],[819,82,-1,2],[819,83,-1,2],[819,85,-1,2],[819,86,-1,2],[819,87,-1,1],[819,88,-1,1],[819,103,1,2],[819,108,1,2],[819,112,1,2],[819,115,1,2],[820,1,1,2],[820,19,1,2],[820,20,1,2],[820,21,1,2],[820,43,-1,2],[820,44,-1,2],[820,45,-1,2],[820,61,-1,2],[820,62,-1,2],[820,63,-1,2],[820,64,1,2],[820,88,1,2],[820,94,-1,2],[820,99,-1,2],[820,107,1,2],[820,108,1,2],[820,109,1,2],[821,17,1,1],[821,24,1,1],[821,38,1,1],[821,45,1,1],[821,53,1,1],[821,76,1,1],[821,81,1,1],[821,82,1,1],[821,86,-1,1],[821,88,-1,1],[821,93,-1,1],[821,95,-1,1],[821,114,1,1],[821,115,1,1],[822,102,-1,1],[822,103,-1,1],[822,107,-1,1],[822,108,-1,1],[823,0,-1,1],[823,1,-1,1],[823,104,-1,1],[823,109,-1,1],[824,11,1,2],[824,16,1,2],[824,20,1,2],[824,23,1,2],[824,31,-1,2],[824,36,-1,2],[824,40,-1,2],[824,43,-1,2],[824,49,-1,2],[824,50,-1,2],[824,54,-1,2],[824,64,-1,2],[824,104,-1,2],[824,109,-1,2],[824,113,-1,2],[824,116,-1,2],[825,9,1,2],[825,14,1,2],[825,22,1,2],[825,23,1,2],[825,29,-1,2],[825,34,-1,2],[825,40,-1,2],[825,41,-1,2],[825,51,-1,2],[825,52,-1,2],[825,61,-1,2],[825,71,-1,2],[825,104,-1,2],[825,109,-1,2],[825,118,-1,2],[825,119,-1,2],[826,2,-1,1],[826,3,-1,1],[826,113,-1,1],[826,116,-1,1],[827,49,-1,1],[827,50,-1,1],[827,113,-1,1],[827,116,-1,1],[828,77,-1,1],[828,80,-1,1],[828,113,-1,1],[828,116,-1,1],[829,4,-1,1],[829,5,-1,1],[829,118,-1,1],[829,119,-1,1],[830,51,-1,1],[830,52,-1,1],[830,118,-1,1],[830,119,-1,1],[831,74,-1,1],[831,75,-1,1],[831,118,-1,1],[831,119,-1,1],[832,18,1,1],[832,25,1,1],[832,28,-1,1],[832,33,-1,1],[832,38,-1,1],[832,53,-1,1],[832,55,-1,1],[832,59,1,1],[832,65,-1,1],[832,69,1,1],[832,78,-1,1],[832,82,1,1],[832,84,1,1],[832,85,1,1],[832,86,1,1],[832,91,1,1],[832,112,-1,1],[832,114,1,1],[833,18,-1,1],[833,25,-1,1],[833,28,1,1],[833,84,-1,1],[833,91,-1,1],[834,1,-1,1],[834,6,-1,1],[834,17,-1,1],[834,19,1,1],[834,23,-1,1],[834,38,-1,1],[834,40,1,1],[834,44,-1,1],[834,54,1,1],[834,61,1,1],[834,78,1,1],[834,82,-1,1],[834,85,-1,1],[834,92,-1,1],[834,99,1,1],[834,104,1,1],[834,112,1,1],[834,114,-1,1],[835,0,-1,1],[835,6,-1,1],[835,12,-1,1],[835,19,1,1],[835,23,-1,1],[835,33,-1,1],[835,40,1,1],[835,44,-1,1],[835,64,1,1],[835,71,1,1],[835,78,1,1],[835,82,-1,1],[835,86,-1,1],[835,93,-1,1],[835,99,-1,1],[835,109,1,1],[835,112,1,1],[835,114,-1,1],[836,17,1,1],[836,21,1,1],[836,38,1,1],[836,42,1,1],[836,53,1,1],[836,72,1,1],[836,73,1,1],[836,76,2,1],[836,78,2,1],[836,79,2,1],[836,86,-1,1],[836,87,-1,1],[836,93,-1,1],[836,94,-1,1],[836,107,1,1],[836,108,1,1],[836,111,2,1],[836,112,2,1],[837,6,-1,1],[837,33,-1,1],[837,38,-1,1],[837,47,-1,1],[837,48,-1,1],[837,57,-1,1],[837,67,-1,1],[837,76,-2,1],[837,78,-2,1],[837,79,-2,1],[837,92,-1,1],[837,93,-1,1],[837,96,-1,1],[837,97,-1,1],[837,100,1,1],[837,105,1,1],[837,111,-2,1],[837,112,-2,1],[838,7,1,1],[838,12,1,1],[838,17,1,1],[838,39,-1,1],[838,46,-1,1],[838,53,1,1],[838,55,-1,1],[838,59,1,1],[838,65,-1,1],[838,69,1,1],[838,78,-1,1],[838,82,1,1],[838,84,1,1],[838,92,-1,1],[838,93,-1,1],[838,98,-1,1],[838,112,-1,1],[838,114,1,1],[839,25,-2,1],[839,26,-1,1],[839,27,-1,1],[839,28,2,1],[839,39,2,1],[839,58,1,1],[839,59,1,1],[839,60,1,1],[839,65,-1,1],[839,66,-1,1],[839,67,-1,1],[839,84,-2,1],[839,96,1,1],[839,97,1,1],[839,98,2,1],[839,100,1,1],[839,106,-1,1],[840,18,-2,1],[840,21,-1,1],[840,24,-1,1],[840,28,2,1],[840,46,2,1],[840,56,1,1],[840,59,1,1],[840,63,1,1],[840,65,-1,1],[840,68,-1,1],[840,72,-1,1],[840,84,-2,1],[840,94,1,1],[840,95,1,1],[840,98,2,1],[840,102,1,1],[840,108,-1,1],[841,7,1,1],[841,39,-1,1],[841,46,-1,1],[841,84,1,1],[841,98,-1,1],[842,1,1,1],[842,54,-1,1],[842,61,-1,1],[842,99,-1,1],[842,104,-1,1],[843,0,-1,1],[843,61,-1,1],[843,64,1,1],[843,99,-1,1],[843,104,-1,1],[844,0,-1,1],[844,54,-1,1],[844,71,1,1],[844,99,-1,1],[844,104,-1,1],[845,1,1,1],[845,61,-1,1],[845,64,1,1],[845,99,-1,1],[845,109,1,1],[846,1,1,1],[846,54,-1,1],[846,71,1,1],[846,99,-1,1],[846,109,1,1],[847,0,1,1],[847,64,-1,1],[847,71,-1,1],[847,99,1,1],[847,109,-1,1],[848,6,1,2],[848,33,1,2],[848,38,1,2],[848,47,1,2],[848,48,1,2],[848,57,-1,2],[848,67,-1,2],[848,76,-1,1],[848,78,-1,1],[848,79,-1,1],[848,92,1,2],[848,93,1,2],[848,96,1,2],[848,97,1,2],[848,100,1,2],[848,105,1,2],[848,111,-1,1],[848,112,-1,1],[849,2,1,2],[849,10,1,2],[849,11,1,2],[849,12,1,2],[849,36,-1,2],[849,37,-1,2],[849,38,-1,2],[849,49,1,2],[849,80,-1,2],[849,81,-1,2],[849,82,-1,2],[849,83,-1,2],[849,86,1,2],[849,92,-1,2],[849,110,1,2],[849,111,1,2],[849,112,1,2],[849,113,1,2],[850,2,-1,1],[850,49,-1,1],[850,80,1,1],[850,110,-1,1],[850,113,-1,1],[851,4,1,2],[851,8,1,2],[851,9,1,2],[851,12,1,2],[851,34,-1,2],[851,35,-1,2],[851,38,-1,2],[851,51,1,2],[851,75,-1,2],[851,76,-1,2],[851,79,-1,2],[851,82,-1,2],[851,86,1,2],[851,92,-1,2],[851,111,-1,2],[851,114,-1,2],[851,117,1,2],[851,118,1,2],[852,5,1,2],[852,8,1,2],[852,9,1,2],[852,12,1,2],[852,34,-1,2],[852,35,-1,2],[852,38,-1,2],[852,52,1,2],[852,74,-1,2],[852,76,-1,2],[852,78,-1,2],[852,81,-1,2],[852,86,1,2],[852,92,-1,2],[852,112,-1,2],[852,115,-1,2],[852,117,-1,2],[852,119,1,2],[853,79,1,1],[853,82,1,1],[853,83,1,1],[853,112,-1,1],[853,115,-1,1],[854,76,-1,1],[854,81,-1,1],[854,82,-1,1],[854,114,-1,1],[854,115,-1,1],[855,3,-1,2],[855,10,-1,2],[855,11,-1,2],[855,12,-1,2],[855,36,1,2],[855,37,1,2],[855,38,1,2],[855,50,-1,2],[855,77,1,2],[855,78,1,2],[855,79,1,2],[855,83,1,2],[855,86,-1,2],[855,92,1,2],[855,110,1,2],[855,114,-1,2],[855,115,-1,2],[855,116,-1,2],[856,3,-1,1],[856,50,-1,1],[856,77,1,1],[856,110,1,1],[856,116,-1,1],[857,11,1,2],[857,16,1,2],[857,27,1,2],[857,31,-1,2],[857,36,-1,2],[857,47,-1,2],[857,57,-1,2],[857,67,-1,2],[857,89,1,2],[857,97,-1,2],[857,101,-1,2],[857,106,-1,2],[858,2,-1,1],[858,11,-1,2],[858,15,1,2],[858,21,-1,2],[858,32,-1,2],[858,36,1,2],[858,42,-1,2],[858,50,1,1],[858,63,-1,2],[858,72,1,2],[858,80,1,1],[858,88,-1,2],[858,95,-1,2],[858,102,-1,2],[858,108,1,2],[858,110,-1,1],[858,116,1,1],[859,5,-1,1],[859,51,1,1],[859,74,1,1],[859,117,1,1],[859,118,1,1],[860,4,-1,1],[860,52,1,1],[860,74,-1,1],[860,117,-1,1],[860,118,-1,1],[861,4,-1,1],[861,51,-1,1],[861,75,1,1],[861,117,-1,1],[861,118,-1,1],[862,5,-1,1],[862,52,-1,1],[862,74,1,1],[862,117,1,1],[862,119,-1,1],[863,5,-1,1],[863,51,1,1],[863,75,-1,1],[863,117,1,1],[863,119,-1,1],[864,4,-1,1],[864,52,1,1],[864,75,1,1],[864,117,-1,1],[864,119,1,1],[865,6,-1,2],[865,8,1,2],[865,12,-1,2],[865,13,1,2],[865,17,-1,2],[865,29,1,2],[865,33,-1,2],[865,34,1,2],[865,38,-1,2],[865,53,-1,2],[865,74,1,2],[865,75,1,2],[865,81,-1,2],[865,82,-1,2],[865,83,-1,2],[865,111,1,2],[865,112,1,2],[865,118,1,2],[865,119,1,2],[866,0,1,2],[866,1,1,2],[866,19,-1,2],[866,20,-1,2],[866,22,-1,2],[866,23,-1,2],[866,33,1,2],[866,38,1,2],[866,53,1,2],[866,76,-1,2],[866,78,-1,2],[866,79,-1,2],[866,81,-1,2],[866,82,-1,2],[866,83,-1,2],[866,85,-1,2],[866,86,-1,2],[866,104,1,2],[866,109,1,2],[867,76,1,1],[867,83,-1,1],[867,111,1,1],[867,112,1,1],[867,114,1,1],[867,115,1,1],[868,2,1,1],[868,3,1,1],[868,4,1,1],[868,5,1,1],[868,13,-1,1],[868,14,-1,1],[868,15,-1,1],[868,16,-1,1],[868,29,1,1],[868,30,1,1],[868,31,1,1],[868,32,1,1],[868,49,-1,1],[868,50,-1,1],[868,51,-1,1],[868,52,-1,1],[869,13,-1,1],[869,14,-1,1],[869,15,-1,1],[869,16,-1,1],[869,29,1,1],[869,30,1,1],[869,31,1,1],[869,32,1,1],[869,74,-1,1],[869,75,-1,1],[869,77,-1,1],[869,80,-1,1],[869,113,-1,1],[869,116,-1,1],[869,118,-1,1],[869,119,-1,1],[870,2,1,1],[870,3,1,1],[870,4,1,1],[870,5,1,1],[870,8,-1,1],[870,9,-1,1],[870,10,-1,1],[870,11,-1,1],[870,34,1,1],[870,35,1,1],[870,36,1,1],[870,37,1,1],[870,49,-1,1],[870,50,-1,1],[870,51,-1,1],[870,52,-1,1],[871,8,-1,1],[871,9,-1,1],[871,10,-1,1],[871,11,-1,1],[871,34,1,1],[871,35,1,1],[871,36,1,1],[871,37,1,1],[871,74,-2,1],[871,75,-2,1],[871,77,-1,1],[871,80,-1,1],[871,113,-1,1],[871,116,-1,1],[871,118,-2,1],[871,119,-2,1],[872,9,-1,1],[872,14,-1,1],[872,22,-1,1],[872,23,-1,1],[872,29,1,1],[872,34,1,1],[872,40,1,1],[872,41,1,1],[872,51,-1,1],[872,52,-1,1],[872,61,-1,1],[872,71,-1,1],[872,104,-1,1],[872,109,-1,1],[872,118,-1,1],[872,119,-1,1],[873,11,-1,1],[873,16,-1,1],[873,20,-1,1],[873,23,-1,1],[873,31,1,1],[873,36,1,1],[873,40,1,1],[873,43,1,1],[873,49,-1,1],[873,50,-1,1],[873,54,-1,1],[873,64,-1,1],[873,104,-1,1],[873,109,-1,1],[873,113,-1,1],[873,116,-1,1],[874,10,-1,1],[874,15,-1,1],[874,19,-1,1],[874,22,-1,1],[874,32,1,1],[874,37,1,1],[874,41,1,1],[874,44,1,1],[874,49,-1,1],[874,50,-1,1],[874,54,-1,1],[874,64,-1,1],[874,104,-1,1],[874,109,-1,1],[874,113,-1,1],[874,116,-1,1],[875,8,-1,1],[875,13,-1,1],[875,19,-1,1],[875,20,-1,1],[875,30,1,1],[875,35,1,1],[875,43,1,1],[875,44,1,1],[875,51,-1,1],[875,52,-1,1],[875,61,-1,1],[875,71,-1,1],[875,104,-1,1],[875,109,-1,1],[875,118,-1,1],[875,119,-1,1],[876,2,-1,2],[876,3,-1,2],[876,4,-1,2],[876,5,-1,2],[876,8,-1,2],[876,9,-1,2],[876,10,-1,2],[876,11,-1,2],[876,34,1,2],[876,35,1,2],[876,36,1,2],[876,37,1,2],[876,49,1,2],[876,50,1,2],[876,51,1,2],[876,52,1,2],[877,4,1,1],[877,5,1,1],[877,9,-1,1],[877,13,1,1],[877,25,1,1],[877,30,-1,1],[877,34,1,1],[877,46,1,1],[877,58,-1,1],[877,59,-1,1],[877,65,1,1],[877,66,1,1],[877,91,1,1],[877,98,1,1],[877,118,1,1],[877,119,1,1],[878,2,1,1],[878,3,1,1],[878,11,-1,1],[878,15,1,1],[878,18,1,1],[878,32,-1,1],[878,36,1,1],[878,39,1,1],[878,56,-1,1],[878,59,-1,1],[878,65,1,1],[878,68,1,1],[878,91,1,1],[878,98,1,1],[878,113,1,1],[878,116,1,1],[879,18,1,1],[879,20,-1,1],[879,22,1,1],[879,25,-1,1],[879,39,1,1],[879,41,-1,1],[879,43,1,1],[879,46,-1,1],[879,54,1,1],[879,56,-1,1],[879,58,1,1],[879,61,-1,1],[879,64,1,1],[879,66,-1,1],[879,68,1,1],[879,71,-1,1],[880,0,1,1],[880,1,1,1],[880,7,1,1],[880,20,-1,1],[880,22,1,1],[880,28,1,1],[880,41,-1,1],[880,43,1,1],[880,56,-1,1],[880,58,1,1],[880,66,-1,1],[880,68,1,1],[880,91,1,1],[880,98,1,1],[880,104,1,1],[880,109,1,1],[881,18,1,1],[881,19,-1,1],[881,23,1,1],[881,25,-1,1],[881,39,1,1],[881,40,-1,1],[881,44,1,1],[881,46,-1,1],[881,54,1,1],[881,55,-1,1],[881,59,1,1],[881,61,-1,1],[881,64,1,1],[881,65,-1,1],[881,69,1,1],[881,71,-1,1],[882,2,1,1],[882,3,1,1],[882,10,-1,1],[882,16,1,1],[882,18,1,1],[882,31,-1,1],[882,37,1,1],[882,39,1,1],[882,55,-1,1],[882,58,-1,1],[882,66,1,1],[882,69,1,1],[882,91,1,1],[882,98,1,1],[882,113,1,1],[882,116,1,1],[883,4,1,1],[883,5,1,1],[883,8,-1,1],[883,14,1,1],[883,25,1,1],[883,29,-1,1],[883,35,1,1],[883,46,1,1],[883,55,-1,1],[883,56,-1,1],[883,68,1,1],[883,69,1,1],[883,91,1,1],[883,98,1,1],[883,118,1,1],[883,119,1,1],[884,18,1,2],[884,19,1,2],[884,23,-1,2],[884,25,-1,2],[884,39,1,2],[884,40,1,2],[884,44,-1,2],[884,46,-1,2],[884,54,1,2],[884,55,1,2],[884,59,-1,2],[884,61,-1,2],[884,64,1,2],[884,65,1,2],[884,69,-1,2],[884,71,-1,2],[885,7,-1,2],[885,8,-1,2],[885,14,1,2],[885,18,1,2],[885,28,-1,2],[885,29,-1,2],[885,35,1,2],[885,39,1,2],[885,51,-1,2],[885,52,-1,2],[885,55,-1,2],[885,56,-1,2],[885,68,1,2],[885,69,1,2],[885,74,1,2],[885,75,1,2],[886,0,-1,2],[886,1,-1,2],[886,4,-1,2],[886,5,-1,2],[886,8,-1,2],[886,13,-1,2],[886,19,-1,2],[886,20,-1,2],[886,30,1,2],[886,35,1,2],[886,43,1,2],[886,44,1,2],[886,54,1,2],[886,64,1,2],[886,74,1,2],[886,75,1,2],[887,7,-1,2],[887,10,-1,2],[887,16,1,2],[887,25,1,2],[887,28,-1,2],[887,31,-1,2],[887,37,1,2],[887,46,1,2],[887,49,-1,2],[887,50,-1,2],[887,55,-1,2],[887,58,-1,2],[887,66,1,2],[887,69,1,2],[887,77,1,2],[887,80,1,2],[888,0,-1,2],[888,1,-1,2],[888,2,-1,2],[888,3,-1,2],[888,10,-1,2],[888,15,-1,2],[888,19,-1,2],[888,22,-1,2],[888,32,1,2],[888,37,1,2],[888,41,1,2],[888,44,1,2],[888,61,1,2],[888,71,1,2],[888,77,1,2],[888,80,1,2],[889,0,-1,1],[889,1,-1,1],[889,2,-1,1],[889,3,-1,1],[889,49,-1,1],[889,50,-1,1],[889,54,-1,1],[889,61,1,1],[889,64,-1,1],[889,71,1,1],[889,77,1,1],[889,80,1,1],[889,104,-1,1],[889,109,-1,1],[889,113,-1,1],[889,116,-1,1],[890,2,-1,1],[890,3,-1,1],[890,10,-1,1],[890,11,-1,1],[890,15,-1,1],[890,16,-1,1],[890,42,1,1],[890,45,1,1],[890,62,1,1],[890,63,1,1],[890,72,1,1],[890,73,1,1],[890,87,-1,1],[890,88,-1,1],[890,113,-1,1],[890,116,-1,1],[891,4,-1,1],[891,5,-1,1],[891,8,-1,1],[891,9,-1,1],[891,13,-1,1],[891,14,-1,1],[891,47,1,1],[891,48,1,1],[891,57,1,1],[891,60,1,1],[891,67,1,1],[891,70,1,1],[891,89,-1,1],[891,90,-1,1],[891,118,-1,1],[891,119,-1,1],[892,21,-1,1],[892,24,-1,1],[892,26,-1,1],[892,27,-1,1],[892,67,-1,1],[892,70,-1,1],[892,72,-1,1],[892,73,-1,1],[892,87,-1,1],[892,88,-1,1],[892,89,-1,1],[892,90,-1,1],[892,105,-1,1],[892,106,-1,1],[892,107,-1,1],[892,108,-1,1],[893,5,1,1],[893,8,-1,1],[893,9,-1,1],[893,12,-1,1],[893,34,1,1],[893,35,1,1],[893,38,1,1],[893,52,1,1],[893,74,-1,1],[893,76,-1,1],[893,78,-1,1],[893,81,-1,1],[893,86,-1,1],[893,92,1,1],[893,112,-1,1],[893,115,-1,1],[893,117,-1,1],[893,119,1,1],[894,3,1,1],[894,10,-1,1],[894,11,-1,1],[894,12,-1,1],[894,36,1,1],[894,37,1,1],[894,38,1,1],[894,50,1,1],[894,77,-1,1],[894,78,-1,1],[894,79,-1,1],[894,83,-1,1],[894,86,-1,1],[894,92,1,1],[894,110,-1,1],[894,114,1,1],[894,115,1,1],[894,116,1,1],[895,5,1,1],[895,13,-1,1],[895,14,-1,1],[895,17,-1,1],[895,29,1,1],[895,30,1,1],[895,33,1,1],[895,52,1,1],[895,74,-1,1],[895,76,-1,1],[895,78,-1,1],[895,81,-1,1],[895,85,-1,1],[895,93,1,1],[895,112,-1,1],[895,115,-1,1],[895,117,-1,1],[895,119,1,1],[896,3,1,1],[896,15,-1,1],[896,16,-1,1],[896,17,-1,1],[896,31,1,1],[896,32,1,1],[896,33,1,1],[896,50,1,1],[896,77,-1,1],[896,78,-1,1],[896,79,-1,1],[896,83,-1,1],[896,85,-1,1],[896,93,1,1],[896,110,-1,1],[896,114,1,1],[896,115,1,1],[896,116,1,1],[897,7,1,1],[897,24,1,1],[897,25,-1,1],[897,28,1,1],[897,45,1,1],[897,46,-1,1],[897,55,-1,1],[897,56,-1,1],[897,65,-1,1],[897,66,-1,1],[897,87,1,1],[897,94,1,1],[897,102,1,1],[897,103,1,1],[897,107,1,1],[897,108,1,1],[898,5,1,1],[898,8,-1,1],[898,13,-1,1],[898,21,-1,1],[898,30,1,1],[898,35,1,1],[898,45,1,1],[898,51,-1,1],[898,62,-1,1],[898,72,-1,1],[898,75,1,1],[898,88,-1,1],[898,94,1,1],[898,103,-1,1],[898,108,-1,1],[898,117,-1,1],[898,119,1,1],[899,1,1,1],[899,19,-1,1],[899,20,-1,1],[899,21,-1,1],[899,43,1,1],[899,44,1,1],[899,45,1,1],[899,61,-1,1],[899,62,-1,1],[899,63,-1,1],[899,64,1,1],[899,88,-1,1],[899,94,1,1],[899,99,-1,1],[899,107,1,1],[899,108,1,1],[899,109,1,1],[900,5,1,1],[900,9,-1,1],[900,14,-1,1],[900,24,-1,1],[900,29,1,1],[900,34,1,1],[900,42,1,1],[900,51,-1,1],[900,62,-1,1],[900,72,-1,1],[900,75,1,1],[900,87,-1,1],[900,95,1,1],[900,103,-1,1],[900,108,-1,1],[900,117,-1,1],[900,119,1,1],[901,1,1,1],[901,22,-1,1],[901,23,-1,1],[901,24,-1,1],[901,40,1,1],[901,41,1,1],[901,42,1,1],[901,61,-1,1],[901,62,-1,1],[901,63,-1,1],[901,64,1,1],[901,87,-1,1],[901,95,1,1],[901,99,-1,1],[901,107,1,1],[901,108,1,1],[901,109,1,1],[902,22,-1,1],[902,23,-1,1],[902,24,-1,1],[902,40,1,1],[902,41,1,1],[902,42,1,1],[902,87,-1,1],[902,95,1,1],[903,7,1,1],[903,21,1,1],[903,25,-1,1],[903,28,1,1],[903,42,1,1],[903,46,-1,1],[903,58,-1,1],[903,59,-1,1],[903,68,-1,1],[903,69,-1,1],[903,88,1,1],[903,95,1,1],[903,102,1,1],[903,103,1,1],[903,107,1,1],[903,108,1,1],[904,2,-1,1],[904,3,-1,1],[904,21,1,1],[904,24,1,1],[904,31,-1,1],[904,32,-1,1],[904,36,-1,1],[904,37,-1,1],[904,62,1,1],[904,63,1,1],[904,72,1,1],[904,73,1,1],[904,94,-1,1],[904,95,-1,1],[904,113,-1,1],[904,116,-1,1],[905,0,-1,1],[905,1,-1,1],[905,20,1,1],[905,23,1,1],[905,41,1,1],[905,44,1,1],[905,54,1,1],[905,62,-1,1],[905,64,1,1],[905,72,-1,1],[905,87,-1,1],[905,88,-1,1],[905,94,-1,1],[905,95,-1,1],[905,103,-1,1],[905,108,-1,1],[906,4,-1,1],[906,5,-1,1],[906,13,-1,1],[906,14,-1,1],[906,34,-1,1],[906,35,-1,1],[906,62,1,1],[906,63,1,1],[906,74,1,1],[906,75,1,1],[906,87,-1,1],[906,88,-1,1],[906,94,-1,1],[906,95,-1,1],[906,107,-1,1],[906,108,-1,1],[907,4,-1,1],[907,5,-1,1],[907,21,1,1],[907,24,1,1],[907,42,1,1],[907,45,1,1],[907,51,-1,1],[907,52,-1,1],[907,74,1,1],[907,75,1,1],[907,87,-1,1],[907,88,-1,1],[907,94,-1,1],[907,95,-1,1],[907,118,-1,1],[907,119,-1,1],[908,7,1,1],[908,18,-1,1],[908,27,1,1],[908,28,1,1],[908,39,-1,1],[908,48,1,1],[908,55,-1,1],[908,58,-1,1],[908,65,-1,1],[908,68,-1,1],[908,89,1,1],[908,96,1,1],[908,100,1,1],[908,101,1,1],[908,105,1,1],[908,106,1,1],[909,1,1,1],[909,19,-1,1],[909,22,-1,1],[909,26,-1,1],[909,41,1,1],[909,44,1,1],[909,48,1,1],[909,54,-1,1],[909,57,-1,1],[909,60,-1,1],[909,71,1,1],[909,90,-1,1],[909,96,1,1],[909,99,-1,1],[909,105,1,1],[909,106,1,1],[909,109,1,1],[910,11,-1,1],[910,16,-1,1],[910,27,-1,1],[910,31,1,1],[910,36,1,1],[910,47,1,1],[910,57,-1,1],[910,67,-1,1],[910,89,-1,1],[910,97,1,1],[910,101,-1,1],[910,106,-1,1],[911,11,-1,1],[911,16,-1,1],[911,27,-1,1],[911,31,1,1],[911,36,1,1],[911,47,1,1],[911,89,-1,1],[911,97,1,1],[912,1,1,1],[912,20,-1,1],[912,23,-1,1],[912,27,-1,1],[912,40,1,1],[912,43,1,1],[912,47,1,1],[912,54,-1,1],[912,57,-1,1],[912,60,-1,1],[912,71,1,1],[912,89,-1,1],[912,97,1,1],[912,99,-1,1],[912,105,1,1],[912,106,1,1],[912,109,1,1],[913,7,1,1],[913,18,-1,1],[913,26,1,1],[913,28,1,1],[913,39,-1,1],[913,47,1,1],[913,56,-1,1],[913,59,-1,1],[913,66,-1,1],[913,69,-1,1],[913,90,1,1],[913,97,1,1],[913,100,1,1],[913,101,1,1],[913,105,1,1],[913,106,1,1],[914,26,1,1],[914,47,1,1],[914,56,-1,1],[914,59,-1,1],[914,66,-1,1],[914,69,-1,1],[914,90,1,1],[914,97,1,1],[915,4,-1,1],[915,5,-1,1],[915,26,1,1],[915,27,1,1],[915,29,-1,1],[915,30,-1,1],[915,34,-1,1],[915,35,-1,1],[915,57,1,1],[915,60,1,1],[915,67,1,1],[915,70,1,1],[915,96,-1,1],[915,97,-1,1],[915,118,-1,1],[915,119,-1,1],[916,26,1,1],[916,27,1,1],[916,29,-1,1],[916,30,-1,1],[916,34,-1,1],[916,35,-1,1],[916,96,-1,1],[916,97,-1,1],[917,0,-1,1],[917,1,-1,1],[917,22,1,1],[917,23,1,1],[917,43,1,1],[917,44,1,1],[917,57,-1,1],[917,61,1,1],[917,67,-1,1],[917,71,1,1],[917,89,-1,1],[917,90,-1,1],[917,96,-1,1],[917,97,-1,1],[917,101,-1,1],[917,106,-1,1],[918,2,-1,1],[918,3,-1,1],[918,15,-1,1],[918,16,-1,1],[918,36,-1,1],[918,37,-1,1],[918,57,1,1],[918,60,1,1],[918,77,1,1],[918,80,1,1],[918,89,-1,1],[918,90,-1,1],[918,96,-1,1],[918,97,-1,1],[918,105,-1,1],[918,106,-1,1],[919,42,-1,1],[919,45,-1,1],[919,47,-1,1],[919,48,-1,1],[919,67,-1,1],[919,70,-1,1],[919,72,-1,1],[919,73,-1,1],[919,94,-1,1],[919,95,-1,1],[919,96,-1,1],[919,97,-1,1],[919,105,-1,1],[919,106,-1,1],[919,107,-1,1],[919,108,-1,1],[920,25,1,2],[920,26,-1,2],[920,46,1,2],[920,47,-1,2],[920,56,1,2],[920,57,-1,2],[920,59,1,2],[920,60,-1,2],[920,66,1,2],[920,67,-1,2],[920,69,1,2],[920,70,-1,2],[920,90,-1,2],[920,91,1,2],[920,97,-1,2],[920,98,1,2],[921,18,1,2],[921,21,-1,2],[921,39,1,2],[921,42,-1,2],[921,58,1,2],[921,59,1,2],[921,62,-1,2],[921,63,-1,2],[921,68,1,2],[921,69,1,2],[921,72,-1,2],[921,73,-1,2],[921,88,-1,2],[921,91,1,2],[921,95,-1,2],[921,98,1,2],[922,7,1,1],[922,18,1,1],[922,25,-1,1],[922,28,1,1],[922,39,1,1],[922,46,-1,1],[922,62,-1,1],[922,63,-1,1],[922,72,-1,1],[922,73,-1,1],[922,91,1,1],[922,98,1,1],[922,102,1,1],[922,103,1,1],[922,107,1,1],[922,108,1,1],[923,10,-1,1],[923,11,-1,1],[923,26,1,1],[923,27,1,1],[923,31,-1,1],[923,32,-1,1],[923,47,1,1],[923,48,1,1],[923,49,-1,1],[923,50,-1,1],[923,67,1,1],[923,70,1,1],[923,100,-1,1],[923,101,-1,1],[923,113,-1,1],[923,116,-1,1],[924,8,-1,1],[924,9,-1,1],[924,21,1,1],[924,24,1,1],[924,29,-1,1],[924,30,-1,1],[924,42,1,1],[924,45,1,1],[924,51,-1,1],[924,52,-1,1],[924,72,1,1],[924,73,1,1],[924,102,-1,1],[924,103,-1,1],[924,118,-1,1],[924,119,-1,1],[925,42,1,2],[925,45,1,2],[925,47,1,2],[925,48,1,2],[925,57,-1,2],[925,60,-1,2],[925,62,-1,2],[925,63,-1,2],[925,94,1,2],[925,95,1,2],[925,96,1,2],[925,97,1,2],[925,100,-1,2],[925,101,-1,2],[925,102,-1,2],[925,103,-1,2],[926,19,-1,1],[926,20,-1,1],[926,26,1,1],[926,27,1,1],[926,40,-1,1],[926,41,-1,1],[926,47,1,1],[926,48,1,1],[926,54,-1,1],[926,60,1,1],[926,64,-1,1],[926,70,1,1],[926,100,1,1],[926,104,-1,1],[926,105,1,1],[926,109,-1,1],[927,21,-1,1],[927,27,1,1],[927,42,-1,1],[927,48,1,1],[927,57,-1,1],[927,63,1,1],[927,67,-1,1],[927,73,1,1],[927,87,1,1],[927,90,-1,1],[927,94,1,1],[927,97,-1,1],[927,100,1,1],[927,103,-1,1],[927,105,1,1],[927,108,-1,1],[928,4,1,1],[928,8,-1,1],[928,14,1,1],[928,26,1,1],[928,29,-1,1],[928,35,1,1],[928,47,1,1],[928,52,-1,1],[928,57,-1,1],[928,70,1,1],[928,75,-1,1],[928,90,1,1],[928,97,1,1],[928,101,-1,1],[928,105,1,1],[928,117,1,1],[928,119,-1,1],[929,4,1,1],[929,9,-1,1],[929,13,1,1],[929,26,1,1],[929,30,-1,1],[929,34,1,1],[929,47,1,1],[929,52,-1,1],[929,60,-1,1],[929,67,1,1],[929,75,-1,1],[929,90,1,1],[929,97,1,1],[929,100,-1,1],[929,106,1,1],[929,117,1,1],[929,119,-1,1],[930,9,-1,1],[930,13,1,1],[930,30,-1,1],[930,34,1,1],[930,60,-1,1],[930,67,1,1],[930,100,-1,1],[930,106,1,1],[931,25,-1,1],[931,26,-1,2],[931,27,-1,2],[931,28,1,1],[931,39,1,1],[931,58,-1,2],[931,59,-1,2],[931,60,-1,2],[931,65,1,2],[931,66,1,2],[931,67,1,2],[931,84,-1,1],[931,96,1,2],[931,97,1,2],[931,98,1,1],[931,100,-1,2],[931,106,1,2],[932,22,-1,1],[932,23,-1,1],[932,26,1,1],[932,27,1,1],[932,43,-1,1],[932,44,-1,1],[932,47,1,1],[932,48,1,1],[932,54,-1,1],[932,57,1,1],[932,64,-1,1],[932,67,1,1],[932,101,1,1],[932,104,-1,1],[932,106,1,1],[932,109,-1,1],[933,22,-1,1],[933,23,-1,1],[933,43,-1,1],[933,44,-1,1],[933,57,1,1],[933,67,1,1],[933,101,1,1],[933,106,1,1],[934,24,-1,1],[934,27,1,1],[934,45,-1,1],[934,48,1,1],[934,60,-1,1],[934,63,1,1],[934,70,-1,1],[934,73,1,1],[934,88,1,1],[934,90,-1,1],[934,95,1,1],[934,97,-1,1],[934,101,1,1],[934,103,-1,1],[934,106,1,1],[934,108,-1,1],[935,15,-1,1],[935,16,-1,1],[935,26,1,1],[935,27,1,1],[935,36,-1,1],[935,37,-1,1],[935,47,1,1],[935,48,1,1],[935,49,-1,1],[935,50,-1,1],[935,57,1,1],[935,60,1,1],[935,105,-1,1],[935,106,-1,1],[935,113,-1,1],[935,116,-1,1],[936,15,-1,1],[936,16,-1,1],[936,36,-1,1],[936,37,-1,1],[936,57,1,1],[936,60,1,1],[936,105,-1,1],[936,106,-1,1],[937,7,-1,2],[937,18,1,2],[937,26,1,2],[937,28,-1,2],[937,39,1,2],[937,47,1,2],[937,56,-1,2],[937,59,-1,2],[937,66,-1,2],[937,69,-1,2],[937,90,1,2],[937,97,1,2],[937,100,-1,2],[937,101,-1,2],[937,105,-1,2],[937,106,-1,2],[938,26,1,2],[938,27,1,2],[938,29,-1,2],[938,30,-1,2],[938,34,-1,2],[938,35,-1,2],[938,51,-1,2],[938,52,-1,2],[938,74,1,2],[938,75,1,2],[938,96,-1,2],[938,97,-1,2],[938,100,-1,2],[938,101,-1,2],[938,105,-1,2],[938,106,-1,2],[939,19,-1,1],[939,21,1,1],[939,22,-1,1],[939,24,1,1],[939,40,-1,1],[939,42,1,1],[939,43,-1,1],[939,45,1,1],[939,61,-1,1],[939,63,1,1],[939,71,-1,1],[939,73,1,1],[939,102,1,1],[939,104,-1,1],[939,107,1,1],[939,109,-1,1],[940,24,-1,2],[940,26,-1,2],[940,45,-1,2],[940,47,-1,2],[940,60,-1,2],[940,62,-1,2],[940,70,-1,2],[940,72,-1,2],[940,88,1,2],[940,89,1,2],[940,95,1,2],[940,96,1,2],[940,101,1,2],[940,102,1,2],[940,106,1,2],[940,107,1,2],[941,2,2,1],[941,11,-1,1],[941,15,1,1],[941,21,1,1],[941,32,-1,1],[941,36,1,1],[941,42,1,1],[941,50,-2,1],[941,63,-1,1],[941,72,1,1],[941,80,-2,1],[941,88,1,1],[941,95,1,1],[941,102,-1,1],[941,108,1,1],[941,110,2,1],[941,116,-2,1],[942,18,-1,1],[942,21,-1,2],[942,24,-1,2],[942,28,1,1],[942,46,1,1],[942,56,-1,2],[942,59,-1,2],[942,63,-1,2],[942,65,1,2],[942,68,1,2],[942,72,1,2],[942,84,-1,1],[942,94,1,2],[942,95,1,2],[942,98,1,1],[942,102,-1,2],[942,108,1,2],[943,56,-1,1],[943,59,-1,1],[943,63,-1,1],[943,65,1,1],[943,68,1,1],[943,72,1,1],[943,102,-1,1],[943,108,1,1],[944,20,-1,1],[944,21,1,1],[944,23,-1,1],[944,24,1,1],[944,41,-1,1],[944,42,1,1],[944,44,-1,1],[944,45,1,1],[944,61,-1,1],[944,62,1,1],[944,71,-1,1],[944,72,1,1],[944,103,1,1],[944,104,-1,1],[944,108,1,1],[944,109,-1,1],[945,24,-1,2],[945,27,-1,2],[945,45,-1,2],[945,48,-1,2],[945,60,-1,2],[945,63,-1,2],[945,70,-1,2],[945,73,-1,2],[945,88,1,2],[945,90,1,2],[945,95,1,2],[945,97,1,2],[945,101,1,2],[945,103,1,2],[945,106,1,2],[945,108,1,2],[946,13,-1,1],[946,14,-1,1],[946,21,1,1],[946,24,1,1],[946,34,-1,1],[946,35,-1,1],[946,42,1,1],[946,45,1,1],[946,51,-1,1],[946,52,-1,1],[946,62,1,1],[946,63,1,1],[946,107,-1,1],[946,108,-1,1],[946,118,-1,1],[946,119,-1,1],[947,7,-1,2],[947,21,1,2],[947,25,1,2],[947,28,-1,2],[947,42,1,2],[947,46,1,2],[947,58,-1,2],[947,59,-1,2],[947,68,-1,2],[947,69,-1,2],[947,88,1,2],[947,95,1,2],[947,102,-1,2],[947,103,-1,2],[947,107,-1,2],[947,108,-1,2],[948,7,-1,2],[948,18,1,2],[948,25,1,2],[948,28,-1,2],[948,39,1,2],[948,46,1,2],[948,62,-1,2],[948,63,-1,2],[948,72,-1,2],[948,73,-1,2],[948,91,1,2],[948,98,1,2],[948,102,-1,2],[948,103,-1,2],[948,107,-1,2],[948,108,-1,2],[949,21,1,2],[949,24,1,2],[949,31,-1,2],[949,32,-1,2],[949,36,-1,2],[949,37,-1,2],[949,49,-1,2],[949,50,-1,2],[949,77,1,2],[949,80,1,2],[949,94,-1,2],[949,95,-1,2],[949,102,-1,2],[949,103,-1,2],[949,107,-1,2],[949,108,-1,2],[950,42,1,2],[950,45,1,2],[950,47,1,2],[950,48,1,2],[950,67,-1,2],[950,70,-1,2],[950,72,-1,2],[950,73,-1,2],[950,94,1,2],[950,95,1,2],[950,96,1,2],[950,97,1,2],[950,105,-1,2],[950,106,-1,2],[950,107,-1,2],[950,108,-1,2],[951,22,-1,2],[951,23,-1,2],[951,26,-1,2],[951,27,-1,2],[951,43,-1,2],[951,44,-1,2],[951,47,-1,2],[951,48,-1,2],[951,54,1,2],[951,57,1,2],[951,64,1,2],[951,67,1,2],[951,101,1,2],[951,104,1,2],[951,106,1,2],[951,109,1,2],[952,20,-1,2],[952,21,-1,2],[952,23,-1,2],[952,24,-1,2],[952,41,-1,2],[952,42,-1,2],[952,44,-1,2],[952,45,-1,2],[952,61,1,2],[952,62,1,2],[952,71,1,2],[952,72,1,2],[952,103,1,2],[952,104,1,2],[952,108,1,2],[952,109,1,2],[953,0,-1,2],[953,1,-1,2],[953,7,-1,2],[953,19,-1,2],[953,23,1,2],[953,28,-1,2],[953,40,-1,1],[953,44,1,1],[953,55,-1,2],[953,59,1,2],[953,65,-1,2],[953,69,1,2],[953,91,-1,2],[953,98,-1,2],[953,104,-1,2],[953,109,-1,2],[954,0,-1,2],[954,6,-1,2],[954,12,-1,2],[954,19,-1,2],[954,23,1,2],[954,33,-1,2],[954,40,-1,2],[954,44,1,2],[954,64,1,2],[954,71,1,2],[954,78,-1,2],[954,82,1,2],[954,86,-1,2],[954,93,-1,2],[954,99,-1,2],[954,109,1,2],[954,112,-1,2],[954,114,1,2],[955,7,-1,2],[955,12,-1,2],[955,17,-1,2],[955,39,1,2],[955,46,1,2],[955,53,-1,2],[955,55,-1,2],[955,59,1,2],[955,65,-1,2],[955,69,1,2],[955,78,-1,2],[955,82,1,2],[955,84,-1,2],[955,92,1,2],[955,93,1,2],[955,98,1,2],[955,112,-1,2],[955,114,1,2],[956,0,-1,2],[956,6,-1,2],[956,12,-1,2],[956,20,-1,2],[956,22,1,2],[956,33,-1,2],[956,41,-1,2],[956,43,1,2],[956,64,1,2],[956,71,1,2],[956,79,-1,2],[956,81,1,2],[956,86,-1,2],[956,93,-1,2],[956,99,-1,2],[956,109,1,2],[956,111,-1,2],[956,115,1,2],[957,7,-1,2],[957,12,-1,2],[957,17,-1,2],[957,39,1,2],[957,46,1,2],[957,53,-1,2],[957,56,-1,2],[957,58,1,2],[957,66,-1,2],[957,68,1,2],[957,79,-1,2],[957,81,1,2],[957,84,-1,2],[957,92,1,2],[957,93,1,2],[957,98,1,2],[957,111,-1,2],[957,115,1,2],[958,15,-1,2],[958,16,-1,2],[958,26,-1,2],[958,27,-1,2],[958,36,-1,2],[958,37,-1,2],[958,47,-1,2],[958,48,-1,2],[958,49,1,2],[958,50,1,2],[958,57,1,2],[958,60,1,2],[958,105,-1,2],[958,106,-1,2],[958,113,1,2],[958,116,1,2],[959,2,1,2],[959,3,1,2],[959,21,1,2],[959,24,1,2],[959,31,-1,2],[959,32,-1,2],[959,36,-1,2],[959,37,-1,2],[959,62,-1,2],[959,63,-1,2],[959,72,-1,2],[959,73,-1,2],[959,94,-1,2],[959,95,-1,2],[959,113,1,2],[959,116,1,2],[960,2,-1,2],[960,3,-1,2],[960,10,-1,2],[960,16,1,2],[960,18,-1,2],[960,31,-1,2],[960,37,1,2],[960,39,-1,2],[960,55,-1,2],[960,58,-1,2],[960,66,1,2],[960,69,1,2],[960,91,-1,2],[960,98,-1,2],[960,113,-1,2],[960,116,-1,2],[961,10,1,2],[961,15,1,2],[961,19,1,2],[961,22,1,2],[961,32,-1,2],[961,37,-1,2],[961,41,-1,2],[961,44,-1,2],[961,49,-1,2],[961,50,-1,2],[961,54,-1,2],[961,64,-1,2],[961,104,-1,2],[961,109,-1,2],[961,113,-1,2],[961,116,-1,2],[962,0,1,2],[962,1,1,2],[962,2,1,2],[962,3,1,2],[962,49,-1,2],[962,50,-1,2],[962,54,-1,2],[962,61,-1,2],[962,64,-1,2],[962,71,-1,2],[962,77,-1,2],[962,80,-1,2],[962,104,-1,2],[962,109,-1,2],[962,113,-1,2],[962,116,-1,2],[963,8,-1,2],[963,9,-1,2],[963,21,-1,2],[963,24,-1,2],[963,29,-1,2],[963,30,-1,2],[963,42,-1,2],[963,45,-1,2],[963,51,1,2],[963,52,1,2],[963,72,1,2],[963,73,1,2],[963,102,-1,2],[963,103,-1,2],[963,118,1,2],[963,119,1,2],[964,13,-1,2],[964,14,-1,2],[964,21,-1,2],[964,24,-1,2],[964,34,-1,2],[964,35,-1,2],[964,42,-1,2],[964,45,-1,2],[964,51,1,2],[964,52,1,2],[964,62,1,2],[964,63,1,2],[964,107,-1,2],[964,108,-1,2],[964,118,1,2],[964,119,1,2],[965,4,1,2],[965,5,1,2],[965,26,1,2],[965,27,1,2],[965,29,-1,2],[965,30,-1,2],[965,34,-1,2],[965,35,-1,2],[965,57,-1,2],[965,60,-1,2],[965,67,-1,2],[965,70,-1,2],[965,96,-1,2],[965,97,-1,2],[965,118,1,2],[965,119,1,2],[966,4,-1,2],[966,5,-1,2],[966,8,-1,2],[966,14,1,2],[966,25,-1,2],[966,29,-1,2],[966,35,1,2],[966,46,-1,2],[966,55,-1,2],[966,56,-1,2],[966,68,1,2],[966,69,1,2],[966,91,-1,2],[966,98,-1,2],[966,118,-1,2],[966,119,-1,2],[967,8,1,2],[967,13,1,2],[967,19,1,2],[967,20,1,2],[967,30,-1,2],[967,35,-1,2],[967,43,-1,2],[967,44,-1,2],[967,51,-1,2],[967,52,-1,2],[967,61,-1,2],[967,71,-1,2],[967,104,-1,2],[967,109,-1,2],[967,118,-1,2],[967,119,-1,2],[968,2,-1,1],[968,7,-1,1],[968,10,-1,1],[968,11,-1,1],[968,15,-1,1],[968,16,-1,1],[968,25,-1,1],[968,39,1,1],[968,50,1,1],[968,58,1,1],[968,59,1,1],[968,68,1,1],[968,69,1,1],[968,80,1,1],[968,84,-1,1],[968,91,-1,1],[968,110,-1,1],[968,116,1,1],[969,4,-1,1],[969,7,-1,1],[969,8,-1,1],[969,9,-1,1],[969,13,-1,1],[969,14,-1,1],[969,18,-1,1],[969,46,1,1],[969,52,1,1],[969,56,1,1],[969,59,1,1],[969,66,1,1],[969,69,1,1],[969,75,1,1],[969,84,-1,1],[969,91,-1,1],[969,117,-1,1],[969,119,1,1],[970,4,-1,1],[970,25,1,1],[970,28,-1,1],[970,29,-1,1],[970,30,-1,1],[970,34,-1,1],[970,35,-1,1],[970,39,-1,1],[970,52,1,1],[970,56,1,1],[970,59,1,1],[970,66,1,1],[970,69,1,1],[970,75,1,1],[970,84,1,1],[970,98,-1,1],[970,117,-1,1],[970,119,1,1],[971,2,-1,1],[971,18,1,1],[971,28,-1,1],[971,31,-1,1],[971,32,-1,1],[971,36,-1,1],[971,37,-1,1],[971,46,-1,1],[971,50,1,1],[971,58,1,1],[971,59,1,1],[971,68,1,1],[971,69,1,1],[971,80,1,1],[971,84,1,1],[971,98,-1,1],[971,110,-1,1],[971,116,1,1],[972,0,-1,1],[972,7,1,1],[972,39,-1,1],[972,40,-1,1],[972,41,-1,1],[972,43,-1,1],[972,44,-1,1],[972,46,-1,1],[972,64,1,1],[972,65,1,1],[972,66,1,1],[972,68,1,1],[972,69,1,1],[972,71,1,1],[972,84,1,1],[972,98,-1,1],[972,99,-1,1],[972,109,1,1],[973,1,1,2],[973,7,1,2],[973,39,-1,2],[973,40,-1,2],[973,41,-1,2],[973,43,-1,2],[973,44,-1,2],[973,46,-1,2],[973,54,-1,2],[973,55,-1,2],[973,56,-1,2],[973,58,-1,2],[973,59,-1,2],[973,61,-1,2],[973,84,1,2],[973,98,-1,2],[973,99,-1,2],[973,104,-1,2],[974,0,-1,1],[974,3,-1,1],[974,10,-1,1],[974,11,-1,1],[974,22,-1,1],[974,23,-1,1],[974,31,-1,1],[974,32,-1,1],[974,43,-1,1],[974,44,-1,1],[974,49,1,1],[974,61,-1,1],[974,64,1,1],[974,80,-1,1],[974,99,-1,1],[974,104,-1,1],[974,110,1,1],[974,116,-1,1],[975,0,-1,1],[975,5,-1,1],[975,8,-1,1],[975,9,-1,1],[975,20,-1,1],[975,23,-1,1],[975,29,-1,1],[975,30,-1,1],[975,41,-1,1],[975,44,-1,1],[975,51,1,1],[975,54,-1,1],[975,71,1,1],[975,75,-1,1],[975,99,-1,1],[975,104,-1,1],[975,117,1,1],[975,119,-1,1],[976,0,1,2],[976,20,1,2],[976,23,1,2],[976,27,1,2],[976,40,-1,2],[976,43,-1,2],[976,47,-1,2],[976,61,1,2],[976,64,-1,2],[976,67,-1,2],[976,70,-1,2],[976,89,1,2],[976,97,-1,2],[976,99,1,2],[976,100,1,2],[976,101,1,2],[976,104,1,2],[977,0,1,2],[977,22,1,2],[977,23,1,2],[977,24,1,2],[977,40,-1,2],[977,41,-1,2],[977,42,-1,2],[977,54,1,2],[977,71,-1,2],[977,72,-1,2],[977,73,-1,2],[977,87,1,2],[977,95,-1,2],[977,99,1,2],[977,102,1,2],[977,103,1,2],[977,104,1,2],[978,1,-1,1],[978,5,-1,1],[978,13,-1,1],[978,14,-1,1],[978,20,-1,1],[978,23,-1,1],[978,34,-1,1],[978,35,-1,1],[978,41,-1,1],[978,44,-1,1],[978,51,1,1],[978,61,1,1],[978,64,-1,1],[978,75,-1,1],[978,99,1,1],[978,109,-1,1],[978,117,1,1],[978,119,-1,1],[979,1,-1,1],[979,3,-1,1],[979,15,-1,1],[979,16,-1,1],[979,22,-1,1],[979,23,-1,1],[979,36,-1,1],[979,37,-1,1],[979,43,-1,1],[979,44,-1,1],[979,49,1,1],[979,54,1,1],[979,71,-1,1],[979,80,-1,1],[979,99,1,1],[979,109,-1,1],[979,110,1,1],[979,116,-1,1],[980,0,1,2],[980,7,1,2],[980,39,-1,2],[980,40,-1,2],[980,41,-1,2],[980,43,-1,2],[980,44,-1,2],[980,46,-1,2],[980,64,-1,2],[980,65,-1,2],[980,66,-1,2],[980,68,-1,2],[980,69,-1,2],[980,71,-1,2],[980,84,1,2],[980,98,-1,2],[980,99,1,2],[980,109,-1,2],[981,1,1,2],[981,20,1,2],[981,23,1,2],[981,27,1,2],[981,40,-1,2],[981,43,-1,2],[981,47,-1,2],[981,54,-1,2],[981,57,-1,2],[981,60,-1,2],[981,71,1,2],[981,89,1,2],[981,97,-1,2],[981,99,-1,2],[981,105,1,2],[981,106,1,2],[981,109,1,2],[982,1,1,2],[982,22,1,2],[982,23,1,2],[982,24,1,2],[982,40,-1,2],[982,41,-1,2],[982,42,-1,2],[982,61,-1,2],[982,62,-1,2],[982,63,-1,2],[982,64,1,2],[982,87,1,2],[982,95,-1,2],[982,99,-1,2],[982,107,1,2],[982,108,1,2],[982,109,1,2],[983,6,-1,1],[983,8,-1,1],[983,12,-1,1],[983,13,-1,1],[983,17,-1,1],[983,29,-1,1],[983,33,-1,1],[983,34,-1,1],[983,38,-1,1],[983,53,-1,1],[983,74,1,1],[983,75,1,1],[983,81,1,1],[983,82,1,1],[983,83,1,1],[983,111,-1,1],[983,112,-1,1],[983,118,1,1],[983,119,1,1],[984,1,1,2],[984,2,-1,2],[984,15,1,2],[984,16,1,2],[984,19,-1,2],[984,20,-1,2],[984,36,1,2],[984,37,1,2],[984,40,-1,2],[984,41,-1,2],[984,50,1,2],[984,54,-1,2],[984,71,1,2],[984,77,-1,2],[984,99,-1,2],[984,109,1,2],[984,110,-1,2],[984,113,-1,2],[985,3,1,2],[985,18,1,2],[985,28,-1,2],[985,31,-1,2],[985,32,-1,2],[985,36,-1,2],[985,37,-1,2],[985,46,-1,2],[985,49,-1,2],[985,55,-1,2],[985,56,-1,2],[985,65,-1,2],[985,66,-1,2],[985,77,-1,2],[985,84,1,2],[985,98,-1,2],[985,110,-1,2],[985,113,-1,2],[986,6,1,1],[986,10,-1,1],[986,12,1,1],[986,15,-1,1],[986,17,1,1],[986,31,-1,1],[986,33,1,1],[986,36,-1,1],[986,38,1,1],[986,53,1,1],[986,76,1,1],[986,77,-1,1],[986,79,1,1],[986,80,-1,1],[986,82,1,1],[986,111,1,1],[986,113,-1,1],[986,114,1,1],[986,116,-1,1],[987,6,1,1],[987,11,-1,1],[987,12,1,1],[987,16,-1,1],[987,17,1,1],[987,32,-1,1],[987,33,1,1],[987,37,-1,1],[987,38,1,1],[987,53,1,1],[987,76,1,1],[987,77,-1,1],[987,78,1,1],[987,80,-1,1],[987,81,1,1],[987,112,1,1],[987,113,-1,1],[987,115,1,1],[987,116,-1,1],[988,17,-1,2],[988,27,-1,2],[988,38,-1,2],[988,48,-1,2],[988,53,-1,2],[988,79,-1,2],[988,82,-1,2],[988,83,-1,2],[988,86,1,2],[988,90,1,2],[988,93,1,2],[988,97,1,2],[988,112,1,2],[988,115,1,2],[989,6,-1,2],[989,33,-1,2],[989,38,-1,2],[989,42,-1,1],[989,45,-1,1],[989,63,-1,2],[989,73,-1,2],[989,79,-1,2],[989,82,-1,2],[989,83,-1,2],[989,92,-1,2],[989,93,-1,2],[989,94,-1,1],[989,95,-1,1],[989,103,1,2],[989,108,1,2],[989,112,1,2],[989,115,1,2],[990,6,-1,1],[990,9,-1,1],[990,12,-1,1],[990,14,-1,1],[990,17,-1,1],[990,30,-1,1],[990,33,-1,1],[990,35,-1,1],[990,38,-1,1],[990,53,-1,1],[990,74,1,1],[990,75,1,1],[990,78,1,1],[990,79,1,1],[990,83,1,1],[990,114,-1,1],[990,115,-1,1],[990,118,1,1],[990,119,1,1],[991,17,1,2],[991,24,-1,2],[991,38,1,2],[991,45,-1,2],[991,53,1,2],[991,76,-1,2],[991,81,-1,2],[991,82,-1,2],[991,86,-1,2],[991,88,1,2],[991,93,-1,2],[991,95,1,2],[991,114,-1,2],[991,115,-1,2],[992,6,1,2],[992,33,1,2],[992,38,1,2],[992,47,1,1],[992,48,1,1],[992,60,-1,2],[992,70,-1,2],[992,76,-1,2],[992,81,-1,2],[992,82,-1,2],[992,92,1,2],[992,93,1,2],[992,96,1,1],[992,97,1,1],[992,101,1,2],[992,106,1,2],[992,114,-1,2],[992,115,-1,2],[993,3,-1,1],[993,5,-1,1],[993,9,-1,1],[993,11,-1,1],[993,14,-1,1],[993,16,-1,1],[993,30,-1,1],[993,32,-1,1],[993,35,-1,1],[993,37,-1,1],[993,50,-1,1],[993,52,-1,1],[993,74,1,1],[993,77,1,1],[993,110,1,1],[993,116,-1,1],[993,117,1,1],[993,119,-1,1],[994,1,1,2],[994,3,-1,2],[994,15,1,2],[994,16,1,2],[994,22,-1,2],[994,23,-1,2],[994,36,1,2],[994,37,1,2],[994,43,-1,2],[994,44,-1,2],[994,49,1,2],[994,54,-1,2],[994,71,1,2],[994,80,-1,2],[994,99,-1,2],[994,109,1,2],[994,110,1,2],[994,116,-1,2],[995,2,1,2],[995,18,1,2],[995,28,-1,2],[995,31,-1,2],[995,32,-1,2],[995,36,-1,2],[995,37,-1,2],[995,46,-1,2],[995,50,-1,2],[995,58,-1,2],[995,59,-1,2],[995,68,-1,2],[995,69,-1,2],[995,80,-1,2],[995,84,1,2],[995,98,-1,2],[995,110,1,2],[995,116,-1,2],[996,1,1,2],[996,4,-1,2],[996,13,1,2],[996,14,1,2],[996,19,-1,2],[996,22,-1,2],[996,34,1,2],[996,35,1,2],[996,40,-1,2],[996,43,-1,2],[996,52,1,2],[996,61,-1,2],[996,64,1,2],[996,74,-1,2],[996,99,-1,2],[996,109,1,2],[996,117,-1,2],[996,118,-1,2],[997,5,1,2],[997,25,1,2],[997,28,-1,2],[997,29,-1,2],[997,30,-1,2],[997,34,-1,2],[997,35,-1,2],[997,39,-1,2],[997,51,-1,2],[997,55,-1,2],[997,58,-1,2],[997,65,-1,2],[997,68,-1,2],[997,74,-1,2],[997,84,1,2],[997,98,-1,2],[997,117,-1,2],[997,118,-1,2],[998,3,1,2],[998,4,-1,2],[998,9,1,2],[998,10,-1,2],[998,14,1,2],[998,15,-1,2],[998,30,1,2],[998,31,-1,2],[998,35,1,2],[998,36,-1,2],[998,50,1,2],[998,51,-1,2],[998,75,1,2],[998,77,-1,2],[998,110,-1,2],[998,116,1,2],[998,117,-1,2],[998,118,-1,2],[999,5,-1,2],[999,9,-1,2],[999,13,1,2],[999,27,-1,2],[999,30,-1,2],[999,34,1,2],[999,48,-1,2],[999,51,1,2],[999,60,-1,2],[999,67,1,2],[999,74,1,2],[999,89,-1,2],[999,96,-1,2],[999,100,-1,2],[999,106,1,2],[999,117,1,2],[999,118,1,2],[1000,4,1,2],[1000,9,1,2],[1000,14,1,2],[1000,24,1,2],[1000,29,-1,2],[1000,34,-1,2],[1000,42,-1,2],[1000,52,-1,2],[1000,63,-1,2],[1000,73,-1,2],[1000,74,1,2],[1000,87,1,2],[1000,95,-1,2],[1000,102,-1,2],[1000,107,-1,2],[1000,117,1,2],[1000,118,1,2],[1001,3,1,2],[1001,5,-1,2],[1001,9,1,2],[1001,11,-1,2],[1001,14,1,2],[1001,16,-1,2],[1001,30,1,2],[1001,32,-1,2],[1001,35,1,2],[1001,37,-1,2],[1001,50,1,2],[1001,52,-1,2],[1001,74,1,2],[1001,77,-1,2],[1001,110,-1,2],[1001,116,1,2],[1001,117,1,2],[1001,119,-1,2],[1002,1,1,2],[1002,5,-1,2],[1002,13,1,2],[1002,14,1,2],[1002,20,-1,2],[1002,23,-1,2],[1002,34,1,2],[1002,35,1,2],[1002,41,-1,2],[1002,44,-1,2],[1002,51,1,2],[1002,61,-1,2],[1002,64,1,2],[1002,75,-1,2],[1002,99,-1,2],[1002,109,1,2],[1002,117,1,2],[1002,119,-1,2],[1003,4,1,2],[1003,25,1,2],[1003,28,-1,2],[1003,29,-1,2],[1003,30,-1,2],[1003,34,-1,2],[1003,35,-1,2],[1003,39,-1,2],[1003,52,-1,2],[1003,56,-1,2],[1003,59,-1,2],[1003,66,-1,2],[1003,69,-1,2],[1003,75,-1,2],[1003,84,1,2],[1003,98,-1,2],[1003,117,1,2],[1003,119,-1,2],[1004,4,-1,2],[1004,9,-1,2],[1004,13,1,2],[1004,26,-1,2],[1004,30,-1,2],[1004,34,1,2],[1004,47,-1,2],[1004,52,1,2],[1004,60,-1,2],[1004,67,1,2],[1004,75,1,2],[1004,90,-1,2],[1004,97,-1,2],[1004,100,-1,2],[1004,106,1,2],[1004,117,-1,2],[1004,119,1,2],[1005,5,1,2],[1005,9,1,2],[1005,14,1,2],[1005,24,1,2],[1005,29,-1,2],[1005,34,-1,2],[1005,42,-1,2],[1005,51,-1,2],[1005,62,-1,2],[1005,72,-1,2],[1005,75,1,2],[1005,87,1,2],[1005,95,-1,2],[1005,103,-1,2],[1005,108,-1,2],[1005,117,-1,2],[1005,119,1,2],[1006,18,1,1],[1006,25,1,1],[1006,28,-1,1],[1006,33,-1,1],[1006,38,-1,1],[1006,53,-1,1],[1006,56,-1,1],[1006,58,1,1],[1006,66,-1,1],[1006,68,1,1],[1006,79,-1,1],[1006,81,1,1],[1006,84,1,1],[1006,85,1,1],[1006,86,1,1],[1006,91,1,1],[1006,111,-1,1],[1006,115,1,1],[1007,6,-1,2],[1007,7,1,2],[1007,12,-1,2],[1007,28,1,2],[1007,33,-1,2],[1007,65,1,2],[1007,66,1,2],[1007,68,1,2],[1007,69,1,2],[1007,76,-1,2],[1007,78,-1,2],[1007,79,-1,2],[1007,81,-1,2],[1007,82,-1,2],[1007,83,-1,2],[1007,86,-1,2],[1007,91,1,2],[1007,93,-1,2],[1007,98,1,2],[1008,7,1,1],[1008,12,1,1],[1008,17,1,1],[1008,39,-1,1],[1008,46,-1,1],[1008,53,1,1],[1008,56,-1,1],[1008,58,1,1],[1008,66,-1,1],[1008,68,1,1],[1008,79,-1,1],[1008,81,1,1],[1008,84,1,1],[1008,92,-1,1],[1008,93,-1,1],[1008,98,-1,1],[1008,111,-1,1],[1008,115,1,1],[1009,1,-1,1],[1009,6,-1,1],[1009,17,-1,1],[1009,20,1,1],[1009,22,-1,1],[1009,38,-1,1],[1009,41,1,1],[1009,43,-1,1],[1009,54,1,1],[1009,61,1,1],[1009,79,1,1],[1009,81,-1,1],[1009,85,-1,1],[1009,92,-1,1],[1009,99,1,1],[1009,104,1,1],[1009,111,1,1],[1009,115,-1,1],[1010,0,-1,1],[1010,6,-1,1],[1010,12,-1,1],[1010,20,1,1],[1010,22,-1,1],[1010,33,-1,1],[1010,41,1,1],[1010,43,-1,1],[1010,64,1,1],[1010,71,1,1],[1010,79,1,1],[1010,81,-1,1],[1010,86,-1,1],[1010,93,-1,1],[1010,99,-1,1],[1010,109,1,1],[1010,111,1,1],[1010,115,-1,1],[1011,0,1,2],[1011,1,1,2],[1011,12,1,2],[1011,17,1,2],[1011,40,-1,2],[1011,41,-1,2],[1011,43,-1,2],[1011,44,-1,2],[1011,53,1,2],[1011,76,-1,2],[1011,78,-1,2],[1011,79,-1,2],[1011,81,-1,2],[1011,82,-1,2],[1011,83,-1,2],[1011,92,-1,2],[1011,93,-1,2],[1011,104,1,2],[1011,109,1,2],[1012,2,1,2],[1012,15,1,2],[1012,16,1,2],[1012,17,1,2],[1012,31,-1,2],[1012,32,-1,2],[1012,33,-1,2],[1012,49,1,2],[1012,80,-1,2],[1012,81,-1,2],[1012,82,-1,2],[1012,83,-1,2],[1012,85,1,2],[1012,93,-1,2],[1012,110,1,2],[1012,111,1,2],[1012,112,1,2],[1012,113,1,2],[1013,18,1,2],[1013,25,-1,2],[1013,39,1,2],[1013,46,-1,2],[1013,65,1,2],[1013,66,1,2],[1013,68,1,2],[1013,69,1,2],[1013,76,1,2],[1013,83,-1,2],[1013,111,1,2],[1013,112,1,2],[1013,114,1,2],[1013,115,1,2],[1014,12,1,1],[1014,17,1,1],[1014,40,-1,2],[1014,41,-1,2],[1014,43,-1,2],[1014,44,-1,2],[1014,53,1,1],[1014,54,-1,2],[1014,61,1,2],[1014,64,-1,2],[1014,71,1,2],[1014,76,-1,2],[1014,83,1,2],[1014,92,-1,1],[1014,93,-1,1],[1014,111,-1,2],[1014,112,-1,2],[1014,114,-1,2],[1014,115,-1,2],[1015,6,-1,2],[1015,11,-1,2],[1015,12,-1,2],[1015,16,-1,2],[1015,17,-1,2],[1015,32,-1,2],[1015,33,-1,2],[1015,37,-1,2],[1015,38,-1,2],[1015,53,-1,2],[1015,76,1,2],[1015,77,1,2],[1015,78,1,2],[1015,80,1,2],[1015,81,1,2],[1015,112,1,2],[1015,113,1,2],[1015,115,1,2],[1015,116,1,2],[1016,3,-1,2],[1016,15,-1,2],[1016,16,-1,2],[1016,17,-1,2],[1016,31,1,2],[1016,32,1,2],[1016,33,1,2],[1016,50,-1,2],[1016,77,1,2],[1016,78,1,2],[1016,79,1,2],[1016,83,1,2],[1016,85,-1,2],[1016,93,1,2],[1016,110,1,2],[1016,114,-1,2],[1016,115,-1,2],[1016,116,-1,2],[1017,4,1,2],[1017,13,1,2],[1017,14,1,2],[1017,17,1,2],[1017,29,-1,2],[1017,30,-1,2],[1017,33,-1,2],[1017,51,1,2],[1017,75,-1,2],[1017,76,-1,2],[1017,79,-1,2],[1017,82,-1,2],[1017,85,1,2],[1017,93,-1,2],[1017,111,-1,2],[1017,114,-1,2],[1017,117,1,2],[1017,118,1,2],[1018,5,1,2],[1018,13,1,2],[1018,14,1,2],[1018,17,1,2],[1018,29,-1,2],[1018,30,-1,2],[1018,33,-1,2],[1018,52,1,2],[1018,74,-1,2],[1018,76,-1,2],[1018,78,-1,2],[1018,81,-1,2],[1018,85,1,2],[1018,93,-1,2],[1018,112,-1,2],[1018,115,-1,2],[1018,117,-1,2],[1018,119,1,2],[1019,6,-1,2],[1019,9,1,2],[1019,12,-1,2],[1019,14,1,2],[1019,17,-1,2],[1019,30,1,2],[1019,33,-1,2],[1019,35,1,2],[1019,38,-1,2],[1019,53,-1,2],[1019,74,1,2],[1019,75,1,2],[1019,78,-1,2],[1019,79,-1,2],[1019,83,-1,2],[1019,114,1,2],[1019,115,1,2],[1019,118,1,2],[1019,119,1,2],[1020,8,1,1],[1020,9,1,1],[1020,10,1,1],[1020,11,1,1],[1020,13,-1,1],[1020,14,-1,1],[1020,15,-1,1],[1020,16,-1,1],[1020,29,1,1],[1020,30,1,1],[1020,31,1,1],[1020,32,1,1],[1020,34,-1,1],[1020,35,-1,1],[1020,36,-1,1],[1020,37,-1,1],[1021,7,1,1],[1021,11,-1,1],[1021,15,1,1],[1021,25,-1,1],[1021,28,1,1],[1021,32,-1,1],[1021,36,1,1],[1021,46,-1,1],[1021,49,1,1],[1021,50,1,1],[1021,56,-1,1],[1021,59,-1,1],[1021,65,1,1],[1021,68,1,1],[1021,77,-1,1],[1021,80,-1,1],[1022,0,1,1],[1022,1,1,1],[1022,2,1,1],[1022,3,1,1],[1022,11,-1,1],[1022,16,-1,1],[1022,20,-1,1],[1022,23,-1,1],[1022,31,1,1],[1022,36,1,1],[1022,40,1,1],[1022,43,1,1],[1022,61,-1,1],[1022,71,-1,1],[1022,77,-1,1],[1022,80,-1,1]],"post_source_inverse_gates":[],"pre_helper_inverse_gates":[[403,628,-1,1],[403,577,-1,2],[403,409,1,1],[355,619,-1,1],[355,556,-1,2],[355,356,1,1],[596,869,1,2],[869,596,-1,1],[593,871,1,2],[871,593,-1,1],[593,596,-1,1],[785,631,-1,2],[631,785,1,1],[782,733,-1,2],[733,782,1,1],[631,733,-1,1],[280,367,-1,2],[367,280,1,1],[277,358,-1,2],[358,277,1,1],[367,358,-1,1],[640,689,1,2],[689,640,-1,1],[447,601,-1,2],[601,447,1,1],[640,447,-1,1],[735,491,1,2],[491,735,-1,1],[730,721,1,2],[721,730,-1,1],[491,721,-1,1],[786,803,1,2],[803,786,-1,1],[781,567,-1,2],[567,781,1,1],[803,567,1,1],[794,801,-1,2],[801,794,1,1],[801,601,-1,1],[768,451,-1,2],[451,768,1,1],[756,716,-1,2],[716,756,1,1],[451,716,-1,1],[810,779,1,2],[779,810,-1,1],[805,602,1,2],[602,805,-1,1],[779,602,-1,1],[819,777,-1,2],[777,819,1,1],[814,255,-1,2],[255,814,1,1],[777,255,-1,1],[857,910,1,2],[910,857,-1,1],[809,616,1,2],[616,809,-1,1],[857,809,-1,1],[858,941,-1,2],[941,858,1,1],[858,785,-1,1],[848,837,1,2],[837,848,-1,1],[848,805,-1,1],[420,836,-1,2],[836,420,1,1],[420,781,-1,1],[991,821,-1,2],[821,991,1,1],[821,836,-1,1],[988,812,1,2],[812,988,-1,1],[812,689,-1,1],[931,839,-1,2],[839,931,1,1],[807,795,-1,2],[795,807,1,1],[839,795,-1,1],[942,840,-1,2],[840,942,1,1],[581,787,-1,2],[787,581,1,1],[840,787,-1,1],[992,796,1,2],[796,992,-1,1],[796,837,-1,1],[989,788,-1,2],[788,989,1,1],[425,607,1,2],[607,425,-1,1],[788,607,-1,1],[1014,691,-1,2],[691,1014,1,1],[1011,547,-1,2],[547,1011,1,1],[691,547,-1,1],[1013,603,1,2],[603,1013,-1,1],[1007,401,1,2],[401,1007,-1,1],[603,401,-1,1],[753,688,1,2],[688,753,-1,1],[595,374,1,2],[374,595,-1,1],[688,374,-1,1],[771,600,1,2],[600,771,-1,1],[866,287,-1,2],[287,866,1,1],[600,287,-1,1],[764,778,1,2],[778,764,-1,1],[816,764,-1,1],[581,764,-1,1],[766,780,1,2],[780,766,-1,1],[807,766,-1,1],[790,724,-1,2],[724,790,1,1],[625,724,-1,1],[288,770,-1,2],[770,288,1,1],[385,288,-1,1],[266,775,1,2],[775,266,-1,1],[583,266,-1,1],[806,734,1,2],[734,806,-1,1],[541,734,-1,1],[616,734,-1,1],[375,380,1,2],[380,375,-1,1],[307,380,-1,1],[804,748,1,2],[748,804,-1,1],[783,748,-1,1],[774,263,1,2],[263,774,-1,1],[558,263,-1,1],[953,550,-1,2],[550,953,1,1],[521,292,1,1],[292,521,-1,2],[550,521,-1,1],[274,257,1,2],[257,274,-1,1],[271,755,1,2],[755,271,-1,1],[257,755,-1,1],[755,257,1,1],[358,367,1,1],[257,367,-1,1],[425,814,1,1],[814,425,1,1],[447,640,-1,1],[425,640,1,1],[698,731,1,2],[731,698,-1,1],[698,806,-1,1],[806,698,1,1],[984,737,1,2],[737,984,-1,1],[740,719,1,2],[719,740,-1,1],[984,740,-1,1],[740,246,-1,1],[698,246,-1,1],[637,732,-1,2],[732,637,1,1],[637,782,-1,1],[782,637,-1,1],[985,738,-1,2],[738,985,1,1],[758,715,-1,2],[715,758,1,1],[985,758,-1,1],[758,249,1,1],[637,249,-1,1],[567,803,1,1],[601,801,-1,1],[567,601,1,1],[759,690,1,2],[690,759,-1,1],[690,780,-1,1],[780,690,1,1],[765,969,-1,2],[969,765,1,1],[760,714,-1,2],[714,760,1,1],[969,714,-1,1],[714,656,-1,1],[690,656,-1,1],[761,599,1,2],[599,761,-1,1],[599,778,-1,1],[778,599,1,1],[767,968,-1,2],[968,767,1,1],[968,715,-1,1],[715,654,-1,1],[599,654,-1,1],[602,779,-1,1],[255,777,-1,1],[602,255,-1,1],[367,453,2,1],[453,257,-1,2],[940,553,-1,2],[553,940,1,1],[305,544,-1,2],[544,305,1,1],[940,305,-1,1],[305,587,-1,1],[447,305,-1,1],[876,870,-1,2],[870,876,1,1],[244,868,-1,2],[868,244,1,1],[876,244,-1,1],[244,254,-1,1],[358,244,-1,1],[1014,771,-1,1],[771,867,1,1],[1013,753,-1,1],[753,435,-1,1],[867,435,-1,1],[435,493,2,1],[493,421,-1,2],[956,1010,-1,2],[1010,956,1,1],[954,835,-1,2],[835,954,1,1],[980,972,-1,2],[972,980,1,1],[1010,835,-1,1],[835,847,1,1],[980,768,-1,1],[768,411,-2,1],[847,411,-2,1],[411,683,-1,2],[744,1009,-1,2],[1009,744,1,1],[745,834,-1,2],[834,745,1,1],[973,750,-1,2],[750,973,1,1],[1009,834,-1,1],[834,842,1,1],[973,756,-1,1],[756,386,-2,1],[842,386,-2,1],[386,475,-1,2],[1001,993,1,2],[993,1001,-1,1],[1018,895,1,2],[895,1018,-1,1],[852,893,1,2],[893,852,-1,1],[1018,852,-1,1],[852,862,1,1],[1001,735,-1,1],[735,363,-2,1],[862,363,-2,1],[363,687,-1,2],[998,726,1,2],[726,998,-1,1],[1017,718,1,2],[718,1017,-1,1],[851,727,1,2],[727,851,-1,1],[1017,851,-1,1],[851,861,1,1],[998,730,-1,1],[730,361,-2,1],[861,361,-2,1],[361,501,-1,2],[1016,896,-1,2],[896,1016,1,1],[855,894,-1,2],[894,855,1,1],[1016,855,-1,1],[855,856,-1,1],[993,726,-1,1],[726,359,-2,1],[856,359,-2,1],[359,685,-1,2],[1012,720,1,2],[720,1012,-1,1],[849,736,1,2],[736,849,-1,1],[1012,849,-1,1],[849,850,1,1],[721,357,-2,1],[850,357,-2,1],[357,491,-1,2],[957,1008,1,2],[1008,957,-1,1],[955,838,1,2],[838,955,-1,1],[1008,838,-1,1],[838,841,-1,1],[972,750,-1,1],[750,353,-2,1],[841,353,-2,1],[353,681,-1,2],[762,1006,1,2],[1006,762,-1,1],[763,832,1,2],[832,763,-1,1],[1006,832,-1,1],[832,833,1,1],[716,300,-2,1],[833,300,-2,1],[300,451,-1,2],[965,915,-1,2],[915,965,1,1],[966,883,-1,2],[883,966,1,1],[967,875,1,2],[875,967,-1,1],[800,877,-1,2],[877,800,1,1],[825,872,1,2],[872,825,-1,1],[963,924,-1,2],[924,963,1,1],[769,891,-1,2],[891,769,1,1],[964,946,-1,2],[946,964,1,1],[1019,990,1,2],[990,1019,-1,1],[865,983,1,2],[983,865,-1,1],[967,825,-1,1],[825,830,-1,1],[596,593,-1,1],[965,769,-1,1],[769,516,1,1],[966,800,-1,1],[800,829,-1,1],[751,907,-1,2],[907,751,1,1],[1019,865,-1,1],[865,831,1,1],[964,751,-1,1],[963,751,-1,1],[751,566,1,1],[831,593,-1,1],[593,652,-1,1],[830,566,-1,1],[651,566,1,2],[566,651,-1,1],[829,516,-1,1],[516,500,-1,1],[652,500,-1,1],[651,500,-1,1],[502,500,1,2],[500,502,-1,1],[959,904,-1,2],[904,959,1,1],[958,935,-1,2],[935,958,1,1],[961,874,1,2],[874,961,-1,1],[960,882,-1,2],[882,960,1,1],[824,873,1,2],[873,824,-1,1],[799,878,-1,2],[878,799,1,1],[754,923,-1,2],[923,754,1,1],[962,889,1,2],[889,962,-1,1],[772,890,-1,2],[890,772,1,1],[1015,987,-1,2],[987,1015,1,1],[517,986,-1,2],[986,517,1,1],[958,754,-1,1],[754,563,1,1],[960,799,-1,1],[799,826,-1,1],[959,772,-1,1],[772,515,1,1],[1015,517,-1,1],[517,828,1,1],[962,824,-1,1],[961,824,-1,1],[824,827,-1,1],[828,596,-1,1],[596,648,-1,1],[827,563,-1,1],[647,563,1,2],[563,647,-1,1],[826,515,-1,1],[515,490,-1,1],[648,490,-1,1],[647,490,-1,1],[496,490,1,2],[490,496,-1,1],[952,944,-1,2],[944,952,1,1],[525,880,-1,2],[880,525,1,1],[303,926,-1,2],[926,303,1,1],[289,939,-1,2],[939,289,1,1],[951,932,-1,2],[932,951,1,1],[952,289,-1,1],[289,585,1,1],[951,303,-1,1],[303,572,1,1],[953,525,-1,1],[525,513,-1,1],[1011,866,-1,1],[866,823,1,1],[825,585,-1,1],[585,636,-1,1],[824,572,-1,1],[635,572,1,2],[572,635,-1,1],[823,513,-1,1],[513,474,-1,1],[636,474,-1,1],[635,474,-1,1],[482,474,1,2],[474,482,-1,1],[920,383,1,2],[383,920,-1,1],[389,373,1,2],[373,389,-1,1],[921,578,1,2],[578,921,-1,1],[920,375,-1,1],[375,554,1,1],[948,922,-1,2],[922,948,1,1],[1007,595,-1,1],[595,798,1,1],[922,389,-1,1],[921,389,-1,1],[389,543,1,1],[800,554,-1,1],[554,621,-1,1],[799,543,-1,1],[620,543,1,2],[543,620,-1,1],[798,525,-1,1],[525,450,-1,1],[621,450,-1,1],[620,450,-1,1],[462,450,1,2],[450,462,-1,1],[421,495,-2,1],[257,455,-2,1],[419,434,1,1],[488,492,-1,1],[486,494,-1,1],[440,452,-1,1],[438,454,-1,1],[947,903,-1,2],[903,947,1,1],[938,315,-1,2],[315,938,1,1],[925,655,1,2],[655,925,-1,1],[538,918,1,2],[918,538,-1,1],[534,906,1,2],[906,534,-1,1],[888,533,-1,2],[533,888,1,1],[392,479,1,1],[479,392,-1,2],[316,387,-1,1],[1022,387,-2,1],[1022,316,2,1],[448,354,-1,1],[354,448,1,2],[298,456,1,1],[456,298,-1,2],[945,934,-1,2],[934,945,1,1],[659,927,-1,2],[927,659,1,1],[296,905,-1,2],[905,296,1,1],[617,304,-1,2],[304,617,1,1],[885,273,1,1],[273,885,-1,2],[937,913,-1,2],[913,937,1,1],[613,290,-1,2],[290,613,1,1],[632,390,-1,2],[390,632,1,1],[302,879,1,2],[879,302,-1,1],[884,881,1,2],[881,884,-1,1],[887,279,1,1],[279,887,-1,2],[262,773,1,2],[773,262,-1,1],[258,270,1,1],[270,258,-1,2],[468,402,-1,1],[402,468,1,2],[311,324,-1,1],[1020,324,-2,1],[1020,311,2,1],[323,268,1,2],[268,323,-1,1],[441,704,-1,2],[704,441,1,1],[297,917,-1,2],[917,297,1,1],[293,757,-1,2],[757,293,1,1],[739,908,-1,2],[908,739,1,1],[584,892,1,2],[892,584,-1,1],[886,529,-1,2],[529,886,1,1],[442,551,1,2],[551,442,-1,1],[240,310,1,1],[310,240,-1,2],[489,705,-1,2],[705,489,1,1],[752,897,-1,2],[897,752,1,1],[569,291,1,2],[291,569,-1,1],[950,919,1,2],[919,950,-1,1],[776,267,1,2],[267,776,-1,1],[276,301,-1,1],[1021,301,-2,1],[1021,276,2,1],[949,321,-1,2],[321,949,1,1],[463,283,1,2],[283,463,-1,1],[483,368,1,2],[368,483,-1,1],[682,395,1,2],[395,682,-1,1],[680,337,1,2],[337,680,-1,1],[497,245,1,2],[245,497,-1,1],[503,251,1,2],[251,503,-1,1],[686,253,1,2],[253,686,-1,1],[684,248,1,2],[248,684,-1,1],[338,519,1,2],[519,338,-1,1],[793,928,-1,2],[928,793,1,1],[378,574,1,2],[574,378,-1,1],[381,399,-1,1],[399,381,1,2],[579,575,-1,2],[575,579,1,1],[573,406,1,1],[406,573,-1,2],[820,899,1,2],[899,820,-1,1],[526,326,1,1],[326,526,-1,2],[1002,978,1,2],[978,1002,-1,1],[747,975,1,2],[975,747,-1,1],[1003,970,-1,2],[970,1003,1,1],[996,728,1,2],[728,996,-1,1],[742,717,1,2],[717,742,-1,1],[997,729,-1,2],[729,997,1,1],[994,979,1,2],[979,994,-1,1],[749,974,1,2],[974,749,-1,1],[995,971,-1,2],[971,995,1,1],[1005,900,1,2],[900,1005,-1,1],[818,898,1,2],[898,818,-1,1],[1004,929,-1,2],[929,1004,1,1],[1000,722,1,2],[722,1000,-1,1],[815,725,1,2],[725,815,-1,1],[999,723,-1,2],[723,999,1,1],[982,901,1,2],[901,982,-1,1],[269,527,1,2],[527,269,-1,1],[981,912,1,2],[912,981,-1,1],[275,531,1,2],[531,275,-1,1],[811,909,1,2],[909,811,-1,1],[977,741,1,2],[741,977,-1,1],[976,743,1,2],[743,976,-1,1],[539,532,-1,2],[532,539,1,1],[802,746,1,2],[746,802,-1,1],[530,331,1,1],[331,530,-1,2],[946,534,-1,1],[534,666,1,1],[945,659,-1,1],[659,592,-1,1],[892,291,-1,1],[938,774,-1,1],[774,813,-1,1],[885,258,-1,1],[258,362,-1,1],[904,321,-1,1],[321,653,1,1],[874,533,-1,1],[533,342,2,1],[875,529,-1,1],[529,346,2,1],[950,584,-1,1],[584,671,-1,1],[927,544,-1,1],[544,377,-1,1],[918,775,-1,1],[775,797,-1,1],[887,301,2,1],[301,562,1,2],[903,578,-1,1],[578,545,1,1],[925,569,-1,1],[569,391,-1,1],[882,279,2,1],[279,576,1,2],[934,553,-1,1],[553,669,-1,1],[937,739,-1,1],[739,624,-1,1],[893,727,-1,1],[727,706,-1,1],[944,296,-1,1],[296,588,1,1],[919,655,-1,1],[655,559,-1,1],[883,273,2,1],[273,404,-1,1],[954,745,-1,1],[745,710,-1,1],[956,744,-1,1],[744,712,1,1],[949,776,-1,1],[776,822,-1,1],[872,310,2,1],[310,340,-1,1],[941,732,-1,1],[732,589,-1,1],[924,262,-1,1],[262,413,1,1],[931,759,-1,1],[759,808,-1,1],[733,414,2,1],[884,302,-1,1],[894,736,-1,1],[736,707,-1,1],[895,718,-1,1],[718,708,1,1],[898,725,-1,1],[725,351,2,1],[897,373,-1,1],[373,552,1,1],[900,722,-1,1],[722,546,-1,1],[873,316,2,1],[316,339,-1,1],[877,270,2,1],[270,397,-1,1],[905,757,-1,1],[757,611,-1,1],[886,240,-1,1],[240,415,2,1],[957,762,-1,1],[762,713,1,1],[955,763,-1,1],[763,711,-1,1],[917,770,-1,1],[770,605,-1,1],[939,293,-1,1],[293,591,1,1],[912,743,-1,1],[743,792,-1,1],[909,746,-1,1],[746,791,-1,1],[890,267,-1,1],[267,345,1,1],[878,276,2,1],[276,396,-1,1],[896,720,-1,1],[720,709,1,1],[1005,818,-1,1],[818,863,1,1],[1004,793,-1,1],[793,864,-1,1],[1003,765,-1,1],[765,665,1,1],[1002,747,-1,1],[747,663,-1,1],[1000,815,-1,1],[815,860,1,1],[999,790,-1,1],[790,859,-1,1],[997,760,-1,1],[760,662,1,1],[996,742,-1,1],[742,664,-1,1],[809,857,1,1],[785,858,-1,1],[995,767,-1,1],[767,661,1,1],[994,749,-1,1],[749,660,-1,1],[992,810,-1,1],[810,854,-1,1],[991,786,-1,1],[786,644,-1,1],[990,274,-1,1],[274,699,-1,1],[989,819,-1,1],[819,853,1,1],[988,794,-1,1],[794,697,1,1],[987,280,-1,1],[280,642,1,1],[986,277,-1,1],[277,696,1,1],[805,848,-1,1],[781,420,-1,1],[983,271,-1,1],[271,639,1,1],[982,820,-1,1],[820,845,-1,1],[981,811,-1,1],[811,846,-1,1],[979,737,-1,1],[737,670,1,1],[978,728,-1,1],[728,667,1,1],[836,821,1,1],[689,812,1,1],[977,804,-1,1],[804,844,1,1],[976,802,-1,1],[802,843,1,1],[975,717,-1,1],[717,370,-1,1],[974,719,-1,1],[719,388,-1,1],[795,839,-1,1],[787,840,-1,1],[971,738,-1,1],[738,657,1,1],[970,729,-1,1],[837,796,-1,1],[607,788,-1,1],[547,691,-1,1],[401,603,1,1],[374,688,1,1],[287,600,1,1],[948,752,-1,1],[947,752,-1,1],[752,630,-1,1],[943,761,-1,1],[942,761,-1,1],[761,817,-1,1],[764,816,-1,1],[936,538,-1,1],[935,538,-1,1],[538,570,1,1],[933,297,-1,1],[932,297,-1,1],[297,668,1,1],[930,723,-1,1],[929,723,-1,1],[723,577,-1,1],[766,807,-1,1],[928,724,-1,1],[724,409,2,1],[926,288,-1,1],[288,385,1,1],[923,266,-1,1],[266,583,1,1],[916,315,-1,1],[915,315,-1,1],[315,523,1,1],[914,383,-1,1],[913,383,-1,1],[383,658,1,1],[911,731,-1,1],[910,731,-1,1],[731,556,-1,1],[734,356,2,1],[908,380,-1,1],[380,307,1,1],[907,773,-1,1],[906,773,-1,1],[773,789,-1,1],[902,741,-1,1],[901,741,-1,1],[741,784,-1,1],[899,748,-1,1],[748,783,-1,1],[891,263,-1,1],[263,558,1,1],[889,387,2,1],[888,387,2,1],[387,422,-1,1],[881,521,-1,1],[521,382,2,1],[880,292,2,1],[879,292,2,1],[292,379,-1,1],[871,324,2,1],[870,324,2,1],[324,329,-1,1],[869,311,2,1],[868,311,2,1],[311,317,-1,1],[431,424,1,2],[424,431,-1,1],[487,594,-1,2],[594,487,1,1],[439,542,-1,2],[542,439,1,1],[864,665,-1,1],[665,703,1,1],[863,663,-1,1],[663,650,-1,1],[860,664,-1,1],[664,702,-1,1],[859,662,-1,1],[662,649,1,1],[858,661,-1,1],[661,701,1,1],[857,660,-1,1],[660,638,-1,1],[855,699,-1,1],[699,646,1,1],[854,644,-1,1],[644,700,-1,1],[853,697,-1,1],[697,645,1,1],[852,642,-1,1],[640,425,-1,1],[851,696,-1,1],[696,643,-1,1],[246,698,-1,1],[249,637,1,1],[849,639,-1,1],[639,597,-1,1],[848,420,-1,1],[420,641,-1,1],[846,670,-1,1],[670,695,1,1],[845,667,-1,1],[667,622,1,1],[844,370,-1,1],[370,694,-1,1],[843,388,-1,1],[840,657,-1,1],[657,693,1,1],[838,691,-1,1],[691,609,1,1],[837,607,-1,1],[607,692,-1,1],[836,689,-1,1],[689,608,1,1],[835,603,-1,1],[601,567,-1,1],[834,688,-1,1],[688,606,-1,1],[656,690,-1,1],[654,599,-1,1],[832,600,-1,1],[600,335,-1,1],[255,602,-1,1],[866,595,-1,1],[865,517,-1,1],[495,487,-1,2],[487,495,1,1],[455,439,-1,2],[439,455,1,1],[822,630,-1,1],[634,630,1,2],[630,634,-1,1],[821,671,-1,1],[671,679,-1,1],[820,666,-1,1],[666,480,1,1],[819,592,-1,1],[592,633,1,1],[818,588,-1,1],[588,473,-1,1],[470,590,1,2],[590,470,-1,1],[817,589,-1,1],[589,481,2,1],[816,414,2,1],[414,631,1,2],[472,412,-1,1],[412,472,1,2],[815,591,-1,1],[591,629,-1,1],[814,587,-1,1],[813,624,-1,1],[628,624,1,2],[624,628,-1,1],[812,584,-1,1],[584,627,-1,1],[811,570,-1,1],[570,477,1,1],[810,669,-1,1],[669,678,1,1],[809,668,-1,1],[668,469,-1,1],[626,376,-1,2],[376,626,1,1],[466,582,1,2],[582,466,-1,1],[808,577,-1,1],[577,478,2,1],[807,409,2,1],[409,625,1,2],[384,476,1,1],[476,384,-1,2],[806,385,-1,1],[385,677,-1,1],[805,377,-1,1],[377,467,1,1],[804,413,-1,1],[413,676,1,1],[803,391,-1,1],[391,471,-1,1],[802,583,-1,1],[583,623,1,1],[801,569,-1,1],[797,605,-1,1],[619,605,1,2],[605,619,-1,1],[796,559,-1,1],[559,618,-1,1],[795,523,-1,1],[523,460,1,1],[794,659,-1,1],[659,675,1,1],[793,658,-1,1],[658,449,-1,1],[446,557,1,2],[557,446,-1,1],[792,556,-1,1],[556,461,2,1],[791,356,2,1],[356,616,1,2],[306,459,1,1],[459,306,-1,2],[790,307,-1,1],[307,674,-1,1],[305,447,1,1],[789,611,-1,1],[615,611,1,2],[611,615,-1,1],[788,655,-1,1],[655,673,-1,1],[787,653,-1,1],[653,457,1,1],[786,553,-1,1],[553,614,1,1],[785,545,-1,1],[545,445,-1,1],[784,546,-1,1],[546,458,2,1],[783,351,2,1],[351,612,1,2],[444,344,-1,1],[344,444,1,2],[782,552,-1,1],[552,610,-1,1],[781,544,-1,1],[780,558,-1,1],[558,604,1,1],[778,345,-1,1],[345,672,1,1],[777,291,-1,1],[291,443,-1,1],[776,562,-1,1],[775,422,2,1],[422,514,1,2],[514,422,-1,1],[774,362,-1,1],[773,415,2,1],[415,250,1,2],[250,415,-1,1],[772,389,-1,1],[393,389,1,2],[389,393,-1,1],[770,387,2,1],[387,512,1,2],[512,387,-1,1],[769,375,-1,1],[403,375,1,2],[375,403,-1,1],[768,401,-1,1],[401,398,-1,1],[767,578,-1,1],[578,580,-1,1],[766,404,2,1],[404,407,-1,1],[765,383,-1,1],[764,576,-1,1],[576,581,-1,1],[763,382,2,1],[382,408,-1,1],[762,379,2,1],[379,405,-1,1],[761,396,2,1],[760,380,-1,1],[380,372,-1,1],[759,397,2,1],[397,400,-1,1],[758,373,-1,1],[757,240,-1,1],[240,369,1,1],[756,374,-1,1],[374,371,-1,1],[755,254,-1,1],[244,358,1,1],[754,303,-1,1],[355,303,1,2],[303,355,-1,1],[753,302,-1,1],[752,301,2,1],[301,524,1,2],[524,301,-1,1],[751,289,-1,1],[299,289,1,2],[289,299,-1,1],[750,547,-1,1],[547,549,-1,1],[749,297,-1,1],[297,294,-1,1],[748,346,2,1],[346,349,-1,1],[747,296,-1,1],[746,342,2,1],[342,350,-1,1],[745,521,-1,1],[521,550,-1,1],[518,348,1,1],[348,518,-1,2],[548,520,-1,2],[520,548,1,1],[341,295,-1,1],[295,341,1,2],[744,292,2,1],[743,339,2,1],[339,347,-1,1],[742,293,-1,1],[293,286,-1,1],[741,340,2,1],[340,343,-1,1],[740,288,-1,1],[288,285,-1,1],[739,258,-1,1],[258,284,1,1],[738,321,-1,1],[321,318,-1,1],[737,538,-1,1],[538,540,-1,1],[736,329,2,1],[329,332,-1,1],[735,280,-1,1],[734,533,-1,1],[533,541,-1,1],[733,279,2,1],[279,333,-1,1],[278,319,-1,1],[319,278,1,2],[732,276,2,1],[276,330,-1,1],[731,316,2,1],[730,277,-1,1],[277,265,-1,1],[729,315,-1,1],[315,312,-1,1],[728,534,-1,1],[534,536,-1,1],[727,324,2,1],[324,327,-1,1],[726,274,-1,1],[725,529,-1,1],[529,537,-1,1],[724,273,2,1],[273,328,-1,1],[272,313,-1,1],[313,272,1,2],[535,528,-1,2],[528,535,1,1],[723,270,2,1],[270,325,-1,1],[722,310,2,1],[721,271,-1,1],[271,261,-1,1],[720,317,2,1],[317,320,-1,1],[719,266,-1,1],[718,311,2,1],[311,314,-1,1],[717,262,-1,1],[716,287,-1,1],[715,267,-1,1],[267,264,-1,1],[714,263,-1,1],[263,260,-1,1],[713,431,-1,1],[712,431,-1,1],[427,431,-1,2],[431,427,1,1],[711,424,-1,1],[710,424,-1,1],[432,424,-1,2],[424,432,1,1],[709,323,-1,1],[708,323,-1,1],[282,323,-1,2],[323,282,1,1],[707,268,-1,1],[706,268,-1,1],[334,268,-1,2],[268,334,1,1],[598,594,1,2],[594,598,-1,1],[594,419,-1,1],[426,433,-1,1],[705,595,-1,1],[430,595,1,2],[595,430,-1,1],[433,430,1,2],[430,433,-1,1],[256,365,1,1],[568,542,1,2],[542,568,-1,1],[542,256,-1,1],[281,366,-1,1],[704,517,-1,1],[322,517,1,2],[517,322,-1,1],[366,322,1,2],[322,366,-1,1],[703,650,-1,1],[702,649,-1,1],[701,638,-1,1],[699,425,1,1],[698,637,-1,1],[697,597,1,1],[696,420,-1,1],[695,622,-1,1],[691,567,1,1],[690,599,-1,1],[689,335,1,1],[688,255,-1,1],[687,503,-1,1],[416,503,-1,2],[503,416,1,1],[686,501,-1,1],[418,501,-1,2],[501,418,1,1],[685,497,-1,1],[423,497,-1,2],[497,423,1,1],[684,491,-1,1],[429,491,-1,2],[491,429,1,1],[683,483,-1,1],[241,483,-1,2],[483,241,1,1],[682,475,-1,1],[243,475,-1,2],[475,243,1,1],[681,463,-1,1],[259,463,-1,2],[463,259,1,1],[680,451,-1,1],[309,451,-1,2],[451,309,1,1],[437,309,-1,2],[309,437,1,1],[679,480,-1,1],[480,511,-1,1],[678,469,-1,1],[469,510,-1,1],[677,467,-1,1],[676,471,-1,1],[675,449,-1,1],[449,509,-1,1],[674,447,-1,1],[673,457,-1,1],[457,508,-1,1],[672,443,-1,1],[671,413,-1,1],[413,507,-1,1],[670,370,-1,1],[669,385,-1,1],[408,398,1,2],[398,408,-1,1],[405,401,1,2],[401,405,-1,1],[404,372,1,2],[372,404,-1,1],[668,377,-1,1],[400,383,1,2],[383,400,-1,1],[397,380,1,2],[380,397,-1,1],[667,388,-1,1],[666,391,-1,1],[382,371,1,2],[371,382,-1,1],[379,374,1,2],[374,379,-1,1],[663,254,-1,1],[662,254,-1,1],[661,246,-1,1],[660,249,-1,1],[659,307,-1,1],[307,505,-1,1],[658,305,-1,1],[655,345,-1,1],[350,294,1,2],[294,350,-1,1],[347,297,1,2],[297,347,-1,1],[346,286,1,2],[286,346,-1,1],[343,296,1,2],[296,343,-1,1],[342,285,1,2],[285,342,-1,1],[340,293,1,2],[293,340,-1,1],[339,288,1,2],[288,339,-1,1],[654,302,-1,1],[333,318,1,2],[318,333,-1,1],[330,321,1,2],[321,330,-1,1],[329,265,1,2],[265,329,-1,1],[328,312,1,2],[312,328,-1,1],[325,315,1,2],[315,325,-1,1],[324,261,1,2],[261,324,-1,1],[320,280,1,2],[280,320,-1,1],[317,277,1,2],[277,317,-1,1],[314,274,1,2],[274,314,-1,1],[311,271,1,2],[271,311,-1,1],[653,291,-1,1],[279,264,1,2],[264,279,-1,1],[276,267,1,2],[267,276,-1,1],[273,260,1,2],[260,273,-1,1],[270,263,1,2],[263,270,-1,1],[650,418,-1,1],[499,418,-1,2],[418,499,1,1],[649,416,-1,1],[498,416,1,2],[416,498,-1,1],[646,427,-1,1],[645,427,-1,1],[494,427,-1,2],[427,494,1,1],[493,489,-1,2],[489,493,1,1],[644,432,-1,1],[643,432,-1,1],[492,432,1,2],[432,492,-1,1],[642,424,-1,1],[641,424,-1,1],[488,424,1,2],[424,488,-1,1],[640,431,-1,1],[639,431,-1,1],[486,431,-1,2],[431,486,1,1],[638,429,-1,1],[485,429,-1,2],[429,485,1,1],[637,423,-1,1],[484,423,1,2],[423,484,-1,1],[634,473,-1,1],[633,473,-1,1],[632,481,2,1],[481,470,1,2],[470,481,-1,1],[631,479,2,1],[479,472,1,2],[472,479,-1,1],[628,477,-1,1],[627,477,-1,1],[626,478,2,1],[478,466,1,2],[466,478,-1,1],[625,476,2,1],[476,468,1,2],[468,476,-1,1],[622,243,-1,1],[465,243,-1,2],[243,465,1,1],[464,241,1,2],[241,464,-1,1],[619,460,-1,1],[618,460,-1,1],[617,461,2,1],[461,446,1,2],[446,461,-1,1],[616,459,2,1],[459,448,1,2],[448,459,-1,1],[615,445,-1,1],[614,445,-1,1],[613,458,2,1],[458,442,1,2],[442,458,-1,1],[612,456,2,1],[456,444,1,2],[444,456,-1,1],[609,282,-1,1],[608,282,-1,1],[454,282,-1,2],[282,454,1,1],[453,441,-1,2],[441,453,1,1],[607,334,-1,1],[606,334,-1,1],[452,334,1,2],[334,452,-1,1],[603,268,-1,1],[602,268,-1,1],[440,268,1,2],[268,440,-1,1],[601,323,-1,1],[600,323,-1,1],[438,323,-1,2],[323,438,1,1],[599,259,-1,1],[436,259,1,2],[259,436,-1,1],[598,597,-1,1],[597,434,-1,1],[596,422,-1,1],[428,422,1,2],[422,428,-1,1],[595,420,-1,1],[426,420,1,2],[420,426,-1,1],[593,415,-1,1],[417,415,1,2],[415,417,-1,1],[592,393,-1,1],[591,393,-1,1],[590,414,2,1],[414,390,1,2],[390,414,-1,1],[589,412,2,1],[412,392,1,2],[392,412,-1,1],[588,389,-1,1],[587,389,-1,1],[586,411,-2,1],[411,395,-1,2],[395,411,1,1],[585,387,-1,1],[410,387,1,2],[387,410,-1,1],[584,403,-1,1],[583,403,-1,1],[582,409,2,1],[409,376,1,2],[376,409,-1,1],[581,406,2,1],[580,378,-1,1],[406,378,1,2],[378,406,-1,1],[578,381,-1,1],[577,402,2,1],[402,384,1,2],[384,402,-1,1],[576,399,2,1],[574,396,2,1],[573,373,-1,1],[396,373,1,2],[373,396,-1,1],[572,369,-1,1],[394,369,1,2],[369,394,-1,1],[571,386,-2,1],[386,368,-1,2],[368,386,1,1],[570,375,-1,1],[569,375,-1,1],[568,567,-1,1],[567,365,-1,1],[566,362,-1,1],[364,362,1,2],[362,364,-1,1],[565,363,-2,1],[363,253,-1,2],[253,363,1,1],[564,361,-2,1],[361,251,-1,2],[251,361,1,1],[563,358,-1,1],[562,358,-1,1],[360,358,1,2],[358,360,-1,1],[561,359,-2,1],[359,248,-1,2],[248,359,1,1],[560,357,-2,1],[357,245,-1,2],[245,357,1,1],[559,355,-1,1],[558,355,-1,1],[557,356,2,1],[356,304,1,2],[304,356,-1,1],[556,354,2,1],[354,306,1,2],[306,354,-1,1],[555,353,-2,1],[353,337,-1,2],[337,353,1,1],[554,301,-1,1],[352,301,1,2],[301,352,-1,1],[553,299,-1,1],[552,299,-1,1],[551,351,2,1],[351,290,1,2],[290,351,-1,1],[550,348,2,1],[549,338,-1,1],[348,338,1,2],[338,348,-1,1],[547,341,-1,1],[546,344,2,1],[344,298,1,2],[298,344,-1,1],[545,289,-1,1],[544,289,-1,1],[543,284,-1,1],[336,284,1,2],[284,336,-1,1],[541,331,2,1],[540,275,-1,1],[331,275,1,2],[275,331,-1,1],[538,278,-1,1],[537,326,2,1],[536,269,-1,1],[326,269,1,2],[269,326,-1,1],[534,272,-1,1],[533,319,2,1],[531,316,2,1],[530,266,-1,1],[316,266,1,2],[266,316,-1,1],[529,313,2,1],[527,310,2,1],[526,262,-1,1],[310,262,1,2],[262,310,-1,1],[525,258,-1,1],[524,258,-1,1],[308,258,1,2],[258,308,-1,1],[523,303,-1,1],[522,300,-2,1],[300,283,-1,2],[283,300,1,1],[521,295,2,1],[519,292,2,1],[518,287,-1,1],[292,287,1,2],[287,292,-1,1],[517,255,-1,1],[281,255,1,2],[255,281,-1,1],[516,250,-1,1],[252,250,1,2],[250,252,-1,1],[515,244,-1,1],[514,244,-1,1],[247,244,1,2],[244,247,-1,1],[513,240,-1,1],[512,240,-1,1],[242,240,1,2],[240,242,-1,1],[385,506,-1,1],[345,504,-1,1]],"pre_target_dirty_cancellation_gates":[[120,401,-1,2],[120,465,1,1],[120,474,1,4],[120,482,-1,2],[120,504,-1,3],[120,505,-1,3],[120,506,-1,3],[120,507,1,6],[120,508,1,6],[120,509,1,6],[120,510,1,6],[120,511,1,6],[120,586,-1,2],[120,773,1,2],[120,775,1,2],[121,374,-1,2],[121,464,-1,1],[121,474,1,4],[121,482,1,2],[121,504,-1,3],[121,505,-1,3],[121,506,1,6],[121,507,-1,3],[121,508,1,6],[121,509,1,6],[121,510,1,6],[121,511,1,6],[121,571,-1,2],[121,906,1,2],[121,918,1,2],[122,248,1,2],[122,257,1,4],[122,271,1,2],[122,274,-1,2],[122,277,1,2],[122,280,-1,2],[122,288,1,1],[122,358,1,4],[122,367,-1,4],[122,504,-1,3],[122,505,-1,3],[122,506,1,6],[122,507,1,6],[122,508,-1,3],[122,509,1,6],[122,510,1,6],[122,511,1,6],[122,578,-1,2],[122,755,1,4],[123,245,1,2],[123,257,1,2],[123,277,1,2],[123,280,-1,2],[123,297,1,1],[123,358,1,4],[123,367,-1,4],[123,373,-1,2],[123,504,-1,3],[123,505,-1,3],[123,506,1,6],[123,507,1,6],[123,508,1,6],[123,509,-1,3],[123,510,1,6],[123,511,1,6],[124,244,1,2],[124,253,1,2],[124,254,-1,2],[124,277,1,1],[124,280,-1,2],[124,293,1,1],[124,367,-1,4],[124,383,-1,2],[124,504,-1,3],[124,505,-1,3],[124,506,1,6],[124,507,1,6],[124,508,1,6],[124,509,1,6],[124,510,-1,3],[124,511,1,6],[124,868,-1,4],[125,244,1,2],[125,251,1,2],[125,254,-1,2],[125,277,1,2],[125,296,1,1],[125,358,1,4],[125,367,-1,2],[125,380,-1,2],[125,504,-1,3],[125,505,-1,3],[125,506,1,6],[125,507,1,6],[125,508,1,6],[125,509,1,6],[125,510,1,6],[125,511,-1,3],[125,868,-1,4],[126,334,1,1],[126,375,1,2],[126,380,-1,4],[126,438,1,1],[126,504,-1,3],[126,505,-1,3],[126,506,1,6],[126,507,1,6],[126,508,1,6],[126,509,1,6],[126,510,1,6],[126,511,1,6],[126,751,1,1],[126,914,-1,2],[126,962,-1,1],[127,263,1,2],[127,267,1,2],[127,437,1,1],[127,450,1,4],[127,462,-1,2],[127,504,-1,3],[127,505,1,6],[127,506,-1,3],[127,507,-1,3],[127,508,1,6],[127,509,1,6],[127,510,1,6],[127,511,1,6],[127,555,-1,2],[127,1011,-1,1],[128,504,-1,3],[128,505,1,6],[128,506,-1,3],[128,507,1,6],[128,508,-1,3],[128,509,1,6],[128,510,1,6],[128,511,1,6],[128,526,1,1],[128,656,1,2],[128,690,-1,4],[128,759,1,2],[128,766,1,2],[128,780,1,4],[128,804,-1,1],[128,849,-1,1],[129,504,-1,3],[129,505,1,6],[129,506,-1,3],[129,507,1,6],[129,508,1,6],[129,509,-1,3],[129,510,1,6],[129,511,1,6],[129,535,1,1],[129,656,1,2],[129,759,1,1],[129,855,1,1],[129,977,-1,1],[130,504,-1,3],[130,505,1,6],[130,506,-1,3],[130,507,1,6],[130,508,1,6],[130,509,1,6],[130,510,-1,3],[130,511,1,6],[130,530,1,1],[130,599,-1,4],[130,654,1,2],[130,761,1,2],[130,764,1,2],[130,778,1,4],[130,802,-1,1],[130,851,-1,1],[131,504,-1,3],[131,505,1,6],[131,506,-1,3],[131,507,1,6],[131,508,1,6],[131,509,1,6],[131,510,1,6],[131,511,-1,3],[131,539,1,1],[131,654,1,2],[131,761,1,1],[131,852,-1,1],[131,976,-1,1],[132,291,1,2],[132,441,1,1],[132,504,-1,3],[132,505,1,6],[132,506,-1,3],[132,507,1,6],[132,508,1,6],[132,509,1,6],[132,510,1,6],[132,511,1,6],[132,593,-1,2],[132,596,-1,2],[132,869,-1,4],[132,871,1,4],[132,980,-1,1],[133,313,-1,1],[133,504,-1,3],[133,505,1,6],[133,506,1,6],[133,507,-1,3],[133,508,-1,3],[133,509,1,6],[133,510,1,6],[133,511,1,6],[133,656,1,2],[133,690,-1,2],[133,820,-1,1],[133,1012,-1,1],[134,504,-1,3],[134,505,1,6],[134,506,1,6],[134,507,-1,3],[134,508,1,6],[134,509,-1,3],[134,510,1,6],[134,511,1,6],[134,527,1,2],[134,656,1,2],[134,690,-1,4],[134,759,1,2],[134,766,-1,2],[134,780,-1,4],[134,982,-1,1],[134,1016,1,1],[135,319,-1,1],[135,504,-1,3],[135,505,1,6],[135,506,1,6],[135,507,-1,3],[135,508,1,6],[135,509,1,6],[135,510,-1,3],[135,511,1,6],[135,599,-1,2],[135,654,1,2],[135,811,-1,1],[135,1017,-1,1],[136,504,-1,3],[136,505,1,6],[136,506,1,6],[136,507,-1,3],[136,508,1,6],[136,509,1,6],[136,510,1,6],[136,511,-1,3],[136,531,1,2],[136,599,-1,4],[136,654,1,2],[136,761,1,2],[136,764,-1,2],[136,778,-1,4],[136,981,-1,1],[136,1018,-1,1],[137,439,1,1],[137,504,-1,3],[137,505,1,6],[137,506,1,6],[137,507,-1,3],[137,508,1,6],[137,509,1,6],[137,510,1,6],[137,511,1,6],[137,596,-1,1],[137,892,1,2],[137,973,-1,1],[138,287,1,4],[138,337,1,2],[138,504,-1,3],[138,505,1,6],[138,506,1,6],[138,507,1,6],[138,508,-1,3],[138,509,-1,3],[138,510,1,6],[138,511,1,6],[138,600,1,4],[138,771,1,2],[138,774,-1,1],[138,866,1,2],[138,959,-1,1],[139,246,1,2],[139,504,-1,3],[139,505,1,6],[139,506,1,6],[139,507,1,6],[139,508,-1,3],[139,509,1,6],[139,510,-1,3],[139,511,1,6],[139,518,1,1],[139,698,-1,2],[139,731,-1,4],[139,734,1,4],[139,763,1,1],[139,806,-1,2],[139,815,-1,1],[140,246,1,2],[140,504,-1,3],[140,505,1,6],[140,506,1,6],[140,507,1,6],[140,508,-1,3],[140,509,1,6],[140,510,1,6],[140,511,-1,3],[140,548,1,1],[140,698,-1,1],[140,762,1,1],[140,818,-1,1],[141,255,1,2],[141,298,1,1],[141,504,-1,3],[141,505,1,6],[141,506,1,6],[141,507,1,6],[141,508,-1,3],[141,509,1,6],[141,510,1,6],[141,511,1,6],[141,777,-1,4],[141,779,1,4],[141,805,1,1],[141,810,-1,2],[141,814,1,1],[141,819,-1,2],[141,967,-1,1],[141,995,-1,1],[142,504,-1,3],[142,505,1,6],[142,506,1,6],[142,507,1,6],[142,508,1,6],[142,509,-1,3],[142,510,-1,3],[142,511,1,6],[142,520,1,2],[142,616,-1,4],[142,734,1,4],[142,806,-1,2],[142,809,-1,2],[142,1000,-1,1],[142,1006,-1,2],[143,348,1,1],[143,504,-1,3],[143,505,1,6],[143,506,1,6],[143,507,1,6],[143,508,1,6],[143,509,-1,3],[143,510,1,6],[143,511,-1,3],[143,616,-1,4],[143,809,-1,2],[143,832,-1,2],[143,857,-1,2],[143,910,1,4],[143,1005,-1,1],[144,255,1,2],[144,504,-1,3],[144,505,1,6],[144,506,1,6],[144,507,1,6],[144,508,1,6],[144,509,-1,3],[144,510,1,6],[144,511,1,6],[144,602,-1,4],[144,613,1,1],[144,777,-1,4],[144,779,1,2],[144,805,1,2],[144,814,1,1],[144,819,-1,2],[144,825,-1,1],[144,985,-1,1],[145,287,1,4],[145,504,-1,3],[145,505,1,6],[145,506,1,6],[145,507,1,6],[145,508,1,6],[145,509,1,6],[145,510,-1,3],[145,511,-1,3],[145,600,-1,4],[145,680,1,1],[145,771,-1,2],[145,776,-1,1],[145,866,1,2],[145,965,-1,1],[146,255,-1,4],[146,306,1,1],[146,425,1,2],[146,447,-1,2],[146,504,-1,3],[146,505,1,6],[146,506,1,6],[146,507,1,6],[146,508,1,6],[146,509,1,6],[146,510,-1,3],[146,511,1,6],[146,601,1,4],[146,607,1,4],[146,640,1,2],[146,689,1,4],[146,814,3,2],[146,961,-1,1],[146,1003,-1,1],[147,255,1,4],[147,504,-1,3],[147,505,1,6],[147,506,1,6],[147,507,1,6],[147,508,1,6],[147,509,1,6],[147,510,1,6],[147,511,-1,3],[147,617,1,1],[147,777,-1,4],[147,814,1,2],[147,819,1,2],[147,824,-1,1],[147,997,-1,1],[148,436,-1,1],[148,450,1,4],[148,462,1,2],[148,504,1,6],[148,505,-1,3],[148,506,-1,3],[148,507,-1,3],[148,508,1,6],[148,509,1,6],[148,510,1,6],[148,511,1,6],[148,522,-1,2],[148,866,-1,1],[148,938,1,1],[148,949,1,1],[149,504,1,6],[149,505,-1,3],[149,506,-1,3],[149,507,1,6],[149,508,-1,3],[149,509,1,6],[149,510,1,6],[149,511,1,6],[149,528,1,2],[149,720,-1,2],[149,741,-1,2],[149,766,1,2],[149,780,1,4],[149,795,-1,4],[149,807,-1,2],[150,326,1,1],[150,504,1,6],[150,505,-1,3],[150,506,-1,3],[150,507,1,6],[150,508,1,6],[150,509,-1,3],[150,510,1,6],[150,511,1,6],[150,748,-1,2],[150,795,-1,4],[150,807,-1,2],[150,839,-1,4],[150,896,-1,2],[150,931,1,2],[151,504,1,6],[151,505,-1,3],[151,506,-1,3],[151,507,1,6],[151,508,1,6],[151,509,1,6],[151,510,-1,3],[151,511,1,6],[151,532,1,2],[151,581,-1,2],[151,718,-1,2],[151,743,-1,2],[151,764,1,2],[151,778,1,4],[151,787,-1,4],[152,331,1,1],[152,504,1,6],[152,505,-1,3],[152,506,-1,3],[152,507,1,6],[152,508,1,6],[152,509,1,6],[152,510,1,6],[152,511,-1,3],[152,581,-1,2],[152,746,-1,2],[152,787,-1,4],[152,840,-1,4],[152,895,-1,2],[152,942,1,2],[153,451,1,4],[153,504,1,6],[153,505,-1,3],[153,506,-1,3],[153,507,1,6],[153,508,1,6],[153,509,1,6],[153,510,1,6],[153,511,1,6],[153,542,1,2],[153,655,1,2],[153,716,-1,4],[153,756,-1,2],[153,768,-1,2],[153,869,-1,2],[154,269,1,1],[154,504,1,6],[154,505,-1,3],[154,506,1,6],[154,507,-1,3],[154,508,-1,3],[154,509,1,6],[154,510,1,6],[154,511,1,6],[154,736,-1,2],[154,795,-1,4],[154,807,-1,2],[154,839,1,4],[154,901,-1,2],[154,931,-1,2],[155,272,1,1],[155,504,1,6],[155,505,-1,3],[155,506,1,6],[155,507,-1,3],[155,508,1,6],[155,509,-1,3],[155,510,1,6],[155,511,1,6],[155,766,-1,2],[155,780,-1,4],[155,795,-1,4],[155,807,-1,2],[155,894,-1,2],[155,899,-1,2],[156,275,1,1],[156,504,1,6],[156,505,-1,3],[156,506,1,6],[156,507,-1,3],[156,508,1,6],[156,509,1,6],[156,510,-1,3],[156,511,1,6],[156,581,-1,2],[156,727,-1,2],[156,787,-1,4],[156,840,1,4],[156,912,-1,2],[156,942,-1,2],[157,278,1,1],[157,504,1,6],[157,505,-1,3],[157,506,1,6],[157,507,-1,3],[157,508,1,6],[157,509,1,6],[157,510,1,6],[157,511,-1,3],[157,581,-1,2],[157,764,-1,2],[157,778,-1,4],[157,787,-1,4],[157,893,-1,2],[157,909,-1,2],[158,504,1,6],[158,505,-1,3],[158,506,1,6],[158,507,-1,3],[158,508,1,6],[158,509,1,6],[158,510,1,6],[158,511,1,6],[158,593,1,2],[158,596,-1,2],[158,704,1,2],[158,756,-1,1],[158,869,-1,4],[158,871,-1,4],[158,919,1,2],[159,283,1,2],[159,315,1,2],[159,504,1,6],[159,505,-1,3],[159,506,1,6],[159,507,1,6],[159,508,-1,3],[159,509,-1,3],[159,510,1,6],[159,511,1,6],[159,547,1,4],[159,691,-1,4],[159,772,-1,1],[159,1011,1,2],[159,1014,1,2],[160,246,1,2],[160,295,-1,1],[160,504,1,6],[160,505,-1,3],[160,506,1,6],[160,507,1,6],[160,508,-1,3],[160,509,1,6],[160,510,-1,3],[160,511,1,6],[160,722,-1,2],[160,731,-1,2],[160,838,1,2],[161,246,1,2],[161,504,1,6],[161,505,-1,3],[161,506,1,6],[161,507,1,6],[161,508,-1,3],[161,509,1,6],[161,510,1,6],[161,511,-1,3],[161,519,1,2],[161,698,-1,2],[161,731,-1,4],[161,734,-1,4],[161,806,1,2],[161,900,-1,2],[161,1008,1,2],[162,290,1,2],[162,504,1,6],[162,505,-1,3],[162,506,1,6],[162,507,1,6],[162,508,-1,3],[162,509,1,6],[162,510,1,6],[162,511,1,6],[162,602,1,4],[162,767,-1,1],[162,805,1,2],[162,837,1,4],[162,848,-1,2],[162,872,-1,2],[163,338,1,1],[163,504,1,6],[163,505,-1,3],[163,506,1,6],[163,507,1,6],[163,508,1,6],[163,509,-1,3],[163,510,-1,3],[163,511,1,6],[163,616,-1,4],[163,725,-1,2],[163,809,-1,2],[163,857,1,2],[163,910,-1,4],[163,957,-1,1],[164,341,1,1],[164,504,1,6],[164,505,-1,3],[164,506,1,6],[164,507,1,6],[164,508,1,6],[164,509,-1,3],[164,510,1,6],[164,511,-1,3],[164,616,-1,4],[164,734,-1,4],[164,806,1,2],[164,809,-1,2],[164,898,-1,2],[164,955,-1,1],[165,456,1,1],[165,504,1,6],[165,505,-1,3],[165,506,1,6],[165,507,1,6],[165,508,1,6],[165,509,-1,3],[165,510,1,6],[165,511,1,6],[165,758,-1,1],[165,796,1,4],[165,837,1,4],[165,848,-1,2],[165,875,-1,2],[165,992,1,2],[166,321,1,2],[166,463,1,1],[166,504,1,6],[166,505,-1,3],[166,506,1,6],[166,507,1,6],[166,508,1,6],[166,509,1,6],[166,510,-1,3],[166,511,-1,3],[166,547,1,4],[166,691,1,4],[166,769,-1,1],[166,1011,1,2],[166,1014,-1,2],[167,255,-1,2],[167,304,1,2],[167,447,-1,2],[167,504,1,6],[167,505,-1,3],[167,506,1,6],[167,507,1,6],[167,508,1,6],[167,509,1,6],[167,510,-1,3],[167,511,1,6],[167,601,1,4],[167,607,1,2],[167,640,1,2],[167,689,1,4],[167,765,-1,1],[167,814,1,1],[167,873,-1,2],[168,425,-1,2],[168,459,1,1],[168,504,1,6],[168,505,-1,3],[168,506,1,6],[168,507,1,6],[168,508,1,6],[168,509,1,6],[168,510,1,6],[168,511,-1,3],[168,607,1,4],[168,760,-1,1],[168,788,-1,4],[168,874,-1,2],[168,989,1,2],[169,257,-1,4],[169,271,1,2],[169,274,1,2],[169,277,-1,2],[169,280,1,2],[169,358,-1,4],[169,367,1,4],[169,504,1,6],[169,505,1,6],[169,506,-1,3],[169,507,-1,3],[169,508,-1,3],[169,509,1,6],[169,510,1,6],[169,511,1,6],[169,684,1,1],[169,752,1,1],[169,755,1,4],[169,951,-1,1],[170,274,1,1],[170,277,-1,2],[170,280,1,2],[170,303,-1,1],[170,358,-1,4],[170,367,1,4],[170,497,1,1],[170,504,1,6],[170,505,1,6],[170,506,-1,3],[170,507,-1,3],[170,508,1,6],[170,509,-1,3],[170,510,1,6],[170,511,1,6],[170,947,1,1],[171,244,-1,2],[171,254,1,2],[171,280,1,2],[171,358,-1,2],[171,367,1,4],[171,504,1,6],[171,505,1,6],[171,506,-1,3],[171,507,-1,3],[171,508,1,6],[171,509,1,6],[171,510,-1,3],[171,511,1,6],[171,686,1,1],[171,739,1,1],[171,868,1,4],[171,952,-1,1],[172,244,-1,2],[172,254,1,2],[172,277,-1,2],[172,280,1,1],[172,289,-1,1],[172,358,-1,4],[172,503,1,1],[172,504,1,6],[172,505,1,6],[172,506,-1,3],[172,507,-1,3],[172,508,1,6],[172,509,1,6],[172,510,1,6],[172,511,-1,3],[172,868,1,4],[172,937,1,1],[173,250,-1,2],[173,282,1,1],[173,288,-1,2],[173,440,-1,1],[173,504,1,6],[173,505,1,6],[173,506,-1,3],[173,507,-1,3],[173,508,1,6],[173,509,1,6],[173,510,1,6],[173,511,1,6],[173,514,-1,2],[173,647,-1,1],[173,651,-1,1],[173,770,1,4],[173,933,-1,2],[173,948,1,1],[174,262,1,1],[174,374,1,4],[174,395,1,2],[174,504,1,6],[174,505,1,6],[174,506,-1,3],[174,507,1,6],[174,508,-1,3],[174,509,-1,3],[174,510,1,6],[174,511,1,6],[174,595,-1,2],[174,688,-1,4],[174,753,-1,2],[174,958,-1,1],[175,249,-1,2],[175,504,1,6],[175,505,1,6],[175,506,-1,3],[175,507,1,6],[175,508,-1,3],[175,509,1,6],[175,510,-1,3],[175,511,1,6],[175,573,1,1],[175,637,1,2],[175,724,1,2],[175,732,-1,4],[175,733,3,4],[175,782,-1,2],[175,834,-1,2],[176,249,-1,2],[176,504,1,6],[176,505,1,6],[176,506,-1,3],[176,507,1,6],[176,508,-1,3],[176,509,1,6],[176,510,1,6],[176,511,-1,3],[176,579,1,1],[176,637,1,1],[176,733,1,2],[176,782,-1,1],[176,928,1,2],[176,1009,-1,2],[177,384,1,1],[177,447,1,1],[177,504,1,6],[177,505,1,6],[177,506,-1,3],[177,507,1,6],[177,508,-1,3],[177,509,1,6],[177,510,1,6],[177,511,1,6],[177,601,1,2],[177,781,1,1],[177,786,-1,2],[177,794,-1,2],[177,801,-1,4],[177,803,1,4],[177,883,1,2],[177,979,-1,2],[178,399,-1,1],[178,504,1,6],[178,505,1,6],[178,506,-1,3],[178,507,1,6],[178,508,1,6],[178,509,-1,3],[178,510,-1,3],[178,511,1,6],[178,631,1,4],[178,723,1,2],[178,733,1,4],[178,744,-1,1],[178,782,1,2],[178,785,-1,2],[179,504,1,6],[179,505,1,6],[179,506,-1,3],[179,507,1,6],[179,508,1,6],[179,509,-1,3],[179,510,1,6],[179,511,-1,3],[179,574,1,2],[179,631,1,4],[179,745,-1,1],[179,785,-1,2],[179,858,1,2],[179,929,1,2],[179,941,1,4],[180,447,1,1],[180,504,1,6],[180,505,1,6],[180,506,-1,3],[180,507,1,6],[180,508,1,6],[180,509,-1,3],[180,510,1,6],[180,511,1,6],[180,567,1,4],[180,601,1,2],[180,626,1,1],[180,737,-1,2],[180,781,1,2],[180,794,-1,2],[180,801,-1,4],[180,803,1,2],[180,877,1,2],[181,266,1,1],[181,374,1,4],[181,504,1,6],[181,505,1,6],[181,506,-1,3],[181,507,1,6],[181,508,1,6],[181,509,1,6],[181,510,-1,3],[181,511,-1,3],[181,595,-1,2],[181,682,1,1],[181,688,1,4],[181,753,1,2],[181,964,-1,1],[182,305,1,2],[182,392,1,1],[182,504,1,6],[182,505,1,6],[182,506,-1,3],[182,507,1,6],[182,508,1,6],[182,509,1,6],[182,510,-1,3],[182,511,1,6],[182,544,-1,4],[182,587,-1,2],[182,601,1,2],[182,640,1,2],[182,689,1,4],[182,882,1,2],[182,978,-1,2],[183,447,1,2],[183,504,1,6],[183,505,1,6],[183,506,-1,3],[183,507,1,6],[183,508,1,6],[183,509,1,6],[183,510,1,6],[183,511,-1,3],[183,601,1,4],[183,632,1,1],[183,728,-1,2],[183,794,1,2],[183,801,-1,4],[183,878,1,2],[184,368,1,2],[184,401,1,4],[184,504,1,6],[184,505,1,6],[184,506,1,6],[184,507,-1,3],[184,508,-1,3],[184,509,-1,3],[184,510,1,6],[184,511,1,6],[184,534,1,1],[184,603,-1,4],[184,754,-1,1],[184,1007,-1,2],[184,1013,-1,2],[185,249,-1,2],[185,504,1,6],[185,505,1,6],[185,506,1,6],[185,507,-1,3],[185,508,-1,3],[185,509,1,6],[185,510,-1,3],[185,511,1,6],[185,575,1,2],[185,732,-1,2],[185,733,1,2],[185,782,-1,1],[185,835,-1,2],[185,999,-1,1],[186,249,-1,2],[186,406,1,1],[186,504,1,6],[186,505,1,6],[186,506,1,6],[186,507,-1,3],[186,508,-1,3],[186,509,1,6],[186,510,1,6],[186,511,-1,3],[186,637,1,2],[186,732,-1,4],[186,733,1,4],[186,782,-3,2],[186,1004,-1,1],[186,1010,-1,2],[187,376,1,2],[187,420,-1,2],[187,504,1,6],[187,505,1,6],[187,506,1,6],[187,507,-1,3],[187,508,-1,3],[187,509,1,6],[187,510,1,6],[187,511,1,6],[187,567,-1,4],[187,781,1,2],[187,800,-1,1],[187,836,-1,4],[187,974,-1,2],[188,378,1,1],[188,504,1,6],[188,505,1,6],[188,506,1,6],[188,507,-1,3],[188,508,1,6],[188,509,-1,3],[188,510,-1,3],[188,511,1,6],[188,631,1,4],[188,785,-1,2],[188,790,-1,1],[188,858,-1,2],[188,941,-1,4],[188,956,-1,1],[189,381,1,1],[189,504,1,6],[189,505,1,6],[189,506,1,6],[189,507,-1,3],[189,508,1,6],[189,509,-1,3],[189,510,1,6],[189,511,-1,3],[189,631,1,4],[189,733,-1,4],[189,782,-1,2],[189,785,-1,2],[189,793,-1,1],[189,954,-1,1],[190,420,-1,2],[190,476,1,1],[190,504,1,6],[190,505,1,6],[190,506,1,6],[190,507,-1,3],[190,508,1,6],[190,509,-1,3],[190,510,1,6],[190,511,1,6],[190,719,-1,2],[190,821,-1,4],[190,836,-1,4],[190,966,-1,1],[190,991,1,2],[191,401,1,4],[191,483,1,1],[191,504,1,6],[191,505,1,6],[191,506,1,6],[191,507,-1,3],[191,508,1,6],[191,509,1,6],[191,510,-1,3],[191,511,-1,3],[191,538,1,1],[191,603,1,4],[191,963,-1,1],[191,1007,-1,2],[191,1013,1,2],[192,305,1,2],[192,390,1,2],[192,447,-1,2],[192,504,1,6],[192,505,1,6],[192,506,1,6],[192,507,-1,3],[192,508,1,6],[192,509,1,6],[192,510,-1,3],[192,511,1,6],[192,544,-1,4],[192,587,-1,2],[192,601,1,4],[192,640,1,1],[192,799,-1,1],[192,975,-1,2],[193,479,1,1],[193,504,1,6],[193,505,1,6],[193,506,1,6],[193,507,-1,3],[193,508,1,6],[193,509,1,6],[193,510,1,6],[193,511,-1,3],[193,640,1,2],[193,689,-1,4],[193,717,-1,2],[193,812,1,4],[193,960,-1,1],[193,988,1,2],[194,499,1,1],[194,500,1,4],[194,502,-1,2],[194,504,1,6],[194,505,1,6],[194,506,1,6],[194,507,1,6],[194,508,-1,3],[194,509,-1,3],[194,510,-1,3],[194,511,1,6],[194,565,-1,2],[194,757,-1,2],[194,908,1,2],[194,1015,-1,1],[195,498,-1,1],[195,500,1,4],[195,502,1,2],[195,504,1,6],[195,505,1,6],[195,506,1,6],[195,507,1,6],[195,508,-1,3],[195,509,-1,3],[195,510,1,6],[195,511,-1,3],[195,517,-1,1],[195,564,-1,2],[195,905,-1,2],[195,913,1,2],[196,266,-1,2],[196,432,1,1],[196,486,1,1],[196,504,1,6],[196,505,1,6],[196,506,1,6],[196,507,1,6],[196,508,-1,3],[196,509,-1,3],[196,510,1,6],[196,511,1,6],[196,512,-1,2],[196,524,-1,2],[196,620,-1,1],[196,635,-1,1],[196,775,-1,4],[196,907,-1,2],[196,936,-1,2],[197,485,1,1],[197,490,1,4],[197,496,-1,2],[197,504,1,6],[197,505,1,6],[197,506,1,6],[197,507,1,6],[197,508,-1,3],[197,509,1,6],[197,510,-1,3],[197,511,-1,3],[197,561,-1,2],[197,770,-1,2],[197,897,1,2],[197,990,-1,2],[198,292,1,2],[198,305,1,1],[198,489,1,1],[198,504,1,6],[198,505,1,6],[198,506,1,6],[198,507,1,6],[198,508,-1,3],[198,509,1,6],[198,510,-1,3],[198,511,1,6],[198,521,1,2],[198,550,1,4],[198,953,-1,2],[198,993,-1,2],[199,487,1,1],[199,504,1,6],[199,505,1,6],[199,506,1,6],[199,507,1,6],[199,508,-1,3],[199,509,1,6],[199,510,1,6],[199,511,-1,3],[199,659,1,1],[199,726,-1,2],[199,880,1,2],[200,484,-1,1],[200,490,1,4],[200,496,1,2],[200,504,1,6],[200,505,1,6],[200,506,1,6],[200,507,1,6],[200,508,1,6],[200,509,-1,3],[200,510,-1,3],[200,511,-1,3],[200,560,-1,2],[200,903,1,2],[200,917,-1,2],[200,983,-1,2],[201,491,-1,4],[201,504,1,6],[201,505,1,6],[201,506,1,6],[201,507,1,6],[201,508,1,6],[201,509,-1,3],[201,510,-1,3],[201,511,1,6],[201,525,-1,1],[201,594,1,2],[201,721,-1,4],[201,730,1,2],[201,735,-1,2],[201,940,1,1],[202,292,-1,2],[202,504,1,6],[202,505,1,6],[202,506,1,6],[202,507,1,6],[202,508,1,6],[202,509,-1,3],[202,510,1,6],[202,511,-1,3],[202,521,-1,2],[202,550,1,4],[202,705,1,2],[202,721,-1,2],[202,945,1,1],[202,953,-1,2],[203,263,-1,4],[203,427,1,1],[203,488,-1,1],[203,504,1,6],[203,505,1,6],[203,506,1,6],[203,507,1,6],[203,508,1,6],[203,509,1,6],[203,510,-1,3],[203,511,-1,3],[203,774,1,2],[203,889,-1,2],[203,916,-1,2],[203,922,1,2],[204,308,-1,1],[204,311,-1,1],[204,323,-1,1],[204,336,-1,1],[204,352,-1,1],[204,355,-1,1],[204,356,-1,1],[204,462,-1,1],[204,504,-1,2],[204,505,1,2],[204,556,1,2],[204,748,1,4],[204,804,-1,2],[204,902,1,2],[205,244,1,1],[205,257,-1,4],[205,271,-1,2],[205,274,1,2],[205,277,-1,2],[205,280,1,2],[205,322,-1,1],[205,358,-1,4],[205,367,1,4],[205,453,1,1],[205,504,-1,2],[205,506,1,2],[205,569,-1,1],[205,716,1,2],[205,755,1,4],[206,256,1,2],[206,451,1,4],[206,455,1,1],[206,504,-1,2],[206,507,1,2],[206,584,-1,1],[206,716,1,4],[206,756,1,2],[206,768,-1,2],[206,876,1,1],[207,240,1,1],[207,255,1,2],[207,344,-1,1],[207,504,-1,2],[207,508,1,2],[207,602,-1,2],[207,715,1,2],[207,777,-1,4],[207,779,1,4],[207,810,-1,2],[207,814,1,1],[207,819,-1,2],[208,255,1,2],[208,504,-1,2],[208,509,1,2],[208,551,1,2],[208,602,-1,4],[208,777,-1,4],[208,805,1,2],[208,810,-1,1],[208,814,1,1],[208,819,-1,2],[208,886,1,1],[208,968,1,2],[209,255,3,4],[209,316,-1,1],[209,354,-1,1],[209,425,-1,2],[209,447,1,2],[209,504,-1,2],[209,510,1,2],[209,601,-1,4],[209,607,-1,4],[209,640,-1,2],[209,689,-1,4],[209,714,1,2],[209,814,-1,2],[210,255,1,4],[210,504,-1,2],[210,511,1,2],[210,557,1,2],[210,777,1,4],[210,814,1,2],[210,819,-1,2],[210,888,1,1],[210,969,1,2],[211,259,1,1],[211,287,1,2],[211,300,1,1],[211,451,-1,4],[211,504,-1,2],[211,716,1,4],[211,756,1,2],[211,768,-1,2],[211,890,1,2],[211,891,1,2],[212,455,1,1],[212,505,-1,2],[212,506,1,2],[212,568,-1,1],[212,750,1,2],[212,870,-1,2],[212,925,-1,1],[213,257,-1,4],[213,271,-1,2],[213,274,1,2],[213,277,-1,2],[213,280,1,2],[213,281,-1,1],[213,358,-1,4],[213,367,1,4],[213,453,1,1],[213,505,-1,2],[213,507,1,2],[213,755,1,4],[213,868,-1,2],[213,950,-1,1],[213,972,1,2],[214,442,1,1],[214,505,-1,2],[214,508,1,2],[214,529,-1,2],[214,602,-1,4],[214,738,1,2],[214,805,-1,2],[214,837,1,4],[214,848,-1,2],[215,310,1,1],[215,444,1,1],[215,505,-1,2],[215,509,1,2],[215,796,-1,4],[215,837,1,4],[215,848,-1,2],[215,971,1,2],[215,992,-1,2],[216,255,1,2],[216,425,-1,1],[216,446,1,1],[216,447,1,2],[216,505,-1,2],[216,510,1,2],[216,533,-1,2],[216,601,-1,4],[216,640,-1,2],[216,689,-1,4],[216,729,1,2],[216,814,-1,1],[217,425,-1,2],[217,448,1,1],[217,505,-1,2],[217,511,1,2],[217,607,1,4],[217,788,1,4],[217,970,1,2],[217,989,-1,2],[217,1022,-1,2],[218,309,1,1],[218,353,1,1],[218,505,-1,2],[218,547,1,2],[218,681,-1,2],[218,904,1,2],[218,915,1,2],[219,242,-1,1],[219,268,1,2],[219,394,-1,1],[219,403,-1,1],[219,409,-1,1],[219,410,-1,1],[219,482,-1,1],[219,506,-1,2],[219,507,1,2],[219,577,1,2],[219,764,1,2],[219,778,1,4],[219,943,1,2],[219,1020,-1,2],[220,258,1,1],[220,402,-1,1],[220,447,1,1],[220,506,-1,2],[220,508,1,2],[220,567,1,2],[220,601,1,2],[220,740,-1,1],[220,786,-1,2],[220,794,-1,2],[220,801,-1,4],[220,803,1,4],[221,447,1,1],[221,506,-1,2],[221,509,1,2],[221,567,1,4],[221,582,1,2],[221,601,1,2],[221,749,-1,1],[221,781,1,2],[221,786,-1,1],[221,794,-1,2],[221,801,-1,4],[221,885,1,1],[222,276,-1,1],[222,305,-1,2],[222,412,-1,1],[222,447,1,1],[222,506,-1,2],[222,510,1,2],[222,544,1,4],[222,587,1,2],[222,640,-1,2],[222,689,-1,4],[222,742,-1,1],[223,447,1,2],[223,506,-1,2],[223,511,1,2],[223,590,1,2],[223,601,1,4],[223,747,-1,1],[223,794,-1,2],[223,801,1,4],[223,887,1,1],[224,241,1,1],[224,386,1,1],[224,475,-1,2],[224,506,-1,2],[224,595,-1,1],[224,923,1,2],[224,924,1,2],[225,273,1,1],[225,420,-1,2],[225,466,1,1],[225,507,-1,2],[225,508,1,2],[225,567,1,4],[225,781,-1,2],[225,836,-1,4],[225,984,-1,1],[226,270,1,1],[226,420,-1,2],[226,468,1,1],[226,507,-1,2],[226,509,1,2],[226,821,1,4],[226,836,-1,4],[226,991,-1,2],[226,994,-1,1],[227,279,1,1],[227,305,-1,2],[227,447,1,2],[227,470,1,1],[227,507,-1,2],[227,510,1,2],[227,544,1,4],[227,587,1,2],[227,601,-1,4],[227,689,-1,2],[227,996,-1,1],[228,472,1,1],[228,507,-1,2],[228,511,1,2],[228,640,1,2],[228,689,-1,4],[228,812,-1,4],[228,988,-1,2],[228,1002,-1,1],[228,1021,-1,2],[229,243,1,1],[229,411,1,1],[229,507,-1,2],[229,683,-1,2],[229,935,1,2],[229,946,1,2],[229,1007,-1,1],[230,247,-1,1],[230,299,-1,1],[230,360,-1,1],[230,428,-1,1],[230,431,-1,1],[230,496,-1,1],[230,508,-1,2],[230,509,1,2],[230,521,1,1],[230,615,1,1],[230,724,1,4],[230,790,1,2],[230,930,-1,2],[231,302,-1,1],[231,421,-1,2],[231,430,-1,1],[231,493,1,1],[231,508,-1,2],[231,510,1,2],[231,544,1,2],[231,730,-1,1],[232,491,-1,4],[232,495,1,1],[232,508,-1,2],[232,511,1,2],[232,598,-1,1],[232,721,1,4],[232,730,-1,2],[232,735,-1,2],[232,884,-1,1],[232,927,1,2],[233,357,1,1],[233,389,-1,1],[233,423,1,1],[233,491,-1,4],[233,508,-1,2],[233,721,1,4],[233,730,-1,2],[233,735,1,2],[233,865,-1,1],[233,926,1,2],[234,419,1,2],[234,495,1,1],[234,509,-1,2],[234,510,1,2],[234,553,1,2],[234,881,-1,2],[234,998,-1,1],[235,421,-1,2],[235,426,-1,1],[235,493,1,1],[235,509,-1,2],[235,511,1,2],[235,879,-1,2],[235,934,1,2],[235,1001,-1,1],[236,359,1,1],[236,429,1,1],[236,509,-1,2],[236,685,-1,2],[236,921,-1,1],[236,932,1,2],[236,1019,-1,1],[237,252,-1,1],[237,292,1,1],[237,364,-1,1],[237,393,-1,1],[237,417,-1,1],[237,424,1,2],[237,502,-1,1],[237,510,-1,2],[237,511,1,2],[237,634,1,1],[237,734,1,4],[237,806,-1,2],[237,911,-1,2],[238,361,1,1],[238,375,-1,1],[238,416,1,1],[238,501,-1,2],[238,510,-1,2],[238,939,1,2],[238,986,1,2],[239,363,1,1],[239,418,1,1],[239,511,-1,2],[239,687,-1,2],[239,920,-1,1],[239,944,1,2],[239,987,1,2]],"scope":"Exact rational scalar columns and emitted pre/post gates. Needs physical Clifford endpoint adapters, inverse orientation, changed bank phases and finite global invoice.","sinks":[355,403],"status":"PASS_EXACT_1023_COLUMN_ABSTRACT_FORWARD_HETEROGENEOUS_DIRTY_DECODER"} \ No newline at end of file diff --git a/research/e8-clean-padding/data/pr390/sink-audit.json b/research/e8-clean-padding/data/pr390/sink-audit.json new file mode 100644 index 0000000000..ef2b6f9ee9 --- /dev/null +++ b/research/e8-clean-padding/data/pr390/sink-audit.json @@ -0,0 +1,72 @@ +{ + "accepted": [ + { + "cut_group": 2030, + "dim": 8, + "exact_rational_zero_clean_row": true, + "frame": 206, + "normalized_moment_minus_volume_delta": 0, + "sink_helper": 355, + "uncompute": [ + [ + 356, + -1, + 1 + ], + [ + 556, + 1, + 2 + ], + [ + 619, + 1, + 1 + ] + ] + }, + { + "cut_group": 2045, + "dim": 8, + "exact_rational_zero_clean_row": true, + "frame": 221, + "normalized_moment_minus_volume_delta": 0, + "sink_helper": 403, + "uncompute": [ + [ + 409, + -1, + 1 + ], + [ + 577, + 1, + 2 + ], + [ + 628, + 1, + 1 + ] + ] + } + ], + "local_histogram_delta": { + "1": 2, + "3": 4, + "4": -4 + }, + "local_mass_delta": -2, + "new_helper_endpoint_dimensions": [ + [ + 8, + 2 + ], + [ + 9, + 781 + ] + ], + "rejected": [], + "scope": "EXACT_RATIONAL_CLEAN_SOURCE_AND_FRAME_WALK_ONLY; new dirtypreconditioning/cleanrepair and fullCliffordadmissionnotchecked" +} \ No newline at end of file diff --git a/research/e8-clean-padding/data/sinks-e8clean.json b/research/e8-clean-padding/data/sinks-e8clean.json new file mode 100644 index 0000000000..0248eed651 --- /dev/null +++ b/research/e8-clean-padding/data/sinks-e8clean.json @@ -0,0 +1,116 @@ +[ + { + "sink_helper": 301, + "cut_group": 1254, + "frame": 731, + "target": 276, + "uncompute": [ + [ + 1021, + 1, + 2 + ] + ] + }, + { + "sink_helper": 301, + "cut_group": 1254, + "frame": 731, + "uncompute": [ + [ + 276, + -1, + 2 + ] + ] + }, + { + "sink_helper": 301, + "cut_group": 1254, + "frame": 731, + "target": 276, + "uncompute": [ + [ + 1021, + -1, + 2 + ] + ] + }, + { + "sink_helper": 324, + "cut_group": 1284, + "frame": 744, + "target": 311, + "uncompute": [ + [ + 1020, + 1, + 2 + ] + ] + }, + { + "sink_helper": 324, + "cut_group": 1284, + "frame": 744, + "uncompute": [ + [ + 311, + -1, + 2 + ] + ] + }, + { + "sink_helper": 324, + "cut_group": 1284, + "frame": 744, + "target": 311, + "uncompute": [ + [ + 1020, + -1, + 2 + ] + ] + }, + { + "sink_helper": 387, + "cut_group": 1318, + "frame": 759, + "target": 316, + "uncompute": [ + [ + 1022, + 1, + 2 + ] + ] + }, + { + "sink_helper": 387, + "cut_group": 1318, + "frame": 759, + "uncompute": [ + [ + 316, + -1, + 2 + ] + ] + }, + { + "sink_helper": 387, + "cut_group": 1318, + "frame": 759, + "target": 316, + "uncompute": [ + [ + 1022, + -1, + 2 + ] + ] + } +] \ No newline at end of file diff --git a/research/e8-clean-padding/verify.sh b/research/e8-clean-padding/verify.sh new file mode 100644 index 0000000000..cccf5e0e21 --- /dev/null +++ b/research/e8-clean-padding/verify.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# One-command verification of research/e8-clean-padding. usage: bash verify.sh [--quick] /fresh/output/dir +# python3 >= 3.11, standard library only. --quick skips the free-sink regeneration (~2 min). +set -euo pipefail +QUICK=0; if [ "${1:-}" = "--quick" ]; then QUICK=1; shift; fi +HERE=$(cd "$(dirname "$0")" && pwd); WD=$(mkdir -p "$1" && cd "$1" && pwd) +case "$WD" in "$HERE"*) echo "output dir must be outside the package"; exit 2;; esac +PY="${PYTHON:-python3} -I -B"; C=$HERE/code; GX=$HERE/complex/gx; D=$HERE/data + +echo "== 0. manifest"; (cd "$HERE" && $PY -c " +import hashlib,sys,os +bad=0;listed=set() +for line in open('MANIFEST.sha256'): + h,p=line.rstrip('\n').split(' ',1);listed.add(p) + if hashlib.sha256(open(p,'rb').read()).hexdigest()!=h: print('MISMATCH',p);bad+=1 +files={os.path.relpath(os.path.join(r,f)) for r,_,fs in os.walk('.') for f in fs if '__pycache__' not in r}-{'MANIFEST.sha256'} +if files-listed: print('UNLISTED',sorted(files-listed));bad+=1 +sys.exit(1 if bad else 0)") && echo " all files match MANIFEST.sha256" + +echo "== 1. pinned inputs (git blob ids)" +$PY -c " +import hashlib +def blob(p): + d=open(p,'rb').read();return hashlib.sha1(b'blob %d\0'%len(d)+d).hexdigest() +pins={'$GX/gx.py':('6d14c0a976146eb881c1e3897b2476f8633d4e9c','Sussman tools/gx/gx.py'), + '$GX/gxcore.py':('3e3f0a3076f3c326e7833c74eceecb3436dd3185','Sussman tools/gx/gxcore.py'), + '$D/gcert1-e8-r783-far.json.gz':('56708f99a48c3f86bfcabfc526c2ff224bdba66a','PR #378 far-retimed E8 word (ours)'), + '$D/pr390/prefix18.json.gz':('51f3ea73e0c1726351450e54e4873cfdd4d98d9e','PR #390 prefix18 word (Dugongue, 0e790f2)'), + '$D/pr390/sink-audit.json':('ef2b6f9ee9d4c0cdd3a3a3aa46e8cfaf2958bf6d','PR #390 sink-audit.json (sinks 355/403)'), + '$D/pr390/prewhite.json':('527a2ea46180a2e9464acbc7f8298474d5b78762','PR #390 prewhite.json (regression target only)'), + '$D/bit/bitE8-kernel.json.gz':('22141be33d588ed9495feaeedda7efe205a5f8d0','PR #382 E8 bit word (ours)')} +for p,(h,what) in pins.items(): + assert blob(p)==h,(p,blob(p));print(' ',h[:12],what)" + +echo "== 2. #390's prefix18 word: Sussman's checkers, source-span rule, same full operator as #378" +$PY $C/cxcheck.py $D/pr390/prefix18.json.gz $GX +$PY $C/cxop.py $D/gcert1-e8-r783-far.json.gz $D/pr390/prefix18.json.gz + +echo "== 3-6. words, local program (both orientations), banks, price, kappa" +if [ $QUICK = 1 ]; then $PY $C/clean.py $HERE $GX $WD/kappa.json; else $PY $C/clean.py $HERE $GX $WD/kappa.json --regen; fi +$PY $C/cxcheck.py $WD/gcert1-e8clean.json.gz $GX +$PY -c " +import json;k=json.load(open('$WD/kappa.json')) +assert k['b']=='40055507598519/40000000000000000' and k['kappa']=='125048239231783/125000000000000000' and k['binding']=='complex' +print('PASS conditional kappa =',k['kappa'],'=',k['kappa_float'],'(complex-bound; #390 component with three padding-fused sinks)')" diff --git a/research/e8-clean-r781/.gitattributes b/research/e8-clean-r781/.gitattributes new file mode 100644 index 0000000000..fa6146e0d9 --- /dev/null +++ b/research/e8-clean-r781/.gitattributes @@ -0,0 +1,2 @@ +data/pr390/* -text +data/pr398/* -text diff --git a/research/e8-clean-r781/LICENSE b/research/e8-clean-r781/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-r781/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-r781/MANIFEST.sha256 b/research/e8-clean-r781/MANIFEST.sha256 new file mode 100644 index 0000000000..a637bce18b --- /dev/null +++ b/research/e8-clean-r781/MANIFEST.sha256 @@ -0,0 +1,34 @@ +ee6940cd756f4b7680a13d21b38ce9d3d1a66e689421e1e120fe32ef2b394ea6 .gitattributes +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE +0d0bbb85f3eb4a35c9e9f26dc5bdf2c74fb31ebe266be7f70f1dd1b5df7425a5 NOTICE.md +b4d7f7fc9a7322d97852150a46af953ce1597e675c99626cd18f04bfbeea9f67 PROOF.md +14f8c2c06c755dc32b5a2d165a39743efe8a8a962ca8247709ebc00fe51f7df2 README.md +6811203fb7df1ac8a9eee3fbeca722de98dbc99077921fe77e0d452c760f0ffc code/bootstrap.py +dbd45d10ef31c9a36a11eab129727683c5c12c895914d03fe5ea3e616bd0837c code/clean.py +97b461509656798d30b2610b4755ce825b1f84ae8772b9b4efd5c84d7404385b code/cxcheck.py +8fc2a43e70fa8c1ce3f3025c9568b562accc5cf25b2ed53d7c0a1cbf954a0599 code/cxkernel.py +2655e1e9ec94fb39512329ec86d261959ccd7c635c7535238f254a82861c2db1 code/cxop.py +e7e06595c12fbafb707a6846719c54b85e0c2bb105927e7e7ee20f028a37438b code/cxretime.py +1cb286196c1530d06f50f0997febc5993b388f33464e295611b920ba30a24eeb code/e8core.py +b06ae2fb90b668f27e73adfee523120f68c746a702c76443e3b9406ccc2f0933 code/emit.py +aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098 code/engines/base_two_moment.py +81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482 code/engines/moment.py +c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c code/engines/outer.py +e650d16538db8d80495fda5109cdfa0775e1d5f3b56b0aa39e5c1efc660877e7 code/layout_bk.py +43a57d720f634c1b3f1b8660d0505d0085c50b7c814607461c3aa3ede6f41b4e code/sinks.py +63c02f96767435dd44f721148a483960bc4a966ef23de0f42a9f1614232a0f2c code/word.py +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 complex/LICENSE-wht-power-saving-lean +557c9ad4660eebd14a00583736c4d12d2c45f3fc9bc148845f9f3efec72c9434 complex/NOTICE-wht-power-saving-lean +6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95 complex/gx/gx.py +eb972c06fe8c322db2d9a8d9a7d05596e8f40c4ca8e5f42eb6df3c7361b5d517 complex/gx/gxcore.py +947f6e1266f009c6c54647e0b348b1e2076bb584b54fae19016bc8086741876a data/bit/bitE8-kernel.json.gz +f2664ee7bcdfb55893abe9f1be8ee6a394a602e8262e611de2a0328bbd508aa7 data/gcert1-e8-r783-far.json.gz +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 data/pr390/LICENSE-pr390 +fe21bb4af91552196e938baf693c22c72a5071dbe857f772b2600b3a2d2cc94c data/pr390/prefix18.json.gz +be5fa48b48491d7b3587e3df22f7d7f8f767dcb48817c4f49f4be87c7cc87519 data/pr390/prewhite.json +a8023406955b9f7b529ec578c8b311f8ccac729c4f33b1d0f8f8fbe960d99edf data/pr390/sink-audit.json +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 data/pr398/LICENSE-pr398 +dea88d4f6e201abec078505ded8d08a85fd6492d8c60874feb9113589f887157 data/pr398/VALIDATION.json +495ec66be65bf66e3a5cd27b411df942cc7c92664807f93e25b88a71cb498d67 data/pr398/signed25.json.gz +fa0429be07417306591f01a787456d680b8f0057d0aa93503db92dda29ef3537 data/sinks-e8clean3.json +dd72fc582bd812a0d225df013168220aa6bd0558477b039eedd8981cdd49d300 verify.sh diff --git a/research/e8-clean-r781/NOTICE.md b/research/e8-clean-r781/NOTICE.md new file mode 100644 index 0000000000..732de5d7ab --- /dev/null +++ b/research/e8-clean-r781/NOTICE.md @@ -0,0 +1,16 @@ +# Notice + +Apache-2.0 (`LICENSE`). Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. + +- `data/pr390/prefix18.json.gz`, `sink-audit.json`, `prewhite.json` are Dugongue's PR #390 (`research/e8-prefix-restoration/data/`, head 0e790f2), byte-identical (git blobs 51f3ea73, ef2b6f9e, 527a2ea4), Apache-2.0 (`data/pr390/LICENSE-pr390`). + - `prewhite.json` is used only as a regression target. + - #390's scripts (`complex-hetero-compose.py`, `root-global.py`, `root-heterobanks.cpp`) were read as data. Their bracket rule and bank assignment are re-implemented in `code/emit.py` and `code/clean.py`. None of #390's scripts were run. +- `data/pr398/signed25.json.gz` and `VALIDATION.json` are Dugongue's PR #398 (`research/e8-signed-prefix/data/`, head c3251c8), byte-identical (git blobs 23a6396d, 3b1a9bb6), Apache-2.0 (`data/pr398/LICENSE-pr398`). `VALIDATION.json` is used only as the control target. #398's scripts (`reconstruct.py`, `complex-compose.py`, `global-template.py`, `outer.py`) were read as data; its bank rule and profile formula are re-implemented in `code/clean.py`. None of its scripts were run. The R781 word carries #376's (applecrusher) helper substitutions. +- `code/bootstrap.py` re-implements #392's (rohanarun) pricing tail, which #398 also uses. +- `complex/gx/gx.py`, `gxcore.py` are by Jacob Sussman (wht-power-saving-lean `9c94857`, Apache-2.0); upstream LICENSE/NOTICE are kept in `complex/`. +- `data/gcert1-e8-r783-far.json.gz` is our #378 word, and `data/bit/bitE8-kernel.json.gz` is our #382 bit word (derived from utcorvusvolat-dotcom's #370). Both are byte-identical. +- `code/engines/*` are PR #315's engines (DreamingOfClouds; eumemic; the #144/#23 lineage), as in our earlier packages. +- `code/e8core.py`, `cxkernel.py`, `cxretime.py`, `cxcheck.py`, `cxop.py` and `layout_bk.py` (DaysSky's B_K rule, #363) are copied unchanged from our `research/e8-far-nine-complex`. +- `code/word.py` and `code/sinks.py` are unchanged from our #394 (`research/e8-clean-padding`); `code/emit.py` is #394's with a `setR` switch for R = 781. +- New here: `code/clean.py` and `data/sinks-e8clean3.json`. +- #352 (`complex_splice.emit`), #363 and #377 (`PROOF.txt`, `global_nine.py`, `RECIPE-9.json`) were read as data only. diff --git a/research/e8-clean-r781/PROOF.md b/research/e8-clean-r781/PROOF.md new file mode 100644 index 0000000000..aa9c412b2b --- /dev/null +++ b/research/e8-clean-r781/PROOF.md @@ -0,0 +1,48 @@ +# Why the fused program computes #398's operator, and what is re-opened + +Notation: x (120 sources), h (783 helpers), y (120 targets). The main word is the gcert/1 word (A, scatter, B), here Dugongue's #398 R781 word with our nine new helper → helper gates (no #390 sinks; R781 has 781 helpers, 1,021 live columns). + +**0. The base word and the bracket change.** The main word is Dugongue's #398 R781 word (#376's R781 helper substitutions on our #378 far word, plus 25 signed disjoint target-prefix pairs), byte-pinned, with our nine new helper → helper gates. #398 compiles it with #352's frozen old response K, main and the full cleanup of the non-y word at FULL. Every one of its 781 helpers is the target or source of a non-y gate (`clean.py` checks this), so under that bracket every helper is touched after its final climb and no padding can be fused. We compile the same word with #390's dirty-preconditioned bracket (§1) instead. Both brackets realize the same invocation (x, h, y) → (x, h, y + x) on arbitrary dirty inputs, which `validate` checks on all 1,021 live columns in both orientations. Both use only scalar operations at common frames, so the paid local events coincide with the word's histogram. Our emission of #398's word reproduces #398's b and κ exactly. The changed scalar schedule, and the Gaussian phases of its endpoint adapters, are an admitted re-opened item (see below); no new climb or edge is introduced. + +**1. The bracket (#390, re-implemented and regression-checked).** The main acts on scalar values as x' = x, h' = N·x + A·h, y' = y + M·x + B·h. Here A is the product of the literal helper → helper shears. The bracket has three parts: +- **Before the main**, at the common old frame: y −= (B·A⁻¹)·h, then h ← A⁻¹·h, where A⁻¹ is the reversed, negated helper → helper subword. +- **The main** now yields (x, N·x + h, y + M·x). +- **After the final climbs**, at FULL: for every non-sink helper, h_r −= N_r·x. + +`emit.prewhite` computes these lists. On #390's own word it reproduces #390's `prewhite.json` exactly, in the same order. On ours, `emit.validate` replays all 1,021 live columns exactly in both orientations. The backward orientation is the same chronological sequence with each t += a·s replaced by s −= a·t. The replay confirms (x, h, y) → (x, h, y + x) forward and (x, h, y) → (x − y, h, y) backward, private work zero, and every main scalar at a common exact frame label. + +**2. Our gates keep everything but the sink rows.** Each new gate is helper → helper at a frame where all three registers already sit, so no climb is added and the paid histogram is unchanged. Each is inserted after the sink's last influence on any y or retained total. The adjoint of the main from all y outputs, including the scatter, is identically zero on the sink from that point on. The x and y rows of the full rational operator and the retained totals are therefore unchanged, as `clean.py` checks against #378. `gx.check1` (E0–E7, exact scalar E5) and the gxcore mirror (sixths units) accept the word. The sinks' clean rows N_r are exactly zero. + +**3. A zero-row sink needs no cleanup.** With N_r = 0, the bracket leaves h_r equal to its input value up to its frame walk. The emitted program has no event on the sink after its final climb except its rank-0 new → old adapter, which acts on the local factor. `validate` enforces this, and a control that adds a FULL repair on a fused sink is rejected. + +**4. Fusing the padding.** The sink's final climb from frame f to FULL is compiled as M₁·C_[d]·M₂ (d = 2 for all three sinks, and these are existing audited edges 731→1, 744→1, 759→1). On the bank stream we apply instead (climb) ⊗ C₇₂ = (M₁⊗I)·(C_[d]⊗C₇₂)·(M₂⊗I). This is one C child of rank d + 1 on a coordinate set (d local coordinates plus window coordinate 72) between the same monomials, so the paid profile changes by rank 2 + rank 1 → rank 3. + +Since no event touches the stream afterwards in this invocation, the fused invocation equals the unfused invocation followed by C₇₂ on that stream. The arbitrary-dirt property of #377 says each invocation acts on a helper stream as C_block ⊗ I_exterior, and its y output is independent of the helper value. So C₇₂ commutes with every other invocation on that bank stream, and with all data-family operations, which use disjoint families. Hence the result equals #377/#390's schedule, where the padding is a separate sweep before the X_δ(g) cover correction. + +The routes of #398's whole banks (bank, slot = divmod(rep·781 + r, 8); the slot route swaps local coordinates 0–8 with block 9·slot … 9·slot+8) fix coordinate 72 (`clean.py` rebuilds them from #398's rule). The fused C on invocation coordinate 72 is therefore P_g·C₇₂·P_g⁻¹ at the bank class g = d·A⁻¹, exactly #377's padding. Each fused occurrence (3 helpers × 8 replicas per stage) lies in a distinct bank, so every such bank class receives C₇₂ exactly once. + +**5. Price.** #398's profile formula: 72 × (validated paid local events) + 1,920 idle children at each of 16, 8, 32, 8, 48, 8, 48, 32, 16 + 9·(781 − 24) paddings. m = 73, live 14,709, deficit 2,496, max child 48, halving degree 2 (73² > 2·48²). From our emission of #398's word this reproduces #398's 24-digit b and κ exactly. Ours: b = 1003667444352030197427/10²⁴, κ = 1002661106042177/10¹⁸ (six bootstrap levels, 47 strict constraints, complex-bound; our #382 c and #398's bit c give the same κ). + +## Re-opened arguments + +- **#398's bracket** (#352's frozen K + cleanup) is replaced by #390's dirty-preconditioned bracket (§0, §1). It is checked here on every live column in both orientations, with common exact labels and private erasure. #398's Gaussian-phase, global-template and finite-invoice audits were run for its own scalar schedule and are not re-run for ours. The scalar work changes (precancellation instead of K, repair instead of cleanup), so the invoice must be re-counted. #390's invoice for the same bracket on R783 stayed below its row reserve. + +- **#352's emitter/validator chronology** (old_response, cleanup after adF of every non-y gate) is not used. It is replaced by #390's bracket (§1), which #390 already introduced. Our extra rule is §3. +- **#377's padding as an end-of-schedule paid rank-1 cover sweep**, for 96 banks per stage. It is replaced by §4. That argument relies on the arbitrary-dirt invocation property (#377/#352, retained) and on the general compiler admitting a C child whose coordinate set mixes local coordinates with an exterior window coordinate. The latter is the same kind of child the compiler emits, up to a coordinate permutation, but #377's window-lift lemma is stated for transitions that cancel the exterior factor. For stage 8, where E₈ already contains coordinate 72, the canonical label T_U ⊗ C_{E_s} is not the right bookkeeping. The argument above is at the operator level and does not use labels. + +## Re-proved by our checks + +- the word's labels, nesting and exact scalar replay (`gx.check1`, gxcore); +- x/y operator rows and retained totals; +- sink zero rows; +- #398's word: gx/gxcore, its x → (x, y) operator equal to #378's, and the all-helpers-touched property of #352's bracket; +- #390's bracket (regression on #390's word), and the bracket on #398's word and on ours, in both orientations on all 1,021 columns, with lifetimes and common labels; +- the fused-sink rule; +- bank distinctness and coordinate-72 fixing; +- the profile from events, b, c and κ. + +## Not re-run (inherited obligations) + +- #398's R781 reconstruction (#376), its Clifford edge and Gaussian-phase audits, global template and finite invoice (row coefficient 15,445 < 20,161), for its own bracket. #392's six-level bootstrap argument. Our word adds 9 scalar gates per invocation; our bracket uses 1,658/1,551/7,776 precancellation/pre-helper/post-repair gates (1,658/1,542/7,800 for #398's word itself). No new local edge is used. +- #377/#352's retained interfaces: window lift, arbitrary-dirt banks, X_δ(g), injective routes, halving, rows, precision. +- #382's bit-side admissions. diff --git a/research/e8-clean-r781/README.md b/research/e8-clean-r781/README.md new file mode 100644 index 0000000000..9e98d67958 --- /dev/null +++ b/research/e8-clean-r781/README.md @@ -0,0 +1,77 @@ +κ = 1.002661106042177e-3 + +# Bank padding fused into clean-sink helper climbs, on #398's signed target-prefix R781 E8 complex program + +A conditional finite construction with **κ = 1002661106042177/10¹⁸ ≈ 1.002661106042177 × 10⁻³**. +That is +1.66446412313·10⁻⁷ (+0.0166 %) over Dugongue's #398 (125311832453733/1.25·10¹⁷ ≈ 1.002494659629864e-3). + +The complex side binds. Its coarse saving rises from #398's b = 31359395740192012461/3.125·10²² ≈ 1.003500664e-3 to **b = 1003667444352030197427/10²⁴ ≈ 1.003667444e-3** (+1.66781·10⁻⁷). +The bit side is our #382 word, unchanged, with c ≈ 1.006907e-3 > b. #398's bit c gives the same κ. + +## What this composes + +- **#398 (Dugongue)** applies 25 signed disjoint target-prefix pairs to #376's R781 word (781 helpers, T = 8 replicas, one rank-1 padding per whole bank). +- **Our #394** fuses a bank's rank-1 padding C₇₂ into the final climb of a free zero-row sink helper in that bank (rank 2 + rank 1 → rank 3). See `PROOF.md`. + +**Fusion does not apply under #398's own bracket.** #398 keeps #352's frozen old response K followed by the full cleanup of the non-y word at FULL. `clean.py` checks that every one of the 781 helpers is the target or source of some non-y gate. Each helper is therefore touched by the cleanup after its final climb, which a fused padding forbids. + +**It applies once the bracket is #390's.** We compile #398's word with #390's dirty-preconditioned bracket instead: target precancellation y −= B·A⁻¹·h, helper prewhitening, and FULL repair of N_r·x for non-sink helpers only. #390 introduced this bracket. Our re-implementation reproduces #390's `prewhite.json` on #390's own word. + +On #398's word the new bracket costs nothing: +- the emitted paid local histogram equals the word's histogram; +- #398's own b and κ are reproduced exactly from our emission. + +The free-sink search over all 773 lifting helpers of #398's word finds exactly **301, 324 and 387** (final lift rank 2, frames 731/744/759, cuts 1974/2005/2040). For 301: + + h276 += h1019/2; h301 −= h276/2; h276 −= h1019/2 + +Under #398's bank rule, bank and slot are divmod(rep·781 + r, 8). The 24 fused occurrences per stage fall in 24 distinct banks, and every slot route fixes coordinate 72. Paddings per stage drop from 781 to 757: + + profile delta vs #398 = {1: −216, 2: −216, 3: +216} (live 14,709, deficit 2,496, max child 48 unchanged) + +## Verify + + bash research/e8-clean-r781/verify.sh --quick /tmp/e8c3-q # ~1 min + bash research/e8-clean-r781/verify.sh /tmp/e8c3-full # adds the free-sink regeneration (~3 min) + +This needs Python 3.11+ and the standard library only. No C++ or Boost is needed. The script: + +1. Checks `MANIFEST.sha256` and the git-blob pins of all inputs: #398's `signed25.json.gz` and `VALIDATION.json`; #390's prefix18, sink-audit and prewhite; #378's word; Sussman's gx; and #382's bit word. +2. Bracket regression: on #390's own word, our compiler reproduces `prewhite.json` gate for gate. +3. Words: + - `gx.check1` (E0–E7, exact scalar) and the gxcore mirror pass on #398's word and on ours. + - #398's x → (x, y) operator equals #378's. + - The all-helpers-touched check confirms that #398's own bracket excludes fusion. + - Ours keeps the paid histogram, x/y operator rows and retained totals of #398's word, and the three sink rows are exactly zero. + - Full mode only: the free-sink search regenerates exactly our gates. +4. Local program: #398's word and ours are replayed in both orientations on all 1,021 live columns. Five mutation controls are rejected. +5. Banks: distinct fused banks, and coordinate 72 is fixed. +6. Price, with #398 as the control. #398's 24-digit coarse root (both PR #315 engines, 10⁻¹⁶ fallback) and its κ are reproduced exactly from our emission. The κ uses the #392/#398 six-level bootstrap with PR #315's outer assembly (47 strict constraints, next grid point rejected). Ours is priced the same way. +7. Runs `cxcheck` (gx, flipped-sign control, source-span rule) on #398's word and on ours. + +## Admitted conditions + +- **Re-opened, with the argument in PROOF.md:** + - #398's literal K/cleanup bracket is replaced by #390's bracket. This is checked here on all columns in both orientations, but #398's Clifford/phase and finite-invoice audits were run for its own bracket; + - #377's padding as a separate sweep, for the 24 fused banks per stage. +- **Inherited and not re-run:** + - #398's R781 reconstruction (#376's helper substitutions), its Clifford edge and phase audits, global template and finite invoice (row coefficient 15,445 < 20,161). We add 9 scalar helper gates per invocation; the bracket uses 1,551/7,776 pre-helper/post-repair gates; + - #392's bootstrap argument; + - #377's and #352's interfaces; + - #382's bit claims. + +This is a conditional finite construction, not a formal verification of the multiplication theorem. + +## Credits + +- **Dugongue:** #398 (the signed target-prefix construction on R781 and its bank/invoice composition) and #390 (the target-prefix mechanism and the dirty-preconditioned bracket used here). +- **applecrusher (#376):** the R781 helper substitutions and frame repairs. +- **rohanarun:** #392/#387 (six-level bootstrap pricing) and #395 (signed prefixes). +- **jacklightChen (#377):** the nine-stage compressed component, banks and padding. +- **#352:** the local invocation, Clifford compiler and original emitter. +- **Jacob Sussman:** the E8 unit, `gx`/`gxcore`. +- **DaysSky** (#363, #373, #375, #381) and **utcorvusvolat-dotcom** (#370): the bit-side lineage. +- **DreamingOfClouds (PR #315):** the engines and outer assembly. +- **Ours:** #378 (far retiming, the base of R781), #382 (bit word), #394 (padding fusion and free-sink search), and here the bracket transfer to #398's word and the checks. + +Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. Apache-2.0 (`LICENSE`). diff --git a/research/e8-clean-r781/code/bootstrap.py b/research/e8-clean-r781/code/bootstrap.py new file mode 100644 index 0000000000..1bc17e7682 --- /dev/null +++ b/research/e8-clean-r781/code/bootstrap.py @@ -0,0 +1,44 @@ +"""Own reimplementation of PR #392's (rohanarun) exact pricing tail, as used by PR #395: + certify24: complex coarse root to 24 decimals by both PR #315 engines with the 10^-16 fallback; + refine: six fixed ordinary-bootstrap levels (beta = eta = 10^-18, saving backoff 10^-24), PR #315 outer assembly, + 47 strict constraints, next grid point and invalid parameters rejected. +Standard library only; engines are the unchanged PR #315 files (same git blobs as #392's).""" +from fractions import Fraction as Q +from e8core import moment, other, outer + +def certify24(H, m, W): + H = {int(k): v for k, v in H.items()} + root = moment.certify(H, m, W, True); lo = Q(root['lower']); hi = Q(root['upper']); assert hi - lo == Q(1, 10**24) + assert moment.moment(H, m, W, lo, True)[1] < 1 < moment.moment(H, m, W, hi, True)[0] + fb = 32 * m * m * sum(H.values()); dens = Q(1, 10**16) + _, up = other.moment(m, W, list(H.items()), lo); _, bad = other.moment(m, W, [(1, fb)], lo) + low, _ = other.moment(m, W, list(H.items()), hi); badl, _ = other.moment(m, W, [(1, fb)], hi) + assert up + dens * bad < 1 < low + dens * badl + return lo, hi + +BRIDGE = dict(proof='PROOF.md', representation='Unchanged PR390 inherited finite envelope; fixed-depth PR185 ordinary wrappers restore internal rows', + semantic=dict(G=dict(base=2, exponent=30000), E=dict(base=2, exponent=100000), B_upper=dict(base=2, exponent=100001), + C0=dict(base=2, exponent=210000), C1=1, strict_literal_gap=1, induction_gap_lower=1), + rows=dict(coefficient=20161, degree=10**6, suffix_slope=4 * 10**6, degree_gap=Q(10**6) - Q(51 * 20161, 25))) + +def refine(b, c, depth=6): + grid = Q(1, 10**18); eta = beta = Q(1, 10**18); backoff = Q(1, 10**24) + s = (1 - beta) * b - backoff + assert Q(0) < s < min(c, (1 - beta) * b) < b < Q(1, 32) + x0 = Q(384599, 10**10); chain = [x0] + for j in range(depth): + old = chain[-1]; a = (1 - s) * s + s * old + assert old < a < s < 1 - a and a == s - s**(j + 1) * (s - x0) + assert min(s - a, 1 - a - s, 1 - a - s * (1 - old), 1 - s) > 0 + chain.append(a) + a = chain[-1]; q = a * (1 - 2 * eta); mn = (1 - eta) * q / (1 + q); t = mn / grid; k = grid * ((t.numerator - 1) // t.denominator) + asm = outer.assembly(a, b, BRIDGE, k, eta=eta, beta=beta) + assert len(asm['strict_constraints']) == 47 and all(x > 0 for x in asm['strict_constraints'].values()) and asm['minimum_margin'] == mn + rej = [] + for name, kk, e, be in [('next_grid', k + grid, eta, beta), ('zero_eta', k, Q(0), beta), ('zero_beta', k, eta, Q(0)), ('unit_beta', k, eta, Q(1))]: + try: outer.assembly(a, b, BRIDGE, kk, eta=e, beta=be) + except AssertionError: rej.append(name) + else: raise AssertionError('accepted invalid witness ' + name) + assert k < mn < b / (1 + b) < k + grid + a5 = chain[-2]; q5 = a5 * (1 - 2 * eta); assert (1 - eta) * q5 / (1 + q5) < k + return k, rej diff --git a/research/e8-clean-r781/code/clean.py b/research/e8-clean-r781/code/clean.py new file mode 100644 index 0000000000..ae77237870 --- /dev/null +++ b/research/e8-clean-r781/code/clean.py @@ -0,0 +1,169 @@ +"""e8clean3: bank-padding fusion (our #394) on Dugongue's #398 signed target-prefix R781 E8 complex program, with +#398's frozen-K/cleanup bracket (#352's) replaced by #390's dirty-preconditioned bracket (re-implemented in emit.py). +usage: clean.py PKGDIR GXDIR OUT.json [--regen] + A. #398's word (signed25.json.gz, byte-pinned): gx.check1 + gxcore mirror; its x->y operator and retained totals in + x equal #378's far word. Under #398's own bracket every one of the 781 helpers is touched by a non-y gate, hence by + the FULL cleanup after its final climb: fusion is impossible there. Ours = #398's word + three free-sink uncomputes: + gx.check1 + gxcore; paid local histogram unchanged; sink rows zero; x/y operator rows and retained totals == #398's; + (--regen) the free-sink search over all lifting helpers of #398's word finds exactly our gates. + B. our bracket compiler reproduces #390's prewhite.json on #390's own word (regression); on #398's word and ours both + orientations are replayed on all 1021 live columns, private work erased, common exact labels, no event on a fused + sink after its padded climb; mutation controls rejected. + C. #398's whole-bank rule (bank, slot = divmod(rep*R + helper, 8), T = 8): every fused occurrence lies in a distinct + bank, each bank has one rank-1 padding on coordinate 72, and every slot route fixes coordinate 72. + D. profile from the validated paid events (#398's formula). Control: #398's own 24-digit coarse root and kappa are + reproduced from our emission of its word (VALIDATION.json). Ours priced the same way (#392/#398 six-level outer).""" +import sys, os, json, gzip, copy +from collections import Counter +from fractions import Fraction as Q +HERE = os.path.dirname(os.path.abspath(__file__)); sys.path.insert(0, HERE) +PKG, GXD, OUT = sys.argv[1], sys.argv[2], sys.argv[3]; REGEN = '--regen' in sys.argv +sys.path.insert(0, GXD); import gx, gxcore +import emit as EM +from word import insert, origmap, sixths +import sinks as SK +from e8core import coarse, price_word, load_word +from bootstrap import certify24, refine +from layout_bk import layout +ld = lambda p: json.load(gzip.open(p)) if p.endswith('.gz') else json.load(open(p)) +far = ld(PKG + '/data/gcert1-e8-r783-far.json.gz'); base = ld(PKG + '/data/pr398/signed25.json.gz') +VAL = ld(PKG + '/data/pr398/VALIDATION.json'); ours = ld(PKG + '/data/sinks-e8clean3.json') +p18 = ld(PKG + '/data/pr390/prefix18.json.gz'); a390 = ld(PKG + '/data/pr390/sink-audit.json')['accepted']; pw390 = ld(PKG + '/data/pr390/prewhite.json') +FUSED = sorted({s['sink_helper'] for s in ours}); assert FUSED == [301, 324, 387] +OD = os.path.dirname(os.path.abspath(OUT)); H390 = {} + +def hist(c): + H = Counter() + for w in c['blocks'].values(): + for r, n in w.items(): H[int(r)] += n + return H + +def gxok(c, name): + st = {}; gx.check1(copy.deepcopy(c), scalar=True, stats=st) + assert gxcore.mirror(gxcore.normal(copy.deepcopy(c)))['hist'] == dict(hist(c)) + print(' %s: gx.check1 PASS (E0-E7 incl. exact scalar E5), gxcore mirror histogram PASS, gates A/B %d/%d' % (name, len(c['A']), len(c['B']))) + return st + +src = open(HERE + '/cxop.py').read().split('\na, ta = op(')[0]; ns = {}; exec(compile(src, 'cxop.py', 'exec'), ns) +print('== B0. bracket regression on #390\'s own word (R = 783)') +EM.setR(783) +w390 = insert(p18, a390); pw = EM.prewhite(w390, {a['sink_helper'] for a in a390}) +for mine, key in zip(pw, ['pre_target_dirty_cancellation_gates', 'pre_helper_inverse_gates', 'post_full_helper_clean_repair_gates']): + assert [(t, s, q) for t, s, q in mine] == [(t, s, Q(a, b)) for t, s, a, b in pw390[key]], key +print(' our bracket compiler reproduces #390 prewhite.json exactly (%d/%d/%d gates)' % tuple(map(len, pw))) + +print('== A. words') +R = base['R']; assert (R, base['v'], base['h']) == (781, 120, 9); EM.setR(R); V, N = EM.V, EM.N +gxok(base, '#398 word (R781 + 25 signed target-prefix pairs)') +oa, ta = ns['op'](far); ob, tb = ns['op'](base) +xo = lambda row: {k: q for k, q in row.items() if k < V} +assert all(xo(oa[r]) == xo(ob[r]) for r in range(2 * V)) and {k: xo(t) for k, t in ta.items()} == {k: xo(t) for k, t in tb.items()} +print(' x -> (x, y) operator and retained totals in x of #398\'s word == #378 far word (same product)') +touched = set() +for g in base['A'] + base['B']: + for r, a, b in g[3]: + t, s = (r, g[2]) if g[0] == 'out' else (g[2], r) + if not (V <= t < 2 * V): touched |= {z for z in (t, s) if z >= 2 * V} +assert touched == set(range(2 * V, N)) +print(' under #398\'s own frozen-K/cleanup bracket all %d helpers are touched by a non-y gate (FULL cleanup after the final climb): no fusion there' % R) +wour = insert(base, ours); st = gxok(wour, 'ours') +wour_out = dict(wour, derived_from=wour['derived_from'] + ' | e8clean3 free sinks 301/324/387 (chafreaky)') +json.dump(wour_out, gzip.open(os.path.join(OD, 'gcert1-e8clean3.json.gz'), 'wt')) +d = hist(wour); d.subtract(hist(base)); assert not any(d.values()); print(' paid local histogram of ours == #398 word (our uncomputes need no climb)') +an = SK.analyse(wour); val = an[7]; fin = an[5] +for r in FUSED: assert not val[r], r +print(' clean x-rows of helpers 301, 324, 387 are exactly zero; final lifts:', [fin[r] for r in FUSED]) +oc, tc = ns['op'](wour) +assert tb == tc and all(ob[r] == oc[r] for r in range(2 * V)); print(' x and y rows of the full rational operator (all 1021 inputs variable) and retained totals == #398 word') +if REGEN: + cur = base; found = []; an0 = SK.analyse(cur) + cands = [r for r in range(2 * V, N) if an0[5][r] > 0] + for r in cands: + gs = SK.find(cur, r, exclude={s['sink_helper'] for s in found}, an=SK.analyse(cur) if found else an0) + if not gs: continue + om = origmap(base, found) + for g in gs: g['cut_group'] = om[g['cut_group']] + trial = insert(base, found + gs); at = SK.analyse(trial) + dd = hist(trial); dd.subtract(hist(base)) + if all(not at[7][s['sink_helper']] for s in found + gs) and not any(dd.values()): + found += sixths(gs); cur = insert(base, found) + assert found == ours, found + print(' regeneration: free-sink search over all %d lifting helpers of #398\'s word finds exactly our three uncomputes' % len(cands)) + +print('== B. local program (both orientations)') +pwb = EM.prewhite(base, set()) +for ori in ['forward', 'backward']: + r = EM.validate(list(EM.emit(base, ori, {}, set(), pwb)), base, ori, {}, set()) + print(' #398 word, %s: PASS all %d live columns, private work erased, common exact labels, %d events' % (ori, N, r['events'])) +pb = r['paid_hist']; assert {int(k): n for k, n in pb.items()} == dict(hist(base)) +pw = EM.prewhite(wour, set(FUSED)); paid = {}; res = {} +for ori in ['forward', 'backward']: + ev = list(EM.emit(wour, ori, H390, set(FUSED), pw)); r = EM.validate(ev, wour, ori, H390, set(FUSED)); paid[ori] = r['paid_hist']; res[ori] = r + print(' %s: PASS all %d live columns, private work erased, common exact labels, %d events, fused padded climbs %s' % (ori, N, r['events'], [e[1:] for e in ev if e[0] == 'climb_pad72'])) + def reject(name, mut): + x = list(ev); mut(x) + try: EM.validate(x, wour, ori, H390, set(FUSED)) + except (AssertionError, KeyError) as e: return name + raise SystemExit('control accepted: ' + name) + ctr = [] + i = next(i for i, e in enumerate(ev) if e[0] == 'scalar' and e[1] == 'cleanup') + def m1(x): # cleanup touching a fused sink after its padded climb + e = x[i]; op = e[2]; x[i] = (e[0], e[1], (op[0], ('L', FUSED[0]) if ori == 'forward' else op[1], op[2] if ori == 'forward' else ('L', FUSED[0]), op[3]), e[3]) + ctr.append(reject('cleanup_on_fused_sink', m1)) + def m2(x): # padded climb moved before the sink's last main use + j = next(j for j, e in enumerate(x) if e[0] == 'climb_pad72'); e = x.pop(j) + k = max(j for j, y in enumerate(x) if y[0] == 'scalar' and y[1] == 'main' and ('L', e[1]) in y[2][1:3]); x.insert(k, e) + ctr.append(reject('padded_climb_before_last_use', m2)) + def m3(x): # drop one of our uncompute adds + j = next(j for j, e in enumerate(x) if e[0] == 'scalar' and e[1] == 'main' and e[2][0] == 'add' and e[2][1 if ori == 'forward' else 2] == ('L', 301) and e[2][2 if ori == 'forward' else 1] == ('L', 276)); x.pop(j) + ctr.append(reject('drop_uncompute_add', m3)) + def m4(x): # flip the sign of one target precancellation + j = next(j for j, e in enumerate(x) if e[0] == 'scalar' and e[1] == 'old_response'); e = x[j]; op = e[2]; x[j] = (e[0], e[1], op[:3] + (-op[3],), e[3]) + ctr.append(reject('flip_precancellation', m4)) + def m5(x): # padded climb priced without the padding coordinate + j = next(j for j, e in enumerate(x) if e[0] == 'climb_pad72'); e = x[j]; x[j] = e[:5] + (e[4],) + ctr.append(reject('padding_not_paid', m5)) + print(' controls rejected:', ctr) +assert paid['forward'] == paid['backward'] and res['forward']['edges'] == res['backward']['edges'] + +print('== C. banks (#398 whole-bank rule, T = 8)') +T, L, m = 8, 9, 73; live = 7680 + 9 * R +def perm(slot): # #398 bank_perm: swap local coordinates 0..8 with block slot*9..slot*9+8 + p = list(range(m)) + if slot: + for i in range(9): p[i], p[slot * 9 + i] = p[slot * 9 + i], p[i] + return p +assign = {(rep, h): divmod(rep * R + h, 8) for rep in range(T) for h in range(R)} +assert sorted(Counter(b for b, _ in assign.values()).values()) == [8] * R +fb = [assign[(rep, h - 2 * V)][0] for rep in range(T) for h in FUSED] # #398 owners index helpers r = register - 2v +assert len(set(fb)) == len(fb) == T * len(FUSED) +assert all(perm(s)[72] == 72 for s in range(8)) +print(' %d fused occurrences per stage in %d distinct banks (one rank-1 padding on coordinate 72 each); every slot route fixes coordinate 72; paddings per stage %d -> %d' % (len(fb), len(set(fb)), R, R - len(fb))) + +print('== D. price') +def profile(ph, nfused): + H = Counter({int(r): 72 * n for r, n in ph.items()}) + for r in [16, 8, 32, 8, 48, 8, 48, 32, 16]: H[r] += 1920 + H[1] += L * R - L * T * nfused; return H +H0 = profile(pb, 0); H = profile(paid['forward'], len(FUSED)) +for X in (H0, H): assert (m * live - sum(r * n for r, n in X.items()), max(X)) == (2496, 48) and m ** 2 > 2 * 48 ** 2 +b0, u0 = certify24(H0, m, live); assert str(b0) == VAL['complex_coarse'], b0 +c398 = Q(VAL['bit_coarse']); k0, rej0 = refine(b0, c398); assert str(k0) == VAL['kappa'] == '125311832453733/125000000000000000' +print(' control: #398 b = %s (24 digits, both engines) and kappa = %s = %.18f reproduced from our emission of its word (rejected %s)' % (b0, k0, float(k0), rej0)) +b, u = certify24(H, m, live); mass = sum(r * n for r, n in H.items()) +print(' b = %s = %.15e (+%.6e over #398)' % (b, float(b), float(b - b0))) +def bit_c(word, K=3): + p = price_word(word); h, v = 8, 120; s = 2 * K + 1; mm = s * h; resid = p['resid'] + T8 = 1 if resid % h == 0 else h; lay = layout(K, h) + Hb = Counter({r: T8 * s * c for r, c in p['H'].items()}) + for r in lay['blocks']: Hb[r] += T8 * 2 * v + W8 = (2 * K * v * h + resid) * T8 // h + assert mm * W8 - sum(r * c for r, c in Hb.items()) == T8 * (2 * K * v - s * 72) + return coarse(Hb, mm, W8) +c = bit_c(load_word(PKG + '/data/bit/bitE8-kernel.json.gz')); assert c == Q(251726760077483, 25 * 10**16) +print(' bit c (our #382 word, B3 unsplit) = %s = %.15e (> b: complex-bound)' % (c, float(c))) +k, rej = refine(b, c); kb, _ = refine(b, c398); assert k == kb and k > k0 and c > b +print(' kappa = %s = %.18f (complex-bound; same with #398\'s bit c), +%.6e over #398; rejected %s' % (k, float(k), float(k - k0), rej)) +json.dump(dict(b=str(b), b_upper=str(u), b_float=float(b), b_398=str(b0), c=str(c), kappa=str(k), kappa_float=float(k), binding='complex', kappa_398=str(k0), + profile={str(r): n for r, n in sorted(H.items())}, live=live, m=m, deficit=m * live - mass, local_paid=paid['forward'], + fused_sinks=FUSED, gx_stats=st), open(OUT, 'w'), indent=1) diff --git a/research/e8-clean-r781/code/cxcheck.py b/research/e8-clean-r781/code/cxcheck.py new file mode 100644 index 0000000000..4973f511e5 --- /dev/null +++ b/research/e8-clean-r781/code/cxcheck.py @@ -0,0 +1,23 @@ +"""Complex certificate checks: Jacob Sussman's gx.check1 (E0-E7: sizes, labels/nesting, equal frames at gates, scatter +cut, gate shapes, bracket rule, exact scalar x-content replay E5, price data E6, exterior gauges E7) and his gxcore +mirror histogram, a flipped-sign control (must fail E5), and the source-span rule (our check: the x-content support of +every non-y operand, and of a slot destination after the gate, lies in the gate frame). +usage: cxcheck.py CERT.json.gz GXDIR""" +import sys, os, gzip, json, copy +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxretime import CX +c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx, gxcore +st = {}; gx.check1(c, scalar=True, stats=st) +Hinv = Counter() +for w in c['blocks'].values(): + for r, n in w.items(): Hinv[int(r)] += n +assert gxcore.mirror(gxcore.normal(copy.deepcopy(c)))['hist'] == dict(Hinv), 'gxcore histogram' +c2 = copy.deepcopy(c) +for g in c2['A']: + if g[0] in ('out', 'in') and g[3]: t, a, b = g[3][0]; g[3][0] = [t, -a, b]; break +try: gx.check1(c2, scalar=True); raise SystemExit('flipped sign accepted') +except AssertionError as e: assert str(e).startswith('E5'), str(e) +sv = CX(c).span_ok(); assert sv == 0, sv +print(' %s: gx.check1 PASS (E0-E7, exact scalar), gxcore mirror PASS, flipped sign rejected (E5), source-span violations 0 | h %d v %d R %d cst %d N %d, gates A/B %d/%d, frames %d' + % (os.path.basename(sys.argv[1]), c['h'], c['v'], c['R'], c['cst'], c['N'], len(c['A']), len(c['B']), len(c['frames']))) diff --git a/research/e8-clean-r781/code/cxkernel.py b/research/e8-clean-r781/code/cxkernel.py new file mode 100644 index 0000000000..32b26a1755 --- /dev/null +++ b/research/e8-clean-r781/code/cxkernel.py @@ -0,0 +1,222 @@ +"""Shared-donor response kernel on a gcert/1 complex program (Sussman's format), via exterior gauges (rule E7/Q2). +Entry: pivot slot p, entrance E (a frame inside p's first frame and inside every donor's first frame), donors d with +rational coefficients c_d such that resp(p) + sum c_d resp(d) = 0, where resp(s) in Q^v = the column of slot s's +initial value in the y rows of the product (A, scatter, B). Transform: p starts at E (ext gauge [p, E]); at the start +of A each donor climbs to E and takes d += c_d p ('in' gate at E). Then Q2 holds for p. +Price (entrance-residual rule, as the bit side's #320/#329 lineage): W = 2Kv + sum_slots (h - dim ext)/h, deficit fixed. +usage: cxkernel.py CERT.json.gz GXDIR OUT.json.gz [K]""" +import sys, os, gzip, json, math, copy +from fractions import Fraction as Fr +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from e8core import coarse +from layout_bk import layout + + +def reduce(u, basis): + for b in basis: + if u >> (b.bit_length() - 1) & 1: u ^= b + return u +def inside(a, b): return all(reduce(u, b) == 0 for u in a) +def echelon(vecs): + """reduced echelon (descending pivots) of the F2 span of vecs""" + B = [] + for u in vecs: + u = reduce(u, B) + if u: + B = [b ^ u if b >> (u.bit_length() - 1) & 1 else b for b in B] + [u] + B.sort(reverse=True) + return B + + +def responses(c): + v, R = c['v'], c['R']; n = 2 * v + R + reg = [dict() for _ in range(n)] + for r in range(2 * v, n): reg[r] = {r: Fr(1)} + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: d[k] = w + else: d.pop(k, None) + def run(gates): + for g in gates: + if g[0] == 'neg': reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == 'out': + src = dict(reg[g[2]]) + for t, a, b in g[3]: axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: axpy(g[2], reg[s], Fr(a, b)) + run(c['A']) + tot = {k: dict(reg[s]) for k, s, _ in c['ret']} + for t in range(v): + for k, a, b in c['scat']['table'][t]: axpy(v + t, tot[k], Fr(a, b)) + run(c['B']) + resp = {s: {} for s in range(2 * v, n)} + for t in range(v): + for s, co in reg[v + t].items(): resp[s][t] = co + return resp + + +def first_frames(c): + v, R = c['v'], c['R']; n = 2 * v + R; first = {} + for ph in ('A', 'B'): + for g in c[ph]: + regs = [g[2]] + ([t for t, _, _ in g[3]] + list(g[4]) if g[0] == 'out' else [s for s, _, _ in g[3]] if g[0] == 'in' else []) + for r in regs: + if r >= 2 * v and r not in first and g[1] != 0: first[r] = g[1] + return first + + +class QBasis: + """incremental rational basis over Q^v with combination tracking (donor slots)""" + def __init__(self): self.rows = [] # (pivot, vec dict, combo dict) + def reduce(self, x): + x = dict(x); cm = {} + for p, vec, co in self.rows: + if p in x: + f = x[p] / vec[p] + for k, u in vec.items(): + w = x.get(k, 0) - f * u + if w: x[k] = w + else: x.pop(k, None) + for k, u in co.items(): + w = cm.get(k, 0) - f * u + if w: cm[k] = w + else: cm.pop(k, None) + return x, cm + def add(self, x, slot): + r, cm = self.reduce(x) + cm = {k: u for k, u in cm.items()}; cm[slot] = cm.get(slot, 0) + 1 + p = min(r); self.rows.append((p, r, cm)) + + +def select(c, a, K=3): + h, v, R = c['h'], c['v'], c['R']; m = (2 * K + 1) * h + fr = [tuple(f) for f in c['frames']]; dim = [len(f) for f in fr] + chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + resp = responses(c); first = first_frames(c) + ret = {s for _, s, _ in c['ret']} + H = [s for s in range(2 * v, 2 * v + R) if s not in ret and s in first and c['start'][s] == 0] + # candidate entrances: frames of the table inside some first frame, plus pairwise intersections not in table skipped + fset = sorted(set(first[s] for s in H)) + cand = [E for E in range(2, len(fr)) if dim[E] > 0 and dim[E] < h and any(inside(fr[E], fr[f]) for f in fset)] + ins = {} + def isin(E, f): + k = (E, f) + if k not in ins: ins[k] = inside(fr[E], fr[f]) + return ins[k] + groups = {E: [s for s in H if isin(E, first[s])] for E in cand} + avail_p = set(H); avail_d = set(H); donor_at = {} + def plan(E): + e = dim[E]; G = groups[E]; mem = [] + for s in G: + d1 = dim[first[s]] + dc = (0.0 if donor_at.get(s) == E else (chi(e) + chi(d1 - e) - chi(d1)) if s in avail_d else None) + if s in donor_at and donor_at[s] != E: dc = None + pg = chi(d1) - chi(d1 - e) if s in avail_p else None + if dc is None and pg is None: continue + mem.append((s, dc, pg)) + mem.sort(key=lambda t: (t[1] if t[1] is not None else 1e9, t[2] if t[2] is not None else -1)) + B = QBasis(); slots = {}; piv = [] + for s, dc, pg in mem: + r, cm = B.reduce(resp[s]) + if not r and pg is not None and pg > 0: piv.append((s, cm, pg)) + elif r and dc is not None: B.add(resp[s], s); slots[s] = dc + if not piv: return None + keep = list(piv) + def users(): + u = Counter() + for _, cm, _ in keep: + for k in cm: u[k] += 1 + return u + while keep: + u = users(); best = None + for i, (s, cm, pg) in enumerate(keep): + freed = sum(slots[k] for k in cm if u[k] == 1) + if freed > pg and (best is None or freed - pg > best[0]): best = (freed - pg, i) + if best is None: break + keep.pop(best[1]) + u = users(); gain = sum(pg for _, _, pg in keep) - sum(slots[k] for k in u) + if gain <= 1e-15: return None + # coefficients: resp(p) = sum cm_k resp(k) -> donor gate d += (-cm_d) p + return gain, [(s, {k: -x for k, x in cm.items()}) for s, cm, _ in keep] + plans = {E: plan(E) for E in cand} + chosen = []; total = 0.0 + while True: + live = [(p[0], E) for E, p in plans.items() if p] + if not live: break + g, E = max(live); _, ents = plans[E] + touched = set() + for p, cm in ents: + chosen.append((E, p, cm)); avail_p.discard(p); avail_d.discard(p); touched.add(p) + for d in cm: donor_at[d] = E; avail_p.discard(d); avail_d.discard(d); touched.add(d) + total += g + for E2 in cand: + if plans.get(E2) and any(s in touched for s in groups[E2]): plans[E2] = plan(E2) + plans[E] = plan(E) + return chosen, total + + +def apply(c, chosen): + c = copy.deepcopy(c); head = [] + ext = [] + for E, p, cm in chosen: + ext.append([p, E]); c['start'][p] = E + byd = {} + for E, p, cm in chosen: + for d, co in cm.items(): byd.setdefault((d, E), []).append([p, co.numerator, co.denominator]) + for (d, E), lst in sorted(byd.items()): head.append(['in', E, d, sorted(lst)]) + c['A'] = head + c['A']; c['ext'] = sorted(ext) + return c + + +def rehist(c): + """recompute block histograms and N exactly as gx.check1 counts them (climbs per class, COPY ranks)""" + v, R = c['v'], c['R']; n = 2 * v + R; dim = [len(f) for f in c['frames']] + cls = lambda r: 'x' if r < v else 'y' if r < 2 * v else 's' + cur = list(c['start']); H = {'x': Counter(), 'y': Counter(), 's': Counter(), 'c': Counter()} + def climb(r, f): + if cur[r] != f: H[cls(r)][dim[f] - dim[cur[r]]] += 1; cur[r] = f + for ph in ('A', 'B'): + if ph == 'B': + for k, s_, f in c['ret']: H['c'][dim[f]] += 1 + for g in c[ph]: + regs = [g[2]] + ([t for t, _, _ in g[3]] + list(g[4]) if g[0] == 'out' else [x for x, _, _ in g[3]] if g[0] == 'in' else []) + for r in regs: climb(r, g[1]) + for r in range(n): climb(r, c['final'][r]) + c['blocks'] = {k: {str(r): x for r, x in sorted(w.items())} for k, w in H.items()} + c['N'] = sum(r * x for w in H.values() for r, x in w.items()) + return c + + +def price(c, K): + """returns b in B_K with the entrance-residual W""" + h, v, R, cst = c['h'], c['v'], c['R'], c['cst'] + Hinv = Counter() + for w in c['blocks'].values(): + for r, n in w.items(): Hinv[int(r)] += n + s = 2 * K + 1; m = s * h; lay = layout(K, h, split=(m - 1) // 2 if K > 2 else None) + tails = sum(len(c['frames'][f]) for _, f in c['ext']) + T = 1 if tails % h == 0 else h + H = Counter({r: T * s * n for r, n in Hinv.items()}) + for r in lay['blocks']: H[r] += T * 2 * v + W = (2 * K * v + R) * T - tails * T // h; assert tails * T % h == 0 + assert m * W - sum(r * n for r, n in H.items()) == T * (2 * K * v - s * cst), 'deficit' + assert 2 * max(H) < m + return coarse(H, m, W) + + +if __name__ == '__main__': + c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx, gxcore + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3 + b0 = price(c, K); print('start b(B_%d) =' % K, b0, float(b0)) + chosen, tot = select(c, float(b0), K) + fr = c['frames'] + print('entries', len(chosen), 'chi %.5f' % tot, 'ranks', Counter(len(fr[E]) for E, _, _ in chosen), + 'donors', len({d for _, _, cm in chosen for d in cm})) + w = rehist(apply(c, chosen)); w['derived_from'] = c['derived_from'] + ' + shared-donor kernel via exterior gauges' + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 (E0-E7 incl. exact scalar E5 and Q2) PASS', st) + for K2 in (2, 3, 4): + b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-clean-r781/code/cxop.py b/research/e8-clean-r781/code/cxop.py new file mode 100644 index 0000000000..772d6698da --- /dev/null +++ b/research/e8-clean-r781/code/cxop.py @@ -0,0 +1,32 @@ +"""Full rational operator of a gcert/1 program (A, scatter, B) on all registers, every initial value a variable; +compare two programs. usage: cxop.py CERT1 CERT2 [GXDIR]""" +import sys, gzip, json +from fractions import Fraction as Fr +def load(p): + x = json.load(gzip.open(p)); return x['cert'] if 'cert' in x else x +def op(c): + v, R = c['v'], c['R']; n = 2 * v + R + reg = [{r: Fr(1)} for r in range(n)] + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: d[k] = w + else: d.pop(k, None) + def run(G): + for g in G: + if g[0] == 'neg': reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == 'out': + src = dict(reg[g[2]]) + for t, a, b in g[3]: axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: axpy(g[2], reg[s], Fr(a, b)) + run(c['A']); tot = {k: dict(reg[s]) for k, s, _ in c['ret']} + for t in range(v): + for k, a, b in c['scat']['table'][t]: axpy(v + t, tot[k], Fr(a, b)) + run(c['B']); return reg, tot +a, ta = op(load(sys.argv[1])); b, tb = op(load(sys.argv[2])) +assert ta == tb, 'retained totals differ' +diff = [r for r in range(len(a)) if a[r] != b[r]] +print('full rational operator on all %d registers (every initial value a variable) and the retained totals: %s' % (len(a), 'IDENTICAL' if not diff else 'DIFFER at %d registers' % len(diff))) +assert not diff diff --git a/research/e8-clean-r781/code/cxretime.py b/research/e8-clean-r781/code/cxretime.py new file mode 100644 index 0000000000..06f79f8280 --- /dev/null +++ b/research/e8-clean-r781/code/cxretime.py @@ -0,0 +1,169 @@ +"""Retiming / descent on a gcert/1 complex program: move gate frames inside +[span(LB_g + prev frames of participants), AND of next frames] with the source-span rule (the x-content support of every +non-y operand, and of a slot destination after the gate, lies in the gate frame). Pins: start, scatter (y at 0, retained +slots at their ret frame), final. Greedy best-improvement with the chi ledger at m = (2K+1)h. +usage: cxretime.py CERT.json.gz GXDIR OUT.json.gz [K] [sweeps]""" +import sys, os, gzip, json, math, random, copy +from fractions import Fraction as Fr +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxkernel import reduce, inside, echelon, rehist, price + + +def regs_of(g): + if g[0] == 'neg': return [g[2]] + if g[0] == 'out': return [g[2]] + [t for t, _, _ in g[3]] + list(g[4]) + return [g[2]] + [s for s, _, _ in g[3]] + + +class CX: + def __init__(self, c): + self.c = c; v = c['v']; self.v = v; n = 2 * v + c['R']; self.n = n + self.fr = [tuple(f) for f in c['frames']]; self.key = {f: i for i, f in enumerate(self.fr)} + self.gates = [['A', g] for g in c['A']] + [['B', g] for g in c['B']] + self.gf = [g[1] for _, g in self.gates] + nA = len(c['A']) + occ = [[('p', c['start'][r])] for r in range(n)] + retf = {s: f for _, s, f in c['ret']} + for gi, (ph, g) in enumerate(self.gates): + if gi == nA: + for t in range(v): occ[v + t].append(('p', 0)) + for s, f in retf.items(): occ[s].append(('p', f)) + for r in regs_of(g): occ[r].append(('g', gi)) + for r in range(n): occ[r].append(('p', c['final'][r])) + self.occ = occ; self.where = [dict() for _ in self.gates] + for r in range(n): + for i, (k, x) in enumerate(occ[r]): + if k == 'g': self.where[x][r] = i + self.lb = self._lb() + + def _lb(self): + c = self.c; v = self.v; ports = c['ports'] + sup = [{r} if r < v else set() for r in range(self.n)] + lb = [] + for ph, g in self.gates: + need = set() + if g[0] == 'out': + for t, _, _ in g[3]: sup[t] |= sup[g[2]] + if g[2] < v or g[2] >= 2 * v: need |= sup[g[2]] + for t, _, _ in g[3]: + if t >= 2 * v: need |= sup[t] + elif g[0] == 'in': + for s, _, _ in g[3]: + sup[g[2]] |= sup[s] + if s < v or s >= 2 * v: need |= sup[s] + if g[2] >= 2 * v: need |= sup[g[2]] + lb.append(tuple(echelon([ports[x] for x in need]))) + return lb + + def fid(self, f): + f = tuple(f) + if f not in self.key: self.key[f] = len(self.fr); self.fr.append(f) + return self.key[f] + + def F(self, r, i): + k, x = self.occ[r][i]; return x if k == 'p' else self.gf[x] + + def span_ok(self): + return sum(1 for gi in range(len(self.gates)) if not inside(self.lb[gi], self.fr[self.gf[gi]])) + + +_sv = {} +def span_vecs(B): + B = tuple(B) + if B not in _sv: + out = {0} + for b in B: out |= {x ^ b for x in out} + _sv[B] = frozenset(out) + return _sv[B] + + +def block_of(M, gi): + f = M.gf[gi]; S = {gi}; stack = [gi] + while stack: + g = stack.pop() + for r, i in M.where[g].items(): + for j in (i - 1, i + 1): + k, x = M.occ[r][j] + if k == 'g' and x not in S and M.gf[x] == f: S.add(x); stack.append(x) + return S + + +def try_move(M, S, chi, d, temp=0.0, rng=None): + """move gate set S (all at one frame) to the best feasible frame; returns gain or None""" + old = M.gf[next(iter(S))]; regs = {} + for g in S: + for r, i in M.where[g].items(): regs.setdefault(r, []).append(i) + parts = [] + for r, ii in regs.items(): + lo_i, hi_i = min(ii), max(ii) + if len(ii) != hi_i - lo_i + 1: return None + parts.append((M.F(r, lo_i - 1), M.F(r, hi_i + 1))) + loE = echelon([u for g in S for u in M.lb[g]] + [u for p, _ in parts for u in M.fr[p]]) + hiV = None + for _, q in parts: + vs = span_vecs(M.fr[q]); hiV = vs if hiV is None else hiV & vs + if not all(u in hiV for u in loE): return None + cands = {M.fid(loE), M.fid(echelon(sorted(hiV)))} | {p for p, _ in parts} | {q for _, q in parts} + for u in sorted(hiV - span_vecs(loE)): cands.add(M.fid(echelon(loE + [u]))) + def ok(F): + return all(inside(M.fr[p], M.fr[F]) and inside(M.fr[F], M.fr[q]) for p, q in parts) and inside(loE, M.fr[F]) + def score(F): return sum(chi(d(F) - d(p)) + chi(d(q) - d(F)) for p, q in parts) + base = score(old); opts = [(score(F), F) for F in cands if F != old and ok(F)] + if not opts: return None + if temp > 0: + sc, F = rng.choice(opts) + if sc < base - 1e-12 or rng.random() < math.exp(-(sc - base) / temp): + for g in S: M.gf[g] = F + return base - sc + return None + sc, F = min(opts) + if sc < base - 1e-12: + for g in S: M.gf[g] = F + return base - sc + return None + + +def subblocks(M, S): + T = sorted(S); out = [S] + for k in range(1, len(T)): out.append(set(T[:k])); out.append(set(T[k:])) + out += [{g} for g in T] if len(T) > 1 else [] + return out + + +def sweep(M, a, m, rng, temp=0.0): + d = lambda f: len(M.fr[f]); chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + moved = 0; gain = 0.0; idx = list(range(len(M.gates))); rng.shuffle(idx); done = set() + for gi in idx: + if gi in done: continue + S = block_of(M, gi); done |= S + subs = subblocks(M, S) if len(S) <= 12 else [S] + if temp > 0: subs = [rng.choice(subs)] + for sub in subs: + g = try_move(M, sub, chi, d, temp, rng) + if g is not None: moved += 1; gain += g; break + return moved, gain + + +def to_cert(M): + c = copy.deepcopy(M.c); c['frames'] = [list(f) for f in M.fr] + A = []; B = [] + for gi, (ph, g) in enumerate(M.gates): + g2 = copy.deepcopy(g); g2[1] = M.gf[gi]; (A if ph == 'A' else B).append(g2) + c['A'] = A; c['B'] = B + return rehist(c) + + +if __name__ == '__main__': + c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3; sw = int(sys.argv[5]) if len(sys.argv) > 5 else 20 + h = c['h']; m = (2 * K + 1) * h + M = CX(c); print('span violations on input', M.span_ok()) + b0 = price(c, K); print('start b', b0, float(b0)); rng = random.Random(1) + for s in range(sw): + mv, g = sweep(M, float(b0), m, rng); print('sweep', s, 'moved', mv, 'chi/a %.4f' % (g / float(b0)), flush=True) + if not mv: break + w = to_cert(M); print('span violations', M.span_ok()) + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 PASS') + for K2 in (2, 3): b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-clean-r781/code/e8core.py b/research/e8-clean-r781/code/e8core.py new file mode 100644 index 0000000000..78983b3687 --- /dev/null +++ b/research/e8-clean-r781/code/e8core.py @@ -0,0 +1,203 @@ +"""Our own engine for bitE8/1 words (E8 root-line labels, h = 8): frame algebra over Q via root-line masks, +legality/F2 replay, five-stage histogram, exact bit coarse saving and PR #315 outer assembly (our engine copies). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +import gzip, json, os, importlib.util +from fractions import Fraction as Q +from collections import Counter + +HERE = os.path.dirname(os.path.abspath(__file__)) +def _load(n): + s = importlib.util.spec_from_file_location('e8_' + n, os.path.join(HERE, "engines", n + ".py")) + m = importlib.util.module_from_spec(s); s.loader.exec_module(m); return m +moment = _load('moment'); other = _load('base_two_moment'); outer = _load('outer') + +B2 = Q(876248285600677, 10**18) # Sussman E8 five-stage (PR #352) +B3 = Q(932783231884153, 10**18) # DaysSky seven-stage B_3 (PR #363; no Lean proof) + + +def load_word(p): + with (gzip.open(p, 'rt') if p.endswith('.gz') else open(p)) as f: + return json.load(f) + + +def save_word(c, p): + with gzip.open(p, 'wt') as f: + json.dump(c, f, separators=(',', ':')) + + +def rank(vecs): + rows = [[Q(x) for x in r] for r in vecs]; rk = 0 + n = len(rows[0]) if rows else 0 + for col in range(n): + p = next((i for i in range(rk, len(rows)) if rows[i][col] != 0), None) + if p is None: continue + rows[rk], rows[p] = rows[p], rows[rk] + for i in range(len(rows)): + if i != rk and rows[i][col] != 0: + f = rows[i][col] / rows[rk][col]; rows[i] = [a - f * b for a, b in zip(rows[i], rows[rk])] + rk += 1 + return rk + + +class Lat: + """Root-spanned subspaces of Q^8 represented by the mask of root lines they contain.""" + def __init__(self, lines): + self.lines = [tuple(x) for x in lines]; self.v = len(lines) + self._dim = {0: 0}; self._close = {} + # Gram (form /2) for orthogonality + self.ip = [[sum(a * b for a, b in zip(x, y)) // 2 for y in self.lines] for x in self.lines] + + def close(self, mask): + """mask of all root lines in span(roots of mask)""" + if mask in self._close: return self._close[mask] + idx = [i for i in range(self.v) if mask >> i & 1] + basis = [] + for i in idx: + if rank([self.lines[j] for j in basis] + [self.lines[i]]) > len(basis): basis.append(i) + d = len(basis); out = 0 + if d == 8: out = (1 << self.v) - 1 + elif d: + B = [self.lines[j] for j in basis] + for i in range(self.v): + if rank(B + [self.lines[i]]) == d: out |= 1 << i + self._close[mask] = out; self._close[out] = out; self._dim[out] = d + return out + + def dim(self, mask): + if mask not in self._dim: self.close(mask) + return self._dim[mask] + + def basis(self, mask): + b = [] + for i in range(self.v): + if mask >> i & 1 and rank([self.lines[j] for j in b] + [self.lines[i]]) > len(b): b.append(i) + return b + + def perp(self, t): + return self.close(sum(1 << j for j in range(self.v) if self.ip[t][j] == 0)) + + +def to_masks(c, L): + return [L.close(sum(1 << i for i in fr)) for fr in c['frames']] + + +PHASES = ('D', 'A', 'B', 'C') + + +def replay(c, L=None, masks=None, check_f2=True, span=True, span_mode='z'): + """Exact legality + F2 replay + histogram of a bitE8/1 word. Returns dict(H_local, steps, ...). + Legality: each register's frames nested (mask inclusion = exact Q-subspace inclusion for root-spanned frames) and + strictly increasing at each move; every gate at one common frame; D compensation at frame 0; y at frame 0 at the + scatter; COPY of retained totals; final frames (x, helpers FULL; y_t at its cap t-perp). + Source-span: every non-target operand's x-support lies in the gate frame.""" + L = L or Lat(c['lines']); masks = masks or to_masks(c, L) + v, R, h = c['v'], c['R'], c['h']; n = 2 * v + R; FULL = (1 << v) - 1 + cur = [masks[f] for f in c['start']] + for r in range(v): assert cur[r] == L.close(1 << r), 'x start' + for r in range(v, 2 * v): assert cur[r] == 0, 'y start at 0' + sig = [L.dim(cur[r]) for r in range(n)] + H = Counter(); steps = 0; viol = [] + val = [1 << i for i in range(n)] + zsupp = [{i: 1} if i < v else {} for i in range(n)] # integer support of each register over the x columns (all ADDs are +1) + def climb(r, m): + nonlocal steps + if cur[r] == m: return + assert cur[r] & ~m == 0 and cur[r] != m, ('not nested', r) + H[L.dim(m) - L.dim(cur[r])] += 1; steps += 1; cur[r] = m + def run(gates, ph): + for k, (f, d, srcs) in enumerate(gates): + m = masks[f] + assert d >= v and d not in srcs and len(set(srcs)) == len(srcs), (ph, k) + for x in [d] + srcs: climb(x, m) + for s in srcs: + val[d] ^= val[s] + if span: + if s < v or s >= 2 * v: + ms = sum(1 << i for i in zsupp[s]) + if ms & ~m: viol.append((ph, k, s)) + zd = zsupp[d] + for i, a in zsupp[s].items(): + w = zd.get(i, 0) + a + if w: zd[i] = w + else: zd.pop(i, None) + if span_mode == 'f2': + zsupp[d] = {i: 1 for i in range(v) if val[d] >> i & 1} + if span and d >= 2 * v: + md = sum(1 << i for i in zsupp[d]) + if md & ~m: viol.append((ph, k, d)) + run(c['D'], 'D') + for r in range(v, n): assert cur[r] == masks[c['start'][r]], 'D compensation at frame 0 (helpers untouched otherwise)' + run(c['A'], 'A') + for t in range(v): assert cur[v + t] == 0, 'y at frame 0 at the scatter' + copies = [val[q] for q in c['ret']] + for q in c['ret']: + assert q >= 2 * v; H[L.dim(cur[q])] += 1 + for t, row in enumerate(c['scatter']): + for k in row: val[v + t] ^= copies[k] + run(c['B'], 'B'); run(c['C'], 'C') + for r in range(n): climb(r, masks[c['final'][r]]) + for r in range(v): assert cur[r] == FULL + for r in range(2 * v, n): assert cur[r] == FULL + for t in range(v): assert cur[v + t] == L.perp(t), 'y final at cap' + if check_f2: + for s in range(v): assert val[s] == 1 << s + for t in range(v): assert val[v + t] == (1 << (v + t)) | (1 << t), ('target', t) + for r in range(2 * v, n): assert val[r] == 1 << r, ('helper', r) + return dict(sig=sig, viol=viol, H=H, steps=steps, n=n, v=v, R=R, h=h, L=L, masks=masks, ncopy=len(c['ret'])) + + +def profile(H_local, v, h=8): + prof = Counter({j: 5 * c for j, c in H_local.items()}) + for j in (2 * h - 2, h - 1, 2 * h + 2, 4): prof[j] += 2 * v + return prof + + +def coarse(H, m, W): + grid = Q(1, 10**18) + root = moment.certify(dict(H), m, W, True); c = Q(int(Q(root['lower']) * 10**18), 10**18) + assert moment.moment(H, m, W, c, True)[1] < 1 < moment.moment(H, m, W, c + grid, True)[0] + fb = 32 * m * m * sum(H.values()) + _, up = other.moment(m, W, list(H.items()), c); _, bad = other.moment(m, W, [(1, fb)], c) + lo, _ = other.moment(m, W, list(H.items()), c + grid); blo, _ = other.moment(m, W, [(1, fb)], c + grid) + assert up + Q(1, 10**16) * bad < 1 < lo + Q(1, 10**16) * blo + return c + + +def kappa(c, b): + grid = Q(1, 10**18); eta = Q(1, 10**12); beta = Q(1, 10**9); cap = (1 - beta) * b + sv = min(c, Q(((cap - grid) * 10**18).__floor__(), 10**18)); binding = 'bit' if sv == c else 'complex' + chain = [Q(384599, 10**10)] + for _ in range(3): + a = (1 - sv) * sv + sv * chain[-1]; assert chain[-1] < a < sv < 1 - a; chain.append(a) + bit = chain[-1] + bridge = dict(proof='PROOF.md', representation='Exact powers with source-bound finite overcharges', + semantic=dict(G=dict(base=2, exponent=30000), E=dict(base=2, exponent=100000), B_upper=dict(base=2, exponent=100001), + C0=dict(base=2, exponent=210000), C1=1, strict_literal_gap=1, induction_gap_lower=1), + rows=dict(coefficient=20161, degree=10**6, suffix_slope=4 * 10**6, degree_gap=Q(10**6) - Q(51 * 20161, 25))) + q = bit * (1 - 2 * eta); mn = (1 - eta) * q / (1 + q); t = mn * 10**18; k = Q((t.numerator - 1) // t.denominator, 10**18) + asm = outer.assembly(bit, b, bridge, k, eta=eta, beta=beta) + assert len(asm['strict_constraints']) == 47 and min(asm['strict_constraints'].values()) > 0 + try: + outer.assembly(bit, b, bridge, k + grid, eta=eta, beta=beta); raise SystemExit('ADJACENT ADMITTED') + except AssertionError: pass + return k, binding + + +def price_word(c, **kw): + r = replay(c, **kw) + v, h, R = r['v'], r['h'], r['R']; m = 5 * h + resid = sum(h - r['sig'][x] for x in range(2 * v, 2 * v + R)) + T = 1 if resid % h == 0 else h + W = (4 * v * h + resid) * T // h; assert (4 * v * h + resid) * T % h == 0 + prof = Counter({j: T * k for j, k in profile(r['H'], v, h).items()}); mass = sum(a * b for a, b in prof.items()) + L_copy = h * r['ncopy'] + assert m * W - mass == T * (4 * v - 5 * L_copy), ('deficit', m * W - mass) + assert 2 * max(prof) < m + cc = coarse(prof, m, W) + return dict(c=cc, H=r['H'], prof=prof, W=W, T=T, resid=resid, m=m, deficit=m * W - mass, replay=r) + + +def phi_fn(m, W, a): + """linearized moment term per child of rank r (float), for search scoring""" + import math + return lambda r: r / (m * W) * math.exp(a * math.log(m / r)) diff --git a/research/e8-clean-r781/code/emit.py b/research/e8-clean-r781/code/emit.py new file mode 100644 index 0000000000..a02dde1ae9 --- /dev/null +++ b/research/e8-clean-r781/code/emit.py @@ -0,0 +1,175 @@ +"""e8clean local program: #390's dirty-preconditioned bracket (target precancellation, helper prewhitening, main, +FULL repair of non-sink helpers only), recomputed for our word, with the bank padding C on coordinate 72 FUSED +into the final climb of each new zero-row sink helper. Own code (reads #352/#390 only as data/spec). +Events: ('phase',p) ('adapter',kind,r,f) ('climb',phase,r,old,new,rank) ('climb_pad72',r,old,new,rank_local,rank_paid) + ('center',k,old,new,rank) ('scalar',phase,op,frame). Streams: ('L',i) live, ('C',k) centre, ('W',0) coefficient.""" +import json,gzip +from fractions import Fraction as Fr +from collections import Counter +def frac(a,b): return Fr(a,b) +V,R=120,783; N=2*V+R +def setR(r): + """helper count of the word (783 for #378/#390/#395, 781 for #376/#398)""" + global R,N; R=r; N=2*V+R +def role(r): return 'X' if rY block) applied: replay main from helper column u_j with x=y=0 + reg={} + cols={j:{j:Fr(1)} for j in range(2*V,N)} + st=[dict() for _ in range(N)] + for j in range(2*V,N): st[j]={j:Fr(1)} + for t,s,q in pre_helper: + for k,x in st[s].items(): + z=st[t].get(k,0)+q*x + if z: st[t][k]=z + else: st[t].pop(k,None) + # st[h] = row h of A^{-1} acting on original columns; now run main on these helper values (x=y=0) + out=replay_main(c,{h:st[h] for h in range(2*V,N)}) + pre_target=[] + for y in range(V,2*V): + for k,x in sorted(out[y].items()): pre_target.append((y,k,-x)) # y -= (B A^-1 h) + # helper part of main from preconditioned helpers must be identity: + for h in range(2*V,N): assert out[h]=={h:Fr(1)}, ('A A^-1 != I',h) + xo=replay_main(c,{t:{t:Fr(1)} for t in range(V)}) + post=[] + for h in range(2*V,N): + if h in sinks: assert not xo[h],('sink row nonzero',h); continue + for s,x in sorted(xo[h].items()): post.append((h,s,-x)) + return pre_target,pre_helper,post +def lift(t,s,q,ori): + return ('add',('L',t),('L',s),q) if ori=='forward' else ('add',('L',s),('L',t),-q) +def emit(c,ori,hetero,fused,pw): + """hetero: {helper: endpoint frame} (#390 rank-8 sinks, no final lift); fused: set of zero-row sinks whose + final climb carries the bank padding C_72.""" + pre_target,pre_helper,post=pw; fr=c['frames']; dim=[len(f) for f in fr] + final=list(c['final']) + for r,f in hetero.items(): final[r]=f + cur=list(c['start']); tab=scat_table(c) + yield ('phase','old_response') + for t,s,q in pre_target+pre_helper: yield ('scalar','old_response',lift(t,s,q,ori),'old0') + yield ('phase','ad0') + for r,f in enumerate(c['start']): yield ('adapter','old_to_new',r,f) + for ph in ['A','centers','B']: + yield ('phase',ph) + if ph=='centers': + for k,r,f in sorted(c['ret']): + C=('C',k) + yield ('scalar','main',('clear',C),f if ori=='forward' else 0) + if ori=='forward': yield ('scalar','main',('add',C,('L',r),Fr(1)),f) + else: + for t in range(V): + if k in tab[t]: yield ('scalar','main',('add',C,('L',V+t),tab[t][k]),0) + yield ('center',k,f if ori=='forward' else 0,0 if ori=='forward' else f,dim[f]) + if ori=='forward': + for t in range(V): + if k in tab[t]: yield ('scalar','main',('add',('L',V+t),C,tab[t][k]),0) + else: yield ('scalar','main',('add',('L',r),C,Fr(-1)),f) + yield ('scalar','main',('clear',C),0 if ori=='forward' else f) + continue + for g in c[ph]: + for r in gate_regs(g): + if cur[r]!=g[1]: + yield ('climb',ph,r,cur[r],g[1],dim[g[1]]-dim[cur[r]]); cur[r]=g[1] + for t,s,q in gate_adds(g): yield ('scalar','main',lift(t,s,q,ori),g[1]) + yield ('phase','final') + for r,f in enumerate(final): + if cur[r]!=f: + if r in fused: yield ('climb_pad72',r,cur[r],f,dim[f]-dim[cur[r]],dim[f]-dim[cur[r]]+1) + else: yield ('climb','final',r,cur[r],f,dim[f]-dim[cur[r]]) + cur[r]=f + yield ('phase','adF') + for r,f in enumerate(final): + yield ('adapter','canonical_to_bank_residual' if r in hetero else 'new_to_old',r,f) + yield ('phase','cleanup') + for t,s,q in post: yield ('scalar','cleanup',lift(t,s,q,ori),'old1') + yield ('phase','done') +PHASES=['old_response','ad0','A','centers','B','final','adF','cleanup','done'] +def nested(fr,a,b): + def red(u,B): + for x in B: + if u>>(x.bit_length()-1)&1: u^=x + return u + return all(red(u,fr[b])==0 for u in fr[a]) +def validate(events,c,ori,hetero,fused): + """independent exact replay on all 1023 live columns + label/lifetime/fusion rules""" + fr=c['frames']; dim=[len(f) for f in fr]; final=list(c['final']) + for r,f in hetero.items(): final[r]=f + cur=list(c['start']); reg={('L',i):{i:Fr(1)} for i in range(N)}; seen=[]; phase=None + hist=Counter(); paid=Counter(); fusedone=set(); centers=set(); counts=Counter(); edges=set() + for ev in events: + counts[ev[0]]+=1 + if ev[0]=='phase': + phase=ev[1]; seen.append(phase); assert seen==PHASES[:len(seen)],'chronology' + if phase=='adF': assert cur==final,'final climbs' + continue + if ev[0]=='adapter': + assert (phase=='ad0' and ev[1]=='old_to_new') or (phase=='adF' and ev[1] in ('new_to_old','canonical_to_bank_residual')); continue + if ev[0] in ('climb','climb_pad72'): + if ev[0]=='climb': _,p,r,o,f,d=ev; assert p==phase + else: + _,r,o,f,d,dp=ev; assert phase=='final' and r in fused and dp==d+1 and f==1; fusedone.add(r) + assert r not in fusedone or ev[0]=='climb_pad72' + assert cur[r]==o and d==dim[f]-dim[o]>0 and nested(fr,o,f),'child' + assert not centers,'centre live during child' + cur[r]=f; hist[d]+=1; paid[d if ev[0]=='climb' else d+1]+=1; edges.add((o,f)); continue + if ev[0]=='center': + _,k,o,f,d=ev; assert phase=='centers' and centers=={('C',k)}; hist[d]+=1; paid[d]+=1; continue + assert ev[0]=='scalar'; _,p,e,f=ev + assert p==('main' if phase in ('A','centers','B') else phase) + tgt=e[1]; src=e[2] if e[0]=='add' else None + for x in [tgt]+([src] if src else []): + if x[0]=='L': + i=x[1]; assert i not in fusedone,'fused sink touched after its padded climb' + if phase=='old_response': assert f=='old0' and role(i) in ('Y','S') + elif phase=='cleanup': assert f=='old1' and cur[i]==1 and role(i) in ('X','S') and i not in hetero and i not in fused + else: assert cur[i]==f,'scalar not at common exact label' + else: assert x[0]=='C' and phase=='centers' + if e[0]=='clear': reg[tgt]={}; centers.discard(tgt) + else: + q=e[3]; d=reg.setdefault(tgt,{}) + for k,x in dict(reg.get(src,{})).items(): + z=d.get(k,0)+q*x + if z: d[k]=z + else: d.pop(k,None) + if tgt[0]=='C': centers.add(tgt) + assert seen==PHASES and not centers + exp={('L',i):{i:Fr(1)} for i in range(N)} + for t in range(V): + if ori=='forward': exp[('L',V+t)][t]=Fr(1) + else: exp[('L',t)][V+t]=Fr(-1) + bad=[r for r in exp if reg[r]!=exp[r]] + assert not bad,(ori,'columns wrong',bad[:5]) + assert all(not z for r,z in reg.items() if r[0]!='L'),'private work not erased' + assert fusedone==set(fused) + return dict(events=sum(counts.values()),counts=dict(counts),local_hist=dict(sorted(hist.items())),paid_hist=dict(sorted(paid.items())),edges=sorted(edges)) diff --git a/research/e8-clean-r781/code/engines/base_two_moment.py b/research/e8-clean-r781/code/engines/base_two_moment.py new file mode 100644 index 0000000000..14a90fa0e7 --- /dev/null +++ b/research/e8-clean-r781/code/engines/base_two_moment.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Maintainer arithmetic cross-check of the pinned PR39 certificate. + +Uses no producer/checker imports. Counts are inputs, not proved by this script. +80-term rational logarithms and 12-term exponentials independently enclose +the two moments. The accompanying written review addresses their realization. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +GRID = 10**30 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def log_unit(x): + require(1 <= x <= 2, "logarithm range") + z = (x-1)/(x+1) + lo = 2*sum((z**(2*j+1)/(2*j+1) for j in range(80)), Q(0)) + return lo, lo+2*z**161/(161*(1-z*z)) + + +def log_bounds(x): + k = 0 + while x > 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/e8-clean-r781/code/engines/moment.py b/research/e8-clean-r781/code/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/e8-clean-r781/code/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/e8-clean-r781/code/layout_bk.py b/research/e8-clean-r781/code/layout_bk.py new file mode 100644 index 0000000000..57aa98085b --- /dev/null +++ b/research/e8-clean-r781/code/layout_bk.py @@ -0,0 +1,63 @@ +"""Our own check of the bridged layout B_K (Sussman's B_2, Work/Bridge/Net.lean; DaysSky's B_K generalisation, PR #363), +reimplemented from the schedule stated in PR #363's README and Sussman's coordinate-frame stage geometry: +K bank pairs, 2K+1 stages on H + 2K.H (m = (2K+1)h). Pair 1: forward, backward, forward; pair p >= 2: backward, forward, +borrowing its first forward from pair p-1 through twin gates (+-1 additions at equal frames). +Checks: frames are coordinate sets; every climb nested; twin gates at equal frames; each invocation entered at its +stage frame; final frames; m-1 moves per data role; exchange identity X_p = -y_p, Y_p = x_p (exact integer +linear algebra on symbolic coefficient vectors). Returns the idle climbs per role pair (optionally split at s). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +def layout(K, h, split=None): + s = 2 * K + 1; m = s * h; l = 0 + blk = lambda name, skip=None: {(name, j) for j in range(h) if j != skip} + B0 = blk('b0'); F = ['F%d' % i for i in range(s - 1)] + ALL = set(B0).union(*[blk(f) for f in F]); assert len(ALL) == m + def enter(t, X): + if t == 0: return {('b0', l)} if X else set() + base = set(B0) if X else B0 - {('b0', l)} + for f in F[:t - 1]: base |= blk(f, l) + return base + def leave(t, X): + return (set(B0) if X else B0 - {('b0', l)}) if t == 0 else enter(t, X) | blk(F[t - 1], l) + sched = [(0, 'F', 1), (1, 'B', 1), (2, 'F', 1)] + for p in range(2, K + 1): sched += [(2 * p - 1, 'B', p), (2 * p, 'F', p)] + fr = {(X, p): enter(0, X) for p in range(1, K + 1) for X in (True, False)} + inv = {k: 0 for k in fr}; idle = {k: [] for k in fr} + # symbolic values: vector over symbols x1..xK, y1..yK + sym = lambda nm, p: tuple(int(q == (nm, p)) for q in [(a, b) for a in 'xy' for b in range(1, K + 1)]) + val = {(True, p): sym('x', p) for p in range(1, K + 1)} | {(False, p): sym('y', p) for p in range(1, K + 1)} + add = lambda u, w, c: tuple(a + c * b for a, b in zip(u, w)) + def go(k, new, is_idle): + assert fr[k] <= new, 'climb not nested' + if new != fr[k]: + (idle[k].append(len(new) - len(fr[k])) if is_idle else None) + if not is_idle: inv[k] += len(new) - len(fr[k]) + fr[k] = set(new) + def gate(d, s_, c): + assert fr[d] == fr[s_], 'twin gate at unequal frames' + val[d] = add(val[d], val[s_], c) + for t, kind, p in sched: + for X in (True, False): + go((X, p), enter(t, X), True); go((X, p), leave(t, X), False) + if kind == 'F': val[(False, p)] = add(val[(False, p)], val[(True, p)], 1) + else: val[(True, p)] = add(val[(True, p)], val[(False, p)], -1) + for q in range(2, K + 1): + if t in (2 * q - 3, 2 * q - 2): + for X in (True, False): go((X, q), fr[(X, q - 1)], True) + if t == 2 * q - 3: gate((True, q - 1), (True, q), 1); gate((False, q), (False, q - 1), -1) + else: gate((False, q), (False, q - 1), 1); gate((True, q - 1), (True, q), -1) + for k in fr: go(k, ALL if k[0] else ALL - {('b0', l)}, True) + for q in range(K, 1, -1): gate((False, q - 1), (False, q), -1); gate((True, q), (True, q - 1), 1) + for k in fr: assert inv[k] + sum(idle[k]) == m - 1 + for p in range(1, K + 1): + assert val[(True, p)] == tuple(-a for a in sym('y', p)) and val[(False, p)] == sym('x', p), ('exchange', p) + assert idle[(True, p)] == idle[(False, p)] + blocks = [r for p in range(1, K + 1) for r in idle[(True, p)]] + if split: + out = [] + for r in blocks: + while r > split: out.append(split); r -= split + if r: out.append(r) + blocks = out + return dict(m=m, per_pair={p: idle[(True, p)] for p in range(1, K + 1)}, blocks=blocks) +if __name__ == '__main__': + print(layout(2, 9)); print(layout(3, 9)); print(layout(3, 9, split=31)) diff --git a/research/e8-clean-r781/code/sinks.py b/research/e8-clean-r781/code/sinks.py new file mode 100644 index 0000000000..9e56d6ff15 --- /dev/null +++ b/research/e8-clean-r781/code/sinks.py @@ -0,0 +1,144 @@ +"""Construct free sink uncomputes on a gcert word: for helper r, after its last Y-influence, subtract an exact rational +combination of other helpers that sit at r's exact frame (no donor advance), so the final clean x-row of r is zero.""" +import sys,json,gzip +from fractions import Fraction as Fr +from collections import Counter,defaultdict +import os +sys.path.insert(0,os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','complex','gx')); import gxcore as G +def cf(k): ng,a,b=k; return Fr(-a if ng else a,b) +def analyse(c): + D=G.normal(json.loads(json.dumps(c))) + dim=[len(x) for x in D['frames']]; v=D['v'];R=D['R'];n=2*v+R + gates=D['A']+D['B']; nA=len(D['A']); NG=len(gates) + val=[({r:Fr(1)} if r=v else ver[r].append((0,dict(val[r]))); lab[r].append((0,cur[r])) + for i,g in enumerate(gates): + t=i+1 + if i==nA: + tot=[dict(val[s]) for s,_ in D['ret']] + for tt in range(v): + for kk,cc in G.scat_row(D,tt): + for key,x in tot[kk].items(): val[v+tt][key]=val[v+tt].get(key,0)+cf(cc)*x + for r in G.regs(g): + if cur[r]!=g[1]: cur[r]=g[1]; lab[r].append((t,g[1])) + src=dict(val[g[2]]) if g[0]=='out' else None + for tg,s,k in G.adds(g): + sv=src if g[0]=='out' else val[s] + d=val[tg] + for key,x in sv.items(): + d[key]=d.get(key,0)+cf(k)*x + if d[key]==0: del d[key] + ver[tg].append((t,dict(d))) + w=defaultdict(dict) + for y in range(v): w[v+y]={y:Fr(1)} + tau={} + for t in range(NG,-1,-1): + for r in range(2*v,n): + if r not in tau and any(w[r].values()): tau[r]=t + if t==0: break + g=gates[t-1] + for tg,s,k in reversed(G.adds(g)): + cc=cf(k) + for y,x in list(w[tg].items()): w[s][y]=w[s].get(y,0)+cc*x + if t-1==nA: + for tt in range(v): + for kk,c2 in G.scat_row(D,tt): + s=D['ret'][kk][0] + for y,x in w[v+tt].items(): w[s][y]=w[s].get(y,0)+cf(c2)*x + fin=[dim[D['final'][r]]-dim[cur[r]] for r in range(n)] + return D,dim,ver,lab,tau,fin,NG,val +def ivs(L,END): + return [(fr,ts,(L[i+1][0] if i+1 (vec, combo) + def red(x,combo): + x=dict(x);combo=dict(combo) + while x: + p=min(x) + if p not in basis: return x,combo + c=x[p]; bv,bc=basis[p] + for k,vv in bv.items(): + x[k]=x.get(k,0)-c*vv + if x[k]==0: del x[k] + for k,vv in bc.items(): + combo[k]=combo.get(k,0)-c*vv + if combo[k]==0: del combo[k] + return x,combo + for key,vec in cands: + x,cb=red(vec,{key:Fr(1)}) + if x: + p=min(x);c=x[p]; basis[p]=({k:a/c for k,a in x.items()},{k:a/c for k,a in cb.items()}) + x,cb=red(target,{}) + if x: return None + return {k:-a for k,a in cb.items()} # target - sum(...)=0 => target = sum(-cb) +def find(c,r,exclude=(),an=None): + D,dim,ver,lab,tau,fin,NG,val=an or analyse(c) + t0=tau.get(r,-1)+1; target=val[r] + if not target: return [] + Lr=[(fr,max(ts,t0),te) for fr,ts,te in ivs(lab[r],NG) if te>t0] + v=D['v'];n=2*v+D['R']; cands=[] + for u in range(2*v,n): + if u==r or u in exclude: continue + for fr,ts,te in ivs(lab[u],NG): + for frr,a,b in Lr: + if fr!=frr: continue + lo,hi=max(ts,a),min(te,b) + if lo>=hi: continue + vs=ver[u] + for j,(tv,vec) in enumerate(vs): + vend=vs[j+1][0] if j+1=1: cands.append(((u,s0,fr),vec)) + # prefer later times? keep order: fewer distinct gates -> sort by time + sol=solve(target,cands) + if sol is None: return None + gates=defaultdict(list) + for (u,s0,fr),a in sol.items(): + gates[(s0,fr)].append([u,-a.numerator,a.denominator]) # r -= a*u => coefficient -a + return [dict(sink_helper=r,cut_group=s0-1,frame=fr,uncompute=sorted(us)) for (s0,fr),us in sorted(gates.items())] +def nested(fr,a,b): return all(G.reduce(u,fr[b])==0 for u in fr[a]) +def find_adv(c,r,exclude=(),noadv=()): + """as find, but donors may also be advanced early along their own walk (fu < L_r < fn); returns (gates, splits)""" + D,dim,ver,lab,tau,fin,NG,val=analyse(c) + fr=D['frames']; t0=tau.get(r,-1)+1; target=val[r] + if not target: return [],[] + Lr=[(f,max(ts,t0),te) for f,ts,te in ivs(lab[r],NG) if te>t0] + v=D['v'];n=2*v+D['R'] + touch=defaultdict(list) + for i,g in enumerate(D['A']+D['B']): + for x in G.regs(g): touch[x].append(i+1) + free=[];adv=[] + for u in range(2*v,n): + if u==r or u in exclude: continue + I=ivs(lab[u],NG) + for j,(fu,ts,te) in enumerate(I): + fn=I[j+1][0] if j+1=hi: continue + vs=ver[u] + for k,(tv,vec) in enumerate(vs): + vend=vs[k+1][0] if k+1=s1 or not vec or s0<1: continue + if fu==f: free.append(((u,s0,f),vec)); continue + if u in noadv: continue + # advance: need fu=s1 or s<1: continue + if dim[fu] original cut index""" + by = {} + for s in sinks: by.setdefault(s['cut_group'], []).append(s) + m = [] + for i in range(len(c['A']) + len(c['B'])): + m.append(i); m.extend(i for _ in by.get(i, [])) + return m + + +def sixths(gs): + """Rewrite a two-donor uncompute r += a*p + (a/2)*q (quarter coefficient) as three same-frame gates + p += q/2; r += a*p; p -= q/2, so every intermediate entry stays in sixths (gxcore E5 units) and every + coefficient has denominator <= 2. The donor p is restored immediately; the net scalar map is identical.""" + from fractions import Fraction as F + out = [] + for g in gs: + u = g['uncompute'] + if all(b in (1, 2, 3, 6) for _, _, b in u): out.append(g); continue + assert len(u) == 2 + (p, a1, b1), (q, a2, b2) = sorted(u, key=lambda x: x[2]) + a, bq = F(a1, b1), F(a2, b2); h = bq / a + assert h.denominator <= 2 and a.denominator <= 2 + base = dict(sink_helper=g['sink_helper'], cut_group=g['cut_group'], frame=g['frame']) + out += [dict(base, target=p, uncompute=[[q, h.numerator, h.denominator]]), + dict(base, uncompute=[[p, a.numerator, a.denominator]]), + dict(base, target=p, uncompute=[[q, -h.numerator, h.denominator]])] + return out diff --git a/research/e8-clean-r781/complex/LICENSE-wht-power-saving-lean b/research/e8-clean-r781/complex/LICENSE-wht-power-saving-lean new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-r781/complex/LICENSE-wht-power-saving-lean @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-r781/complex/NOTICE-wht-power-saving-lean b/research/e8-clean-r781/complex/NOTICE-wht-power-saving-lean new file mode 100644 index 0000000000..7008ce01c1 --- /dev/null +++ b/research/e8-clean-r781/complex/NOTICE-wht-power-saving-lean @@ -0,0 +1,489 @@ +Walsh-Hadamard power saving (wht-power-saving-lean) +Copyright 2026 Jacob Sussman + +Repository: https://github.com/jacobalansussman/wht-power-saving-lean + +This repository is not a project of OpenAI. OpenAI did not write, review or +endorse it. The package name "OAI" and the namespace "OAI.PowerSaving" are +those of openai/math and are kept only because the new files extend that +development. + +This repository is not a project of CrocSwap/integer-mult-bounds either. Its +authors did not write, review or endorse it. Section 6 says what is taken +from their repository. + +This repository contains files from, and files derived from, the repository +"openai/math" (https://github.com/openai/math), family 130, "Exact Fourier +transforms below n log n", at commit fd4aeeb2ee4fc729c18d98444fed42fd0529eeeb. +That repository is published under the Apache License, Version 2.0. A copy of +the licence is in the file LICENSE. The upstream repository has no NOTICE file +and its licence text names no copyright holder; the files are attributed here +to the authors of openai/math (OpenAI). + +1. Unmodified upstream files. + The 89 files under OAI/Computability/ are byte-for-byte copies of the files + with the same paths under lean/ in openai/math at the commit above. They + have not been changed. Modified copies of some of them are under + Work/Fourier/ and Work/FourierE8/ and are listed in section 7. + One more file of openai/math is here unchanged, outside the Lean build: + third-party/openai-math/lean/ComparatorChallenges/UniformFourier.lean is a + byte-for-byte copy of lean/ComparatorChallenges/UniformFourier.lean at the + commit above (the statement of OpenAI's Fourier challenge). It is included + so that the modified copy named in section 2 can be compared with it. + +2. Files that contain upstream text. + - Work/CarrierCheck/ChallengeB2Ke16x.lean, + Work/CarrierCheck/ChallengeB2Ke16xR.lean, + Work/GCert/Data/ChallengeB2Gp193x.lean, + Work/GCert/Data/ChallengeB2Ge8x.lean and the text template + tools/gen/templates/ChallengeB2L16x.lean.txt each contain, as their + lines 22-270, lines 9-257 of + lean/ComparatorChallenges/UniformFourier.lean of openai/math (the RAM cost + model), unchanged. Everything else in these files was written for this + repository. + - Work/Fourier/UniformFourierChallenge.lean is a modified copy of + lean/ComparatorChallenges/UniformFourier.lean of openai/math (the + statement of OpenAI's Fourier challenge, 336 lines). Changes: a comment + was added at the top; the exponent 1 - 1/(10^(13:ℕ)) was replaced by + 1 - 7474546/(10^(10:ℕ)); seven names received the suffix "Z" + (decimalExponent, decimalTime, TimeBounds, DFTGoal, ConvGoal, + transform_main, convolution_main). Everything else in the file is the + upstream text, unchanged. See section 7. + - Work/FourierE8/UniformFourierChallenge.lean is a second modified copy + of the same upstream file, for the fourth result, with the same three + kinds of change: a comment added at the top; the exponent replaced by + 1 - 8762478/(10^(10:ℕ)); the suffix "E8" on the same seven names. + Everything else in the file is the upstream text, unchanged. See + section 7. + - Work/Scratch/Engine.lean and Work/Block/Engine.lean contain copies of + proofs of openai/math, changed for this repository: sections 1, 2 and 5 + of Work/Scratch/Engine.lean are upstream proofs with the batch layout + renamed, and both files contain a copy of the private upstream theorem + "hills_project" (lean/OAI/Computability/FourierTransform/ + TensorProgram.lean) with its envelope generalised. The comments in the + two files mark these places. + - lakefile.lean is adapted from lean/lakefile.lean of openai/math: the same + package name, toolchain, package option and Mathlib pin; every other + dependency was removed and the libraries of this repository were added. + lean-toolchain is a byte-for-byte copy of lean/lean-toolchain. + lake-manifest.json lists Mathlib and its dependencies at the revisions of + lean/lake-manifest.json. + - RELATED-WORK.md reproduces the BibTeX entries of two manuscripts of + openai/math. + +3. New files that build on upstream proofs. + The other files under WHTCheck/ and Work/ were written for this + repository. They import the upstream files, and several of them generalise + or adapt proofs of upstream files (for example Work/Block/Recursion.lean, + which says so in its header). They are changes and additions made for this + repository and are not part of openai/math. + +4. How the new files were made. + Jacob Sussman made the new files on 2026-10-08, 2026-10-09 and 2026-10-10 + by directing a team of AI agents (Claude). The agents wrote the new Lean + files, the certificate data and the generator scripts. They made the + rebuild scripts under tools/rebuild/, in part by adapting programs of + CrocSwap/integer-mult-bounds (section 6): ten of the thirteen on + 2026-10-09, tidied for this repository on 2026-10-10, and three on + 2026-10-10. On 2026-10-10 they also wrote the search programs under + tools/e8/ and found with them the certificate of the fourth result + (section 8). See README.md, section 4. + +5. Ideas taken from other public work. + The network of the first result uses ideas published by others, among them + the helper circuit "NStar3" (Swapnil-jain/integer-mult-kappa, which credits + CrocSwap pull request #36 and Paureel for parts of it), its transfer to + family 130 (shea256/fourier-transform-below-nlogn), and "carrier links" and + "whole-residual batching" (pull requests to CrocSwap/integer-mult-bounds). + No file of Swapnil-jain/integer-mult-kappa or of + shea256/fourier-transform-below-nlogn is included here. One comment in + Work/Scratch/Engine.lean quotes three counts reported in + Swapnil-jain/integer-mult-kappa and names that source. The general frame + lemma that Work/GFrame proves is stated in + notes/general-clifford-frames.tex of CrocSwap/integer-mult-bounds; its Lean + proof was written for this repository. The credits, with links, are in + RELATED-WORK.md. + +6. Data derived from, and programs adapted from, + CrocSwap/integer-mult-bounds (second result). + The helper circuit of the second result is the paired-cube circuit of the + repository "CrocSwap/integer-mult-bounds" + (https://github.com/CrocSwap/integer-mult-bounds), in the state of its pull + request #193. It is the design of that community: icekylinx (pull requests + #144 and #184), eumemic (#168, and #117 behind its modules), ikeboy / + Avi Eisenberg (#191 and #193), with an664 (#128) credited there for the + workspace-sharing principle, and DaysSky (#162) and chafreaky (#163) + credited by #168 for its closure-compiled carrier arcs and for the + fusion of its single-target outputs. That repository is published under + the Apache + License, Version 2.0 (the same licence text as the file LICENSE). Its + NOTICE file begins "A sharper exponent for integer multiplication / + Copyright 2026 Douglas Colkitt" and says that the community release "is + not solely Douglas Colkitt's work". A complete copy of that NOTICE file, as + it is at the head of pull request #193, is in + third-party/CrocSwap-integer-mult-bounds/NOTICE. + + The data were taken from these files of that repository. They were loaded + as data by the programs under tools/rebuild/. No program of that + repository was run, and none is included here unchanged; six of the + programs under tools/rebuild/ are adapted from programs of that + repository ("Programs", below). + - at the head of pull request #168 (eumemic), + 4a3c769e5c5430e7114c4d3e099ff34664677f17: + references/paired-cube/sources/local_L1.json + references/paired-cube/sources/tmod_TE_TD_TB3_1_1_4_full_6.0617964e-4.json + references/paired-cube/sources/pmod_J0_full_6.0666810e-4.json + references/paired-cube/sources/qmod_climb3u_best.json + references/paired-cube/selected-module/matching-arcs.json + references/paired-cube/physical/frames.json + - at the head of pull request #193 (ikeboy), + 187e1010ac8b259af8e9b5166f68b64bc27b4b47: + research/source-assisted-v4/data/physical-pairs.json + + Two more files at the head of pull request #168 are read for comparison + only: the programs print whether their graph and their counts agree + with them. Nothing in the certificate is taken from them: + references/paired-cube/selected-module/SOURCE.json + certificates/paired-cube-complex-input.json + + One more file is fetched and read only on request. No certificate and + no Lean module of this repository is made from it; the documentation + gives its sha256 and the price that tools/gx/gxdry.py computes for + the certificate that the rebuild makes from it: + - at the head of pull request #233 (chafreaky), + 109a857a329d18ed5552d5573f17ddfa886ae57f: + research/source-assisted-v4-layer/witness/physical-pairs.json + + None of these ten files is included in this repository. + tools/rebuild/fetch_inputs.py fetches them and checks their sha256. + + Files of this repository that contain data derived from them: + tools/certificate/gcert1-p11-pr193.json.gz and the Lean data modules + generated from it, Work/GCert/Data/Gen/P193*.lean and the files they import + from Work/GCert/Data/Gen/P193/; its block counts are also in the generated + modules Work/GCert/Data/P193Price.lean, RateB2Gp193.lean, RateB2Gp193x.lean + and InstB2Gp193.lean. + Changes made: the circuit was rebuilt from those data as one explicit, + renumbered list of additions with a table of frames, in the certificate + format "gcert/1" of this repository; its 1,980 in-place steps were written + as pairs of additions with rescaled coefficients; the Lean data modules + were generated from that list. No file of that repository is included + unchanged, except the copy of its NOTICE file named above. + + Programs. The Python files under tools/rebuild/ were made by the agents + (section 4), who read programs of that repository as text and ran none + of them. Six of the thirteen files are adapted from those programs: + the parts named below follow the outside program statement by statement + or method by method, with the layout changed, some names changed and + the parts that this certificate does not use left out. Each of the six + says so in its first lines. + - tools/rebuild/compile.py: the function closure follows + compile_closure of scripts/paired_cube/closure.py; the function + select follows the first part of select of + scripts/paired_cube/gauges.py. + - tools/rebuild/graphgen.py: the class Gen follows the class Graph of + scripts/paired_cube/graph.py; its method fuse follows the branch + "f8:" of merge_outputs of scripts/paired_cube/modules.py, which + fuses the three single-target outputs of a port into one. That + branch came with pull request #168 (eumemic), which says of the + fusion that it "follows #163's same-singleton fusion" and credits + it so: "Same-singleton output fusion: @chafreaky (#163); the fold + orders here come from our own search." + - tools/rebuild/aligned.py: the functions op_tags, local_values and + build follow op_tags, local_values and main of + research/source-assisted-v4/source_aligned_local_v4.py, except its + search for pairs and the records it writes. + - tools/rebuild/stage.py: the order of the events, the backward pass + (responses) and many names are those of + research/terminal-sinks/sinks_gate.py and of + scripts/paired_cube_physical.py; the event records and the exact + arithmetic were written for this repository, and the frame scan + was rewritten so that it returns every block. + - tools/rebuild/build.py: the function target_hist and the field names + of profile follow the last part of select of + scripts/paired_cube/gauges.py; the calls that make the graph and its + hash follow regenerate of scripts/paired_cube_producer.py. + - tools/rebuild/f2.py: the function perp follows perp, and the second + half of the function rref follows the second half of basis, of + scripts/paired_cube/frames.py. + The outside programs are those at the two commits named above + (source_aligned_local_v4.py at the second, the others at the first). + Of the other seven files, rebuild.py, fetch_inputs.py, rbpaths.py, + rewrite.py, phys.py and emit.py were written for this repository. + modules.py was written for this repository too; for the three module + files it checks the contract that the outside + scripts/paired_cube/modules.py states for them in its functions + triple_module_from, pair_module_from and all_but_one_from, each of + which is marked there "eumemic, Claude assistance; Apache-2.0". + + Notices and attribution sentences in the first lines of those outside + programs, quoted with the line numbers of each file at its commit. + The other lines of each header say what the program does and name no + person: + + scripts/paired_cube/closure.py, lines 4-5 (pull request #168, + eumemic; from pull request #162, DaysSky): + Copyright 2026 DaysSky (PR162, + research/extended-links/cxlinks.py), Apache-2.0; moved here + unchanged apart from this header and the imports (eumemic, Claude + assistance). + + scripts/paired_cube/graph.py, modules.py, frames.py, gauges.py and + scripts/paired_cube_producer.py (pull request #144, icekylinx; + graph.py, modules.py and paired_cube_producer.py changed in #168, + eumemic), the two comment lines at the top of each: + Copyright 2026 icekylinx. Apache-2.0. + Developed with GPT-6 Astra assistance; integrated with Codex + assistance. + graph.py, lines 6-9: + The coarse positive query modules restrict the already adopted + PR117 DAG (eumemic; Apache-2.0; Claude assistance; + cbb05ce504d571546d9b7794c186a613c659c3bf). The paired-channel + decomposition and this assembly are new work for icekylinx with + OpenAI GPT-6 Astra assistance. + modules.py, lines 6-7: + The pair-disjoint module is a specialization of the already + adopted PR117 positive DAG (eumemic, Apache-2.0, pinned + cbb05ce504d571546d9b7794c186a613c659c3bf). + modules.py, line 272, above merge_outputs: + Output merging (pmerge.py variants; eumemic, Claude assistance; + Apache-2.0). + frames.py, line 7: + New work for icekylinx, OpenAI GPT-6 Astra assistance. + paired_cube_producer.py, line 8: + Copyright 2026 icekylinx, Apache-2.0; OpenAI GPT-6 Astra + assistance, inherited PR117 notices. + + scripts/paired_cube_physical.py, lines 4-7 (pull request #168, + eumemic): + Prepared by eumemic with Anthropic Claude assistance. Apache-2.0. + The signed word, frozen arcs, gauges, chronology and shared-core + accounting are icekylinx's PR144. Frame descent under PR130's + general Clifford frames and compensated birth-cut reuse follow + PR131 and jamesyc's PR124; deadline (late) compensation reads + follow PR143. + + research/terminal-sinks/sinks_gate.py, lines 4-6 (pull request + #168, eumemic): + The substitution is the terminal-sink lemma of PR #166 by jamesyc + (closed by its author), independently audited here: this gate's + own frame scans, replay and controls carry the soundness argument + and do not use #166's checker. Gate, audit and integration by + eumemic with Anthropic Claude assistance. Apache-2.0. + + research/source-assisted-v4/source_aligned_local_v4.py, lines 4-9 + (pull requests #191 and #193, ikeboy / Avi Eisenberg): + Derived from + research/source-assisted/decision/source_aligned_local.py + (icekylinx, GPT-6 Astra assistance, Apache-2.0). Only the three + frozen query modules change: this copy reads PR168 v4's selected + modules (eumemic, Claude assistance) from + references/paired-cube/sources instead of the PR168 fd25adb7 + modules. The local configuration, arc transport, frame + inheritance and physical layer code are unchanged. + + Notices of that NOTICE file that pertain to these data, quoted: + + Paired-cube and shared-core extension, 9 October 2026 + Copyright 2026 icekylinx + + Source-assisted common-frame extension (2026-10-09) + Copyright 2026 icekylinx. Apache-2.0. + Substantial dependency: eumemic PR168, + fd25adb7fbaa12ee761d02c733c54d1d2a7687ee + + The full text of both notices, and the notices of the work they build on, + are in the copy named above. The credits, with links and with the words of + pull request #193 about its own sources, are in README.md ("Whose circuit + this is") and in RELATED-WORK.md, section 1. + +7. Modified copies of upstream files (third and fourth results). + The files listed below are copies of files of openai/math at the commit + above, changed for this repository. Each begins with a comment that names + the upstream file it is derived from and states what was changed. The + upstream originals under lean/OAI/Computability/ are in this repository + as well, unchanged (section 1), and the copies import them. The upstream + challenge file lean/ComparatorChallenges/UniformFourier.lean is in this + repository in both forms: unchanged under third-party/openai-math/ + (section 1) and modified (section 2). + + - Work/Fourier/ArbitraryLength.lean: modified copy of + lean/OAI/Computability/FourierTransform/ArbitraryLength.lean (224 + lines; 159 of them unchanged in the copy). Changes: identifiers renamed + on 64 lines (18 names: 15 with the suffix Z, 3 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/Asymptotics.lean: modified copy of + lean/OAI/Computability/FourierTransform/Asymptotics.lean (187 lines; + 112 of them unchanged in the copy). Changes: identifiers renamed on 74 + lines (32 names: 26 with the suffix Z, 6 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + - Work/Fourier/Axioms.lean: written for this repository (not a copy of an + upstream file). + - Work/Fourier/ConvolutionProgram.lean: modified copy of + lean/OAI/Computability/FourierTransform/ConvolutionProgram.lean (100 + lines; 77 of them unchanged in the copy). Changes: identifiers renamed + on 22 lines (10 names: 9 with the suffix Z, 1 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/Goal.lean: written for this repository; contains lines of + upstream files: of its 7 code lines, 6 are lines of + lean/OAI/Computability/FourierTransform/Goal.lean (original lines 35, + 75-77, 79, 81): unchanged: its lines 25; with identifiers renamed: its + lines 21, 24, 26, 28, 30. + - Work/Fourier/Main.lean: modified copy of + lean/OAI/Computability/FourierTransform/Main.lean (151 lines; 90 of + them unchanged in the copy). Changes: identifiers renamed on 59 lines + (40 names: 35 with the suffix Z, 5 with Z inserted); 1 import line + replaced by 2; 24 comment lines added; other code lines changed: 1 of + the original, 1 of the copy (copy line 59). + - Work/Fourier/Seam.lean: written for this repository; contains lines of + upstream files: of its 122 code lines, 15 are lines of + lean/OAI/Computability/FourierTransform/TensorProgram.lean (original + lines 36-37, 95-96): unchanged: its lines 93-94, 113-114, 141-142, + 163-164, 185-187, 194-196; with identifiers renamed: its lines 184; 3 + are lines of lean/OAI/Computability/FourierTransform/TensorSaving.lean + (original lines 83-84, 114): with identifiers renamed: its lines 45-46, + 59; 1 is a line of lean/OAI/Computability/FourierTransform/Main.lean + (original line 60): with identifiers renamed: its lines 213. + - Work/Fourier/SectorAlgorithm.lean: modified copy of + lean/OAI/Computability/FourierTransform/SectorAlgorithm.lean (224 + lines; 162 of them unchanged in the copy). Changes: identifiers renamed + on 61 lines (17 names: 13 with the suffix Z, 4 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/SynchronizedAlgorithm.lean: modified copy of + lean/OAI/Computability/FourierTransform/SynchronizedAlgorithm.lean (126 + lines; 94 of them unchanged in the copy). Changes: identifiers renamed + on 31 lines (12 names: 10 with the suffix Z, 1 with Z inserted, 1 + other), the other being "canopy" to "Grove.canopy" (5 lines); 1 import + line replaced by 1; 16 comment lines added; no other change to the + code. + - Work/Fourier/TransformProgram.lean: modified copy of + lean/OAI/Computability/FourierTransform/TransformProgram.lean (146 + lines; 94 of them unchanged in the copy). Changes: identifiers renamed + on 51 lines (21 names: 19 with the suffix Z, 2 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/UniformBounds.lean: modified copy of + lean/OAI/Computability/FourierTransform/UniformBounds.lean (183 lines; + 115 of them unchanged in the copy). Changes: identifiers renamed on 67 + lines (29 names: 25 with the suffix Z, 4 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + - Work/Fourier/UniformFourierChallenge.lean: modified copy of + lean/ComparatorChallenges/UniformFourier.lean (336 lines; 328 of them + unchanged in the copy). Changes: identifiers renamed on 7 lines (7 + names: 7 with the suffix Z); 12 comment lines added; other code lines + changed: 1 of the original, 1 of the copy (copy line 281). + - Work/Fourier/WorkingCompiler.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingCompiler.lean (153 + lines; 104 of them unchanged in the copy). Changes: identifiers renamed + on 48 lines (14 names: 14 with the suffix Z); 1 import line replaced by + 1; 15 comment lines added; no other change to the code. + - Work/Fourier/WorkingPreparation.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingPreparation.lean (212 + lines; 156 of them unchanged in the copy). Changes: identifiers renamed + on 55 lines (30 names: 28 with the suffix Z, 2 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/WorkingTransform.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingTransform.lean (119 + lines; 91 of them unchanged in the copy). Changes: identifiers renamed + on 27 lines (9 names: 8 with the suffix Z, 1 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + + Changes made to the eleven copied proof files: every declaration received + the letter "Z" in its name (as a suffix of its own name, or of the name + of the declaration it belongs to), so that it does not collide with the + upstream declaration of the same name; the upstream exponent "alpha" + (1 - 2/10^11) and the bound "hills" defined from it were replaced by + "alphaZ" (1 - 7474547/10^10) and "hillsZ", which are defined in + Work/Fourier/Seam.lean, and the single use of the upstream theorem + "hills_program" by "hillsZ_program"; the five definitions of the upstream + statement that contain its exponent (decimalExponent, decimalTime, + TimeBounds, DFTGoal, ConvGoal) were replaced by the versions of + Work/Fourier/Goal.lean, whose exponent is 1 - 7474546/(10^(10:ℕ)); + the import lines point to the copies; a header comment was added. + Two further changes: in the copy of Main.lean the same constant stands + once as the literal 2/10^11 and was replaced there too, and the two + final theorems of that copy received a documentation comment; in the + copy of SynchronizedAlgorithm.lean the name "canopy" was written out as + "Grove.canopy" in 5 places, because the short name is shadowed in the + larger environment of the copy. The script also renamed three names + inside upstream comments; the comments are otherwise the upstream ones + and describe the upstream network. + The proofs are those of openai/math. The copies were made by the script + tools/fourier/mkchain.py of this repository. + + Work/Fourier/Goal.lean contains copies of those five definitions of + lean/OAI/Computability/FourierTransform/Goal.lean, with the exponent + replaced and the suffix "Z" on the five names. + + Work/Fourier/Seam.lean was written for this repository. It repeats the + statement of the upstream theorem "hills_program" (TensorProgram.lean) and + the definition of "hills" (TensorSaving.lean) with the two names replaced; + its header says so. + + Fourth result. The 15 files under Work/FourierE8/ repeat the 15 files + under Work/Fourier/ for the kernel program of the fourth result, file + for file and under the same file names: ArbitraryLength.lean, + Asymptotics.lean, ConvolutionProgram.lean, Goal.lean, Main.lean, + SectorAlgorithm.lean, SynchronizedAlgorithm.lean, TransformProgram.lean, + UniformBounds.lean, UniformFourierChallenge.lean, WorkingCompiler.lean, + WorkingPreparation.lean, WorkingTransform.lean, Seam.lean and + Axioms.lean. The eleven copied proof files, + Goal.lean and UniformFourierChallenge.lean are modified copies of the + same upstream files as their namesakes above, made by the script + tools/fourier/mkchain_e8.py (a copy of tools/fourier/mkchain.py with + its constants changed). The changes are those described above with + three differences: the suffix is "E8" where the copies of the third + result have "Z"; "alphaE8" is 1 - 8762479/10^10; and the exponent of + Work/FourierE8/Goal.lean is 1 - 8762478/(10^(10:ℕ)). Each of these + files begins with a comment that names the upstream file it is derived + from and states what was changed. Work/FourierE8/Seam.lean and + Work/FourierE8/Axioms.lean were written for this repository: they are + Work/Fourier/Seam.lean and Work/Fourier/Axioms.lean with names and + numbers replaced, and the seam repeats the same upstream statement and + definition as the seam of the third result. The proofs are those of + openai/math. + + The work of others that the third result follows (danadran01, shea256, + eumemic) is credited in README.md ("Whose reduction this is") and in + RELATED-WORK.md, section 1. No file of their repositories is included + here. + +8. The certificate of the fourth result and the search programs. + tools/certificate/gcert1-e8-r783.json.gz, the Lean data modules + generated from it (Work/GCert/Data/Gen/E8*.lean, Work/GCert/Data/Gen/E8/ + and the modules of Work/GCert/Data/ with E8 or B2Ge8 in their names) and + the Python programs under tools/e8/ were made by the agents for this + repository on 2026-10-10 (section 4). The circuit in that certificate + is not the circuit of section 6, and no data file of + CrocSwap/integer-mult-bounds was loaded to make it. It uses three + devices that were published by others in pull requests to that + repository: + - the in-place pair, a + b and a - b formed on the two arrays that held + a and b: icekylinx (#184), carried in #191 and #193 (ikeboy); + - the re-use of a finished helper with a compensating read: jamesyc + (#124) and eumemic (#143); + - the late pairing rule, the choice of which finished helper a new + value takes: Chafik Boukhalfa (the account chafreaky), #200 and #233, + and pull request #2 of this repository. The search programs apply the + idea with a greedy rule of their own; his program, his pairs and his + certificate were not used. + No program of that repository is included in tools/e8/, imported or + run by it. The programs of tools/e8/ have not been compared statement + by statement with the programs of that repository, as those of + tools/rebuild/ were (section 6). The integer programme of + tools/e8/ is solved with the open-source solver HiGHS, called through + SciPy (scipy.optimize.milp), with NumPy; none of the three is included + here. The credits, with links, are in README.md ("Whose ideas the new + unit uses") and in RELATED-WORK.md, section 8. + +Not included in this repository and fetched by the build: Mathlib +(https://github.com/leanprover-community/mathlib4, Apache License 2.0) and its +dependencies. The comparator (https://github.com/leanprover/comparator) is a +separate tool and is not included. diff --git a/research/e8-clean-r781/complex/gx/gx.py b/research/e8-clean-r781/complex/gx/gx.py new file mode 100644 index 0000000000..6d14c0a976 --- /dev/null +++ b/research/e8-clean-r781/complex/gx/gx.py @@ -0,0 +1,296 @@ +#!/usr/bin/python3 -I +"""gx.py. OWN code (imports nothing of port-producer, nothing outside). +(1) convert(c0): gcert/0 (port-producer's event list) -> gcert/1, the LEAN-FACING NORMAL FORM: + only the main phase (no read0 / undo / uninj: the invocation theorem derives the dirt gate and the undo + gate from the product), every gate an elementary fan-out or fan-in add, the 4x4 K block written as three + such adds plus a sign carried by one register, the star scatter as a table. +(2) check1(c1): the local decidable conditions of EXTENDED-CERT-SPEC.md on a gcert/1 file: + E0 sizes, E1 labels (nested subspaces by containment, equal frame at a gate), E2 scatter cut, + E3 shape (kinds of gates; X1; S1), E4 bracket rule S2, E5 scalar (x-content replay: hid and X3), + E6 price data (block histograms, N), E7 exterior gauges only (Q2). Raises AssertionError(": ..."). +""" +from fractions import Fraction as Fr +from collections import Counter +from math import lcm + + +def need(c, msg): + if not c: + raise AssertionError(msg) + + +def reduce(u, basis): + """basis: reduced echelon, pivot = leading bit, descending. Returns u modulo the span.""" + for b in basis: + if u >> (b.bit_length() - 1) & 1: + u ^= b + return u + + +def echelon_ok(f): + piv = [b.bit_length() - 1 for b in f] + if any(b == 0 for b in f) or piv != sorted(piv, reverse=True) or len(set(piv)) != len(piv): + return False + return all(not (b >> p & 1) for i, b in enumerate(f) for j, p in enumerate(piv) if i != j) + + +def inside(a, b): + return all(reduce(u, b) == 0 for u in a) + + +def par(x): + return bin(x).count("1") & 1 + + +KJ = [[[1, 2] if i == j else [-1, 2] for j in range(4)] for i in range(4)] + + +def convert(c0): + need(c0["format"] == "gcert/0", "input is not gcert/0") + v, h, R = c0["v"], c0["h"], c0["R"] + ev = c0["events"] + cen = [n for n, e in enumerate(ev) if e[0] == "centre"] + need(cen == list(range(cen[0], cen[0] + len(cen))), "centres are not contiguous: no single scatter cut") + A, B, ret = [], [], [] + neg = set() # x registers currently holding MINUS their value (between the two K blocks) + openq = {} + for n, e in enumerate(ev): + k = e[0] + out = A if n < cen[0] else B + if k in ("read0", "undo", "uninj"): + continue + if k == "inj": + need(e[2] not in neg, "inj reads a negated x register") + out.append(["out", e[3], e[2], [[e[1], 1, 1]], []]) + elif k == "op": + if e[3] == -1: + out.append(["neg", e[5], e[1]]) + else: + need(e[3] == 1, "op ca") + out.append(["out", e[5], e[2], [[e[1], e[4], 1]], []]) + elif k == "centre": + ret.append([e[2], e[1], e[3]]) + elif k == "gread": + hit = set(t for t, _, _ in e[3]) + out.append(["out", e[2], e[1], [[v + t, a, b] for t, a, b in e[3]], [v + t for t in e[4] if t not in hit]]) + elif k == "rread": + out.append(["out", e[2], e[1], [[v + t, a, b] for t, a, b in e[3]], []]) + elif k == "ysh": + out.append(["out", e[4], e[2], [[e[1], e[3], 1]], []]) + elif k == "yw": + out.append(["out", e[4], e[2], [[e[1], e[3][0], e[3][1]]], []]) + elif k == "kd": + out.append(["out", e[3], e[2], [[e[1], -1 if e[2] in neg else 1, 1]], []]) + elif k == "ktr": + q = tuple(e[1]) + need(e[2] == KJ, "ktr matrix is not 1 - J/2") + x1, rest = q[0], list(q[1:]) + if q not in openq: # first block: x := M x, register x1 keeps the sign + out.append(["in", e[3], x1, [[r, 1, 1] for r in rest]]) + out.append(["out", e[3], x1, [[r, -1, 2] for r in rest], []]) + out.append(["in", e[3], x1, [[r, 1, 1] for r in rest]]) + openq[q] = n + neg.add(x1) + else: # second block: the three adds undone in reverse order + out.append(["in", e[3], x1, [[r, -1, 1] for r in rest]]) + out.append(["out", e[3], x1, [[r, 1, 2] for r in rest], []]) + out.append(["in", e[3], x1, [[r, -1, 1] for r in rest]]) + del openq[q] + neg.discard(x1) + else: + raise AssertionError("unknown event kind %r" % k) + need(not openq and not neg, "a K block is not closed") + ext = sorted([z[3], z[1]] for z in c0["gauge"] if z[5]) + c1 = dict(format="gcert/1", derived_from=c0["name"] + " (gcert/0)", p=c0["p"], h=h, v=v, R=R, cst=c0["cst"], + N=c0["N"], ports=c0["ports"], frames=c0["frames"], start=c0["start"], final=c0["final"], + ext=ext, ret=sorted(ret), scat=dict(inside=c0["scat"]["inside"], outside=c0["scat"]["outside"]), + A=A, B=B, blocks=c0["blocks"]) + return c1 + + +def scat_row(c, t): + """the scatter of target t: [(k, coefficient)], from the table or from the star rule""" + sc = c["scat"] + if "table" in sc: + return [(k, Fr(a, b)) for k, a, b in sc["table"][t]] + sin, sout = Fr(*sc["inside"]), Fr(*sc["outside"]) + return [(k, sin if c["ports"][t] >> k & 1 else sout) for k in range(c["h"])] + + +def gate_regs(g): + if g[0] == "neg": + return [g[2]], [], [] + if g[0] == "out": + return [g[2]] + [t for t, _, _ in g[3]] + list(g[4]), [(t, g[2], Fr(a, b)) for t, a, b in g[3]], g[4] + if g[0] == "in": + return [g[2]] + [s for s, _, _ in g[3]], [(g[2], s, Fr(a, b)) for s, a, b in g[3]], [] + raise AssertionError("E0: unknown gate kind %r" % (g[0],)) + + +def check1(c, scalar=True, stats=None): + need(c.get("format") == "gcert/1", "E0: format") + h, v, R = c["h"], c["v"], c["R"] + nreg = 2 * v + R + ports, fr = c["ports"], [tuple(f) for f in c["frames"]] + need(len(ports) == v == len(set(ports)) and all(par(q) and 0 < q < 1 << h for q in ports), "E0: ports") + need(fr[0] == () and fr[1] == tuple(1 << i for i in range(h - 1, -1, -1)), "E0: frames 0 and 1") + need(all(echelon_ok(f) for f in fr) and len(set(fr)) == len(fr), "E0: frame table not reduced echelon / repeats") + dim = [len(f) for f in fr] + start, final = c["start"], c["final"] + need(len(start) == len(final) == nreg, "E0: start / final") + ext = {r: f for r, f in c["ext"]} + for t in range(v): + need(fr[start[t]] == (ports[t],) and final[t] == 1, "E1: x start / final") + f = fr[final[v + t]] + need(start[v + t] == 0 and len(f) == h - 1 and all(par(u & ports[t]) == 0 for u in f), "E1: y start / final") + for r in range(2 * v, nreg): + need(start[r] == ext.get(r, 0) and final[r] == 1, "E1: slot start / final") + cls = lambda r: "x" if r < v else "y" if r < 2 * v else "s" + cur = list(start) + H = {"x": Counter(), "y": Counter(), "s": Counter(), "c": Counter()} + steps = set() + + def climb(r, f, where): + o = cur[r] + if o != f: + if (o, f) not in steps: + need(dim[o] < dim[f] and inside(fr[o], fr[f]), "E1: step not nested (%s, register %d)" % (where, r)) + steps.add((o, f)) + H[cls(r)][dim[f] - dim[o]] += 1 + cur[r] = f + okind = {("x", "s"), ("s", "s"), ("s", "y"), ("x", "y"), ("x", "x"), ("y", "y")} + ysum, piv, ytg = Counter(), set(), set() + inc = 0 + for ph, gates in (("A", c["A"]), ("B", c["B"])): + if ph == "B": # ---- E2: the scatter cut + need(sorted(k for k, _, _ in c["ret"]) == list(range(len(c["ret"]))), "E2: retained totals numbered 0..") + if "table" in c["scat"]: + need(len(c["scat"]["table"]) == v and all(0 <= k < len(c["ret"]) for row in c["scat"]["table"] for k, _, _ in row), + "E2: scatter table") + else: + need(len(c["ret"]) == h, "E2: one retained total per coordinate (star rule)") + for k, s, f in c["ret"]: + need(cls(s) == "s" and cur[s] == f, "E2: retained slot %d is not at its frame" % s) + H["c"][dim[f]] += 1 + need(all(cur[v + t] == 0 for t in range(v)), "E2: a y role left frame 0 before the scatter") + for i, g in enumerate(gates): + regs, pairs, _ = gate_regs(g) + need(all(0 <= r < nreg for r in regs) and len(set(regs)) == len(regs), "E3: registers of gate %s%d" % (ph, i)) + inc += len(regs) + for r in regs: + climb(r, g[1], "%s%d" % (ph, i)) + for t, s, co in pairs: + kd = (cls(s), cls(t)) + need(kd in okind, "E3: gate kind %s -> %s (gate %s%d)" % (kd + (ph, i))) + need(ph == "B" or kd in {("x", "s"), ("s", "s")}, "E3: bank gate before the scatter (gate A%d)" % i) + if kd == ("y", "y"): + ysum[s, t] += co + piv.add(s) + ytg.add(t) + need(ph == "B" or all(cls(r) != "y" for r in regs), "E2: y role named in phase A") + for r in range(nreg): + climb(r, final[r], "final") + need(not (piv & ytg), "E4: a pivot is the target of a gate reading y") + need(all(x == 0 for x in ysum.values()), "E4: y-reads of a (pivot, target) pair do not cancel") + Hs = {k: {str(r): n for r, n in sorted(w.items())} for k, w in H.items()} + need(Hs == c["blocks"], "E6: block histograms") + N = sum(r * n for w in H.values() for r, n in w.items()) + tails = sum(dim[f] for f in ext.values()) + need(N == c["N"] and N + tails == R * h + 2 * v * (h - 1) + c["cst"], "E6: N") + if stats is not None: + stats.update(steps=len(steps), incidences=inc, blocks=sum(sum(w.values()) for w in H.values()), + step_work=sum(dim[a] * dim[b] for a, b in steps), ysh_pairs=len(ysum)) + if scalar: + scal(c, stats) + q2(c) + return True + + +def scal(c, stats=None): + """E5: exact replay of the x-content of every register through A, scatter, B.""" + h, v, R = c["h"], c["v"], c["R"] + nreg = 2 * v + R + reg = [({r: Fr(1)} if r < v else {}) for r in range(nreg)] + den = {"x": 1, "y": 1, "s": 1} + mx = {"x": Fr(0), "y": Fr(0), "s": Fr(0)} + cls = lambda r: "x" if r < v else "y" if r < 2 * v else "s" + + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: + d[k] = w + kk = cls(t) + if w.denominator != 1: + den[kk] = lcm(den[kk], w.denominator) + if abs(w) > mx[kk]: + mx[kk] = abs(w) + else: + d.pop(k, None) + + def run(gates): + for g in gates: + if g[0] == "neg": + reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == "out": + src = dict(reg[g[2]]) + for t, a, b in g[3]: + axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: + axpy(g[2], reg[s], Fr(a, b)) + run(c["A"]) + tot = {k: dict(reg[s]) for k, s, _ in c["ret"]} + for t in range(v): + for k, co in scat_row(c, t): + axpy(v + t, tot[k], co) + run(c["B"]) + need(all(reg[t] == {t: 1} for t in range(v)), "E5: an x role is not restored (X3)") + need(all(reg[v + t] == {t: 1} for t in range(v)), "E5: a target does not receive exactly its source (hid)") + if stats is not None: + stats.update(den=dict(den), maxabs={k: str(x) for k, x in mx.items()}, + gates_A=len(c["A"]), gates_B=len(c["B"])) + + +def q2(c): + """E7 (only for files with exterior gauges, rule (2)): for every slot q that starts off the zero frame, the + column of q in the y rows of the product is zero (its dirt is removed in line, the derived dirt gate at + frame 0 does not touch it). Replay with the gauged slots as variables, x = 0.""" + h, v, R = c["h"], c["v"], c["R"] + ext = [r for r, _ in c["ext"]] + if not ext: + return True + reg = [dict() for _ in range(2 * v + R)] + for r in ext: + reg[r] = {r: Fr(1)} + + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: + d[k] = w + else: + d.pop(k, None) + + def run(gates): + for g in gates: + if g[0] == "neg": + reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == "out": + src = dict(reg[g[2]]) + for t, a, b in g[3]: + axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: + axpy(g[2], reg[s], Fr(a, b)) + run(c["A"]) + tot = {k: dict(reg[s]) for k, s, _ in c["ret"]} + for t in range(v): + for k, co in scat_row(c, t): + if tot[k]: + axpy(v + t, tot[k], co) + run(c["B"]) + need(all(not reg[v + t] for t in range(v)), "E7: the dirt of an exterior-gauged slot reaches a y role (Q2)") + return True diff --git a/research/e8-clean-r781/complex/gx/gxcore.py b/research/e8-clean-r781/complex/gx/gxcore.py new file mode 100644 index 0000000000..3e3f0a3076 --- /dev/null +++ b/research/e8-clean-r781/complex/gx/gxcore.py @@ -0,0 +1,375 @@ +"""gxcore.py: gcert/1 JSON -> normal data D, PYTHON MIRROR of the two Lean checks +(label side: E0 frames, E1 pairs, E1/E2/E6 replay in segments; scalar side: E3 kinds, E4 bracket, E5 replay +in source batches, E7), derived data (distinct climbs, cut states, block histogram) and kernel sizes. +Own code; the reference is gx.py (check1), not imported. Python 3, standard library only.""" +import json, gzip +from collections import Counter +from math import gcd + + +class Reject(Exception): + pass + + +def need(c, msg): + if not c: + raise Reject(msg) + + +def load(path): + c = json.load(gzip.open(path, "rt") if path.endswith(".gz") else open(path)) + need(c.get("format") == "gcert/1", "E0: format is not gcert/1") + return c + + +def co(num, den): + need(den > 0, "E0: denominator") + return (num < 0, abs(num), den) + + +def normal(c): + """the Lean-facing data: gates as tuples, coefficients (neg, num, den), ret by total""" + def gate(g): + if g[0] == "out": + return ("out", g[1], g[2], [(t, co(a, b)) for t, a, b in g[3]], list(g[4])) + need(g[0] == "in", "E0: unknown gate kind %r" % (g[0],)) + return ("in", g[1], g[2], [(s, co(a, b)) for s, a, b in g[3]]) + ret = sorted(c["ret"]) + need([k for k, _, _ in ret] == list(range(len(ret))), "E2: retained totals numbered 0..") + sc = c["scat"] + scat = ("table", [[(k, co(a, b)) for k, a, b in row] for row in sc["table"]]) if "table" in sc else \ + ("star", co(*sc["inside"]), co(*sc["outside"])) + return dict(h=c["h"], v=c["v"], R=c["R"], N=c["N"], cst=c["cst"], ports=list(c["ports"]), + frames=[list(f) for f in c["frames"]], start=list(c["start"]), final=list(c["final"]), + ext=[tuple(e) for e in c.get("ext", [])], ret=[(s, f) for _, s, f in ret], scat=scat, + A=[gate(g) for g in c["A"]], B=[gate(g) for g in c["B"]], + blocks={k: {int(r): n for r, n in c["blocks"][k].items()} for k in "xysc"}) + + +def regs(g): + return [g[2]] + [t for t, _ in g[3]] + (g[4] if g[0] == "out" else []) + + +def adds(g): + """single adds (tgt, src, coef) in order""" + return [(t, g[2], k) for t, k in g[3]] if g[0] == "out" else [(g[2], s, k) for s, k in g[3]] + + +def reduce(u, basis): + for b in basis: + if u >> (b.bit_length() - 1) & 1: + u ^= b + return u + + +def echelon_ok(f): + piv = [b.bit_length() - 1 for b in f] + if any(b == 0 for b in f) or any(piv[i] <= piv[i + 1] for i in range(len(piv) - 1)): + return False + return all(not (b >> p & 1) for i, b in enumerate(f) for j, p in enumerate(piv) if i != j) + + +def par(x): + return bin(x).count("1") & 1 + + +def cls(D, r): + return "x" if r < D["v"] else "y" if r < 2 * D["v"] else "s" + + +# ---- label side ------------------------------------------------------------------------------------------ +def chk_frames(D): + """E0: ports; frame table reduced echelon, no repeats, zero first, full second""" + h, v, fr = D["h"], D["v"], D["frames"] + p = D["ports"] + need(len(p) == v == len(set(p)) and all(par(q) and 0 < q < 1 << h for q in p), "E0: ports") + need(len(fr) >= 2 and fr[0] == [] and fr[1] == [1 << i for i in range(h - 1, -1, -1)], "E0: frames 0 and 1") + need(all(echelon_ok(f) and all(b < 1 << h for b in f) for f in fr), "E0: frame table not reduced echelon") + need(len(set(map(tuple, fr))) == len(fr), "E0: frame table has repeats") + return [len(f) for f in fr] + + +def derive(D): + """distinct climbs in order of first use (NOT a check: plain replay of the frame ids)""" + cur, seen, pairs = list(D["start"]), set(), [] + + def go(r, f): + o = cur[r] + if o != f: + if (o, f) not in seen: + seen.add((o, f)) + pairs.append((o, f)) + cur[r] = f + for g in D["A"] + D["B"]: + for r in regs(g): + go(r, g[1]) + for r, f in enumerate(D["final"]): + go(r, f) + return pairs + + +def chk_pairs(D, dim, pairs): + """E1, level 2: every listed pair is a nested pair of the table; returns the mask-operation count""" + fr, n, work = D["frames"], len(D["frames"]), 0 + for a, b in pairs: + need(a < n and b < n and dim[a] < dim[b], "E1: pair (%d, %d) does not climb" % (a, b)) + need(all(reduce(u, fr[b]) == 0 for u in fr[a]), "E1: pair (%d, %d) is not nested" % (a, b)) + work += dim[a] * dim[b] + return work + + +def cut_points(D, gmax, wmax=210000): + """replay segments: each phase (A, B) is cut into k pieces of equal gate count, k = the least number with at + most `gmax` gates AND at most `wmax` work per piece on average (work = sum over gates of the dimension of the + gate's frame; measured at h = 22: about 1 ms of kernel time per unit, NOTES.md). + Cut points = gate counts in A ++ B (always 0, |A| and the end).""" + nA, nB = len(D["A"]), len(D["B"]) + cuts = [0] + for off, gs in ((0, D["A"]), (nA, D["B"])): + n = len(gs) + k = max(1, -(-n // gmax), -(-sum(len(D["frames"][g[1]]) for g in gs) // wmax)) + cuts += [off + (n * i) // k for i in range(1, k + 1)] + return sorted(set(cuts)) + + +def label_data(D, dim, cuts): + """for gx-labels (gcert-interface.md LABELS v1): ordered block ranks per replay segment, the final climbs as + gates without adds (same final frame, at most 32 registers, only registers that still climb), their ranks, + the largest number of registers named by one gate. Plain replay (the mirror has accepted the file).""" + cur, G = list(D["start"]), D["A"] + D["B"] + rs, most = [], 0 + for a, b in zip(cuts, cuts[1:]): + r = [] + for g in G[a:b]: + most = max(most, len(regs(g))) + for x in regs(g): + if cur[x] != g[1]: + r.append(dim[g[1]] - dim[cur[x]]) + cur[x] = g[1] + rs.append(r) + by = {} + for x, f in enumerate(D["final"]): + if cur[x] != f: + by.setdefault(f, []).append(x) + fins, rF = [], [] + for f in sorted(by): + for i in range(0, len(by[f]), 32): + xs = by[f][i:i + 32] + fins.append(("out", f, xs[0], [], xs[1:])) + rF += [dim[f] - dim[cur[x]] for x in xs] + return dict(rs=rs, fins=fins, rF=rF, most=max(most, 32 if fins else 0)) + + +def chk_replay(D, dim, pairs, cuts): + """E1 (labels), E2 (scatter cut), E6 (price), in the segments given by `cuts`. + Returns (states at the cuts, histogram by class, visits per segment).""" + h, v, R, fr = D["h"], D["v"], D["R"], D["frames"] + n = 2 * v + R + start, final, ext = D["start"], D["final"], dict(D["ext"]) + need(len(start) == len(final) == n, "E0: start / final") + for t in range(v): + need(fr[start[t]] == [D["ports"][t]] and final[t] == 1, "E1: x start / final") + f = fr[final[v + t]] + need(start[v + t] == 0 and len(f) == h - 1 and all(par(u & D["ports"][t]) == 0 for u in f), "E1: y start / final") + for r in range(2 * v, n): + need(start[r] == ext.get(r, 0) and final[r] == 1, "E1: slot start / final") + ok = set(pairs) + need(len(ok) == len(pairs), "E1: pair list has repeats") + cur = list(start) + H = {k: Counter() for k in "xysc"} + + def climb(r, f, where): + o = cur[r] + if o != f: + need((o, f) in ok, "E1: climb (%d, %d) is not a tested pair (%s, register %d)" % (o, f, where, r)) + H[cls(D, r)][dim[f] - dim[o]] += 1 + seg[dim[f] - dim[o]] += 1 + cur[r] = f + seg, segs = Counter(), [] + G, nA = D["A"] + D["B"], len(D["A"]) + states, visits = [], [] + need(cuts[0] == 0 and cuts[-1] == len(G) and cuts == sorted(cuts), "cut points") + for a, b in zip(cuts, cuts[1:]): + states.append(list(cur)) + vs = 0 + for i in range(a, b): + if i == nA: + scatter_cut(D, cur, dim, H, seg) + g = G[i] + rs = regs(g) + need(all(0 <= r < n for r in rs) and len(set(rs)) == len(rs), "E3: registers of gate %d" % i) + need(i >= nA or all(r < v or r >= 2 * v for r in rs), "E2: y role named in phase A (gate %d)" % i) + vs += len(rs) + for r in rs: + climb(r, g[1], "gate %d" % i) + visits.append(vs) + if b < len(G): + segs.append(seg) + seg = Counter() + if nA == len(G): + scatter_cut(D, cur, dim, H, seg) + states.append(list(cur)) + for r in range(n): + climb(r, final[r], "final") + segs.append(seg) + Hb = {k: dict(sorted(w.items())) for k, w in H.items()} + need(Hb == D["blocks"], "E6: block histogram differs from `blocks`") + N = sum(r * c for w in H.values() for r, c in w.items()) + need(N == D["N"] and N + sum(dim[f] for f in ext.values()) == R * h + 2 * v * (h - 1) + D["cst"], "E6: N") + need(sum(r * c for r, c in H["c"].items()) == D["cst"], "E6: cst") + return states, Hb, visits, [[w[r] for r in range(h + 1)] for w in segs] + + +def scatter_cut(D, cur, dim, H, seg): + v = D["v"] + if D["scat"][0] == "table": + need(len(D["scat"][1]) == v and all(k < len(D["ret"]) for row in D["scat"][1] for k, _ in row), "E2: scatter table") + else: + need(len(D["ret"]) == D["h"], "E2: one retained total per coordinate (star rule)") + for s, f in D["ret"]: + need(s >= 2 * v and cur[s] == f, "E2: retained slot %d is not at its frame" % s) + H["c"][dim[f]] += 1 + seg[dim[f]] += 1 + need(all(cur[v + t] == 0 for t in range(v)), "E2: a y role left frame 0 before the scatter") + + +# ---- scalar side ----------------------------------------------------------------------------------------- +SC = 6 # all scalar entries are kept as integers in units of 1/6 +KINDS = {("x", "s"), ("s", "s"), ("s", "y"), ("x", "y"), ("x", "x"), ("y", "y")} + + +def chk_shape(D): + """E3 kinds, E4 bracket""" + ysum, piv, ytg = Counter(), set(), set() + for ph in "AB": + for i, g in enumerate(D[ph]): + for t, s, (ng, a, b) in adds(g): + kd = (cls(D, s), cls(D, t)) + need(kd in KINDS and t != s, "E3: gate kind %s -> %s (gate %s%d)" % (kd + (ph, i))) + need(ph == "B" or kd in {("x", "s"), ("s", "s")}, "E3: bank gate before the scatter (gate A%d)" % i) + if kd == ("y", "y"): + need(SC % b == 0, "E4: denominator beyond sixths") + ysum[s, t] += (-a if ng else a) * (SC // b) + piv.add(s) + ytg.add(t) + need(not (piv & ytg), "E4: a pivot is the target of a gate reading y") + need(all(x == 0 for x in ysum.values()), "E4: y-reads of a (pivot, target) pair do not cancel") + return len(ysum) + + +def scat_row(D, t): + sc = D["scat"] + if sc[0] == "table": + return sc[1][t] + return [(k, sc[1] if D["ports"][t] >> k & 1 else sc[2]) for k in range(D["h"])] + + + +def replay(D, init, count=None): + """exact replay through A, scatter, B of sparse vectors with entries in sixths; `init` = register -> {key: 6}""" + v = D["v"] + reg = [dict(init.get(r, ())) for r in range(2 * v + D["R"])] + + def axpy(t, src, k): + ng, a, b = k + d = reg[t] + for key, u in src.items(): + w = u * a + need(w % b == 0, "E5: an entry needs a denominator beyond sixths (register %d)" % t) + w = w // b + w = d.get(key, 0) + (-w if ng else w) + if count is not None: + count[key] += 1 + if w: + d[key] = w + else: + d.pop(key, None) + + def run(gates): + for g in gates: + if g[0] == "out": + src = dict(reg[g[2]]) + for t, k in g[3]: + axpy(t, src, k) + else: + for s, k in g[3]: + axpy(g[2], reg[s], k) + run(D["A"]) + afterA = sum(len(d) for d in reg) + tot = [dict(reg[s]) for s, _ in D["ret"]] + for t in range(v): + for k, cf in scat_row(D, t): + if tot[k]: + axpy(v + t, tot[k], cf) + run(D["B"]) + return reg, afterA + + +def chk_scalar(D, batches=1): + """E5 (+ E7 when `ext` is non-empty). Returns stats: denominators and largest numerators per class in the + units of the spec (x halves, y sixths, slots integers), updates per source batch, entries after A.""" + v = D["v"] + count = Counter() + reg, afterA = replay(D, {t: {t: SC} for t in range(v)}, count) + need(all(reg[t] == {t: SC} for t in range(v)), "E5: an x role is not restored (X3)") + need(all(reg[v + t] == {t: SC} for t in range(v)), "E5: a target does not receive exactly its source (hid)") + if D["ext"]: + rg, _ = replay(D, {r: {r: SC} for r, _ in D["ext"]}) + need(all(not rg[v + t] for t in range(v)), "E7: the dirt of an exterior-gauged slot reaches a y role") + step = -(-v // batches) + per = [sum(count[k] for k in range(lo, min(lo + step, v))) for lo in range(0, v, step)] + return dict(updates=sum(count.values()), per_batch=per, afterA=afterA, + batches=[(lo, min(lo + step, v)) for lo in range(0, v, step)]) + + +def digits(D): + """largest |entry| met and denominators per class, by a second replay that watches every write (slow path + kept separate from the check): returns {class: (lcm of denominators, largest |numerator| in units 1/den)}""" + v = D["v"] + den = {"x": 1, "y": 1, "s": 1} + mx = {"x": 0, "y": 0, "s": 0} + reg = [({r: SC} if r < v else {}) for r in range(2 * v + D["R"])] + + def axpy(t, src, k): + ng, a, b = k + d, kk = reg[t], cls(D, t) + for key, u in src.items(): + w = d.get(key, 0) + (-(u * a // b) if ng else u * a // b) + if w: + d[key] = w + q = SC // gcd(w, SC) + if den[kk] % q: + den[kk] = den[kk] * q // gcd(den[kk], q) + if abs(w) > mx[kk]: + mx[kk] = abs(w) + else: + d.pop(key, None) + for g in D["A"]: + for t, s, k in adds(g): + axpy(t, reg[s], k) + tot = [dict(reg[s]) for s, _ in D["ret"]] + for t in range(v): + for k, cf in scat_row(D, t): + axpy(v + t, tot[k], cf) + for g in D["B"]: + for t, s, k in adds(g): + axpy(t, reg[s], k) + return {k: (den[k], mx[k] * den[k] // SC if (mx[k] * den[k]) % SC == 0 else "%d/6" % mx[k]) for k in "xys"} + + +def mirror(D, gmax=12000, batches=1, pairs=None, cuts=None): + """both checks; returns everything the generator and the dry run need""" + dim = chk_frames(D) + pairs = derive(D) if pairs is None else pairs + work = chk_pairs(D, dim, pairs) + cuts = cut_points(D, gmax) if cuts is None else cuts + states, H, visits, segH = chk_replay(D, dim, pairs, cuts) + ysh = chk_shape(D) + S = chk_scalar(D, batches) + hist = Counter() + for k in "xysc": + for r, n in H[k].items(): + hist[r] += n + return dict(dim=dim, pairs=pairs, pair_work=work, cuts=cuts, states=states, H=H, visits=visits, ysh=ysh, + scal=S, hist=dict(sorted(hist.items())), segH=segH, + lab=label_data(D, dim, cuts)) diff --git a/research/e8-clean-r781/data/bit/bitE8-kernel.json.gz b/research/e8-clean-r781/data/bit/bitE8-kernel.json.gz new file mode 100644 index 0000000000..22141be33d Binary files /dev/null and b/research/e8-clean-r781/data/bit/bitE8-kernel.json.gz differ diff --git a/research/e8-clean-r781/data/gcert1-e8-r783-far.json.gz b/research/e8-clean-r781/data/gcert1-e8-r783-far.json.gz new file mode 100644 index 0000000000..56708f99a4 Binary files /dev/null and b/research/e8-clean-r781/data/gcert1-e8-r783-far.json.gz differ diff --git a/research/e8-clean-r781/data/pr390/LICENSE-pr390 b/research/e8-clean-r781/data/pr390/LICENSE-pr390 new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-r781/data/pr390/LICENSE-pr390 @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-r781/data/pr390/prefix18.json.gz b/research/e8-clean-r781/data/pr390/prefix18.json.gz new file mode 100644 index 0000000000..51f3ea73e0 Binary files /dev/null and b/research/e8-clean-r781/data/pr390/prefix18.json.gz differ diff --git a/research/e8-clean-r781/data/pr390/prewhite.json b/research/e8-clean-r781/data/pr390/prewhite.json new file mode 100644 index 0000000000..527a2ea461 --- /dev/null +++ b/research/e8-clean-r781/data/pr390/prewhite.json @@ -0,0 +1 @@ +{"checks":{"all_columns":1023,"clean_target_entries":14400,"helper_dirty_entries":613089,"source_entries":122760},"coefficient_bill":{"denominators":[1,2,3,4,6],"max_denominator_bits":3,"max_numerator_bits":2,"pre_post_real_primitive_upper":61161},"main_gates":3922,"n":1023,"post_full_helper_clean_repair_gates":[[240,0,-1,2],[240,1,-1,2],[240,4,-1,2],[240,5,-1,2],[240,9,-1,2],[240,14,-1,2],[240,22,-1,2],[240,23,-1,2],[240,29,1,2],[240,34,1,2],[240,40,1,2],[240,41,1,2],[240,54,1,2],[240,64,1,2],[240,74,1,2],[240,75,1,2],[241,0,-1,2],[241,99,-1,2],[241,109,-1,2],[242,0,1,2],[242,1,-1,2],[243,1,-1,2],[243,99,1,2],[243,104,-1,2],[244,2,-1,2],[244,3,-1,2],[244,4,-1,2],[244,5,-1,2],[244,13,-1,2],[244,14,-1,2],[244,15,-1,2],[244,16,-1,2],[244,29,1,2],[244,30,1,2],[244,31,1,2],[244,32,1,2],[244,49,1,2],[244,50,1,2],[244,51,1,2],[244,52,1,2],[245,2,-1,1],[245,49,1,1],[245,77,1,1],[245,110,1,1],[245,116,-1,1],[246,2,-1,1],[246,50,1,1],[246,77,-1,1],[246,110,-1,1],[246,113,-1,1],[247,2,1,2],[247,3,-1,2],[248,3,-1,1],[248,50,1,1],[248,80,1,1],[248,110,-1,1],[248,113,-1,1],[249,3,-1,1],[249,49,1,1],[249,77,1,1],[249,110,1,1],[249,113,1,1],[250,4,-1,1],[250,5,-1,1],[250,74,-1,1],[250,75,-1,1],[251,4,-1,1],[251,51,1,1],[251,74,1,1],[251,117,1,1],[251,119,-1,1],[252,4,1,2],[252,5,-1,2],[253,5,-1,1],[253,52,1,1],[253,75,1,1],[253,117,-1,1],[253,118,-1,1],[254,4,-1,1],[254,5,-1,1],[254,51,1,1],[254,52,1,1],[255,6,-1,1],[255,12,-1,1],[255,17,-1,1],[255,21,-1,1],[255,24,-1,1],[255,62,1,1],[255,72,1,1],[255,81,1,1],[255,85,-1,1],[255,86,-1,1],[255,87,-1,1],[255,88,-1,1],[255,102,-1,1],[255,107,-1,1],[255,111,-1,1],[256,6,-1,1],[256,12,-1,1],[256,38,1,1],[256,53,1,1],[257,4,-1,1],[257,5,-1,1],[257,9,-1,1],[257,14,-1,1],[257,30,-1,1],[257,35,-1,1],[257,51,1,1],[257,52,1,1],[257,78,1,1],[257,79,1,1],[257,83,1,1],[257,114,-1,1],[257,115,-1,1],[258,7,-1,2],[258,9,-1,2],[258,13,1,2],[258,18,1,2],[258,28,-1,2],[258,30,-1,2],[258,34,1,2],[258,39,1,2],[258,51,-1,2],[258,52,-1,2],[258,58,-1,2],[258,59,-1,2],[258,65,1,2],[258,66,1,2],[258,74,1,2],[258,75,1,2],[259,7,-1,2],[259,84,-1,2],[259,98,-1,2],[260,8,-1,1],[260,14,-1,1],[261,8,-1,1],[261,34,-1,1],[262,4,1,2],[262,5,1,2],[262,8,-1,2],[262,9,-1,2],[262,29,-1,2],[262,30,-1,2],[262,72,1,2],[262,73,1,2],[262,74,-1,2],[262,75,-1,2],[262,87,1,2],[262,88,1,2],[262,94,1,2],[262,95,1,2],[262,102,-1,2],[262,103,-1,2],[263,8,-1,1],[263,9,-1,1],[263,13,-1,1],[263,14,-1,1],[263,47,1,1],[263,48,1,1],[263,51,-1,1],[263,52,-1,1],[263,74,1,1],[263,75,1,1],[263,89,-1,1],[263,90,-1,1],[263,100,-1,1],[263,101,-1,1],[263,105,-1,1],[263,106,-1,1],[264,10,-1,1],[264,16,-1,1],[265,10,-1,1],[265,36,-1,1],[266,2,1,2],[266,3,1,2],[266,10,-1,2],[266,11,-1,2],[266,31,-1,2],[266,32,-1,2],[266,67,1,2],[266,70,1,2],[266,77,-1,2],[266,80,-1,2],[266,89,1,2],[266,90,1,2],[266,96,1,2],[266,97,1,2],[266,100,-1,2],[266,101,-1,2],[267,10,-1,1],[267,11,-1,1],[267,15,-1,1],[267,16,-1,1],[267,42,1,1],[267,45,1,1],[267,49,-1,1],[267,50,-1,1],[267,77,1,1],[267,80,1,1],[267,87,-1,1],[267,88,-1,1],[267,102,-1,1],[267,103,-1,1],[267,107,-1,1],[267,108,-1,1],[268,12,-1,1],[268,17,1,1],[268,33,-1,1],[268,38,1,1],[268,85,1,1],[268,86,-1,1],[268,92,1,1],[268,93,-1,1],[269,9,1,2],[269,13,-1,2],[269,29,-1,2],[269,35,-1,2],[270,7,-1,2],[270,9,1,2],[270,13,-1,2],[270,18,1,2],[270,28,-1,2],[270,30,1,2],[270,34,-1,2],[270,39,1,2],[270,51,-1,2],[270,52,-1,2],[270,58,1,2],[270,59,1,2],[270,65,-1,2],[270,66,-1,2],[270,74,1,2],[270,75,1,2],[271,4,1,2],[271,5,1,2],[271,8,-1,2],[271,13,-1,2],[271,29,-1,2],[271,34,-1,2],[271,51,-1,2],[271,52,-1,2],[271,53,-1,2],[271,81,1,2],[271,82,1,2],[271,83,1,2],[271,86,1,2],[271,92,1,2],[271,111,-1,2],[271,112,-1,2],[272,8,1,2],[272,14,-1,2],[272,30,-1,2],[272,34,-1,2],[273,7,-1,2],[273,8,1,2],[273,14,-1,2],[273,18,1,2],[273,28,-1,2],[273,29,1,2],[273,35,-1,2],[273,39,1,2],[273,51,-1,2],[273,52,-1,2],[273,55,1,2],[273,56,1,2],[273,68,-1,2],[273,69,-1,2],[273,74,1,2],[273,75,1,2],[274,4,1,2],[274,5,1,2],[274,9,-1,2],[274,14,-1,2],[274,30,-1,2],[274,35,-1,2],[274,51,-1,2],[274,52,-1,2],[274,78,1,2],[274,79,1,2],[274,83,1,2],[274,114,-1,2],[274,115,-1,2],[275,11,1,2],[275,15,-1,2],[275,31,-1,2],[275,37,-1,2],[276,7,1,2],[276,11,1,2],[276,15,-1,2],[276,25,-1,2],[276,28,1,2],[276,32,1,2],[276,36,-1,2],[276,46,-1,2],[276,49,1,2],[276,50,1,2],[276,56,1,2],[276,59,1,2],[276,65,-1,2],[276,68,-1,2],[276,77,-1,2],[276,80,-1,2],[277,2,-1,2],[277,3,-1,2],[277,6,-1,2],[277,10,-1,2],[277,15,-1,2],[277,31,-1,2],[277,36,-1,2],[277,53,1,2],[277,76,1,2],[277,79,1,2],[277,82,1,2],[277,85,-1,2],[277,86,-1,2],[277,92,-1,2],[277,93,-1,2],[277,111,1,2],[277,114,1,2],[278,10,1,2],[278,16,-1,2],[278,32,-1,2],[278,36,-1,2],[279,7,-1,2],[279,10,1,2],[279,16,-1,2],[279,25,1,2],[279,28,-1,2],[279,31,1,2],[279,37,-1,2],[279,46,1,2],[279,49,-1,2],[279,50,-1,2],[279,55,1,2],[279,58,1,2],[279,66,-1,2],[279,69,-1,2],[279,77,1,2],[279,80,1,2],[280,2,-1,2],[280,3,-1,2],[280,11,-1,2],[280,16,-1,2],[280,32,-1,2],[280,37,-1,2],[280,76,1,2],[280,78,1,2],[280,81,1,2],[280,112,1,2],[280,115,1,2],[281,6,1,2],[281,17,-1,2],[281,33,1,2],[281,53,-1,2],[282,17,-1,2],[282,33,-1,2],[282,85,1,2],[282,93,1,2],[283,7,1,1],[283,18,-1,1],[283,25,1,1],[283,84,1,1],[283,98,-1,1],[284,18,-1,1],[284,39,-1,1],[285,19,-1,1],[285,41,-1,1],[286,19,-1,1],[286,43,-1,1],[287,0,-1,1],[287,1,-1,1],[287,19,-1,1],[287,20,-1,1],[287,22,-1,1],[287,23,-1,1],[287,33,1,1],[287,38,1,1],[287,53,1,1],[287,76,1,1],[287,78,1,1],[287,79,1,1],[287,81,1,1],[287,82,1,1],[287,83,1,1],[287,85,-1,1],[287,86,-1,1],[287,104,-1,1],[287,109,-1,1],[288,0,-1,2],[288,1,-1,2],[288,19,-1,2],[288,20,-1,2],[288,40,-1,2],[288,41,-1,2],[288,60,1,2],[288,61,1,2],[288,70,1,2],[288,71,1,2],[288,89,-1,2],[288,90,-1,2],[288,96,-1,2],[288,97,-1,2],[288,100,1,2],[288,105,1,2],[289,19,-1,2],[289,21,-1,2],[289,22,-1,2],[289,24,-1,2],[289,40,-1,2],[289,42,-1,2],[289,43,-1,2],[289,45,-1,2],[289,61,1,2],[289,63,1,2],[289,71,1,2],[289,73,1,2],[289,102,1,2],[289,104,1,2],[289,107,1,2],[289,109,1,2],[290,21,-1,1],[290,45,-1,1],[290,87,1,1],[290,95,-1,1],[291,21,-1,1],[291,24,-1,1],[291,26,-1,1],[291,27,-1,1],[291,57,-1,1],[291,60,-1,1],[291,62,-1,1],[291,63,-1,1],[291,87,-1,1],[291,88,-1,1],[291,89,-1,1],[291,90,-1,1],[291,100,-1,1],[291,101,-1,1],[291,102,-1,1],[291,103,-1,1],[292,19,-1,2],[292,20,1,2],[292,22,-1,2],[292,23,1,2],[292,40,-1,2],[292,41,1,2],[292,43,-1,2],[292,44,1,2],[292,55,-1,2],[292,56,1,2],[292,58,-1,2],[292,59,1,2],[292,65,-1,2],[292,66,1,2],[292,68,-1,2],[292,69,1,2],[293,0,-1,2],[293,1,-1,2],[293,19,-1,2],[293,22,-1,2],[293,40,-1,2],[293,43,-1,2],[293,54,1,2],[293,63,1,2],[293,64,1,2],[293,73,1,2],[293,87,-1,2],[293,88,-1,2],[293,94,-1,2],[293,95,-1,2],[293,102,1,2],[293,107,1,2],[294,22,-1,1],[294,44,-1,1],[295,19,1,2],[295,23,-1,2],[295,41,1,2],[295,43,1,2],[296,0,-1,2],[296,1,-1,2],[296,20,-1,2],[296,23,-1,2],[296,41,-1,2],[296,44,-1,2],[296,54,1,2],[296,62,1,2],[296,64,1,2],[296,72,1,2],[296,87,-1,2],[296,88,-1,2],[296,94,-1,2],[296,95,-1,2],[296,103,1,2],[296,108,1,2],[297,0,-1,2],[297,1,-1,2],[297,22,-1,2],[297,23,-1,2],[297,43,-1,2],[297,44,-1,2],[297,57,1,2],[297,61,1,2],[297,67,1,2],[297,71,1,2],[297,89,-1,2],[297,90,-1,2],[297,96,-1,2],[297,97,-1,2],[297,101,1,2],[297,106,1,2],[298,24,-1,2],[298,42,-1,2],[298,88,-1,2],[298,94,1,2],[299,21,1,2],[299,24,-1,2],[299,42,1,2],[299,45,-1,2],[300,18,-1,2],[300,25,-1,2],[300,28,1,2],[300,84,-1,2],[300,91,-1,2],[301,7,1,2],[301,25,-1,2],[301,28,1,2],[301,46,-1,2],[301,49,1,2],[301,50,1,2],[301,77,-1,2],[301,80,-1,2],[302,18,1,2],[302,20,1,2],[302,22,-1,2],[302,25,-1,2],[302,39,1,2],[302,41,1,2],[302,43,-1,2],[302,46,-1,2],[302,54,1,2],[302,56,1,2],[302,58,-1,2],[302,61,-1,2],[302,64,1,2],[302,66,1,2],[302,68,-1,2],[302,71,-1,2],[303,19,-1,2],[303,20,-1,2],[303,26,-1,2],[303,27,-1,2],[303,40,-1,2],[303,41,-1,2],[303,47,-1,2],[303,48,-1,2],[303,54,1,2],[303,60,1,2],[303,64,1,2],[303,70,1,2],[303,100,1,2],[303,104,1,2],[303,105,1,2],[303,109,1,2],[304,26,-1,1],[304,48,-1,1],[304,89,1,1],[304,97,-1,1],[305,21,-1,2],[305,26,-1,2],[305,42,-1,2],[305,47,-1,2],[305,57,-1,2],[305,62,-1,2],[305,67,-1,2],[305,72,-1,2],[305,87,1,2],[305,89,1,2],[305,94,1,2],[305,96,1,2],[305,100,1,2],[305,102,1,2],[305,105,1,2],[305,107,1,2],[306,27,-1,2],[306,47,-1,2],[306,90,-1,2],[306,96,1,2],[307,55,-1,1],[307,58,-1,1],[307,65,-1,1],[307,68,-1,1],[308,7,1,2],[308,28,-1,2],[309,28,-1,2],[309,84,1,2],[309,91,-1,2],[310,0,-1,2],[310,1,-1,2],[310,4,-1,2],[310,5,-1,2],[310,9,1,2],[310,14,1,2],[310,22,1,2],[310,23,1,2],[310,29,-1,2],[310,34,-1,2],[310,40,-1,2],[310,41,-1,2],[310,54,1,2],[310,64,1,2],[310,74,1,2],[310,75,1,2],[311,8,1,2],[311,9,1,2],[311,10,1,2],[311,11,1,2],[311,13,1,2],[311,14,1,2],[311,15,1,2],[311,16,1,2],[311,29,-1,2],[311,30,-1,2],[311,31,-1,2],[311,32,-1,2],[311,34,-1,2],[311,35,-1,2],[311,36,-1,2],[311,37,-1,2],[312,29,-1,1],[312,35,-1,1],[313,8,1,2],[313,14,1,2],[313,30,-1,2],[313,34,1,2],[314,14,1,2],[314,30,-1,2],[315,26,1,1],[315,27,1,1],[315,29,-1,1],[315,30,-1,1],[315,34,-1,1],[315,35,-1,1],[315,51,1,1],[315,52,1,1],[315,74,-1,1],[315,75,-1,1],[315,96,-1,1],[315,97,-1,1],[315,100,1,1],[315,101,1,1],[315,105,1,1],[315,106,1,1],[316,0,1,2],[316,1,1,2],[316,2,1,2],[316,3,1,2],[316,11,1,2],[316,16,1,2],[316,20,1,2],[316,23,1,2],[316,31,-1,2],[316,36,-1,2],[316,40,-1,2],[316,43,-1,2],[316,61,-1,2],[316,71,-1,2],[316,77,-1,2],[316,80,-1,2],[317,15,1,2],[317,16,1,2],[317,31,-1,2],[317,32,-1,2],[318,31,-1,1],[318,37,-1,1],[319,10,1,2],[319,16,1,2],[319,32,-1,2],[319,36,1,2],[320,16,1,2],[320,32,-1,2],[321,21,1,1],[321,24,1,1],[321,31,-1,1],[321,32,-1,1],[321,36,-1,1],[321,37,-1,1],[321,49,1,1],[321,50,1,1],[321,77,-1,1],[321,80,-1,1],[321,94,-1,1],[321,95,-1,1],[321,102,1,1],[321,103,1,1],[321,107,1,1],[321,108,1,1],[322,6,1,2],[322,17,1,2],[322,33,-1,2],[322,53,-1,2],[323,12,1,2],[323,17,1,2],[323,33,-1,2],[323,38,-1,2],[323,85,1,2],[323,86,1,2],[323,92,-1,2],[323,93,-1,2],[324,8,1,2],[324,9,1,2],[324,10,1,2],[324,11,1,2],[324,34,-1,2],[324,35,-1,2],[324,36,-1,2],[324,37,-1,2],[325,30,1,2],[325,34,-1,2],[326,9,-1,2],[326,13,1,2],[326,29,-1,2],[326,35,-1,2],[327,9,1,2],[327,35,-1,2],[328,29,1,2],[328,35,-1,2],[329,10,1,2],[329,11,1,2],[329,36,-1,2],[329,37,-1,2],[330,32,1,2],[330,36,-1,2],[331,11,-1,2],[331,15,1,2],[331,31,-1,2],[331,37,-1,2],[332,11,1,2],[332,37,-1,2],[333,31,1,2],[333,37,-1,2],[334,12,-1,2],[334,38,-1,2],[334,86,-1,2],[334,92,-1,2],[335,38,-1,1],[335,53,-1,1],[335,86,1,1],[336,18,1,2],[336,39,-1,2],[337,28,1,1],[337,39,-1,1],[337,46,1,1],[337,84,-1,1],[337,91,-1,1],[338,20,1,2],[338,22,-1,2],[338,40,-1,2],[338,44,-1,2],[339,20,1,2],[339,23,1,2],[339,40,-1,2],[339,43,-1,2],[340,22,1,2],[340,23,1,2],[340,40,-1,2],[340,41,-1,2],[341,19,1,2],[341,23,-1,2],[341,41,-1,2],[341,43,-1,2],[342,19,1,2],[342,22,1,2],[342,41,-1,2],[342,44,-1,2],[343,23,1,2],[343,41,-1,2],[344,24,1,2],[344,42,-1,2],[344,88,1,2],[344,94,1,2],[345,42,-1,1],[345,45,-1,1],[345,87,1,1],[345,88,1,1],[346,19,1,2],[346,20,1,2],[346,43,-1,2],[346,44,-1,2],[347,23,1,2],[347,43,-1,2],[348,20,-1,2],[348,22,-1,2],[348,40,1,2],[348,44,-1,2],[349,20,1,2],[349,44,-1,2],[350,22,1,2],[350,44,-1,2],[351,21,1,2],[351,45,-1,2],[351,88,1,2],[351,94,-1,2],[352,25,1,2],[352,46,-1,2],[353,7,1,2],[353,39,-1,2],[353,46,-1,2],[353,84,1,2],[353,98,-1,2],[354,27,1,2],[354,47,-1,2],[354,90,1,2],[354,96,1,2],[356,26,1,2],[356,48,-1,2],[356,90,1,2],[356,96,-1,2],[357,2,-1,2],[357,49,-1,2],[357,80,1,2],[357,110,-1,2],[357,113,-1,2],[358,2,-1,1],[358,3,-1,1],[358,6,-1,1],[358,10,1,1],[358,15,1,1],[358,31,1,1],[358,36,1,1],[358,53,1,1],[358,76,-1,1],[358,79,-1,1],[358,82,-1,1],[358,85,-1,1],[358,86,-1,1],[358,92,-1,1],[358,93,-1,1],[358,111,-1,1],[358,114,-1,1],[359,3,-1,2],[359,50,-1,2],[359,77,1,2],[359,110,1,2],[359,116,-1,2],[360,49,1,2],[360,50,-1,2],[361,4,-1,2],[361,51,-1,2],[361,75,1,2],[361,117,-1,2],[361,118,-1,2],[362,51,-1,1],[362,52,-1,1],[362,74,1,1],[362,75,1,1],[363,5,-1,2],[363,52,-1,2],[363,74,1,2],[363,117,1,2],[363,119,-1,2],[364,51,1,2],[364,52,-1,2],[365,12,1,1],[365,53,-1,1],[366,33,1,2],[366,53,-1,2],[367,2,-1,1],[367,3,-1,1],[367,11,1,1],[367,16,1,1],[367,32,1,1],[367,37,1,1],[367,76,-1,1],[367,78,-1,1],[367,81,-1,1],[367,112,-1,1],[367,115,-1,1],[368,0,1,1],[368,54,-1,1],[368,61,1,1],[368,99,1,1],[368,109,-1,1],[369,54,-1,1],[369,64,-1,1],[370,0,-1,1],[370,54,-1,1],[370,71,1,1],[370,99,-1,1],[370,104,-1,1],[371,55,-1,1],[371,59,-1,1],[372,55,-1,1],[372,68,-1,1],[373,18,1,1],[373,24,1,1],[373,39,1,1],[373,45,1,1],[373,55,-1,1],[373,56,-1,1],[373,62,-1,1],[373,63,-1,1],[373,65,-1,1],[373,66,-1,1],[373,72,-1,1],[373,73,-1,1],[373,87,1,1],[373,91,1,1],[373,94,1,1],[373,98,1,1],[374,6,1,1],[374,7,1,1],[374,17,1,1],[374,28,1,1],[374,38,1,1],[374,55,-1,1],[374,56,-1,1],[374,58,-1,1],[374,59,-1,1],[374,76,-1,1],[374,78,-1,1],[374,79,-1,1],[374,81,-1,1],[374,82,-1,1],[374,83,-1,1],[374,85,1,1],[374,91,1,1],[374,92,1,1],[374,98,1,1],[375,25,1,2],[375,27,-1,2],[375,46,1,2],[375,48,-1,2],[375,55,1,2],[375,57,-1,2],[375,58,1,2],[375,60,-1,2],[375,65,1,2],[375,67,-1,2],[375,68,1,2],[375,70,-1,2],[375,89,-1,2],[375,91,1,2],[375,96,-1,2],[375,98,1,2],[376,57,-1,1],[376,70,-1,1],[376,100,1,1],[376,106,-1,1],[377,57,-1,1],[377,67,-1,1],[377,100,1,1],[377,105,1,1],[378,56,1,2],[378,58,-1,2],[378,65,-1,2],[378,69,-1,2],[379,56,1,2],[379,58,-1,2],[379,66,1,2],[379,68,-1,2],[380,25,1,1],[380,27,1,1],[380,46,1,1],[380,48,1,1],[380,55,-1,1],[380,57,-1,1],[380,58,-1,1],[380,60,-1,1],[380,65,-1,1],[380,67,-1,1],[380,68,-1,1],[380,70,-1,1],[380,89,1,1],[380,91,1,1],[380,96,1,1],[380,98,1,1],[381,55,1,2],[381,59,-1,2],[381,66,-1,2],[381,68,-1,2],[382,55,1,2],[382,59,-1,2],[382,65,1,2],[382,69,-1,2],[383,25,1,1],[383,26,1,1],[383,46,1,1],[383,47,1,1],[383,56,-1,1],[383,57,-1,1],[383,59,-1,1],[383,60,-1,1],[383,66,-1,1],[383,67,-1,1],[383,69,-1,1],[383,70,-1,1],[383,90,1,1],[383,91,1,1],[383,97,1,1],[383,98,1,1],[384,60,-1,2],[384,67,-1,2],[384,101,-1,2],[384,105,1,2],[385,19,-1,1],[385,20,-1,1],[385,40,-1,1],[385,41,-1,1],[386,1,1,2],[386,54,-1,2],[386,61,-1,2],[386,99,-1,2],[386,104,-1,2],[387,0,1,2],[387,1,1,2],[387,2,1,2],[387,3,1,2],[387,61,-1,2],[387,71,-1,2],[387,77,-1,2],[387,80,-1,2],[388,0,-1,1],[388,61,-1,1],[388,64,1,1],[388,99,-1,1],[388,104,-1,1],[389,18,1,2],[389,24,-1,2],[389,39,1,2],[389,45,-1,2],[389,55,1,2],[389,56,1,2],[389,62,-1,2],[389,63,-1,2],[389,65,1,2],[389,66,1,2],[389,72,-1,2],[389,73,-1,2],[389,87,-1,2],[389,91,1,2],[389,94,-1,2],[389,98,1,2],[390,62,-1,1],[390,73,-1,1],[390,102,1,1],[390,108,-1,1],[391,62,-1,1],[391,63,-1,1],[391,102,-1,1],[391,103,-1,1],[392,63,-1,2],[392,72,-1,2],[392,103,-1,2],[392,107,1,2],[393,62,1,2],[393,63,-1,2],[393,72,1,2],[393,73,-1,2],[394,54,1,2],[394,64,-1,2],[395,1,1,1],[395,64,-1,1],[395,71,1,1],[395,99,-1,1],[395,104,-1,1],[396,56,1,2],[396,59,1,2],[396,65,-1,2],[396,68,-1,2],[397,58,1,2],[397,59,1,2],[397,65,-1,2],[397,66,-1,2],[398,65,-1,1],[398,69,-1,1],[399,55,1,2],[399,59,1,2],[399,66,-1,2],[399,68,1,2],[400,59,1,2],[400,66,-1,2],[401,6,1,1],[401,7,1,1],[401,12,1,1],[401,28,1,1],[401,33,1,1],[401,65,-1,1],[401,66,-1,1],[401,68,-1,1],[401,69,-1,1],[401,76,-1,1],[401,78,-1,1],[401,79,-1,1],[401,81,-1,1],[401,82,-1,1],[401,83,-1,1],[401,86,1,1],[401,91,1,1],[401,93,1,1],[401,98,1,1],[402,60,1,2],[402,67,-1,2],[402,101,1,2],[402,105,1,2],[404,55,1,2],[404,56,1,2],[404,68,-1,2],[404,69,-1,2],[405,66,1,2],[405,68,-1,2],[406,56,-1,2],[406,58,1,2],[406,65,-1,2],[406,69,-1,2],[407,56,1,2],[407,69,-1,2],[408,65,1,2],[408,69,-1,2],[409,57,1,2],[409,70,-1,2],[409,101,1,2],[409,105,-1,2],[410,61,1,2],[410,71,-1,2],[411,0,1,2],[411,64,-1,2],[411,71,-1,2],[411,99,1,2],[411,109,-1,2],[412,63,1,2],[412,72,-1,2],[412,103,1,2],[412,107,1,2],[413,72,-1,1],[413,73,-1,1],[413,102,1,1],[413,103,1,1],[414,62,1,2],[414,73,-1,2],[414,103,1,2],[414,107,-1,2],[415,4,1,2],[415,5,1,2],[415,74,-1,2],[415,75,-1,2],[416,74,-1,2],[416,117,-1,2],[416,119,-1,2],[417,74,1,2],[417,75,-1,2],[418,75,-1,2],[418,117,1,2],[418,118,-1,2],[419,76,-1,1],[419,78,1,1],[419,82,-1,1],[419,83,1,1],[420,17,1,2],[420,21,-1,2],[420,38,1,2],[420,42,-1,2],[420,53,1,2],[420,72,1,2],[420,73,1,2],[420,76,-1,1],[420,78,-1,1],[420,79,-1,1],[420,86,-1,2],[420,87,1,2],[420,93,-1,2],[420,94,1,2],[420,107,1,2],[420,108,1,2],[420,111,-1,1],[420,112,-1,1],[421,76,-1,1],[421,111,-1,1],[421,115,-1,1],[422,2,1,2],[422,3,1,2],[422,77,-1,2],[422,80,-1,2],[423,77,-1,2],[423,110,-1,2],[423,116,-1,2],[424,78,-1,1],[424,79,1,1],[424,81,-1,1],[424,82,1,1],[424,111,1,1],[424,112,-1,1],[424,114,1,1],[424,115,-1,1],[425,6,1,2],[425,33,1,2],[425,38,1,2],[425,42,1,2],[425,45,1,2],[425,62,1,2],[425,72,1,2],[425,81,1,1],[425,92,1,2],[425,93,1,2],[425,94,1,2],[425,95,1,2],[425,102,-1,2],[425,107,-1,2],[425,111,-1,1],[426,76,1,2],[426,79,-1,2],[426,81,1,2],[426,83,-1,2],[427,79,-1,2],[427,81,-1,2],[427,111,1,2],[427,115,1,2],[428,77,1,2],[428,80,-1,2],[429,80,-1,2],[429,110,1,2],[429,113,-1,2],[430,76,1,2],[430,79,1,2],[430,81,-1,2],[430,83,-1,2],[431,78,1,2],[431,79,1,2],[431,81,-1,2],[431,82,-1,2],[431,111,1,2],[431,112,1,2],[431,114,-1,2],[431,115,-1,2],[432,78,-1,2],[432,82,-1,2],[432,112,-1,2],[432,114,-1,2],[433,81,1,2],[433,83,-1,2],[434,82,1,1],[434,83,-1,1],[435,76,1,1],[435,83,-1,1],[435,111,1,1],[435,112,1,1],[435,114,1,1],[435,115,1,1],[436,7,1,2],[436,84,-1,2],[437,28,-1,2],[437,84,-1,2],[438,17,-1,2],[438,33,-1,2],[438,85,-1,2],[438,93,-1,2],[439,6,-1,2],[439,12,-1,2],[439,38,-1,2],[439,53,-1,2],[439,85,-1,2],[439,93,1,2],[440,12,1,2],[440,38,1,2],[440,86,-1,2],[440,92,-1,2],[441,6,-1,2],[441,17,-1,2],[441,33,-1,2],[441,53,-1,2],[441,86,-1,2],[441,92,1,2],[442,21,1,2],[442,45,-1,2],[442,87,-1,2],[442,95,-1,2],[443,87,-1,1],[443,88,-1,1],[444,24,1,2],[444,42,-1,2],[444,88,-1,2],[444,94,-1,2],[445,88,-1,1],[445,95,-1,1],[446,26,1,2],[446,48,-1,2],[446,89,-1,2],[446,97,-1,2],[447,12,-1,2],[447,26,-1,2],[447,33,-1,2],[447,47,-1,2],[447,53,-1,2],[447,57,-1,2],[447,60,-1,2],[447,78,-1,2],[447,81,-1,2],[447,83,-1,2],[447,85,1,2],[447,92,1,2],[447,100,-1,2],[447,101,-1,2],[447,111,1,2],[447,114,1,2],[448,27,1,2],[448,47,-1,2],[448,90,-1,2],[448,96,-1,2],[449,90,-1,1],[449,97,-1,1],[450,91,-1,1],[450,98,-1,1],[451,0,-1,1],[451,18,-1,1],[451,19,-1,1],[451,20,-1,1],[451,22,-1,1],[451,23,-1,1],[451,25,-1,1],[451,28,2,1],[451,64,1,1],[451,65,1,1],[451,66,1,1],[451,68,1,1],[451,69,1,1],[451,71,1,1],[451,84,-2,1],[451,91,-2,1],[451,99,-1,1],[451,109,1,1],[452,38,1,2],[452,92,-1,2],[453,6,-1,2],[453,85,-1,2],[453,86,-1,2],[453,92,-1,2],[453,93,-1,2],[454,17,-1,2],[454,93,-1,2],[455,85,-1,2],[455,93,-1,2],[456,24,-1,2],[456,42,-1,2],[456,88,1,2],[456,94,-1,2],[457,94,-1,1],[457,95,-1,1],[458,87,1,2],[458,95,-1,2],[459,27,-1,2],[459,47,-1,2],[459,90,1,2],[459,96,-1,2],[460,96,-1,1],[460,97,-1,1],[461,89,1,2],[461,97,-1,2],[462,91,1,2],[462,98,-1,2],[463,7,1,2],[463,18,1,2],[463,25,-1,2],[463,84,1,2],[463,98,-1,2],[464,0,1,2],[464,99,-1,2],[465,1,-1,2],[465,99,-1,2],[466,57,1,2],[466,70,-1,2],[466,100,-1,2],[466,106,-1,2],[467,100,-1,1],[467,105,-1,1],[468,60,1,2],[468,67,-1,2],[468,101,-1,2],[468,105,-1,2],[469,101,-1,1],[469,106,-1,1],[470,62,1,2],[470,73,-1,2],[470,102,-1,2],[470,108,-1,2],[471,102,-1,1],[471,103,-1,1],[472,63,1,2],[472,72,-1,2],[472,103,-1,2],[472,107,-1,2],[473,103,-1,1],[473,108,-1,1],[474,104,-1,1],[474,109,-1,1],[475,1,1,1],[475,99,-1,1],[475,104,-1,1],[476,60,-1,2],[476,67,-1,2],[476,101,1,2],[476,105,-1,2],[477,105,-1,1],[477,106,-1,1],[478,100,1,2],[478,106,-1,2],[479,63,-1,2],[479,72,-1,2],[479,103,1,2],[479,107,-1,2],[480,107,-1,1],[480,108,-1,1],[481,102,1,2],[481,108,-1,2],[482,104,1,2],[482,109,-1,2],[483,0,1,2],[483,54,1,2],[483,61,-1,2],[483,99,1,2],[483,109,-1,2],[484,77,1,2],[484,110,-1,2],[485,80,-1,2],[485,110,-1,2],[486,79,-1,2],[486,81,-1,2],[486,111,-1,2],[486,115,-1,2],[487,76,-1,2],[487,78,-1,2],[487,82,-1,2],[487,83,-1,2],[487,111,-1,2],[487,115,1,2],[488,78,1,2],[488,82,1,2],[488,112,-1,2],[488,114,-1,2],[489,76,-1,2],[489,79,-1,2],[489,81,-1,2],[489,83,-1,2],[489,112,-1,2],[489,114,1,2],[490,113,-1,1],[490,116,-1,1],[491,2,-1,1],[491,5,-1,1],[491,8,-1,1],[491,11,-1,1],[491,13,-1,1],[491,16,-1,1],[491,29,-1,1],[491,32,-1,1],[491,34,-1,1],[491,37,-1,1],[491,49,-1,1],[491,52,-1,1],[491,74,1,1],[491,80,2,1],[491,110,-2,1],[491,113,-2,1],[491,117,1,1],[491,119,-1,1],[492,82,1,2],[492,114,-1,2],[493,76,-1,2],[493,111,-1,2],[493,112,-1,2],[493,114,-1,2],[493,115,-1,2],[494,79,-1,2],[494,115,-1,2],[495,111,-1,2],[495,115,-1,2],[496,113,1,2],[496,116,-1,2],[497,2,1,2],[497,49,-1,2],[497,77,1,2],[497,110,1,2],[497,116,-1,2],[498,74,1,2],[498,117,-1,2],[499,75,-1,2],[499,117,-1,2],[500,118,-1,1],[500,119,-1,1],[501,75,1,1],[501,117,-1,1],[501,118,-1,1],[502,118,1,2],[502,119,-1,2],[503,4,1,2],[503,51,-1,2],[503,74,1,2],[503,117,1,2],[503,119,-1,2],[504,0,-1,1],[504,1,-1,1],[504,2,-1,1],[504,3,-1,1],[504,4,-1,1],[504,5,-1,1],[504,7,-1,1],[504,8,-1,1],[504,9,-1,1],[504,10,-1,1],[504,11,-1,1],[504,13,-1,1],[504,14,-1,1],[504,15,-1,1],[504,16,-1,1],[504,18,-1,1],[504,19,-1,1],[504,20,-1,1],[504,22,-1,1],[504,23,-1,1],[504,25,-1,1],[504,33,1,1],[504,38,1,1],[504,42,1,1],[504,45,1,1],[504,47,1,1],[504,48,1,1],[504,53,1,1],[504,57,1,1],[504,60,1,1],[504,62,1,1],[504,63,1,1],[504,67,1,1],[504,70,1,1],[504,72,1,1],[504,73,1,1],[504,76,1,1],[504,78,1,1],[504,79,1,1],[504,81,1,1],[504,82,1,1],[504,83,1,1],[504,84,-1,1],[504,85,-1,1],[504,86,-1,1],[504,87,-1,1],[504,88,-1,1],[504,89,-1,1],[504,90,-1,1],[504,91,-2,1],[504,98,-1,1],[504,104,-1,1],[504,109,-1,1],[504,113,-1,1],[504,116,-1,1],[504,118,-1,1],[504,119,-1,1],[505,0,-1,1],[505,1,-1,1],[505,2,-1,1],[505,3,-1,1],[505,4,-1,1],[505,5,-1,1],[505,12,1,1],[505,17,1,1],[505,21,1,1],[505,24,1,1],[505,26,1,1],[505,27,1,1],[505,28,-1,1],[505,29,-1,1],[505,30,-1,1],[505,31,-1,1],[505,32,-1,1],[505,34,-1,1],[505,35,-1,1],[505,36,-1,1],[505,37,-1,1],[505,39,-1,1],[505,40,-1,1],[505,41,-1,1],[505,43,-1,1],[505,44,-1,1],[505,46,-1,1],[505,53,1,1],[505,57,1,1],[505,60,1,1],[505,62,1,1],[505,63,1,1],[505,67,1,1],[505,70,1,1],[505,72,1,1],[505,73,1,1],[505,76,1,1],[505,78,1,1],[505,79,1,1],[505,81,1,1],[505,82,1,1],[505,83,1,1],[505,84,1,1],[505,91,-1,1],[505,92,-1,1],[505,93,-1,1],[505,94,-1,1],[505,95,-1,1],[505,96,-1,1],[505,97,-1,1],[505,98,-2,1],[505,104,-1,1],[505,109,-1,1],[505,113,-1,1],[505,116,-1,1],[505,118,-1,1],[505,119,-1,1],[506,0,-1,1],[506,6,1,1],[506,7,-1,1],[506,8,-1,1],[506,9,-1,1],[506,10,-1,1],[506,11,-1,1],[506,17,1,1],[506,21,1,1],[506,24,1,1],[506,26,1,1],[506,27,1,1],[506,28,-1,1],[506,29,-1,1],[506,30,-1,1],[506,31,-1,1],[506,32,-1,1],[506,38,1,1],[506,42,1,1],[506,45,1,1],[506,47,1,1],[506,48,1,1],[506,49,-1,1],[506,50,-1,1],[506,51,-1,1],[506,52,-1,1],[506,54,-1,1],[506,55,-1,1],[506,56,-1,1],[506,58,-1,1],[506,59,-1,1],[506,61,-1,1],[506,67,1,1],[506,70,1,1],[506,72,1,1],[506,73,1,1],[506,76,1,1],[506,78,1,1],[506,79,1,1],[506,81,1,1],[506,82,1,1],[506,83,1,1],[506,85,1,1],[506,91,-1,1],[506,92,1,1],[506,98,-1,1],[506,99,-1,1],[506,100,-1,1],[506,101,-1,1],[506,102,-1,1],[506,103,-1,1],[506,104,-2,1],[506,109,-1,1],[506,113,-1,1],[506,116,-1,1],[506,118,-1,1],[506,119,-1,1],[507,1,-1,1],[507,6,1,1],[507,7,-1,1],[507,12,1,1],[507,13,-1,1],[507,14,-1,1],[507,15,-1,1],[507,16,-1,1],[507,21,1,1],[507,24,1,1],[507,26,1,1],[507,27,1,1],[507,28,-1,1],[507,33,1,1],[507,34,-1,1],[507,35,-1,1],[507,36,-1,1],[507,37,-1,1],[507,42,1,1],[507,45,1,1],[507,47,1,1],[507,48,1,1],[507,49,-1,1],[507,50,-1,1],[507,51,-1,1],[507,52,-1,1],[507,57,1,1],[507,60,1,1],[507,62,1,1],[507,63,1,1],[507,64,-1,1],[507,65,-1,1],[507,66,-1,1],[507,68,-1,1],[507,69,-1,1],[507,71,-1,1],[507,76,1,1],[507,78,1,1],[507,79,1,1],[507,81,1,1],[507,82,1,1],[507,83,1,1],[507,86,1,1],[507,91,-1,1],[507,93,1,1],[507,98,-1,1],[507,99,1,1],[507,104,-1,1],[507,105,-1,1],[507,106,-1,1],[507,107,-1,1],[507,108,-1,1],[507,109,-2,1],[507,113,-1,1],[507,116,-1,1],[507,118,-1,1],[507,119,-1,1],[508,2,-1,1],[508,6,1,1],[508,8,-1,1],[508,12,1,1],[508,13,-1,1],[508,17,1,1],[508,18,-1,1],[508,19,-1,1],[508,20,-1,1],[508,24,1,1],[508,26,1,1],[508,27,1,1],[508,29,-1,1],[508,33,1,1],[508,34,-1,1],[508,38,1,1],[508,39,-1,1],[508,40,-1,1],[508,41,-1,1],[508,45,1,1],[508,47,1,1],[508,48,1,1],[508,49,-1,1],[508,53,1,1],[508,54,-1,1],[508,55,-1,1],[508,56,-1,1],[508,60,1,1],[508,62,1,1],[508,63,1,1],[508,64,-1,1],[508,65,-1,1],[508,66,-1,1],[508,70,1,1],[508,72,1,1],[508,73,1,1],[508,74,-1,1],[508,75,-1,1],[508,77,-1,1],[508,81,1,1],[508,82,1,1],[508,83,1,1],[508,87,1,1],[508,91,-1,1],[508,94,1,1],[508,98,-1,1],[508,100,1,1],[508,104,-1,1],[508,105,1,1],[508,109,-1,1],[508,110,-1,1],[508,111,-1,1],[508,112,-1,1],[508,113,-2,1],[508,116,-1,1],[508,118,-1,1],[508,119,-1,1],[509,3,-1,1],[509,6,1,1],[509,9,-1,1],[509,12,1,1],[509,14,-1,1],[509,17,1,1],[509,18,-1,1],[509,21,1,1],[509,22,-1,1],[509,23,-1,1],[509,26,1,1],[509,27,1,1],[509,30,-1,1],[509,33,1,1],[509,35,-1,1],[509,38,1,1],[509,39,-1,1],[509,42,1,1],[509,43,-1,1],[509,44,-1,1],[509,47,1,1],[509,48,1,1],[509,50,-1,1],[509,53,1,1],[509,54,-1,1],[509,57,1,1],[509,58,-1,1],[509,59,-1,1],[509,62,1,1],[509,63,1,1],[509,64,-1,1],[509,67,1,1],[509,68,-1,1],[509,69,-1,1],[509,72,1,1],[509,73,1,1],[509,74,-1,1],[509,75,-1,1],[509,78,1,1],[509,79,1,1],[509,80,-1,1],[509,83,1,1],[509,88,1,1],[509,91,-1,1],[509,95,1,1],[509,98,-1,1],[509,101,1,1],[509,104,-1,1],[509,106,1,1],[509,109,-1,1],[509,110,1,1],[509,113,-1,1],[509,114,-1,1],[509,115,-1,1],[509,116,-2,1],[509,118,-1,1],[509,119,-1,1],[510,4,-1,1],[510,6,1,1],[510,10,-1,1],[510,12,1,1],[510,15,-1,1],[510,17,1,1],[510,19,-1,1],[510,21,1,1],[510,22,-1,1],[510,24,1,1],[510,25,-1,1],[510,27,1,1],[510,31,-1,1],[510,33,1,1],[510,36,-1,1],[510,38,1,1],[510,40,-1,1],[510,42,1,1],[510,43,-1,1],[510,45,1,1],[510,46,-1,1],[510,48,1,1],[510,51,-1,1],[510,53,1,1],[510,55,-1,1],[510,57,1,1],[510,58,-1,1],[510,60,1,1],[510,61,-1,1],[510,63,1,1],[510,65,-1,1],[510,67,1,1],[510,68,-1,1],[510,70,1,1],[510,71,-1,1],[510,73,1,1],[510,74,-1,1],[510,76,1,1],[510,77,-1,1],[510,79,1,1],[510,80,-1,1],[510,82,1,1],[510,89,1,1],[510,91,-1,1],[510,96,1,1],[510,98,-1,1],[510,102,1,1],[510,104,-1,1],[510,107,1,1],[510,109,-1,1],[510,111,1,1],[510,113,-1,1],[510,114,1,1],[510,116,-1,1],[510,117,-1,1],[510,118,-2,1],[510,119,-1,1],[511,5,-1,1],[511,6,1,1],[511,11,-1,1],[511,12,1,1],[511,16,-1,1],[511,17,1,1],[511,20,-1,1],[511,21,1,1],[511,23,-1,1],[511,24,1,1],[511,25,-1,1],[511,26,1,1],[511,32,-1,1],[511,33,1,1],[511,37,-1,1],[511,38,1,1],[511,41,-1,1],[511,42,1,1],[511,44,-1,1],[511,45,1,1],[511,46,-1,1],[511,47,1,1],[511,52,-1,1],[511,53,1,1],[511,56,-1,1],[511,57,1,1],[511,59,-1,1],[511,60,1,1],[511,61,-1,1],[511,62,1,1],[511,66,-1,1],[511,67,1,1],[511,69,-1,1],[511,70,1,1],[511,71,-1,1],[511,72,1,1],[511,75,-1,1],[511,76,1,1],[511,77,-1,1],[511,78,1,1],[511,80,-1,1],[511,81,1,1],[511,90,1,1],[511,91,-1,1],[511,97,1,1],[511,98,-1,1],[511,103,1,1],[511,104,-1,1],[511,108,1,1],[511,109,-1,1],[511,112,1,1],[511,113,-1,1],[511,115,1,1],[511,116,-1,1],[511,117,1,1],[511,118,-1,1],[511,119,-2,1],[512,0,-1,1],[512,1,-1,1],[512,61,-1,1],[512,71,-1,1],[513,0,-1,1],[513,1,-1,1],[513,104,-1,1],[513,109,-1,1],[514,2,-1,1],[514,3,-1,1],[514,77,-1,1],[514,80,-1,1],[515,2,-1,1],[515,3,-1,1],[515,113,-1,1],[515,116,-1,1],[516,4,-1,1],[516,5,-1,1],[516,118,-1,1],[516,119,-1,1],[517,6,-1,2],[517,10,-1,2],[517,12,-1,2],[517,15,-1,2],[517,17,-1,2],[517,31,-1,2],[517,33,-1,2],[517,36,-1,2],[517,38,-1,2],[517,53,-1,2],[517,76,1,2],[517,77,1,2],[517,79,1,2],[517,80,1,2],[517,82,1,2],[517,111,1,2],[517,113,1,2],[517,114,1,2],[517,116,1,2],[518,20,-1,2],[518,22,-1,2],[518,40,-1,2],[518,44,1,2],[519,20,-1,1],[519,22,1,1],[519,40,-1,1],[519,44,-1,1],[520,19,-1,1],[520,23,-1,1],[520,41,1,1],[520,43,-1,1],[521,19,-1,2],[521,20,-1,2],[521,22,1,2],[521,23,1,2],[521,40,-1,2],[521,41,-1,2],[521,43,1,2],[521,44,1,2],[521,55,-1,2],[521,56,-1,2],[521,58,1,2],[521,59,1,2],[521,65,-1,2],[521,66,-1,2],[521,68,1,2],[521,69,1,2],[522,18,-1,1],[522,25,-1,1],[523,26,-1,1],[523,27,-1,1],[523,96,1,1],[523,97,1,1],[524,7,-1,1],[524,25,-1,1],[524,28,-1,1],[524,46,-1,1],[525,0,-1,2],[525,1,-1,2],[525,7,-1,2],[525,20,-1,2],[525,22,1,2],[525,28,-1,2],[525,41,-1,2],[525,43,1,2],[525,56,-1,2],[525,58,1,2],[525,66,-1,2],[525,68,1,2],[525,91,-1,2],[525,98,-1,2],[525,104,-1,2],[525,109,-1,2],[526,9,-1,2],[526,13,-1,2],[526,29,-1,2],[526,35,1,2],[527,9,-1,1],[527,13,-1,1],[527,29,1,1],[527,35,-1,1],[528,8,-1,1],[528,14,1,1],[528,30,-1,1],[528,34,-1,1],[529,0,1,1],[529,1,1,1],[529,4,1,1],[529,5,1,1],[529,8,-1,1],[529,13,-1,1],[529,19,-1,1],[529,20,-1,1],[529,30,1,1],[529,35,1,1],[529,43,1,1],[529,44,1,1],[529,54,-1,1],[529,64,-1,1],[529,74,-1,1],[529,75,-1,1],[530,11,-1,2],[530,15,-1,2],[530,31,-1,2],[530,37,1,2],[531,11,-1,1],[531,15,-1,1],[531,31,1,1],[531,37,-1,1],[532,10,-1,1],[532,16,1,1],[532,32,-1,1],[532,36,-1,1],[533,0,1,1],[533,1,1,1],[533,2,1,1],[533,3,1,1],[533,10,-1,1],[533,15,-1,1],[533,19,-1,1],[533,22,-1,1],[533,32,1,1],[533,37,1,1],[533,41,1,1],[533,44,1,1],[533,61,-1,1],[533,71,-1,1],[533,77,-1,1],[533,80,-1,1],[534,4,1,2],[534,5,1,2],[534,13,-1,2],[534,14,-1,2],[534,34,-1,2],[534,35,-1,2],[534,62,1,2],[534,63,1,2],[534,74,-1,2],[534,75,-1,2],[534,87,1,2],[534,88,1,2],[534,94,1,2],[534,95,1,2],[534,107,-1,2],[534,108,-1,2],[535,8,-1,2],[535,14,-1,2],[535,30,-1,2],[535,34,1,2],[536,13,-1,1],[536,35,-1,1],[537,13,-1,1],[537,35,1,1],[538,2,1,2],[538,3,1,2],[538,15,-1,2],[538,16,-1,2],[538,36,-1,2],[538,37,-1,2],[538,57,1,2],[538,60,1,2],[538,77,-1,2],[538,80,-1,2],[538,89,1,2],[538,90,1,2],[538,96,1,2],[538,97,1,2],[538,105,-1,2],[538,106,-1,2],[539,10,-1,2],[539,16,-1,2],[539,32,-1,2],[539,36,1,2],[540,15,-1,1],[540,37,-1,1],[541,10,-1,1],[541,15,-2,1],[541,26,-1,1],[541,32,1,1],[541,37,2,1],[541,48,1,1],[541,90,-1,1],[541,96,1,1],[542,6,-1,1],[542,12,-1,1],[542,38,-1,1],[542,53,-1,1],[542,85,1,1],[542,93,-1,1],[543,18,-1,1],[543,39,-1,1],[543,91,-1,1],[543,98,-1,1],[544,21,-1,1],[544,26,1,1],[544,42,-1,1],[544,47,1,1],[544,57,-1,1],[544,62,1,1],[544,67,-1,1],[544,72,1,1],[544,87,1,1],[544,89,-1,1],[544,94,1,1],[544,96,-1,1],[544,100,1,1],[544,102,-1,1],[544,105,1,1],[544,107,-1,1],[545,21,-1,1],[545,42,-1,1],[545,88,-1,1],[545,95,-1,1],[546,24,-1,1],[546,42,1,1],[546,87,-1,1],[546,95,1,1],[547,0,-1,1],[547,1,-1,1],[547,12,1,1],[547,17,1,1],[547,40,-1,1],[547,41,-1,1],[547,43,-1,1],[547,44,-1,1],[547,53,1,1],[547,76,1,1],[547,78,1,1],[547,79,1,1],[547,81,1,1],[547,82,1,1],[547,83,1,1],[547,92,-1,1],[547,93,-1,1],[547,104,-1,1],[547,109,-1,1],[548,19,-1,2],[548,23,-1,2],[548,41,-1,2],[548,43,1,2],[549,40,-1,1],[549,44,-1,1],[550,0,1,1],[550,1,1,1],[550,7,1,1],[550,19,-1,1],[550,23,1,1],[550,28,1,1],[550,40,-2,1],[550,44,2,1],[550,55,-1,1],[550,59,1,1],[550,65,-1,1],[550,69,1,1],[550,91,1,1],[550,98,1,1],[550,104,1,1],[550,109,1,1],[551,21,-1,1],[551,45,1,1],[551,87,-1,1],[551,95,-1,1],[552,24,-1,1],[552,45,-1,1],[552,87,-1,1],[552,94,-1,1],[553,24,-1,1],[553,26,1,1],[553,45,-1,1],[553,47,1,1],[553,60,-1,1],[553,62,1,1],[553,70,-1,1],[553,72,1,1],[553,88,1,1],[553,89,-1,1],[553,95,1,1],[553,96,-1,1],[553,101,1,1],[553,102,-1,1],[553,106,1,1],[553,107,-1,1],[554,25,-1,1],[554,46,-1,1],[554,91,-1,1],[554,98,-1,1],[555,39,-1,1],[555,46,-1,1],[556,27,-1,1],[556,47,1,1],[556,89,-1,1],[556,97,1,1],[557,26,-1,1],[557,48,1,1],[557,89,-1,1],[557,97,-1,1],[558,8,-1,1],[558,9,-1,1],[558,13,-1,1],[558,14,-1,1],[559,47,-1,1],[559,48,-1,1],[559,96,-1,1],[559,97,-1,1],[560,2,-1,1],[560,49,-1,1],[561,3,-1,1],[561,50,-1,1],[562,49,-1,1],[562,50,-1,1],[562,77,1,1],[562,80,1,1],[563,49,-1,1],[563,50,-1,1],[563,113,-1,1],[563,116,-1,1],[564,4,-1,1],[564,51,-1,1],[565,5,-1,1],[565,52,-1,1],[566,51,-1,1],[566,52,-1,1],[566,118,-1,1],[566,119,-1,1],[567,21,1,1],[567,33,1,1],[567,42,1,1],[567,62,1,1],[567,63,1,1],[567,76,1,1],[567,78,1,1],[567,79,1,1],[567,85,-1,1],[567,87,-1,1],[567,94,-1,1],[567,102,1,1],[567,103,1,1],[567,111,1,1],[567,112,1,1],[568,6,1,2],[568,12,-1,2],[568,38,1,2],[568,53,-1,2],[569,21,1,2],[569,24,1,2],[569,26,1,2],[569,27,1,2],[569,57,-1,2],[569,60,-1,2],[569,62,-1,2],[569,63,-1,2],[569,87,1,2],[569,88,1,2],[569,89,1,2],[569,90,1,2],[569,100,-1,2],[569,101,-1,2],[569,102,-1,2],[569,103,-1,2],[570,57,-1,1],[570,60,-1,1],[570,105,1,1],[570,106,1,1],[571,54,-1,1],[571,61,-1,1],[572,54,-1,1],[572,64,-1,1],[572,104,-1,1],[572,109,-1,1],[573,56,-1,2],[573,58,-1,2],[573,65,-1,2],[573,69,1,2],[574,56,-1,1],[574,58,-1,1],[574,65,1,1],[574,69,-1,1],[575,55,-1,1],[575,59,1,1],[575,66,-1,1],[575,68,-1,1],[576,55,-1,1],[576,58,-1,1],[576,66,1,1],[576,69,1,1],[577,60,-1,1],[577,67,1,1],[577,100,-1,1],[577,106,1,1],[578,18,1,1],[578,21,1,1],[578,39,1,1],[578,42,1,1],[578,58,-1,1],[578,59,-1,1],[578,62,-1,1],[578,63,-1,1],[578,68,-1,1],[578,69,-1,1],[578,72,-1,1],[578,73,-1,1],[578,88,1,1],[578,91,1,1],[578,95,1,1],[578,98,1,1],[579,55,-1,2],[579,59,-1,2],[579,66,-1,2],[579,68,1,2],[580,58,-1,1],[580,69,-1,1],[581,18,-1,2],[581,21,-1,2],[581,24,-1,2],[581,28,1,2],[581,46,1,2],[581,55,-1,2],[581,58,-1,1],[581,62,-1,2],[581,66,1,2],[581,69,1,1],[581,73,1,2],[581,84,-1,2],[581,94,1,2],[581,95,1,2],[581,98,1,2],[581,103,-1,2],[581,107,1,2],[582,57,-1,1],[582,70,1,1],[582,100,-1,1],[582,106,-1,1],[583,10,-1,1],[583,11,-1,1],[583,31,-1,1],[583,32,-1,1],[584,21,1,2],[584,24,1,2],[584,26,1,2],[584,27,1,2],[584,67,-1,2],[584,70,-1,2],[584,72,-1,2],[584,73,-1,2],[584,87,1,2],[584,88,1,2],[584,89,1,2],[584,90,1,2],[584,105,-1,2],[584,106,-1,2],[584,107,-1,2],[584,108,-1,2],[585,61,-1,1],[585,71,-1,1],[585,104,-1,1],[585,109,-1,1],[586,64,-1,1],[586,71,-1,1],[587,62,-1,1],[587,72,-1,1],[587,102,1,1],[587,107,1,1],[588,62,-1,1],[588,72,-1,1],[588,103,-1,1],[588,108,-1,1],[589,63,-1,1],[589,72,1,1],[589,102,-1,1],[589,108,1,1],[590,62,-1,1],[590,73,1,1],[590,102,-1,1],[590,108,-1,1],[591,63,-1,1],[591,73,-1,1],[591,102,-1,1],[591,107,-1,1],[592,63,-1,1],[592,73,-1,1],[592,103,1,1],[592,108,1,1],[593,8,1,2],[593,9,1,2],[593,10,1,2],[593,11,1,2],[593,34,-1,2],[593,35,-1,2],[593,36,-1,2],[593,37,-1,2],[593,74,-1,1],[593,75,-1,1],[593,77,-1,2],[593,80,-1,2],[593,113,-1,2],[593,116,-1,2],[593,118,-1,1],[593,119,-1,1],[594,76,-1,1],[594,78,-1,1],[594,82,-1,1],[594,83,-1,1],[594,111,1,1],[594,115,-1,1],[595,6,-1,2],[595,7,1,2],[595,17,-1,2],[595,28,1,2],[595,38,-1,2],[595,55,1,2],[595,56,1,2],[595,58,1,2],[595,59,1,2],[595,76,-1,2],[595,78,-1,2],[595,79,-1,2],[595,81,-1,2],[595,82,-1,2],[595,83,-1,2],[595,85,-1,2],[595,91,1,2],[595,92,-1,2],[595,98,1,2],[596,13,1,2],[596,14,1,2],[596,15,1,2],[596,16,1,2],[596,29,-1,2],[596,30,-1,2],[596,31,-1,2],[596,32,-1,2],[596,74,-1,2],[596,75,-1,2],[596,77,-1,2],[596,80,-1,2],[596,113,-1,2],[596,116,-1,2],[596,118,-1,2],[596,119,-1,2],[597,82,-1,1],[597,83,-1,1],[597,112,1,1],[598,76,1,2],[598,78,1,2],[598,82,-1,2],[598,83,-1,2],[599,42,-1,1],[599,45,-1,1],[599,56,-1,1],[599,59,-1,1],[599,63,-1,1],[599,65,1,1],[599,68,1,1],[599,72,1,1],[599,87,1,1],[599,88,1,1],[599,102,-1,1],[599,108,1,1],[600,19,-1,1],[600,20,-1,1],[600,22,-1,1],[600,23,-1,1],[600,54,-1,1],[600,61,1,1],[600,64,-1,1],[600,71,1,1],[600,76,-1,1],[600,83,1,1],[600,111,-1,1],[600,112,-1,1],[600,114,-1,1],[600,115,-1,1],[601,12,-1,1],[601,26,1,1],[601,33,-1,1],[601,47,1,1],[601,53,-1,1],[601,57,-1,1],[601,60,-1,1],[601,78,1,1],[601,81,1,1],[601,83,1,1],[601,85,1,1],[601,92,1,1],[601,100,-1,1],[601,101,-1,1],[601,111,-1,1],[601,114,-1,1],[602,6,-1,1],[602,12,-2,1],[602,17,-1,1],[602,26,-1,1],[602,27,-1,1],[602,57,-1,1],[602,67,-1,1],[602,76,-1,1],[602,78,-1,1],[602,79,-1,1],[602,85,-1,1],[602,86,-2,1],[602,89,-1,1],[602,90,-1,1],[602,100,1,1],[602,105,1,1],[602,111,-1,1],[602,112,-1,1],[603,18,1,1],[603,25,-1,1],[603,39,1,1],[603,46,-1,1],[603,65,-1,1],[603,66,-1,1],[603,68,-1,1],[603,69,-1,1],[603,76,1,1],[603,83,-1,1],[603,111,1,1],[603,112,1,1],[603,114,1,1],[603,115,1,1],[604,89,-1,1],[604,90,-1,1],[605,89,-1,1],[605,90,-1,1],[605,96,-1,1],[605,97,-1,1],[606,38,-1,1],[606,92,-1,1],[607,6,-1,1],[607,33,-1,1],[607,38,-1,1],[607,42,-1,1],[607,45,-1,1],[607,62,1,1],[607,72,1,1],[607,81,2,1],[607,92,-1,1],[607,93,-1,1],[607,94,-1,1],[607,95,-1,1],[607,102,-1,1],[607,107,-1,1],[607,111,-2,1],[608,17,-1,1],[608,93,1,1],[609,17,-1,1],[609,93,1,1],[610,87,-1,1],[610,94,-1,1],[611,87,-1,1],[611,88,-1,1],[611,94,-1,1],[611,95,-1,1],[612,88,-1,1],[612,94,1,1],[613,21,-1,2],[613,45,-1,2],[613,87,-1,2],[613,95,1,2],[614,88,-1,1],[614,95,-1,1],[615,87,1,2],[615,88,-1,2],[615,94,1,2],[615,95,-1,2],[616,3,1,1],[616,10,-1,1],[616,15,-1,1],[616,26,-1,1],[616,32,1,1],[616,37,1,1],[616,48,1,1],[616,49,-1,1],[616,57,-1,1],[616,67,-1,1],[616,80,1,1],[616,90,-2,1],[616,96,2,1],[616,101,-1,1],[616,106,-1,1],[616,110,-1,1],[616,116,1,1],[617,26,-1,2],[617,48,-1,2],[617,89,-1,2],[617,97,1,2],[618,96,-1,1],[618,97,-1,1],[619,89,1,2],[619,90,1,2],[619,96,-1,2],[619,97,-1,2],[620,18,1,2],[620,39,1,2],[620,91,-1,2],[620,98,-1,2],[621,91,-1,1],[621,98,-1,1],[622,1,-1,1],[622,99,1,1],[622,109,-1,1],[623,100,-1,1],[623,101,-1,1],[624,100,-1,1],[624,101,-1,1],[624,105,-1,1],[624,106,-1,1],[625,8,-1,1],[625,14,1,1],[625,29,-1,1],[625,35,1,1],[625,57,-1,1],[625,70,1,1],[625,101,-2,1],[625,105,2,1],[626,57,-1,2],[626,70,-1,2],[626,100,-1,2],[626,106,1,2],[627,105,-1,1],[627,106,-1,1],[628,100,1,2],[628,101,1,2],[628,105,-1,2],[628,106,-1,2],[629,102,-1,1],[629,107,-1,1],[630,102,-1,1],[630,103,-1,1],[630,107,-1,1],[630,108,-1,1],[631,2,1,1],[631,10,-1,1],[631,16,1,1],[631,21,1,1],[631,31,-1,1],[631,37,1,1],[631,42,1,1],[631,50,-1,1],[631,62,-1,1],[631,73,1,1],[631,80,-1,1],[631,88,1,1],[631,95,1,1],[631,103,-2,1],[631,107,2,1],[631,110,1,1],[631,116,-1,1],[632,62,-1,2],[632,73,-1,2],[632,102,-1,2],[632,108,1,2],[633,103,-1,1],[633,108,-1,1],[634,102,1,2],[634,103,-1,2],[634,107,1,2],[634,108,-1,2],[635,54,1,2],[635,64,1,2],[635,104,-1,2],[635,109,-1,2],[636,104,-1,1],[636,109,-1,1],[637,3,-1,1],[637,11,-1,2],[637,15,1,2],[637,24,-1,2],[637,32,-1,2],[637,36,1,2],[637,45,-1,2],[637,49,1,1],[637,63,-1,2],[637,72,1,2],[637,87,-1,2],[637,94,-1,2],[637,102,-1,2],[637,108,1,2],[638,80,-1,1],[638,110,1,1],[638,116,-1,1],[639,81,-1,1],[639,82,-1,1],[639,83,-1,1],[639,111,1,1],[639,112,1,1],[640,17,-1,2],[640,26,-1,2],[640,38,-1,2],[640,47,-1,2],[640,53,-1,2],[640,67,-1,2],[640,70,-1,2],[640,78,-1,1],[640,81,-1,1],[640,83,-1,1],[640,86,1,2],[640,93,1,2],[640,105,-1,2],[640,106,-1,2],[640,111,1,1],[640,114,1,1],[641,78,-1,1],[641,112,-1,1],[642,76,-1,1],[642,78,-1,1],[642,81,-1,1],[642,112,-1,1],[642,115,-1,1],[643,82,-1,1],[643,114,-1,1],[644,76,-1,1],[644,81,-1,1],[644,82,-1,1],[644,114,-1,1],[644,115,-1,1],[645,79,-1,1],[645,115,1,1],[646,79,-1,1],[646,115,1,1],[647,49,1,2],[647,50,1,2],[647,113,-1,2],[647,116,-1,2],[648,113,-1,1],[648,116,-1,1],[649,74,-1,1],[649,117,-1,1],[649,118,-1,1],[650,75,-1,1],[650,117,1,1],[650,119,-1,1],[651,51,1,2],[651,52,1,2],[651,118,-1,2],[651,119,-1,2],[652,118,-1,1],[652,119,-1,1],[653,21,-1,1],[653,24,-1,1],[653,94,1,1],[653,95,1,1],[654,7,-1,1],[654,25,-1,1],[654,39,1,1],[654,84,-1,1],[654,91,-1,1],[655,42,-1,1],[655,45,-1,1],[655,47,-1,1],[655,48,-1,1],[655,57,-1,1],[655,60,-1,1],[655,62,-1,1],[655,63,-1,1],[655,94,-1,1],[655,95,-1,1],[655,96,-1,1],[655,97,-1,1],[655,100,-1,1],[655,101,-1,1],[655,102,-1,1],[655,103,-1,1],[656,7,-1,1],[656,18,-1,1],[656,46,1,1],[656,84,-1,1],[656,91,-1,1],[657,18,-1,1],[657,28,1,1],[657,46,1,1],[657,84,-1,1],[657,98,1,1],[658,26,-1,1],[658,47,-1,1],[658,90,-1,1],[658,97,-1,1],[659,21,-1,2],[659,27,-1,2],[659,42,-1,2],[659,48,-1,2],[659,57,-1,2],[659,63,-1,2],[659,67,-1,2],[659,73,-1,2],[659,87,1,2],[659,90,1,2],[659,94,1,2],[659,97,1,2],[659,100,1,2],[659,103,1,2],[659,105,1,2],[659,108,1,2],[660,3,-1,1],[660,49,1,1],[660,80,-1,1],[660,110,1,1],[660,116,-1,1],[661,2,-1,1],[661,50,1,1],[661,80,1,1],[661,110,-1,1],[661,116,1,1],[662,5,-1,1],[662,51,1,1],[662,74,1,1],[662,117,1,1],[662,118,1,1],[663,5,-1,1],[663,51,1,1],[663,75,-1,1],[663,117,1,1],[663,119,-1,1],[664,4,-1,1],[664,52,1,1],[664,74,-1,1],[664,117,-1,1],[664,118,-1,1],[665,4,-1,1],[665,52,1,1],[665,75,1,1],[665,117,-1,1],[665,119,1,1],[666,62,-1,1],[666,63,-1,1],[666,107,1,1],[666,108,1,1],[667,1,1,1],[667,61,-1,1],[667,64,1,1],[667,99,-1,1],[667,109,1,1],[668,57,-1,1],[668,67,-1,1],[668,101,-1,1],[668,106,-1,1],[669,60,-1,1],[669,70,-1,1],[669,101,1,1],[669,106,1,1],[670,1,1,1],[670,54,-1,1],[670,71,1,1],[670,99,-1,1],[670,109,1,1],[671,72,-1,1],[671,73,-1,1],[671,107,-1,1],[671,108,-1,1],[672,87,-1,1],[672,88,-1,1],[673,94,-1,1],[673,95,-1,1],[674,89,-1,1],[674,96,-1,1],[675,90,-1,1],[675,97,-1,1],[676,102,-1,1],[676,103,-1,1],[677,100,-1,1],[677,105,-1,1],[678,101,-1,1],[678,106,-1,1],[679,107,-1,1],[679,108,-1,1],[680,28,1,2],[680,39,1,2],[680,46,-1,2],[680,84,-1,2],[680,91,-1,2],[681,7,1,1],[681,84,1,1],[681,98,-1,1],[682,1,1,2],[682,64,1,2],[682,71,-1,2],[682,99,-1,2],[682,104,-1,2],[683,0,1,1],[683,99,1,1],[683,109,-1,1],[684,3,1,2],[684,50,-1,2],[684,80,1,2],[684,110,-1,2],[684,113,-1,2],[685,77,1,1],[685,110,1,1],[685,116,-1,1],[686,5,1,2],[686,52,-1,2],[686,75,1,2],[686,117,-1,2],[686,118,-1,2],[687,74,1,1],[687,117,1,1],[687,119,-1,1],[688,18,1,1],[688,25,-1,1],[688,39,1,1],[688,46,-1,1],[688,55,-1,1],[688,56,-1,1],[688,58,-1,1],[688,59,-1,1],[688,76,1,1],[688,83,-1,1],[688,111,1,1],[688,112,1,1],[688,114,1,1],[688,115,1,1],[689,17,1,1],[689,26,-1,1],[689,38,1,1],[689,47,-1,1],[689,53,1,1],[689,67,1,1],[689,70,1,1],[689,78,-2,1],[689,81,-2,1],[689,83,-2,1],[689,86,-1,1],[689,93,-1,1],[689,105,1,1],[689,106,1,1],[689,111,2,1],[689,114,2,1],[690,47,-1,1],[690,48,-1,1],[690,58,-1,1],[690,59,-1,1],[690,60,-1,1],[690,65,1,1],[690,66,1,1],[690,67,1,1],[690,89,1,1],[690,90,1,1],[690,100,-1,1],[690,106,1,1],[691,12,2,1],[691,17,2,1],[691,40,-1,1],[691,41,-1,1],[691,43,-1,1],[691,44,-1,1],[691,53,2,1],[691,54,1,1],[691,61,-1,1],[691,64,1,1],[691,71,-1,1],[691,76,1,1],[691,83,-1,1],[691,92,-2,1],[691,93,-2,1],[691,111,1,1],[691,112,1,1],[691,114,1,1],[691,115,1,1],[692,6,-1,1],[692,33,-1,1],[692,93,-1,1],[693,28,-1,1],[693,84,1,1],[693,98,-1,1],[694,0,-1,1],[694,99,-1,1],[694,104,-1,1],[695,1,-1,1],[695,99,1,1],[695,109,-1,1],[696,76,-1,1],[696,79,-1,1],[696,82,-1,1],[696,111,-1,1],[696,114,-1,1],[697,79,1,1],[697,82,1,1],[697,83,1,1],[697,112,-1,1],[697,115,-1,1],[698,11,1,2],[698,16,1,2],[698,27,1,2],[698,31,-1,2],[698,36,-1,2],[698,47,-1,2],[698,60,-1,2],[698,70,-1,2],[698,89,1,2],[698,97,-1,2],[698,100,-1,2],[698,105,-1,2],[699,78,1,1],[699,79,1,1],[699,83,1,1],[699,114,-1,1],[699,115,-1,1],[700,76,-1,1],[700,81,-1,1],[700,115,-1,1],[701,80,-1,1],[701,110,1,1],[701,116,-1,1],[702,74,-1,1],[702,117,-1,1],[702,118,-1,1],[703,75,-1,1],[703,117,1,1],[703,119,-1,1],[704,6,-1,1],[704,17,-1,1],[704,33,-1,1],[704,53,-1,1],[704,86,1,1],[704,92,-1,1],[705,76,-1,1],[705,79,-1,1],[705,81,-1,1],[705,83,-1,1],[705,112,1,1],[705,114,-1,1],[706,12,-1,1],[706,38,1,1],[706,86,-1,1],[706,92,1,1],[707,12,-1,1],[707,38,1,1],[707,86,-1,1],[707,92,1,1],[708,17,1,1],[708,33,-1,1],[708,85,1,1],[708,93,-1,1],[709,17,1,1],[709,33,-1,1],[709,85,1,1],[709,93,-1,1],[710,78,-1,1],[710,82,1,1],[710,112,-1,1],[710,114,1,1],[711,78,-1,1],[711,82,1,1],[711,112,-1,1],[711,114,1,1],[712,79,1,1],[712,81,-1,1],[712,111,1,1],[712,115,-1,1],[713,79,1,1],[713,81,-1,1],[713,111,1,1],[713,115,-1,1],[714,5,-1,1],[714,7,-1,1],[714,8,-1,1],[714,9,-1,1],[714,13,-1,1],[714,14,-1,1],[714,18,-1,1],[714,46,1,1],[714,51,1,1],[714,55,1,1],[714,58,1,1],[714,65,1,1],[714,68,1,1],[714,74,1,1],[714,84,-1,1],[714,91,-1,1],[714,117,1,1],[714,118,1,1],[715,3,-1,1],[715,7,-1,1],[715,10,-1,1],[715,11,-1,1],[715,15,-1,1],[715,16,-1,1],[715,25,-1,1],[715,39,1,1],[715,49,1,1],[715,55,1,1],[715,56,1,1],[715,65,1,1],[715,66,1,1],[715,77,1,1],[715,84,-1,1],[715,91,-1,1],[715,110,1,1],[715,113,1,1],[716,1,-1,1],[716,18,-1,1],[716,19,-1,1],[716,20,-1,1],[716,22,-1,1],[716,23,-1,1],[716,25,-1,1],[716,28,1,1],[716,54,1,1],[716,55,1,1],[716,56,1,1],[716,58,1,1],[716,59,1,1],[716,61,1,1],[716,84,-1,1],[716,91,-1,1],[716,99,1,1],[716,104,1,1],[717,0,-1,1],[717,4,-1,1],[717,8,-1,1],[717,9,-1,1],[717,19,-1,1],[717,22,-1,1],[717,29,-1,1],[717,30,-1,1],[717,40,-1,1],[717,43,-1,1],[717,52,1,1],[717,54,-1,1],[717,71,1,1],[717,74,-1,1],[717,99,-1,1],[717,104,-1,1],[717,117,-1,1],[717,118,-1,1],[718,4,1,1],[718,13,-1,1],[718,14,-1,1],[718,17,-1,1],[718,29,1,1],[718,30,1,1],[718,33,1,1],[718,51,1,1],[718,75,-1,1],[718,76,-1,1],[718,79,-1,1],[718,82,-1,1],[718,85,-1,1],[718,93,1,1],[718,111,-1,1],[718,114,-1,1],[718,117,1,1],[718,118,1,1],[719,0,-1,1],[719,2,-1,1],[719,10,-1,1],[719,11,-1,1],[719,19,-1,1],[719,20,-1,1],[719,31,-1,1],[719,32,-1,1],[719,40,-1,1],[719,41,-1,1],[719,50,1,1],[719,61,-1,1],[719,64,1,1],[719,77,-1,1],[719,99,-1,1],[719,104,-1,1],[719,110,-1,1],[719,113,-1,1],[720,2,1,1],[720,15,-1,1],[720,16,-1,1],[720,17,-1,1],[720,31,1,1],[720,32,1,1],[720,33,1,1],[720,49,1,1],[720,80,-1,1],[720,81,-1,1],[720,82,-1,1],[720,83,-1,1],[720,85,-1,1],[720,93,1,1],[720,110,1,1],[720,111,1,1],[720,112,1,1],[720,113,1,1],[721,2,-1,1],[721,4,-1,1],[721,8,-1,1],[721,10,-1,1],[721,13,-1,1],[721,15,-1,1],[721,29,-1,1],[721,31,-1,1],[721,34,-1,1],[721,36,-1,1],[721,49,-1,1],[721,51,-1,1],[721,75,1,1],[721,80,1,1],[721,110,-1,1],[721,113,-1,1],[721,117,-1,1],[721,118,-1,1],[722,4,1,1],[722,9,-1,1],[722,14,-1,1],[722,24,-1,1],[722,29,1,1],[722,34,1,1],[722,42,1,1],[722,52,-1,1],[722,63,-1,1],[722,73,-1,1],[722,74,1,1],[722,87,-1,1],[722,95,1,1],[722,102,-1,1],[722,107,-1,1],[722,117,1,1],[722,118,1,1],[723,5,1,1],[723,9,-1,1],[723,13,1,1],[723,27,1,1],[723,30,-1,1],[723,34,1,1],[723,48,1,1],[723,51,-1,1],[723,60,-1,1],[723,67,1,1],[723,74,-1,1],[723,89,1,1],[723,96,1,1],[723,100,-1,1],[723,106,1,1],[723,117,-1,1],[723,118,-1,1],[724,5,1,1],[724,8,-1,1],[724,14,1,1],[724,27,1,1],[724,29,-1,1],[724,35,1,1],[724,48,1,1],[724,51,-1,1],[724,57,-1,1],[724,70,1,1],[724,74,-1,1],[724,89,1,1],[724,96,1,1],[724,101,-1,1],[724,105,1,1],[724,117,-1,1],[724,118,-1,1],[725,4,1,1],[725,8,-1,1],[725,13,-1,1],[725,21,-1,1],[725,30,1,1],[725,35,1,1],[725,45,1,1],[725,52,-1,1],[725,63,-1,1],[725,73,-1,1],[725,74,1,1],[725,88,-1,1],[725,94,1,1],[725,102,-1,1],[725,107,-1,1],[725,117,1,1],[725,118,1,1],[726,3,-1,1],[726,4,-1,1],[726,9,-1,1],[726,10,-1,1],[726,14,-1,1],[726,15,-1,1],[726,30,-1,1],[726,31,-1,1],[726,35,-1,1],[726,36,-1,1],[726,50,-1,1],[726,51,-1,1],[726,75,1,1],[726,77,1,1],[726,110,1,1],[726,116,-1,1],[726,117,-1,1],[726,118,-1,1],[727,4,1,1],[727,8,-1,1],[727,9,-1,1],[727,12,-1,1],[727,34,1,1],[727,35,1,1],[727,38,1,1],[727,51,1,1],[727,75,-1,1],[727,76,-1,1],[727,79,-1,1],[727,82,-1,1],[727,86,-1,1],[727,92,1,1],[727,111,-1,1],[727,114,-1,1],[727,117,1,1],[727,118,1,1],[728,1,-1,1],[728,4,-1,1],[728,13,-1,1],[728,14,-1,1],[728,19,-1,1],[728,22,-1,1],[728,34,-1,1],[728,35,-1,1],[728,40,-1,1],[728,43,-1,1],[728,52,1,1],[728,61,1,1],[728,64,-1,1],[728,74,-1,1],[728,99,1,1],[728,109,-1,1],[728,117,-1,1],[728,118,-1,1],[729,5,-1,1],[729,25,1,1],[729,28,-1,1],[729,29,-1,1],[729,30,-1,1],[729,34,-1,1],[729,35,-1,1],[729,39,-1,1],[729,51,1,1],[729,55,1,1],[729,58,1,1],[729,65,1,1],[729,68,1,1],[729,74,1,1],[729,84,1,1],[729,98,-1,1],[729,117,1,1],[729,118,1,1],[730,2,1,2],[730,4,-1,2],[730,8,1,2],[730,10,-1,2],[730,13,1,2],[730,15,-1,2],[730,29,1,2],[730,31,-1,2],[730,34,1,2],[730,36,-1,2],[730,49,1,2],[730,51,-1,2],[730,75,1,2],[730,80,-1,2],[730,110,1,2],[730,113,1,2],[730,117,-1,2],[730,118,-1,2],[731,11,-1,1],[731,16,-1,1],[731,27,-1,1],[731,31,1,1],[731,36,1,1],[731,47,1,1],[731,60,-1,1],[731,70,-1,1],[731,89,-1,1],[731,97,1,1],[731,100,-1,1],[731,105,-1,1],[732,3,2,1],[732,11,-1,1],[732,15,1,1],[732,24,1,1],[732,32,-1,1],[732,36,1,1],[732,45,1,1],[732,49,-2,1],[732,63,-1,1],[732,72,1,1],[732,87,1,1],[732,94,1,1],[732,102,-1,1],[732,108,1,1],[733,3,1,1],[733,10,-1,1],[733,16,1,1],[733,24,1,1],[733,31,-1,1],[733,37,1,1],[733,45,1,1],[733,49,-1,1],[733,62,-1,1],[733,73,1,1],[733,87,1,1],[733,94,1,1],[733,103,-1,1],[733,107,1,1],[734,2,1,1],[734,10,-1,1],[734,15,-1,1],[734,26,-1,1],[734,32,1,1],[734,37,1,1],[734,48,1,1],[734,50,-1,1],[734,60,-1,1],[734,70,-1,1],[734,77,2,1],[734,90,-1,1],[734,96,1,1],[734,100,-1,1],[734,105,-1,1],[734,110,2,1],[734,113,2,1],[735,2,1,2],[735,5,-1,2],[735,8,1,2],[735,11,-1,2],[735,13,1,2],[735,16,-1,2],[735,29,1,2],[735,32,-1,2],[735,34,1,2],[735,37,-1,2],[735,49,1,2],[735,52,-1,2],[735,74,1,2],[735,80,-1,1],[735,110,1,1],[735,113,1,1],[735,117,1,2],[735,119,-1,2],[736,2,1,1],[736,10,-1,1],[736,11,-1,1],[736,12,-1,1],[736,36,1,1],[736,37,1,1],[736,38,1,1],[736,49,1,1],[736,80,-1,1],[736,81,-1,1],[736,82,-1,1],[736,83,-1,1],[736,86,-1,1],[736,92,1,1],[736,110,1,1],[736,111,1,1],[736,112,1,1],[736,113,1,1],[737,1,-1,1],[737,2,-1,1],[737,15,-1,1],[737,16,-1,1],[737,19,-1,1],[737,20,-1,1],[737,36,-1,1],[737,37,-1,1],[737,40,-1,1],[737,41,-1,1],[737,50,1,1],[737,54,1,1],[737,71,-1,1],[737,77,-1,1],[737,99,1,1],[737,109,-1,1],[737,110,-1,1],[737,113,-1,1],[738,3,-1,1],[738,18,1,1],[738,28,-1,1],[738,31,-1,1],[738,32,-1,1],[738,36,-1,1],[738,37,-1,1],[738,46,-1,1],[738,49,1,1],[738,55,1,1],[738,56,1,1],[738,65,1,1],[738,66,1,1],[738,77,1,1],[738,84,1,1],[738,98,-1,1],[738,110,1,1],[738,113,1,1],[739,7,-1,2],[739,18,1,2],[739,27,1,2],[739,28,-1,2],[739,39,1,2],[739,48,1,2],[739,55,-1,2],[739,58,-1,2],[739,65,-1,2],[739,68,-1,2],[739,89,1,2],[739,96,1,2],[739,100,-1,2],[739,101,-1,2],[739,105,-1,2],[739,106,-1,2],[740,0,1,2],[740,2,-1,2],[740,10,1,2],[740,11,1,2],[740,19,-1,2],[740,20,-1,2],[740,31,1,2],[740,32,1,2],[740,40,-1,2],[740,41,-1,2],[740,50,1,2],[740,61,1,2],[740,64,-1,2],[740,77,-1,2],[740,99,1,2],[740,104,1,2],[740,110,-1,2],[740,113,-1,2],[741,0,1,1],[741,22,-1,1],[741,23,-1,1],[741,24,-1,1],[741,40,1,1],[741,41,1,1],[741,42,1,1],[741,54,1,1],[741,71,-1,1],[741,72,-1,1],[741,73,-1,1],[741,87,-1,1],[741,95,1,1],[741,99,1,1],[741,102,1,1],[741,103,1,1],[741,104,1,1],[742,0,1,2],[742,4,-1,2],[742,8,1,2],[742,9,1,2],[742,19,-1,2],[742,22,-1,2],[742,29,1,2],[742,30,1,2],[742,40,-1,2],[742,43,-1,2],[742,52,1,2],[742,54,1,2],[742,71,-1,2],[742,74,-1,2],[742,99,1,2],[742,104,1,2],[742,117,-1,2],[742,118,-1,2],[743,0,1,1],[743,20,-1,1],[743,23,-1,1],[743,27,-1,1],[743,40,1,1],[743,43,1,1],[743,47,1,1],[743,61,1,1],[743,64,-1,1],[743,67,-1,1],[743,70,-1,1],[743,89,-1,1],[743,97,1,1],[743,99,1,1],[743,100,1,1],[743,101,1,1],[743,104,1,1],[744,1,-1,2],[744,6,-1,2],[744,17,-1,2],[744,20,-1,2],[744,22,1,2],[744,38,-1,2],[744,41,-1,2],[744,43,1,2],[744,54,1,2],[744,61,1,2],[744,79,-1,2],[744,81,1,2],[744,85,-1,2],[744,92,-1,2],[744,99,1,2],[744,104,1,2],[744,111,-1,2],[744,115,1,2],[745,1,-1,2],[745,6,-1,2],[745,17,-1,2],[745,19,-1,2],[745,23,1,2],[745,38,-1,2],[745,40,-1,2],[745,44,1,2],[745,54,1,2],[745,61,1,2],[745,78,-1,2],[745,82,1,2],[745,85,-1,2],[745,92,-1,2],[745,99,1,2],[745,104,1,2],[745,112,-1,2],[745,114,1,2],[746,0,1,1],[746,19,-1,1],[746,22,-1,1],[746,26,-1,1],[746,41,1,1],[746,44,1,1],[746,48,1,1],[746,61,1,1],[746,64,-1,1],[746,67,-1,1],[746,70,-1,1],[746,90,-1,1],[746,96,1,1],[746,99,1,1],[746,100,1,1],[746,101,1,1],[746,104,1,1],[747,0,1,2],[747,5,-1,2],[747,8,1,2],[747,9,1,2],[747,20,-1,2],[747,23,-1,2],[747,29,1,2],[747,30,1,2],[747,41,-1,2],[747,44,-1,2],[747,51,1,2],[747,54,1,2],[747,71,-1,2],[747,75,-1,2],[747,99,1,2],[747,104,1,2],[747,117,1,2],[747,119,-1,2],[748,0,1,1],[748,19,-1,1],[748,20,-1,1],[748,21,-1,1],[748,43,1,1],[748,44,1,1],[748,45,1,1],[748,54,1,1],[748,71,-1,1],[748,72,-1,1],[748,73,-1,1],[748,88,-1,1],[748,94,1,1],[748,99,1,1],[748,102,1,1],[748,103,1,1],[748,104,1,1],[749,0,1,2],[749,3,-1,2],[749,10,1,2],[749,11,1,2],[749,22,-1,2],[749,23,-1,2],[749,31,1,2],[749,32,1,2],[749,43,-1,2],[749,44,-1,2],[749,49,1,2],[749,61,1,2],[749,64,-1,2],[749,80,-1,2],[749,99,1,2],[749,104,1,2],[749,110,1,2],[749,116,-1,2],[750,1,-1,1],[750,7,1,1],[750,39,-1,1],[750,40,-1,1],[750,41,-1,1],[750,43,-1,1],[750,44,-1,1],[750,46,-1,1],[750,54,1,1],[750,55,1,1],[750,56,1,1],[750,58,1,1],[750,59,1,1],[750,61,1,1],[750,84,1,1],[750,98,-1,1],[750,99,1,1],[750,104,1,1],[751,4,-1,2],[751,5,-1,2],[751,21,-1,2],[751,24,-1,2],[751,42,-1,2],[751,45,-1,2],[751,51,1,2],[751,52,1,2],[751,74,1,2],[751,75,1,2],[751,87,-1,2],[751,88,-1,2],[751,94,-1,2],[751,95,-1,2],[751,118,1,2],[751,119,1,2],[752,7,-1,2],[752,24,1,2],[752,25,1,2],[752,28,-1,2],[752,45,1,2],[752,46,1,2],[752,55,-1,2],[752,56,-1,2],[752,65,-1,2],[752,66,-1,2],[752,87,1,2],[752,94,1,2],[752,102,-1,2],[752,103,-1,2],[752,107,-1,2],[752,108,-1,2],[753,18,1,2],[753,25,-1,2],[753,39,1,2],[753,46,-1,2],[753,55,1,2],[753,56,1,2],[753,58,1,2],[753,59,1,2],[753,76,1,2],[753,83,-1,2],[753,111,1,2],[753,112,1,2],[753,114,1,2],[753,115,1,2],[754,10,-1,2],[754,11,-1,2],[754,26,-1,2],[754,27,-1,2],[754,31,-1,2],[754,32,-1,2],[754,47,-1,2],[754,48,-1,2],[754,49,1,2],[754,50,1,2],[754,67,1,2],[754,70,1,2],[754,100,-1,2],[754,101,-1,2],[754,113,1,2],[754,116,1,2],[755,4,-1,1],[755,5,-1,1],[755,8,-1,1],[755,13,-1,1],[755,29,-1,1],[755,34,-1,1],[755,51,1,1],[755,52,1,1],[755,53,1,1],[755,81,1,1],[755,82,1,1],[755,83,1,1],[755,86,-1,1],[755,92,-1,1],[755,111,-1,1],[755,112,-1,1],[756,1,1,2],[756,18,-1,2],[756,19,-1,2],[756,20,-1,2],[756,22,-1,2],[756,23,-1,2],[756,25,-1,2],[756,28,1,2],[756,54,-1,2],[756,55,-1,2],[756,56,-1,2],[756,58,-1,2],[756,59,-1,2],[756,61,-1,2],[756,84,-1,2],[756,91,-1,2],[756,99,-1,2],[756,104,-1,2],[757,0,-1,1],[757,1,-1,1],[757,19,1,1],[757,22,1,1],[757,40,1,1],[757,43,1,1],[757,54,1,1],[757,63,-1,1],[757,64,1,1],[757,73,-1,1],[757,87,-1,1],[757,88,-1,1],[757,94,-1,1],[757,95,-1,1],[757,102,-1,1],[757,107,-1,1],[758,3,1,2],[758,7,-1,2],[758,10,-1,2],[758,11,-1,2],[758,15,-1,2],[758,16,-1,2],[758,25,-1,2],[758,39,1,2],[758,49,-1,2],[758,55,-1,2],[758,56,-1,2],[758,65,-1,2],[758,66,-1,2],[758,77,-1,2],[758,84,-1,2],[758,91,-1,2],[758,110,-1,2],[758,113,-1,2],[759,47,1,2],[759,48,1,2],[759,58,-1,2],[759,59,-1,2],[759,60,-1,2],[759,65,1,2],[759,66,1,2],[759,67,1,2],[759,89,-1,2],[759,90,-1,2],[759,100,-1,2],[759,106,1,2],[760,5,1,2],[760,7,-1,2],[760,8,-1,2],[760,9,-1,2],[760,13,-1,2],[760,14,-1,2],[760,18,-1,2],[760,46,1,2],[760,51,-1,2],[760,55,-1,2],[760,58,-1,2],[760,65,-1,2],[760,68,-1,2],[760,74,-1,2],[760,84,-1,2],[760,91,-1,2],[760,117,-1,2],[760,118,-1,2],[761,42,1,2],[761,45,1,2],[761,56,-1,2],[761,59,-1,2],[761,63,-1,2],[761,65,1,2],[761,68,1,2],[761,72,1,2],[761,87,-1,2],[761,88,-1,2],[761,102,-1,2],[761,108,1,2],[762,18,-1,2],[762,25,-1,2],[762,28,1,2],[762,33,1,2],[762,38,1,2],[762,53,1,2],[762,56,-1,2],[762,58,1,2],[762,66,-1,2],[762,68,1,2],[762,79,-1,2],[762,81,1,2],[762,84,-1,2],[762,85,-1,2],[762,86,-1,2],[762,91,-1,2],[762,111,-1,2],[762,115,1,2],[763,18,-1,2],[763,25,-1,2],[763,28,1,2],[763,33,1,2],[763,38,1,2],[763,53,1,2],[763,55,-1,2],[763,59,1,2],[763,65,-1,2],[763,69,1,2],[763,78,-1,2],[763,82,1,2],[763,84,-1,2],[763,85,-1,2],[763,86,-1,2],[763,91,-1,2],[763,112,-1,2],[763,114,1,2],[764,7,-1,1],[764,25,-1,2],[764,39,1,2],[764,42,1,2],[764,45,1,2],[764,55,-1,2],[764,58,-1,2],[764,62,-1,2],[764,66,1,2],[764,69,1,2],[764,73,1,2],[764,84,-1,1],[764,87,-1,2],[764,88,-1,2],[764,91,-1,1],[764,103,-1,2],[764,107,1,2],[765,4,1,2],[765,7,-1,2],[765,8,-1,2],[765,9,-1,2],[765,13,-1,2],[765,14,-1,2],[765,18,-1,2],[765,46,1,2],[765,52,-1,2],[765,56,-1,2],[765,59,-1,2],[765,66,-1,2],[765,69,-1,2],[765,75,-1,2],[765,84,-1,2],[765,91,-1,2],[765,117,1,2],[765,119,-1,2],[766,7,-1,1],[766,18,-1,2],[766,46,1,2],[766,47,1,2],[766,48,1,2],[766,55,-1,2],[766,56,-1,2],[766,57,-1,2],[766,68,1,2],[766,69,1,2],[766,70,1,2],[766,84,-1,1],[766,89,-1,2],[766,90,-1,2],[766,91,-1,1],[766,101,-1,2],[766,105,1,2],[767,2,1,2],[767,7,-1,2],[767,10,-1,2],[767,11,-1,2],[767,15,-1,2],[767,16,-1,2],[767,25,-1,2],[767,39,1,2],[767,50,-1,2],[767,58,-1,2],[767,59,-1,2],[767,68,-1,2],[767,69,-1,2],[767,80,-1,2],[767,84,-1,2],[767,91,-1,2],[767,110,1,2],[767,116,-1,2],[768,0,1,2],[768,18,-1,2],[768,19,-1,2],[768,20,-1,2],[768,22,-1,2],[768,23,-1,2],[768,25,-1,2],[768,28,1,1],[768,64,-1,2],[768,65,-1,2],[768,66,-1,2],[768,68,-1,2],[768,69,-1,2],[768,71,-1,2],[768,84,-1,1],[768,91,-1,1],[768,99,1,2],[768,109,-1,2],[769,4,1,2],[769,5,1,2],[769,8,-1,2],[769,9,-1,2],[769,13,-1,2],[769,14,-1,2],[769,47,1,2],[769,48,1,2],[769,57,-1,2],[769,60,-1,2],[769,67,-1,2],[769,70,-1,2],[769,89,-1,2],[769,90,-1,2],[769,118,1,2],[769,119,1,2],[770,0,-1,1],[770,1,-1,1],[770,19,1,1],[770,20,1,1],[770,40,1,1],[770,41,1,1],[770,60,-1,1],[770,61,1,1],[770,70,-1,1],[770,71,1,1],[770,89,-1,1],[770,90,-1,1],[770,96,-1,1],[770,97,-1,1],[770,100,-1,1],[770,105,-1,1],[771,19,1,2],[771,20,1,2],[771,22,1,2],[771,23,1,2],[771,54,-1,2],[771,61,1,2],[771,64,-1,2],[771,71,1,2],[771,76,-1,2],[771,83,1,2],[771,111,-1,2],[771,112,-1,2],[771,114,-1,2],[771,115,-1,2],[772,2,1,2],[772,3,1,2],[772,10,-1,2],[772,11,-1,2],[772,15,-1,2],[772,16,-1,2],[772,42,1,2],[772,45,1,2],[772,62,-1,2],[772,63,-1,2],[772,72,-1,2],[772,73,-1,2],[772,87,-1,2],[772,88,-1,2],[772,113,1,2],[772,116,1,2],[773,4,-1,1],[773,5,-1,1],[773,8,-1,1],[773,9,-1,1],[773,29,-1,1],[773,30,-1,1],[773,72,1,1],[773,73,1,1],[773,74,1,1],[773,75,1,1],[773,87,-1,1],[773,88,-1,1],[773,94,-1,1],[773,95,-1,1],[773,102,-1,1],[773,103,-1,1],[774,8,1,2],[774,9,1,2],[774,13,1,2],[774,14,1,2],[774,47,-1,2],[774,48,-1,2],[774,51,-1,2],[774,52,-1,2],[774,74,1,2],[774,75,1,2],[774,89,1,2],[774,90,1,2],[774,100,-1,2],[774,101,-1,2],[774,105,-1,2],[774,106,-1,2],[775,2,-1,1],[775,3,-1,1],[775,10,-1,1],[775,11,-1,1],[775,31,-1,1],[775,32,-1,1],[775,67,1,1],[775,70,1,1],[775,77,1,1],[775,80,1,1],[775,89,-1,1],[775,90,-1,1],[775,96,-1,1],[775,97,-1,1],[775,100,-1,1],[775,101,-1,1],[776,10,1,2],[776,11,1,2],[776,15,1,2],[776,16,1,2],[776,42,-1,2],[776,45,-1,2],[776,49,-1,2],[776,50,-1,2],[776,77,1,2],[776,80,1,2],[776,87,1,2],[776,88,1,2],[776,102,-1,2],[776,103,-1,2],[776,107,-1,2],[776,108,-1,2],[777,6,-1,1],[777,12,-1,1],[777,17,-1,1],[777,21,-2,1],[777,24,-2,1],[777,63,1,1],[777,73,1,1],[777,79,1,1],[777,82,1,1],[777,83,1,1],[777,85,-1,1],[777,86,-1,1],[777,87,-2,1],[777,88,-2,1],[777,103,-1,1],[777,108,-1,1],[777,112,-1,1],[777,115,-1,1],[778,7,2,1],[778,25,1,1],[778,39,-1,1],[778,42,-1,1],[778,45,-1,1],[778,55,-1,1],[778,58,-1,1],[778,62,-1,1],[778,66,1,1],[778,69,1,1],[778,73,1,1],[778,84,2,1],[778,87,1,1],[778,88,1,1],[778,91,2,1],[778,103,-1,1],[778,107,1,1],[779,6,-1,1],[779,12,-2,1],[779,17,-1,1],[779,26,-2,1],[779,27,-2,1],[779,60,-1,1],[779,70,-1,1],[779,76,-1,1],[779,81,-1,1],[779,82,-1,1],[779,85,-1,1],[779,86,-2,1],[779,89,-2,1],[779,90,-2,1],[779,101,1,1],[779,106,1,1],[779,114,-1,1],[779,115,-1,1],[780,7,2,1],[780,18,1,1],[780,46,-1,1],[780,47,-1,1],[780,48,-1,1],[780,55,-1,1],[780,56,-1,1],[780,57,-1,1],[780,68,1,1],[780,69,1,1],[780,70,1,1],[780,84,2,1],[780,89,1,1],[780,90,1,1],[780,91,2,1],[780,101,-1,1],[780,105,1,1],[781,21,-1,2],[781,33,1,2],[781,42,-1,2],[781,62,1,2],[781,63,1,2],[781,76,-1,2],[781,78,-1,2],[781,79,-1,2],[781,85,-1,2],[781,87,1,2],[781,94,1,2],[781,102,1,2],[781,103,1,2],[781,111,-1,2],[781,112,-1,2],[782,3,-1,2],[782,10,-1,2],[782,16,1,2],[782,24,-1,2],[782,31,-1,2],[782,37,1,2],[782,45,-1,2],[782,49,1,2],[782,62,-1,2],[782,73,1,2],[782,87,-1,2],[782,94,-1,2],[782,103,-1,2],[782,107,1,2],[783,19,-1,1],[783,20,-1,1],[783,21,-2,1],[783,43,1,1],[783,44,1,1],[783,45,2,1],[783,88,-2,1],[783,94,2,1],[784,24,-1,1],[784,42,1,1],[784,87,-1,1],[784,95,1,1],[785,2,-1,2],[785,10,-1,2],[785,16,1,2],[785,21,-1,2],[785,31,-1,2],[785,37,1,2],[785,42,-1,2],[785,50,1,2],[785,62,-1,2],[785,73,1,2],[785,80,1,2],[785,88,-1,2],[785,95,-1,2],[785,103,-1,1],[785,107,1,1],[785,110,-1,2],[785,116,1,2],[786,24,-1,2],[786,33,1,2],[786,45,-1,2],[786,62,1,1],[786,63,1,1],[786,76,-1,2],[786,81,-1,2],[786,82,-1,2],[786,85,-1,2],[786,88,1,2],[786,95,1,2],[786,102,1,1],[786,103,1,1],[786,114,-1,2],[786,115,-1,2],[787,18,-1,1],[787,21,-1,1],[787,24,-1,1],[787,28,1,1],[787,46,1,1],[787,55,1,1],[787,58,2,1],[787,62,1,1],[787,66,-1,1],[787,69,-2,1],[787,73,-1,1],[787,84,-1,1],[787,94,1,1],[787,95,1,1],[787,98,1,1],[787,103,1,1],[787,107,-1,1],[788,6,-1,1],[788,33,-1,1],[788,38,-1,1],[788,42,-2,1],[788,45,-2,1],[788,63,1,1],[788,73,1,1],[788,79,1,1],[788,82,1,1],[788,83,1,1],[788,92,-1,1],[788,93,-1,1],[788,94,-2,1],[788,95,-2,1],[788,103,-1,1],[788,108,-1,1],[788,112,-1,1],[788,115,-1,1],[789,87,-1,1],[789,88,-1,1],[789,94,-1,1],[789,95,-1,1],[790,5,-1,2],[790,8,-1,2],[790,14,1,2],[790,27,-1,2],[790,29,-1,2],[790,35,1,2],[790,48,-1,2],[790,51,1,2],[790,57,-1,2],[790,70,1,2],[790,74,1,2],[790,89,-1,2],[790,96,-1,2],[790,101,-1,2],[790,105,1,2],[790,117,1,2],[790,118,1,2],[791,26,-1,1],[791,48,1,1],[791,90,-1,1],[791,96,1,1],[792,27,-1,1],[792,47,1,1],[792,89,-1,1],[792,97,1,1],[793,4,-1,2],[793,8,-1,2],[793,14,1,2],[793,26,-1,2],[793,29,-1,2],[793,35,1,2],[793,47,-1,2],[793,52,1,2],[793,57,-1,2],[793,70,1,2],[793,75,1,2],[793,90,-1,2],[793,97,-1,2],[793,101,-1,2],[793,105,1,2],[793,117,-1,2],[793,119,1,2],[794,12,-1,2],[794,27,-1,2],[794,33,-1,2],[794,48,-1,2],[794,53,-1,2],[794,57,-1,1],[794,60,-1,1],[794,79,-1,2],[794,82,-1,2],[794,83,-1,2],[794,85,1,2],[794,90,1,2],[794,92,1,2],[794,97,1,2],[794,100,-1,1],[794,101,-1,1],[794,112,1,2],[794,115,1,2],[795,25,-1,1],[795,26,-1,1],[795,27,-1,1],[795,28,1,1],[795,39,1,1],[795,55,1,1],[795,56,1,1],[795,57,2,1],[795,68,-1,1],[795,69,-1,1],[795,70,-2,1],[795,84,-1,1],[795,96,1,1],[795,97,1,1],[795,98,1,1],[795,101,2,1],[795,105,-2,1],[796,6,-1,1],[796,33,-1,1],[796,38,-1,1],[796,47,-2,1],[796,48,-2,1],[796,60,-1,1],[796,70,-1,1],[796,76,-1,1],[796,81,-1,1],[796,82,-1,1],[796,92,-1,1],[796,93,-1,1],[796,96,-2,1],[796,97,-2,1],[796,101,1,1],[796,106,1,1],[796,114,-1,1],[796,115,-1,1],[797,89,-1,1],[797,90,-1,1],[797,96,-1,1],[797,97,-1,1],[798,7,-1,1],[798,28,-1,1],[798,91,-1,1],[798,98,-1,1],[799,2,-1,2],[799,3,-1,2],[799,11,-1,2],[799,15,1,2],[799,18,-1,2],[799,32,-1,2],[799,36,1,2],[799,39,-1,2],[799,56,-1,2],[799,59,-1,2],[799,65,1,2],[799,68,1,2],[799,91,-1,2],[799,98,-1,2],[799,113,-1,2],[799,116,-1,2],[800,4,-1,2],[800,5,-1,2],[800,9,-1,2],[800,13,1,2],[800,25,-1,2],[800,30,-1,2],[800,34,1,2],[800,46,-1,2],[800,58,-1,2],[800,59,-1,2],[800,65,1,2],[800,66,1,2],[800,91,-1,2],[800,98,-1,2],[800,118,-1,2],[800,119,-1,2],[801,12,-1,1],[801,27,1,1],[801,33,-1,1],[801,48,1,1],[801,53,-1,1],[801,57,-2,1],[801,60,-2,1],[801,79,1,1],[801,82,1,1],[801,83,1,1],[801,85,1,1],[801,90,-1,1],[801,92,1,1],[801,97,-1,1],[801,100,-2,1],[801,101,-2,1],[801,112,-1,1],[801,115,-1,1],[802,0,1,2],[802,19,1,2],[802,22,1,2],[802,26,1,2],[802,41,-1,2],[802,44,-1,2],[802,48,-1,2],[802,61,1,2],[802,64,-1,2],[802,67,-1,2],[802,70,-1,2],[802,90,1,2],[802,96,-1,2],[802,99,1,2],[802,100,1,2],[802,101,1,2],[802,104,1,2],[803,24,-1,1],[803,33,-1,1],[803,45,-1,1],[803,62,-2,1],[803,63,-2,1],[803,76,-1,1],[803,81,-1,1],[803,82,-1,1],[803,85,1,1],[803,88,1,1],[803,95,1,1],[803,102,-2,1],[803,103,-2,1],[803,114,-1,1],[803,115,-1,1],[804,0,1,2],[804,19,1,2],[804,20,1,2],[804,21,1,2],[804,43,-1,2],[804,44,-1,2],[804,45,-1,2],[804,54,1,2],[804,71,-1,2],[804,72,-1,2],[804,73,-1,2],[804,88,1,2],[804,94,-1,2],[804,99,1,2],[804,102,1,2],[804,103,1,2],[804,104,1,2],[805,6,1,2],[805,12,1,1],[805,17,1,2],[805,26,1,2],[805,27,1,2],[805,57,-1,2],[805,67,-1,2],[805,76,-1,2],[805,78,-1,2],[805,79,-1,2],[805,85,1,2],[805,86,1,1],[805,89,1,2],[805,90,1,2],[805,100,1,2],[805,105,1,2],[805,111,-1,2],[805,112,-1,2],[806,2,1,2],[806,10,1,2],[806,15,1,2],[806,26,1,2],[806,32,-1,2],[806,37,-1,2],[806,48,-1,2],[806,50,-1,2],[806,60,-1,2],[806,70,-1,2],[806,77,1,1],[806,90,1,2],[806,96,-1,2],[806,100,-1,2],[806,105,-1,2],[806,110,1,1],[806,113,1,1],[807,25,-1,2],[807,26,-1,2],[807,27,-1,2],[807,28,1,2],[807,39,1,2],[807,55,-1,2],[807,56,-1,2],[807,57,-1,1],[807,68,1,2],[807,69,1,2],[807,70,1,1],[807,84,-1,2],[807,96,1,2],[807,97,1,2],[807,98,1,2],[807,101,-1,1],[807,105,1,1],[808,60,-1,1],[808,67,1,1],[808,100,-1,1],[808,106,1,1],[809,3,1,2],[809,10,1,2],[809,15,1,2],[809,26,1,2],[809,32,-1,2],[809,37,-1,2],[809,48,-1,2],[809,49,-1,2],[809,57,-1,2],[809,67,-1,2],[809,80,1,2],[809,90,1,1],[809,96,-1,1],[809,101,-1,2],[809,106,-1,2],[809,110,-1,2],[809,116,1,2],[810,6,1,2],[810,12,1,1],[810,17,1,2],[810,26,1,1],[810,27,1,1],[810,60,-1,2],[810,70,-1,2],[810,76,-1,2],[810,81,-1,2],[810,82,-1,2],[810,85,1,2],[810,86,1,1],[810,89,1,1],[810,90,1,1],[810,101,1,2],[810,106,1,2],[810,114,-1,2],[810,115,-1,2],[811,1,1,2],[811,19,1,2],[811,22,1,2],[811,26,1,2],[811,41,-1,2],[811,44,-1,2],[811,48,-1,2],[811,54,-1,2],[811,57,-1,2],[811,60,-1,2],[811,71,1,2],[811,90,1,2],[811,96,-1,2],[811,99,-1,2],[811,105,1,2],[811,106,1,2],[811,109,1,2],[812,17,1,1],[812,27,-1,1],[812,38,1,1],[812,48,-1,1],[812,53,1,1],[812,79,-1,1],[812,82,-1,1],[812,83,-1,1],[812,86,-1,1],[812,90,1,1],[812,93,-1,1],[812,97,1,1],[812,112,1,1],[812,115,1,1],[813,100,-1,1],[813,101,-1,1],[813,105,-1,1],[813,106,-1,1],[814,6,-1,2],[814,12,-1,2],[814,17,-1,2],[814,21,-1,2],[814,24,-1,2],[814,62,-1,2],[814,72,-1,2],[814,81,-1,2],[814,85,-1,2],[814,86,-1,2],[814,87,-1,2],[814,88,-1,2],[814,102,1,2],[814,107,1,2],[814,111,1,2],[815,4,1,2],[815,8,1,2],[815,13,1,2],[815,21,1,2],[815,30,-1,2],[815,35,-1,2],[815,45,-1,2],[815,52,-1,2],[815,63,-1,2],[815,73,-1,2],[815,74,1,2],[815,88,1,2],[815,94,-1,2],[815,102,-1,2],[815,107,-1,2],[815,117,1,2],[815,118,1,2],[816,55,-1,1],[816,58,-1,1],[816,62,-2,1],[816,66,1,1],[816,69,1,1],[816,73,2,1],[816,103,-2,1],[816,107,2,1],[817,63,-1,1],[817,72,1,1],[817,102,-1,1],[817,108,1,1],[818,5,1,2],[818,8,1,2],[818,13,1,2],[818,21,1,2],[818,30,-1,2],[818,35,-1,2],[818,45,-1,2],[818,51,-1,2],[818,62,-1,2],[818,72,-1,2],[818,75,1,2],[818,88,1,2],[818,94,-1,2],[818,103,-1,2],[818,108,-1,2],[818,117,-1,2],[818,119,1,2],[819,6,-1,2],[819,12,-1,2],[819,17,-1,2],[819,21,-1,1],[819,24,-1,1],[819,63,-1,2],[819,73,-1,2],[819,79,-1,2],[819,82,-1,2],[819,83,-1,2],[819,85,-1,2],[819,86,-1,2],[819,87,-1,1],[819,88,-1,1],[819,103,1,2],[819,108,1,2],[819,112,1,2],[819,115,1,2],[820,1,1,2],[820,19,1,2],[820,20,1,2],[820,21,1,2],[820,43,-1,2],[820,44,-1,2],[820,45,-1,2],[820,61,-1,2],[820,62,-1,2],[820,63,-1,2],[820,64,1,2],[820,88,1,2],[820,94,-1,2],[820,99,-1,2],[820,107,1,2],[820,108,1,2],[820,109,1,2],[821,17,1,1],[821,24,1,1],[821,38,1,1],[821,45,1,1],[821,53,1,1],[821,76,1,1],[821,81,1,1],[821,82,1,1],[821,86,-1,1],[821,88,-1,1],[821,93,-1,1],[821,95,-1,1],[821,114,1,1],[821,115,1,1],[822,102,-1,1],[822,103,-1,1],[822,107,-1,1],[822,108,-1,1],[823,0,-1,1],[823,1,-1,1],[823,104,-1,1],[823,109,-1,1],[824,11,1,2],[824,16,1,2],[824,20,1,2],[824,23,1,2],[824,31,-1,2],[824,36,-1,2],[824,40,-1,2],[824,43,-1,2],[824,49,-1,2],[824,50,-1,2],[824,54,-1,2],[824,64,-1,2],[824,104,-1,2],[824,109,-1,2],[824,113,-1,2],[824,116,-1,2],[825,9,1,2],[825,14,1,2],[825,22,1,2],[825,23,1,2],[825,29,-1,2],[825,34,-1,2],[825,40,-1,2],[825,41,-1,2],[825,51,-1,2],[825,52,-1,2],[825,61,-1,2],[825,71,-1,2],[825,104,-1,2],[825,109,-1,2],[825,118,-1,2],[825,119,-1,2],[826,2,-1,1],[826,3,-1,1],[826,113,-1,1],[826,116,-1,1],[827,49,-1,1],[827,50,-1,1],[827,113,-1,1],[827,116,-1,1],[828,77,-1,1],[828,80,-1,1],[828,113,-1,1],[828,116,-1,1],[829,4,-1,1],[829,5,-1,1],[829,118,-1,1],[829,119,-1,1],[830,51,-1,1],[830,52,-1,1],[830,118,-1,1],[830,119,-1,1],[831,74,-1,1],[831,75,-1,1],[831,118,-1,1],[831,119,-1,1],[832,18,1,1],[832,25,1,1],[832,28,-1,1],[832,33,-1,1],[832,38,-1,1],[832,53,-1,1],[832,55,-1,1],[832,59,1,1],[832,65,-1,1],[832,69,1,1],[832,78,-1,1],[832,82,1,1],[832,84,1,1],[832,85,1,1],[832,86,1,1],[832,91,1,1],[832,112,-1,1],[832,114,1,1],[833,18,-1,1],[833,25,-1,1],[833,28,1,1],[833,84,-1,1],[833,91,-1,1],[834,1,-1,1],[834,6,-1,1],[834,17,-1,1],[834,19,1,1],[834,23,-1,1],[834,38,-1,1],[834,40,1,1],[834,44,-1,1],[834,54,1,1],[834,61,1,1],[834,78,1,1],[834,82,-1,1],[834,85,-1,1],[834,92,-1,1],[834,99,1,1],[834,104,1,1],[834,112,1,1],[834,114,-1,1],[835,0,-1,1],[835,6,-1,1],[835,12,-1,1],[835,19,1,1],[835,23,-1,1],[835,33,-1,1],[835,40,1,1],[835,44,-1,1],[835,64,1,1],[835,71,1,1],[835,78,1,1],[835,82,-1,1],[835,86,-1,1],[835,93,-1,1],[835,99,-1,1],[835,109,1,1],[835,112,1,1],[835,114,-1,1],[836,17,1,1],[836,21,1,1],[836,38,1,1],[836,42,1,1],[836,53,1,1],[836,72,1,1],[836,73,1,1],[836,76,2,1],[836,78,2,1],[836,79,2,1],[836,86,-1,1],[836,87,-1,1],[836,93,-1,1],[836,94,-1,1],[836,107,1,1],[836,108,1,1],[836,111,2,1],[836,112,2,1],[837,6,-1,1],[837,33,-1,1],[837,38,-1,1],[837,47,-1,1],[837,48,-1,1],[837,57,-1,1],[837,67,-1,1],[837,76,-2,1],[837,78,-2,1],[837,79,-2,1],[837,92,-1,1],[837,93,-1,1],[837,96,-1,1],[837,97,-1,1],[837,100,1,1],[837,105,1,1],[837,111,-2,1],[837,112,-2,1],[838,7,1,1],[838,12,1,1],[838,17,1,1],[838,39,-1,1],[838,46,-1,1],[838,53,1,1],[838,55,-1,1],[838,59,1,1],[838,65,-1,1],[838,69,1,1],[838,78,-1,1],[838,82,1,1],[838,84,1,1],[838,92,-1,1],[838,93,-1,1],[838,98,-1,1],[838,112,-1,1],[838,114,1,1],[839,25,-2,1],[839,26,-1,1],[839,27,-1,1],[839,28,2,1],[839,39,2,1],[839,58,1,1],[839,59,1,1],[839,60,1,1],[839,65,-1,1],[839,66,-1,1],[839,67,-1,1],[839,84,-2,1],[839,96,1,1],[839,97,1,1],[839,98,2,1],[839,100,1,1],[839,106,-1,1],[840,18,-2,1],[840,21,-1,1],[840,24,-1,1],[840,28,2,1],[840,46,2,1],[840,56,1,1],[840,59,1,1],[840,63,1,1],[840,65,-1,1],[840,68,-1,1],[840,72,-1,1],[840,84,-2,1],[840,94,1,1],[840,95,1,1],[840,98,2,1],[840,102,1,1],[840,108,-1,1],[841,7,1,1],[841,39,-1,1],[841,46,-1,1],[841,84,1,1],[841,98,-1,1],[842,1,1,1],[842,54,-1,1],[842,61,-1,1],[842,99,-1,1],[842,104,-1,1],[843,0,-1,1],[843,61,-1,1],[843,64,1,1],[843,99,-1,1],[843,104,-1,1],[844,0,-1,1],[844,54,-1,1],[844,71,1,1],[844,99,-1,1],[844,104,-1,1],[845,1,1,1],[845,61,-1,1],[845,64,1,1],[845,99,-1,1],[845,109,1,1],[846,1,1,1],[846,54,-1,1],[846,71,1,1],[846,99,-1,1],[846,109,1,1],[847,0,1,1],[847,64,-1,1],[847,71,-1,1],[847,99,1,1],[847,109,-1,1],[848,6,1,2],[848,33,1,2],[848,38,1,2],[848,47,1,2],[848,48,1,2],[848,57,-1,2],[848,67,-1,2],[848,76,-1,1],[848,78,-1,1],[848,79,-1,1],[848,92,1,2],[848,93,1,2],[848,96,1,2],[848,97,1,2],[848,100,1,2],[848,105,1,2],[848,111,-1,1],[848,112,-1,1],[849,2,1,2],[849,10,1,2],[849,11,1,2],[849,12,1,2],[849,36,-1,2],[849,37,-1,2],[849,38,-1,2],[849,49,1,2],[849,80,-1,2],[849,81,-1,2],[849,82,-1,2],[849,83,-1,2],[849,86,1,2],[849,92,-1,2],[849,110,1,2],[849,111,1,2],[849,112,1,2],[849,113,1,2],[850,2,-1,1],[850,49,-1,1],[850,80,1,1],[850,110,-1,1],[850,113,-1,1],[851,4,1,2],[851,8,1,2],[851,9,1,2],[851,12,1,2],[851,34,-1,2],[851,35,-1,2],[851,38,-1,2],[851,51,1,2],[851,75,-1,2],[851,76,-1,2],[851,79,-1,2],[851,82,-1,2],[851,86,1,2],[851,92,-1,2],[851,111,-1,2],[851,114,-1,2],[851,117,1,2],[851,118,1,2],[852,5,1,2],[852,8,1,2],[852,9,1,2],[852,12,1,2],[852,34,-1,2],[852,35,-1,2],[852,38,-1,2],[852,52,1,2],[852,74,-1,2],[852,76,-1,2],[852,78,-1,2],[852,81,-1,2],[852,86,1,2],[852,92,-1,2],[852,112,-1,2],[852,115,-1,2],[852,117,-1,2],[852,119,1,2],[853,79,1,1],[853,82,1,1],[853,83,1,1],[853,112,-1,1],[853,115,-1,1],[854,76,-1,1],[854,81,-1,1],[854,82,-1,1],[854,114,-1,1],[854,115,-1,1],[855,3,-1,2],[855,10,-1,2],[855,11,-1,2],[855,12,-1,2],[855,36,1,2],[855,37,1,2],[855,38,1,2],[855,50,-1,2],[855,77,1,2],[855,78,1,2],[855,79,1,2],[855,83,1,2],[855,86,-1,2],[855,92,1,2],[855,110,1,2],[855,114,-1,2],[855,115,-1,2],[855,116,-1,2],[856,3,-1,1],[856,50,-1,1],[856,77,1,1],[856,110,1,1],[856,116,-1,1],[857,11,1,2],[857,16,1,2],[857,27,1,2],[857,31,-1,2],[857,36,-1,2],[857,47,-1,2],[857,57,-1,2],[857,67,-1,2],[857,89,1,2],[857,97,-1,2],[857,101,-1,2],[857,106,-1,2],[858,2,-1,1],[858,11,-1,2],[858,15,1,2],[858,21,-1,2],[858,32,-1,2],[858,36,1,2],[858,42,-1,2],[858,50,1,1],[858,63,-1,2],[858,72,1,2],[858,80,1,1],[858,88,-1,2],[858,95,-1,2],[858,102,-1,2],[858,108,1,2],[858,110,-1,1],[858,116,1,1],[859,5,-1,1],[859,51,1,1],[859,74,1,1],[859,117,1,1],[859,118,1,1],[860,4,-1,1],[860,52,1,1],[860,74,-1,1],[860,117,-1,1],[860,118,-1,1],[861,4,-1,1],[861,51,-1,1],[861,75,1,1],[861,117,-1,1],[861,118,-1,1],[862,5,-1,1],[862,52,-1,1],[862,74,1,1],[862,117,1,1],[862,119,-1,1],[863,5,-1,1],[863,51,1,1],[863,75,-1,1],[863,117,1,1],[863,119,-1,1],[864,4,-1,1],[864,52,1,1],[864,75,1,1],[864,117,-1,1],[864,119,1,1],[865,6,-1,2],[865,8,1,2],[865,12,-1,2],[865,13,1,2],[865,17,-1,2],[865,29,1,2],[865,33,-1,2],[865,34,1,2],[865,38,-1,2],[865,53,-1,2],[865,74,1,2],[865,75,1,2],[865,81,-1,2],[865,82,-1,2],[865,83,-1,2],[865,111,1,2],[865,112,1,2],[865,118,1,2],[865,119,1,2],[866,0,1,2],[866,1,1,2],[866,19,-1,2],[866,20,-1,2],[866,22,-1,2],[866,23,-1,2],[866,33,1,2],[866,38,1,2],[866,53,1,2],[866,76,-1,2],[866,78,-1,2],[866,79,-1,2],[866,81,-1,2],[866,82,-1,2],[866,83,-1,2],[866,85,-1,2],[866,86,-1,2],[866,104,1,2],[866,109,1,2],[867,76,1,1],[867,83,-1,1],[867,111,1,1],[867,112,1,1],[867,114,1,1],[867,115,1,1],[868,2,1,1],[868,3,1,1],[868,4,1,1],[868,5,1,1],[868,13,-1,1],[868,14,-1,1],[868,15,-1,1],[868,16,-1,1],[868,29,1,1],[868,30,1,1],[868,31,1,1],[868,32,1,1],[868,49,-1,1],[868,50,-1,1],[868,51,-1,1],[868,52,-1,1],[869,13,-1,1],[869,14,-1,1],[869,15,-1,1],[869,16,-1,1],[869,29,1,1],[869,30,1,1],[869,31,1,1],[869,32,1,1],[869,74,-1,1],[869,75,-1,1],[869,77,-1,1],[869,80,-1,1],[869,113,-1,1],[869,116,-1,1],[869,118,-1,1],[869,119,-1,1],[870,2,1,1],[870,3,1,1],[870,4,1,1],[870,5,1,1],[870,8,-1,1],[870,9,-1,1],[870,10,-1,1],[870,11,-1,1],[870,34,1,1],[870,35,1,1],[870,36,1,1],[870,37,1,1],[870,49,-1,1],[870,50,-1,1],[870,51,-1,1],[870,52,-1,1],[871,8,-1,1],[871,9,-1,1],[871,10,-1,1],[871,11,-1,1],[871,34,1,1],[871,35,1,1],[871,36,1,1],[871,37,1,1],[871,74,-2,1],[871,75,-2,1],[871,77,-1,1],[871,80,-1,1],[871,113,-1,1],[871,116,-1,1],[871,118,-2,1],[871,119,-2,1],[872,9,-1,1],[872,14,-1,1],[872,22,-1,1],[872,23,-1,1],[872,29,1,1],[872,34,1,1],[872,40,1,1],[872,41,1,1],[872,51,-1,1],[872,52,-1,1],[872,61,-1,1],[872,71,-1,1],[872,104,-1,1],[872,109,-1,1],[872,118,-1,1],[872,119,-1,1],[873,11,-1,1],[873,16,-1,1],[873,20,-1,1],[873,23,-1,1],[873,31,1,1],[873,36,1,1],[873,40,1,1],[873,43,1,1],[873,49,-1,1],[873,50,-1,1],[873,54,-1,1],[873,64,-1,1],[873,104,-1,1],[873,109,-1,1],[873,113,-1,1],[873,116,-1,1],[874,10,-1,1],[874,15,-1,1],[874,19,-1,1],[874,22,-1,1],[874,32,1,1],[874,37,1,1],[874,41,1,1],[874,44,1,1],[874,49,-1,1],[874,50,-1,1],[874,54,-1,1],[874,64,-1,1],[874,104,-1,1],[874,109,-1,1],[874,113,-1,1],[874,116,-1,1],[875,8,-1,1],[875,13,-1,1],[875,19,-1,1],[875,20,-1,1],[875,30,1,1],[875,35,1,1],[875,43,1,1],[875,44,1,1],[875,51,-1,1],[875,52,-1,1],[875,61,-1,1],[875,71,-1,1],[875,104,-1,1],[875,109,-1,1],[875,118,-1,1],[875,119,-1,1],[876,2,-1,2],[876,3,-1,2],[876,4,-1,2],[876,5,-1,2],[876,8,-1,2],[876,9,-1,2],[876,10,-1,2],[876,11,-1,2],[876,34,1,2],[876,35,1,2],[876,36,1,2],[876,37,1,2],[876,49,1,2],[876,50,1,2],[876,51,1,2],[876,52,1,2],[877,4,1,1],[877,5,1,1],[877,9,-1,1],[877,13,1,1],[877,25,1,1],[877,30,-1,1],[877,34,1,1],[877,46,1,1],[877,58,-1,1],[877,59,-1,1],[877,65,1,1],[877,66,1,1],[877,91,1,1],[877,98,1,1],[877,118,1,1],[877,119,1,1],[878,2,1,1],[878,3,1,1],[878,11,-1,1],[878,15,1,1],[878,18,1,1],[878,32,-1,1],[878,36,1,1],[878,39,1,1],[878,56,-1,1],[878,59,-1,1],[878,65,1,1],[878,68,1,1],[878,91,1,1],[878,98,1,1],[878,113,1,1],[878,116,1,1],[879,18,1,1],[879,20,-1,1],[879,22,1,1],[879,25,-1,1],[879,39,1,1],[879,41,-1,1],[879,43,1,1],[879,46,-1,1],[879,54,1,1],[879,56,-1,1],[879,58,1,1],[879,61,-1,1],[879,64,1,1],[879,66,-1,1],[879,68,1,1],[879,71,-1,1],[880,0,1,1],[880,1,1,1],[880,7,1,1],[880,20,-1,1],[880,22,1,1],[880,28,1,1],[880,41,-1,1],[880,43,1,1],[880,56,-1,1],[880,58,1,1],[880,66,-1,1],[880,68,1,1],[880,91,1,1],[880,98,1,1],[880,104,1,1],[880,109,1,1],[881,18,1,1],[881,19,-1,1],[881,23,1,1],[881,25,-1,1],[881,39,1,1],[881,40,-1,1],[881,44,1,1],[881,46,-1,1],[881,54,1,1],[881,55,-1,1],[881,59,1,1],[881,61,-1,1],[881,64,1,1],[881,65,-1,1],[881,69,1,1],[881,71,-1,1],[882,2,1,1],[882,3,1,1],[882,10,-1,1],[882,16,1,1],[882,18,1,1],[882,31,-1,1],[882,37,1,1],[882,39,1,1],[882,55,-1,1],[882,58,-1,1],[882,66,1,1],[882,69,1,1],[882,91,1,1],[882,98,1,1],[882,113,1,1],[882,116,1,1],[883,4,1,1],[883,5,1,1],[883,8,-1,1],[883,14,1,1],[883,25,1,1],[883,29,-1,1],[883,35,1,1],[883,46,1,1],[883,55,-1,1],[883,56,-1,1],[883,68,1,1],[883,69,1,1],[883,91,1,1],[883,98,1,1],[883,118,1,1],[883,119,1,1],[884,18,1,2],[884,19,1,2],[884,23,-1,2],[884,25,-1,2],[884,39,1,2],[884,40,1,2],[884,44,-1,2],[884,46,-1,2],[884,54,1,2],[884,55,1,2],[884,59,-1,2],[884,61,-1,2],[884,64,1,2],[884,65,1,2],[884,69,-1,2],[884,71,-1,2],[885,7,-1,2],[885,8,-1,2],[885,14,1,2],[885,18,1,2],[885,28,-1,2],[885,29,-1,2],[885,35,1,2],[885,39,1,2],[885,51,-1,2],[885,52,-1,2],[885,55,-1,2],[885,56,-1,2],[885,68,1,2],[885,69,1,2],[885,74,1,2],[885,75,1,2],[886,0,-1,2],[886,1,-1,2],[886,4,-1,2],[886,5,-1,2],[886,8,-1,2],[886,13,-1,2],[886,19,-1,2],[886,20,-1,2],[886,30,1,2],[886,35,1,2],[886,43,1,2],[886,44,1,2],[886,54,1,2],[886,64,1,2],[886,74,1,2],[886,75,1,2],[887,7,-1,2],[887,10,-1,2],[887,16,1,2],[887,25,1,2],[887,28,-1,2],[887,31,-1,2],[887,37,1,2],[887,46,1,2],[887,49,-1,2],[887,50,-1,2],[887,55,-1,2],[887,58,-1,2],[887,66,1,2],[887,69,1,2],[887,77,1,2],[887,80,1,2],[888,0,-1,2],[888,1,-1,2],[888,2,-1,2],[888,3,-1,2],[888,10,-1,2],[888,15,-1,2],[888,19,-1,2],[888,22,-1,2],[888,32,1,2],[888,37,1,2],[888,41,1,2],[888,44,1,2],[888,61,1,2],[888,71,1,2],[888,77,1,2],[888,80,1,2],[889,0,-1,1],[889,1,-1,1],[889,2,-1,1],[889,3,-1,1],[889,49,-1,1],[889,50,-1,1],[889,54,-1,1],[889,61,1,1],[889,64,-1,1],[889,71,1,1],[889,77,1,1],[889,80,1,1],[889,104,-1,1],[889,109,-1,1],[889,113,-1,1],[889,116,-1,1],[890,2,-1,1],[890,3,-1,1],[890,10,-1,1],[890,11,-1,1],[890,15,-1,1],[890,16,-1,1],[890,42,1,1],[890,45,1,1],[890,62,1,1],[890,63,1,1],[890,72,1,1],[890,73,1,1],[890,87,-1,1],[890,88,-1,1],[890,113,-1,1],[890,116,-1,1],[891,4,-1,1],[891,5,-1,1],[891,8,-1,1],[891,9,-1,1],[891,13,-1,1],[891,14,-1,1],[891,47,1,1],[891,48,1,1],[891,57,1,1],[891,60,1,1],[891,67,1,1],[891,70,1,1],[891,89,-1,1],[891,90,-1,1],[891,118,-1,1],[891,119,-1,1],[892,21,-1,1],[892,24,-1,1],[892,26,-1,1],[892,27,-1,1],[892,67,-1,1],[892,70,-1,1],[892,72,-1,1],[892,73,-1,1],[892,87,-1,1],[892,88,-1,1],[892,89,-1,1],[892,90,-1,1],[892,105,-1,1],[892,106,-1,1],[892,107,-1,1],[892,108,-1,1],[893,5,1,1],[893,8,-1,1],[893,9,-1,1],[893,12,-1,1],[893,34,1,1],[893,35,1,1],[893,38,1,1],[893,52,1,1],[893,74,-1,1],[893,76,-1,1],[893,78,-1,1],[893,81,-1,1],[893,86,-1,1],[893,92,1,1],[893,112,-1,1],[893,115,-1,1],[893,117,-1,1],[893,119,1,1],[894,3,1,1],[894,10,-1,1],[894,11,-1,1],[894,12,-1,1],[894,36,1,1],[894,37,1,1],[894,38,1,1],[894,50,1,1],[894,77,-1,1],[894,78,-1,1],[894,79,-1,1],[894,83,-1,1],[894,86,-1,1],[894,92,1,1],[894,110,-1,1],[894,114,1,1],[894,115,1,1],[894,116,1,1],[895,5,1,1],[895,13,-1,1],[895,14,-1,1],[895,17,-1,1],[895,29,1,1],[895,30,1,1],[895,33,1,1],[895,52,1,1],[895,74,-1,1],[895,76,-1,1],[895,78,-1,1],[895,81,-1,1],[895,85,-1,1],[895,93,1,1],[895,112,-1,1],[895,115,-1,1],[895,117,-1,1],[895,119,1,1],[896,3,1,1],[896,15,-1,1],[896,16,-1,1],[896,17,-1,1],[896,31,1,1],[896,32,1,1],[896,33,1,1],[896,50,1,1],[896,77,-1,1],[896,78,-1,1],[896,79,-1,1],[896,83,-1,1],[896,85,-1,1],[896,93,1,1],[896,110,-1,1],[896,114,1,1],[896,115,1,1],[896,116,1,1],[897,7,1,1],[897,24,1,1],[897,25,-1,1],[897,28,1,1],[897,45,1,1],[897,46,-1,1],[897,55,-1,1],[897,56,-1,1],[897,65,-1,1],[897,66,-1,1],[897,87,1,1],[897,94,1,1],[897,102,1,1],[897,103,1,1],[897,107,1,1],[897,108,1,1],[898,5,1,1],[898,8,-1,1],[898,13,-1,1],[898,21,-1,1],[898,30,1,1],[898,35,1,1],[898,45,1,1],[898,51,-1,1],[898,62,-1,1],[898,72,-1,1],[898,75,1,1],[898,88,-1,1],[898,94,1,1],[898,103,-1,1],[898,108,-1,1],[898,117,-1,1],[898,119,1,1],[899,1,1,1],[899,19,-1,1],[899,20,-1,1],[899,21,-1,1],[899,43,1,1],[899,44,1,1],[899,45,1,1],[899,61,-1,1],[899,62,-1,1],[899,63,-1,1],[899,64,1,1],[899,88,-1,1],[899,94,1,1],[899,99,-1,1],[899,107,1,1],[899,108,1,1],[899,109,1,1],[900,5,1,1],[900,9,-1,1],[900,14,-1,1],[900,24,-1,1],[900,29,1,1],[900,34,1,1],[900,42,1,1],[900,51,-1,1],[900,62,-1,1],[900,72,-1,1],[900,75,1,1],[900,87,-1,1],[900,95,1,1],[900,103,-1,1],[900,108,-1,1],[900,117,-1,1],[900,119,1,1],[901,1,1,1],[901,22,-1,1],[901,23,-1,1],[901,24,-1,1],[901,40,1,1],[901,41,1,1],[901,42,1,1],[901,61,-1,1],[901,62,-1,1],[901,63,-1,1],[901,64,1,1],[901,87,-1,1],[901,95,1,1],[901,99,-1,1],[901,107,1,1],[901,108,1,1],[901,109,1,1],[902,22,-1,1],[902,23,-1,1],[902,24,-1,1],[902,40,1,1],[902,41,1,1],[902,42,1,1],[902,87,-1,1],[902,95,1,1],[903,7,1,1],[903,21,1,1],[903,25,-1,1],[903,28,1,1],[903,42,1,1],[903,46,-1,1],[903,58,-1,1],[903,59,-1,1],[903,68,-1,1],[903,69,-1,1],[903,88,1,1],[903,95,1,1],[903,102,1,1],[903,103,1,1],[903,107,1,1],[903,108,1,1],[904,2,-1,1],[904,3,-1,1],[904,21,1,1],[904,24,1,1],[904,31,-1,1],[904,32,-1,1],[904,36,-1,1],[904,37,-1,1],[904,62,1,1],[904,63,1,1],[904,72,1,1],[904,73,1,1],[904,94,-1,1],[904,95,-1,1],[904,113,-1,1],[904,116,-1,1],[905,0,-1,1],[905,1,-1,1],[905,20,1,1],[905,23,1,1],[905,41,1,1],[905,44,1,1],[905,54,1,1],[905,62,-1,1],[905,64,1,1],[905,72,-1,1],[905,87,-1,1],[905,88,-1,1],[905,94,-1,1],[905,95,-1,1],[905,103,-1,1],[905,108,-1,1],[906,4,-1,1],[906,5,-1,1],[906,13,-1,1],[906,14,-1,1],[906,34,-1,1],[906,35,-1,1],[906,62,1,1],[906,63,1,1],[906,74,1,1],[906,75,1,1],[906,87,-1,1],[906,88,-1,1],[906,94,-1,1],[906,95,-1,1],[906,107,-1,1],[906,108,-1,1],[907,4,-1,1],[907,5,-1,1],[907,21,1,1],[907,24,1,1],[907,42,1,1],[907,45,1,1],[907,51,-1,1],[907,52,-1,1],[907,74,1,1],[907,75,1,1],[907,87,-1,1],[907,88,-1,1],[907,94,-1,1],[907,95,-1,1],[907,118,-1,1],[907,119,-1,1],[908,7,1,1],[908,18,-1,1],[908,27,1,1],[908,28,1,1],[908,39,-1,1],[908,48,1,1],[908,55,-1,1],[908,58,-1,1],[908,65,-1,1],[908,68,-1,1],[908,89,1,1],[908,96,1,1],[908,100,1,1],[908,101,1,1],[908,105,1,1],[908,106,1,1],[909,1,1,1],[909,19,-1,1],[909,22,-1,1],[909,26,-1,1],[909,41,1,1],[909,44,1,1],[909,48,1,1],[909,54,-1,1],[909,57,-1,1],[909,60,-1,1],[909,71,1,1],[909,90,-1,1],[909,96,1,1],[909,99,-1,1],[909,105,1,1],[909,106,1,1],[909,109,1,1],[910,11,-1,1],[910,16,-1,1],[910,27,-1,1],[910,31,1,1],[910,36,1,1],[910,47,1,1],[910,57,-1,1],[910,67,-1,1],[910,89,-1,1],[910,97,1,1],[910,101,-1,1],[910,106,-1,1],[911,11,-1,1],[911,16,-1,1],[911,27,-1,1],[911,31,1,1],[911,36,1,1],[911,47,1,1],[911,89,-1,1],[911,97,1,1],[912,1,1,1],[912,20,-1,1],[912,23,-1,1],[912,27,-1,1],[912,40,1,1],[912,43,1,1],[912,47,1,1],[912,54,-1,1],[912,57,-1,1],[912,60,-1,1],[912,71,1,1],[912,89,-1,1],[912,97,1,1],[912,99,-1,1],[912,105,1,1],[912,106,1,1],[912,109,1,1],[913,7,1,1],[913,18,-1,1],[913,26,1,1],[913,28,1,1],[913,39,-1,1],[913,47,1,1],[913,56,-1,1],[913,59,-1,1],[913,66,-1,1],[913,69,-1,1],[913,90,1,1],[913,97,1,1],[913,100,1,1],[913,101,1,1],[913,105,1,1],[913,106,1,1],[914,26,1,1],[914,47,1,1],[914,56,-1,1],[914,59,-1,1],[914,66,-1,1],[914,69,-1,1],[914,90,1,1],[914,97,1,1],[915,4,-1,1],[915,5,-1,1],[915,26,1,1],[915,27,1,1],[915,29,-1,1],[915,30,-1,1],[915,34,-1,1],[915,35,-1,1],[915,57,1,1],[915,60,1,1],[915,67,1,1],[915,70,1,1],[915,96,-1,1],[915,97,-1,1],[915,118,-1,1],[915,119,-1,1],[916,26,1,1],[916,27,1,1],[916,29,-1,1],[916,30,-1,1],[916,34,-1,1],[916,35,-1,1],[916,96,-1,1],[916,97,-1,1],[917,0,-1,1],[917,1,-1,1],[917,22,1,1],[917,23,1,1],[917,43,1,1],[917,44,1,1],[917,57,-1,1],[917,61,1,1],[917,67,-1,1],[917,71,1,1],[917,89,-1,1],[917,90,-1,1],[917,96,-1,1],[917,97,-1,1],[917,101,-1,1],[917,106,-1,1],[918,2,-1,1],[918,3,-1,1],[918,15,-1,1],[918,16,-1,1],[918,36,-1,1],[918,37,-1,1],[918,57,1,1],[918,60,1,1],[918,77,1,1],[918,80,1,1],[918,89,-1,1],[918,90,-1,1],[918,96,-1,1],[918,97,-1,1],[918,105,-1,1],[918,106,-1,1],[919,42,-1,1],[919,45,-1,1],[919,47,-1,1],[919,48,-1,1],[919,67,-1,1],[919,70,-1,1],[919,72,-1,1],[919,73,-1,1],[919,94,-1,1],[919,95,-1,1],[919,96,-1,1],[919,97,-1,1],[919,105,-1,1],[919,106,-1,1],[919,107,-1,1],[919,108,-1,1],[920,25,1,2],[920,26,-1,2],[920,46,1,2],[920,47,-1,2],[920,56,1,2],[920,57,-1,2],[920,59,1,2],[920,60,-1,2],[920,66,1,2],[920,67,-1,2],[920,69,1,2],[920,70,-1,2],[920,90,-1,2],[920,91,1,2],[920,97,-1,2],[920,98,1,2],[921,18,1,2],[921,21,-1,2],[921,39,1,2],[921,42,-1,2],[921,58,1,2],[921,59,1,2],[921,62,-1,2],[921,63,-1,2],[921,68,1,2],[921,69,1,2],[921,72,-1,2],[921,73,-1,2],[921,88,-1,2],[921,91,1,2],[921,95,-1,2],[921,98,1,2],[922,7,1,1],[922,18,1,1],[922,25,-1,1],[922,28,1,1],[922,39,1,1],[922,46,-1,1],[922,62,-1,1],[922,63,-1,1],[922,72,-1,1],[922,73,-1,1],[922,91,1,1],[922,98,1,1],[922,102,1,1],[922,103,1,1],[922,107,1,1],[922,108,1,1],[923,10,-1,1],[923,11,-1,1],[923,26,1,1],[923,27,1,1],[923,31,-1,1],[923,32,-1,1],[923,47,1,1],[923,48,1,1],[923,49,-1,1],[923,50,-1,1],[923,67,1,1],[923,70,1,1],[923,100,-1,1],[923,101,-1,1],[923,113,-1,1],[923,116,-1,1],[924,8,-1,1],[924,9,-1,1],[924,21,1,1],[924,24,1,1],[924,29,-1,1],[924,30,-1,1],[924,42,1,1],[924,45,1,1],[924,51,-1,1],[924,52,-1,1],[924,72,1,1],[924,73,1,1],[924,102,-1,1],[924,103,-1,1],[924,118,-1,1],[924,119,-1,1],[925,42,1,2],[925,45,1,2],[925,47,1,2],[925,48,1,2],[925,57,-1,2],[925,60,-1,2],[925,62,-1,2],[925,63,-1,2],[925,94,1,2],[925,95,1,2],[925,96,1,2],[925,97,1,2],[925,100,-1,2],[925,101,-1,2],[925,102,-1,2],[925,103,-1,2],[926,19,-1,1],[926,20,-1,1],[926,26,1,1],[926,27,1,1],[926,40,-1,1],[926,41,-1,1],[926,47,1,1],[926,48,1,1],[926,54,-1,1],[926,60,1,1],[926,64,-1,1],[926,70,1,1],[926,100,1,1],[926,104,-1,1],[926,105,1,1],[926,109,-1,1],[927,21,-1,1],[927,27,1,1],[927,42,-1,1],[927,48,1,1],[927,57,-1,1],[927,63,1,1],[927,67,-1,1],[927,73,1,1],[927,87,1,1],[927,90,-1,1],[927,94,1,1],[927,97,-1,1],[927,100,1,1],[927,103,-1,1],[927,105,1,1],[927,108,-1,1],[928,4,1,1],[928,8,-1,1],[928,14,1,1],[928,26,1,1],[928,29,-1,1],[928,35,1,1],[928,47,1,1],[928,52,-1,1],[928,57,-1,1],[928,70,1,1],[928,75,-1,1],[928,90,1,1],[928,97,1,1],[928,101,-1,1],[928,105,1,1],[928,117,1,1],[928,119,-1,1],[929,4,1,1],[929,9,-1,1],[929,13,1,1],[929,26,1,1],[929,30,-1,1],[929,34,1,1],[929,47,1,1],[929,52,-1,1],[929,60,-1,1],[929,67,1,1],[929,75,-1,1],[929,90,1,1],[929,97,1,1],[929,100,-1,1],[929,106,1,1],[929,117,1,1],[929,119,-1,1],[930,9,-1,1],[930,13,1,1],[930,30,-1,1],[930,34,1,1],[930,60,-1,1],[930,67,1,1],[930,100,-1,1],[930,106,1,1],[931,25,-1,1],[931,26,-1,2],[931,27,-1,2],[931,28,1,1],[931,39,1,1],[931,58,-1,2],[931,59,-1,2],[931,60,-1,2],[931,65,1,2],[931,66,1,2],[931,67,1,2],[931,84,-1,1],[931,96,1,2],[931,97,1,2],[931,98,1,1],[931,100,-1,2],[931,106,1,2],[932,22,-1,1],[932,23,-1,1],[932,26,1,1],[932,27,1,1],[932,43,-1,1],[932,44,-1,1],[932,47,1,1],[932,48,1,1],[932,54,-1,1],[932,57,1,1],[932,64,-1,1],[932,67,1,1],[932,101,1,1],[932,104,-1,1],[932,106,1,1],[932,109,-1,1],[933,22,-1,1],[933,23,-1,1],[933,43,-1,1],[933,44,-1,1],[933,57,1,1],[933,67,1,1],[933,101,1,1],[933,106,1,1],[934,24,-1,1],[934,27,1,1],[934,45,-1,1],[934,48,1,1],[934,60,-1,1],[934,63,1,1],[934,70,-1,1],[934,73,1,1],[934,88,1,1],[934,90,-1,1],[934,95,1,1],[934,97,-1,1],[934,101,1,1],[934,103,-1,1],[934,106,1,1],[934,108,-1,1],[935,15,-1,1],[935,16,-1,1],[935,26,1,1],[935,27,1,1],[935,36,-1,1],[935,37,-1,1],[935,47,1,1],[935,48,1,1],[935,49,-1,1],[935,50,-1,1],[935,57,1,1],[935,60,1,1],[935,105,-1,1],[935,106,-1,1],[935,113,-1,1],[935,116,-1,1],[936,15,-1,1],[936,16,-1,1],[936,36,-1,1],[936,37,-1,1],[936,57,1,1],[936,60,1,1],[936,105,-1,1],[936,106,-1,1],[937,7,-1,2],[937,18,1,2],[937,26,1,2],[937,28,-1,2],[937,39,1,2],[937,47,1,2],[937,56,-1,2],[937,59,-1,2],[937,66,-1,2],[937,69,-1,2],[937,90,1,2],[937,97,1,2],[937,100,-1,2],[937,101,-1,2],[937,105,-1,2],[937,106,-1,2],[938,26,1,2],[938,27,1,2],[938,29,-1,2],[938,30,-1,2],[938,34,-1,2],[938,35,-1,2],[938,51,-1,2],[938,52,-1,2],[938,74,1,2],[938,75,1,2],[938,96,-1,2],[938,97,-1,2],[938,100,-1,2],[938,101,-1,2],[938,105,-1,2],[938,106,-1,2],[939,19,-1,1],[939,21,1,1],[939,22,-1,1],[939,24,1,1],[939,40,-1,1],[939,42,1,1],[939,43,-1,1],[939,45,1,1],[939,61,-1,1],[939,63,1,1],[939,71,-1,1],[939,73,1,1],[939,102,1,1],[939,104,-1,1],[939,107,1,1],[939,109,-1,1],[940,24,-1,2],[940,26,-1,2],[940,45,-1,2],[940,47,-1,2],[940,60,-1,2],[940,62,-1,2],[940,70,-1,2],[940,72,-1,2],[940,88,1,2],[940,89,1,2],[940,95,1,2],[940,96,1,2],[940,101,1,2],[940,102,1,2],[940,106,1,2],[940,107,1,2],[941,2,2,1],[941,11,-1,1],[941,15,1,1],[941,21,1,1],[941,32,-1,1],[941,36,1,1],[941,42,1,1],[941,50,-2,1],[941,63,-1,1],[941,72,1,1],[941,80,-2,1],[941,88,1,1],[941,95,1,1],[941,102,-1,1],[941,108,1,1],[941,110,2,1],[941,116,-2,1],[942,18,-1,1],[942,21,-1,2],[942,24,-1,2],[942,28,1,1],[942,46,1,1],[942,56,-1,2],[942,59,-1,2],[942,63,-1,2],[942,65,1,2],[942,68,1,2],[942,72,1,2],[942,84,-1,1],[942,94,1,2],[942,95,1,2],[942,98,1,1],[942,102,-1,2],[942,108,1,2],[943,56,-1,1],[943,59,-1,1],[943,63,-1,1],[943,65,1,1],[943,68,1,1],[943,72,1,1],[943,102,-1,1],[943,108,1,1],[944,20,-1,1],[944,21,1,1],[944,23,-1,1],[944,24,1,1],[944,41,-1,1],[944,42,1,1],[944,44,-1,1],[944,45,1,1],[944,61,-1,1],[944,62,1,1],[944,71,-1,1],[944,72,1,1],[944,103,1,1],[944,104,-1,1],[944,108,1,1],[944,109,-1,1],[945,24,-1,2],[945,27,-1,2],[945,45,-1,2],[945,48,-1,2],[945,60,-1,2],[945,63,-1,2],[945,70,-1,2],[945,73,-1,2],[945,88,1,2],[945,90,1,2],[945,95,1,2],[945,97,1,2],[945,101,1,2],[945,103,1,2],[945,106,1,2],[945,108,1,2],[946,13,-1,1],[946,14,-1,1],[946,21,1,1],[946,24,1,1],[946,34,-1,1],[946,35,-1,1],[946,42,1,1],[946,45,1,1],[946,51,-1,1],[946,52,-1,1],[946,62,1,1],[946,63,1,1],[946,107,-1,1],[946,108,-1,1],[946,118,-1,1],[946,119,-1,1],[947,7,-1,2],[947,21,1,2],[947,25,1,2],[947,28,-1,2],[947,42,1,2],[947,46,1,2],[947,58,-1,2],[947,59,-1,2],[947,68,-1,2],[947,69,-1,2],[947,88,1,2],[947,95,1,2],[947,102,-1,2],[947,103,-1,2],[947,107,-1,2],[947,108,-1,2],[948,7,-1,2],[948,18,1,2],[948,25,1,2],[948,28,-1,2],[948,39,1,2],[948,46,1,2],[948,62,-1,2],[948,63,-1,2],[948,72,-1,2],[948,73,-1,2],[948,91,1,2],[948,98,1,2],[948,102,-1,2],[948,103,-1,2],[948,107,-1,2],[948,108,-1,2],[949,21,1,2],[949,24,1,2],[949,31,-1,2],[949,32,-1,2],[949,36,-1,2],[949,37,-1,2],[949,49,-1,2],[949,50,-1,2],[949,77,1,2],[949,80,1,2],[949,94,-1,2],[949,95,-1,2],[949,102,-1,2],[949,103,-1,2],[949,107,-1,2],[949,108,-1,2],[950,42,1,2],[950,45,1,2],[950,47,1,2],[950,48,1,2],[950,67,-1,2],[950,70,-1,2],[950,72,-1,2],[950,73,-1,2],[950,94,1,2],[950,95,1,2],[950,96,1,2],[950,97,1,2],[950,105,-1,2],[950,106,-1,2],[950,107,-1,2],[950,108,-1,2],[951,22,-1,2],[951,23,-1,2],[951,26,-1,2],[951,27,-1,2],[951,43,-1,2],[951,44,-1,2],[951,47,-1,2],[951,48,-1,2],[951,54,1,2],[951,57,1,2],[951,64,1,2],[951,67,1,2],[951,101,1,2],[951,104,1,2],[951,106,1,2],[951,109,1,2],[952,20,-1,2],[952,21,-1,2],[952,23,-1,2],[952,24,-1,2],[952,41,-1,2],[952,42,-1,2],[952,44,-1,2],[952,45,-1,2],[952,61,1,2],[952,62,1,2],[952,71,1,2],[952,72,1,2],[952,103,1,2],[952,104,1,2],[952,108,1,2],[952,109,1,2],[953,0,-1,2],[953,1,-1,2],[953,7,-1,2],[953,19,-1,2],[953,23,1,2],[953,28,-1,2],[953,40,-1,1],[953,44,1,1],[953,55,-1,2],[953,59,1,2],[953,65,-1,2],[953,69,1,2],[953,91,-1,2],[953,98,-1,2],[953,104,-1,2],[953,109,-1,2],[954,0,-1,2],[954,6,-1,2],[954,12,-1,2],[954,19,-1,2],[954,23,1,2],[954,33,-1,2],[954,40,-1,2],[954,44,1,2],[954,64,1,2],[954,71,1,2],[954,78,-1,2],[954,82,1,2],[954,86,-1,2],[954,93,-1,2],[954,99,-1,2],[954,109,1,2],[954,112,-1,2],[954,114,1,2],[955,7,-1,2],[955,12,-1,2],[955,17,-1,2],[955,39,1,2],[955,46,1,2],[955,53,-1,2],[955,55,-1,2],[955,59,1,2],[955,65,-1,2],[955,69,1,2],[955,78,-1,2],[955,82,1,2],[955,84,-1,2],[955,92,1,2],[955,93,1,2],[955,98,1,2],[955,112,-1,2],[955,114,1,2],[956,0,-1,2],[956,6,-1,2],[956,12,-1,2],[956,20,-1,2],[956,22,1,2],[956,33,-1,2],[956,41,-1,2],[956,43,1,2],[956,64,1,2],[956,71,1,2],[956,79,-1,2],[956,81,1,2],[956,86,-1,2],[956,93,-1,2],[956,99,-1,2],[956,109,1,2],[956,111,-1,2],[956,115,1,2],[957,7,-1,2],[957,12,-1,2],[957,17,-1,2],[957,39,1,2],[957,46,1,2],[957,53,-1,2],[957,56,-1,2],[957,58,1,2],[957,66,-1,2],[957,68,1,2],[957,79,-1,2],[957,81,1,2],[957,84,-1,2],[957,92,1,2],[957,93,1,2],[957,98,1,2],[957,111,-1,2],[957,115,1,2],[958,15,-1,2],[958,16,-1,2],[958,26,-1,2],[958,27,-1,2],[958,36,-1,2],[958,37,-1,2],[958,47,-1,2],[958,48,-1,2],[958,49,1,2],[958,50,1,2],[958,57,1,2],[958,60,1,2],[958,105,-1,2],[958,106,-1,2],[958,113,1,2],[958,116,1,2],[959,2,1,2],[959,3,1,2],[959,21,1,2],[959,24,1,2],[959,31,-1,2],[959,32,-1,2],[959,36,-1,2],[959,37,-1,2],[959,62,-1,2],[959,63,-1,2],[959,72,-1,2],[959,73,-1,2],[959,94,-1,2],[959,95,-1,2],[959,113,1,2],[959,116,1,2],[960,2,-1,2],[960,3,-1,2],[960,10,-1,2],[960,16,1,2],[960,18,-1,2],[960,31,-1,2],[960,37,1,2],[960,39,-1,2],[960,55,-1,2],[960,58,-1,2],[960,66,1,2],[960,69,1,2],[960,91,-1,2],[960,98,-1,2],[960,113,-1,2],[960,116,-1,2],[961,10,1,2],[961,15,1,2],[961,19,1,2],[961,22,1,2],[961,32,-1,2],[961,37,-1,2],[961,41,-1,2],[961,44,-1,2],[961,49,-1,2],[961,50,-1,2],[961,54,-1,2],[961,64,-1,2],[961,104,-1,2],[961,109,-1,2],[961,113,-1,2],[961,116,-1,2],[962,0,1,2],[962,1,1,2],[962,2,1,2],[962,3,1,2],[962,49,-1,2],[962,50,-1,2],[962,54,-1,2],[962,61,-1,2],[962,64,-1,2],[962,71,-1,2],[962,77,-1,2],[962,80,-1,2],[962,104,-1,2],[962,109,-1,2],[962,113,-1,2],[962,116,-1,2],[963,8,-1,2],[963,9,-1,2],[963,21,-1,2],[963,24,-1,2],[963,29,-1,2],[963,30,-1,2],[963,42,-1,2],[963,45,-1,2],[963,51,1,2],[963,52,1,2],[963,72,1,2],[963,73,1,2],[963,102,-1,2],[963,103,-1,2],[963,118,1,2],[963,119,1,2],[964,13,-1,2],[964,14,-1,2],[964,21,-1,2],[964,24,-1,2],[964,34,-1,2],[964,35,-1,2],[964,42,-1,2],[964,45,-1,2],[964,51,1,2],[964,52,1,2],[964,62,1,2],[964,63,1,2],[964,107,-1,2],[964,108,-1,2],[964,118,1,2],[964,119,1,2],[965,4,1,2],[965,5,1,2],[965,26,1,2],[965,27,1,2],[965,29,-1,2],[965,30,-1,2],[965,34,-1,2],[965,35,-1,2],[965,57,-1,2],[965,60,-1,2],[965,67,-1,2],[965,70,-1,2],[965,96,-1,2],[965,97,-1,2],[965,118,1,2],[965,119,1,2],[966,4,-1,2],[966,5,-1,2],[966,8,-1,2],[966,14,1,2],[966,25,-1,2],[966,29,-1,2],[966,35,1,2],[966,46,-1,2],[966,55,-1,2],[966,56,-1,2],[966,68,1,2],[966,69,1,2],[966,91,-1,2],[966,98,-1,2],[966,118,-1,2],[966,119,-1,2],[967,8,1,2],[967,13,1,2],[967,19,1,2],[967,20,1,2],[967,30,-1,2],[967,35,-1,2],[967,43,-1,2],[967,44,-1,2],[967,51,-1,2],[967,52,-1,2],[967,61,-1,2],[967,71,-1,2],[967,104,-1,2],[967,109,-1,2],[967,118,-1,2],[967,119,-1,2],[968,2,-1,1],[968,7,-1,1],[968,10,-1,1],[968,11,-1,1],[968,15,-1,1],[968,16,-1,1],[968,25,-1,1],[968,39,1,1],[968,50,1,1],[968,58,1,1],[968,59,1,1],[968,68,1,1],[968,69,1,1],[968,80,1,1],[968,84,-1,1],[968,91,-1,1],[968,110,-1,1],[968,116,1,1],[969,4,-1,1],[969,7,-1,1],[969,8,-1,1],[969,9,-1,1],[969,13,-1,1],[969,14,-1,1],[969,18,-1,1],[969,46,1,1],[969,52,1,1],[969,56,1,1],[969,59,1,1],[969,66,1,1],[969,69,1,1],[969,75,1,1],[969,84,-1,1],[969,91,-1,1],[969,117,-1,1],[969,119,1,1],[970,4,-1,1],[970,25,1,1],[970,28,-1,1],[970,29,-1,1],[970,30,-1,1],[970,34,-1,1],[970,35,-1,1],[970,39,-1,1],[970,52,1,1],[970,56,1,1],[970,59,1,1],[970,66,1,1],[970,69,1,1],[970,75,1,1],[970,84,1,1],[970,98,-1,1],[970,117,-1,1],[970,119,1,1],[971,2,-1,1],[971,18,1,1],[971,28,-1,1],[971,31,-1,1],[971,32,-1,1],[971,36,-1,1],[971,37,-1,1],[971,46,-1,1],[971,50,1,1],[971,58,1,1],[971,59,1,1],[971,68,1,1],[971,69,1,1],[971,80,1,1],[971,84,1,1],[971,98,-1,1],[971,110,-1,1],[971,116,1,1],[972,0,-1,1],[972,7,1,1],[972,39,-1,1],[972,40,-1,1],[972,41,-1,1],[972,43,-1,1],[972,44,-1,1],[972,46,-1,1],[972,64,1,1],[972,65,1,1],[972,66,1,1],[972,68,1,1],[972,69,1,1],[972,71,1,1],[972,84,1,1],[972,98,-1,1],[972,99,-1,1],[972,109,1,1],[973,1,1,2],[973,7,1,2],[973,39,-1,2],[973,40,-1,2],[973,41,-1,2],[973,43,-1,2],[973,44,-1,2],[973,46,-1,2],[973,54,-1,2],[973,55,-1,2],[973,56,-1,2],[973,58,-1,2],[973,59,-1,2],[973,61,-1,2],[973,84,1,2],[973,98,-1,2],[973,99,-1,2],[973,104,-1,2],[974,0,-1,1],[974,3,-1,1],[974,10,-1,1],[974,11,-1,1],[974,22,-1,1],[974,23,-1,1],[974,31,-1,1],[974,32,-1,1],[974,43,-1,1],[974,44,-1,1],[974,49,1,1],[974,61,-1,1],[974,64,1,1],[974,80,-1,1],[974,99,-1,1],[974,104,-1,1],[974,110,1,1],[974,116,-1,1],[975,0,-1,1],[975,5,-1,1],[975,8,-1,1],[975,9,-1,1],[975,20,-1,1],[975,23,-1,1],[975,29,-1,1],[975,30,-1,1],[975,41,-1,1],[975,44,-1,1],[975,51,1,1],[975,54,-1,1],[975,71,1,1],[975,75,-1,1],[975,99,-1,1],[975,104,-1,1],[975,117,1,1],[975,119,-1,1],[976,0,1,2],[976,20,1,2],[976,23,1,2],[976,27,1,2],[976,40,-1,2],[976,43,-1,2],[976,47,-1,2],[976,61,1,2],[976,64,-1,2],[976,67,-1,2],[976,70,-1,2],[976,89,1,2],[976,97,-1,2],[976,99,1,2],[976,100,1,2],[976,101,1,2],[976,104,1,2],[977,0,1,2],[977,22,1,2],[977,23,1,2],[977,24,1,2],[977,40,-1,2],[977,41,-1,2],[977,42,-1,2],[977,54,1,2],[977,71,-1,2],[977,72,-1,2],[977,73,-1,2],[977,87,1,2],[977,95,-1,2],[977,99,1,2],[977,102,1,2],[977,103,1,2],[977,104,1,2],[978,1,-1,1],[978,5,-1,1],[978,13,-1,1],[978,14,-1,1],[978,20,-1,1],[978,23,-1,1],[978,34,-1,1],[978,35,-1,1],[978,41,-1,1],[978,44,-1,1],[978,51,1,1],[978,61,1,1],[978,64,-1,1],[978,75,-1,1],[978,99,1,1],[978,109,-1,1],[978,117,1,1],[978,119,-1,1],[979,1,-1,1],[979,3,-1,1],[979,15,-1,1],[979,16,-1,1],[979,22,-1,1],[979,23,-1,1],[979,36,-1,1],[979,37,-1,1],[979,43,-1,1],[979,44,-1,1],[979,49,1,1],[979,54,1,1],[979,71,-1,1],[979,80,-1,1],[979,99,1,1],[979,109,-1,1],[979,110,1,1],[979,116,-1,1],[980,0,1,2],[980,7,1,2],[980,39,-1,2],[980,40,-1,2],[980,41,-1,2],[980,43,-1,2],[980,44,-1,2],[980,46,-1,2],[980,64,-1,2],[980,65,-1,2],[980,66,-1,2],[980,68,-1,2],[980,69,-1,2],[980,71,-1,2],[980,84,1,2],[980,98,-1,2],[980,99,1,2],[980,109,-1,2],[981,1,1,2],[981,20,1,2],[981,23,1,2],[981,27,1,2],[981,40,-1,2],[981,43,-1,2],[981,47,-1,2],[981,54,-1,2],[981,57,-1,2],[981,60,-1,2],[981,71,1,2],[981,89,1,2],[981,97,-1,2],[981,99,-1,2],[981,105,1,2],[981,106,1,2],[981,109,1,2],[982,1,1,2],[982,22,1,2],[982,23,1,2],[982,24,1,2],[982,40,-1,2],[982,41,-1,2],[982,42,-1,2],[982,61,-1,2],[982,62,-1,2],[982,63,-1,2],[982,64,1,2],[982,87,1,2],[982,95,-1,2],[982,99,-1,2],[982,107,1,2],[982,108,1,2],[982,109,1,2],[983,6,-1,1],[983,8,-1,1],[983,12,-1,1],[983,13,-1,1],[983,17,-1,1],[983,29,-1,1],[983,33,-1,1],[983,34,-1,1],[983,38,-1,1],[983,53,-1,1],[983,74,1,1],[983,75,1,1],[983,81,1,1],[983,82,1,1],[983,83,1,1],[983,111,-1,1],[983,112,-1,1],[983,118,1,1],[983,119,1,1],[984,1,1,2],[984,2,-1,2],[984,15,1,2],[984,16,1,2],[984,19,-1,2],[984,20,-1,2],[984,36,1,2],[984,37,1,2],[984,40,-1,2],[984,41,-1,2],[984,50,1,2],[984,54,-1,2],[984,71,1,2],[984,77,-1,2],[984,99,-1,2],[984,109,1,2],[984,110,-1,2],[984,113,-1,2],[985,3,1,2],[985,18,1,2],[985,28,-1,2],[985,31,-1,2],[985,32,-1,2],[985,36,-1,2],[985,37,-1,2],[985,46,-1,2],[985,49,-1,2],[985,55,-1,2],[985,56,-1,2],[985,65,-1,2],[985,66,-1,2],[985,77,-1,2],[985,84,1,2],[985,98,-1,2],[985,110,-1,2],[985,113,-1,2],[986,6,1,1],[986,10,-1,1],[986,12,1,1],[986,15,-1,1],[986,17,1,1],[986,31,-1,1],[986,33,1,1],[986,36,-1,1],[986,38,1,1],[986,53,1,1],[986,76,1,1],[986,77,-1,1],[986,79,1,1],[986,80,-1,1],[986,82,1,1],[986,111,1,1],[986,113,-1,1],[986,114,1,1],[986,116,-1,1],[987,6,1,1],[987,11,-1,1],[987,12,1,1],[987,16,-1,1],[987,17,1,1],[987,32,-1,1],[987,33,1,1],[987,37,-1,1],[987,38,1,1],[987,53,1,1],[987,76,1,1],[987,77,-1,1],[987,78,1,1],[987,80,-1,1],[987,81,1,1],[987,112,1,1],[987,113,-1,1],[987,115,1,1],[987,116,-1,1],[988,17,-1,2],[988,27,-1,2],[988,38,-1,2],[988,48,-1,2],[988,53,-1,2],[988,79,-1,2],[988,82,-1,2],[988,83,-1,2],[988,86,1,2],[988,90,1,2],[988,93,1,2],[988,97,1,2],[988,112,1,2],[988,115,1,2],[989,6,-1,2],[989,33,-1,2],[989,38,-1,2],[989,42,-1,1],[989,45,-1,1],[989,63,-1,2],[989,73,-1,2],[989,79,-1,2],[989,82,-1,2],[989,83,-1,2],[989,92,-1,2],[989,93,-1,2],[989,94,-1,1],[989,95,-1,1],[989,103,1,2],[989,108,1,2],[989,112,1,2],[989,115,1,2],[990,6,-1,1],[990,9,-1,1],[990,12,-1,1],[990,14,-1,1],[990,17,-1,1],[990,30,-1,1],[990,33,-1,1],[990,35,-1,1],[990,38,-1,1],[990,53,-1,1],[990,74,1,1],[990,75,1,1],[990,78,1,1],[990,79,1,1],[990,83,1,1],[990,114,-1,1],[990,115,-1,1],[990,118,1,1],[990,119,1,1],[991,17,1,2],[991,24,-1,2],[991,38,1,2],[991,45,-1,2],[991,53,1,2],[991,76,-1,2],[991,81,-1,2],[991,82,-1,2],[991,86,-1,2],[991,88,1,2],[991,93,-1,2],[991,95,1,2],[991,114,-1,2],[991,115,-1,2],[992,6,1,2],[992,33,1,2],[992,38,1,2],[992,47,1,1],[992,48,1,1],[992,60,-1,2],[992,70,-1,2],[992,76,-1,2],[992,81,-1,2],[992,82,-1,2],[992,92,1,2],[992,93,1,2],[992,96,1,1],[992,97,1,1],[992,101,1,2],[992,106,1,2],[992,114,-1,2],[992,115,-1,2],[993,3,-1,1],[993,5,-1,1],[993,9,-1,1],[993,11,-1,1],[993,14,-1,1],[993,16,-1,1],[993,30,-1,1],[993,32,-1,1],[993,35,-1,1],[993,37,-1,1],[993,50,-1,1],[993,52,-1,1],[993,74,1,1],[993,77,1,1],[993,110,1,1],[993,116,-1,1],[993,117,1,1],[993,119,-1,1],[994,1,1,2],[994,3,-1,2],[994,15,1,2],[994,16,1,2],[994,22,-1,2],[994,23,-1,2],[994,36,1,2],[994,37,1,2],[994,43,-1,2],[994,44,-1,2],[994,49,1,2],[994,54,-1,2],[994,71,1,2],[994,80,-1,2],[994,99,-1,2],[994,109,1,2],[994,110,1,2],[994,116,-1,2],[995,2,1,2],[995,18,1,2],[995,28,-1,2],[995,31,-1,2],[995,32,-1,2],[995,36,-1,2],[995,37,-1,2],[995,46,-1,2],[995,50,-1,2],[995,58,-1,2],[995,59,-1,2],[995,68,-1,2],[995,69,-1,2],[995,80,-1,2],[995,84,1,2],[995,98,-1,2],[995,110,1,2],[995,116,-1,2],[996,1,1,2],[996,4,-1,2],[996,13,1,2],[996,14,1,2],[996,19,-1,2],[996,22,-1,2],[996,34,1,2],[996,35,1,2],[996,40,-1,2],[996,43,-1,2],[996,52,1,2],[996,61,-1,2],[996,64,1,2],[996,74,-1,2],[996,99,-1,2],[996,109,1,2],[996,117,-1,2],[996,118,-1,2],[997,5,1,2],[997,25,1,2],[997,28,-1,2],[997,29,-1,2],[997,30,-1,2],[997,34,-1,2],[997,35,-1,2],[997,39,-1,2],[997,51,-1,2],[997,55,-1,2],[997,58,-1,2],[997,65,-1,2],[997,68,-1,2],[997,74,-1,2],[997,84,1,2],[997,98,-1,2],[997,117,-1,2],[997,118,-1,2],[998,3,1,2],[998,4,-1,2],[998,9,1,2],[998,10,-1,2],[998,14,1,2],[998,15,-1,2],[998,30,1,2],[998,31,-1,2],[998,35,1,2],[998,36,-1,2],[998,50,1,2],[998,51,-1,2],[998,75,1,2],[998,77,-1,2],[998,110,-1,2],[998,116,1,2],[998,117,-1,2],[998,118,-1,2],[999,5,-1,2],[999,9,-1,2],[999,13,1,2],[999,27,-1,2],[999,30,-1,2],[999,34,1,2],[999,48,-1,2],[999,51,1,2],[999,60,-1,2],[999,67,1,2],[999,74,1,2],[999,89,-1,2],[999,96,-1,2],[999,100,-1,2],[999,106,1,2],[999,117,1,2],[999,118,1,2],[1000,4,1,2],[1000,9,1,2],[1000,14,1,2],[1000,24,1,2],[1000,29,-1,2],[1000,34,-1,2],[1000,42,-1,2],[1000,52,-1,2],[1000,63,-1,2],[1000,73,-1,2],[1000,74,1,2],[1000,87,1,2],[1000,95,-1,2],[1000,102,-1,2],[1000,107,-1,2],[1000,117,1,2],[1000,118,1,2],[1001,3,1,2],[1001,5,-1,2],[1001,9,1,2],[1001,11,-1,2],[1001,14,1,2],[1001,16,-1,2],[1001,30,1,2],[1001,32,-1,2],[1001,35,1,2],[1001,37,-1,2],[1001,50,1,2],[1001,52,-1,2],[1001,74,1,2],[1001,77,-1,2],[1001,110,-1,2],[1001,116,1,2],[1001,117,1,2],[1001,119,-1,2],[1002,1,1,2],[1002,5,-1,2],[1002,13,1,2],[1002,14,1,2],[1002,20,-1,2],[1002,23,-1,2],[1002,34,1,2],[1002,35,1,2],[1002,41,-1,2],[1002,44,-1,2],[1002,51,1,2],[1002,61,-1,2],[1002,64,1,2],[1002,75,-1,2],[1002,99,-1,2],[1002,109,1,2],[1002,117,1,2],[1002,119,-1,2],[1003,4,1,2],[1003,25,1,2],[1003,28,-1,2],[1003,29,-1,2],[1003,30,-1,2],[1003,34,-1,2],[1003,35,-1,2],[1003,39,-1,2],[1003,52,-1,2],[1003,56,-1,2],[1003,59,-1,2],[1003,66,-1,2],[1003,69,-1,2],[1003,75,-1,2],[1003,84,1,2],[1003,98,-1,2],[1003,117,1,2],[1003,119,-1,2],[1004,4,-1,2],[1004,9,-1,2],[1004,13,1,2],[1004,26,-1,2],[1004,30,-1,2],[1004,34,1,2],[1004,47,-1,2],[1004,52,1,2],[1004,60,-1,2],[1004,67,1,2],[1004,75,1,2],[1004,90,-1,2],[1004,97,-1,2],[1004,100,-1,2],[1004,106,1,2],[1004,117,-1,2],[1004,119,1,2],[1005,5,1,2],[1005,9,1,2],[1005,14,1,2],[1005,24,1,2],[1005,29,-1,2],[1005,34,-1,2],[1005,42,-1,2],[1005,51,-1,2],[1005,62,-1,2],[1005,72,-1,2],[1005,75,1,2],[1005,87,1,2],[1005,95,-1,2],[1005,103,-1,2],[1005,108,-1,2],[1005,117,-1,2],[1005,119,1,2],[1006,18,1,1],[1006,25,1,1],[1006,28,-1,1],[1006,33,-1,1],[1006,38,-1,1],[1006,53,-1,1],[1006,56,-1,1],[1006,58,1,1],[1006,66,-1,1],[1006,68,1,1],[1006,79,-1,1],[1006,81,1,1],[1006,84,1,1],[1006,85,1,1],[1006,86,1,1],[1006,91,1,1],[1006,111,-1,1],[1006,115,1,1],[1007,6,-1,2],[1007,7,1,2],[1007,12,-1,2],[1007,28,1,2],[1007,33,-1,2],[1007,65,1,2],[1007,66,1,2],[1007,68,1,2],[1007,69,1,2],[1007,76,-1,2],[1007,78,-1,2],[1007,79,-1,2],[1007,81,-1,2],[1007,82,-1,2],[1007,83,-1,2],[1007,86,-1,2],[1007,91,1,2],[1007,93,-1,2],[1007,98,1,2],[1008,7,1,1],[1008,12,1,1],[1008,17,1,1],[1008,39,-1,1],[1008,46,-1,1],[1008,53,1,1],[1008,56,-1,1],[1008,58,1,1],[1008,66,-1,1],[1008,68,1,1],[1008,79,-1,1],[1008,81,1,1],[1008,84,1,1],[1008,92,-1,1],[1008,93,-1,1],[1008,98,-1,1],[1008,111,-1,1],[1008,115,1,1],[1009,1,-1,1],[1009,6,-1,1],[1009,17,-1,1],[1009,20,1,1],[1009,22,-1,1],[1009,38,-1,1],[1009,41,1,1],[1009,43,-1,1],[1009,54,1,1],[1009,61,1,1],[1009,79,1,1],[1009,81,-1,1],[1009,85,-1,1],[1009,92,-1,1],[1009,99,1,1],[1009,104,1,1],[1009,111,1,1],[1009,115,-1,1],[1010,0,-1,1],[1010,6,-1,1],[1010,12,-1,1],[1010,20,1,1],[1010,22,-1,1],[1010,33,-1,1],[1010,41,1,1],[1010,43,-1,1],[1010,64,1,1],[1010,71,1,1],[1010,79,1,1],[1010,81,-1,1],[1010,86,-1,1],[1010,93,-1,1],[1010,99,-1,1],[1010,109,1,1],[1010,111,1,1],[1010,115,-1,1],[1011,0,1,2],[1011,1,1,2],[1011,12,1,2],[1011,17,1,2],[1011,40,-1,2],[1011,41,-1,2],[1011,43,-1,2],[1011,44,-1,2],[1011,53,1,2],[1011,76,-1,2],[1011,78,-1,2],[1011,79,-1,2],[1011,81,-1,2],[1011,82,-1,2],[1011,83,-1,2],[1011,92,-1,2],[1011,93,-1,2],[1011,104,1,2],[1011,109,1,2],[1012,2,1,2],[1012,15,1,2],[1012,16,1,2],[1012,17,1,2],[1012,31,-1,2],[1012,32,-1,2],[1012,33,-1,2],[1012,49,1,2],[1012,80,-1,2],[1012,81,-1,2],[1012,82,-1,2],[1012,83,-1,2],[1012,85,1,2],[1012,93,-1,2],[1012,110,1,2],[1012,111,1,2],[1012,112,1,2],[1012,113,1,2],[1013,18,1,2],[1013,25,-1,2],[1013,39,1,2],[1013,46,-1,2],[1013,65,1,2],[1013,66,1,2],[1013,68,1,2],[1013,69,1,2],[1013,76,1,2],[1013,83,-1,2],[1013,111,1,2],[1013,112,1,2],[1013,114,1,2],[1013,115,1,2],[1014,12,1,1],[1014,17,1,1],[1014,40,-1,2],[1014,41,-1,2],[1014,43,-1,2],[1014,44,-1,2],[1014,53,1,1],[1014,54,-1,2],[1014,61,1,2],[1014,64,-1,2],[1014,71,1,2],[1014,76,-1,2],[1014,83,1,2],[1014,92,-1,1],[1014,93,-1,1],[1014,111,-1,2],[1014,112,-1,2],[1014,114,-1,2],[1014,115,-1,2],[1015,6,-1,2],[1015,11,-1,2],[1015,12,-1,2],[1015,16,-1,2],[1015,17,-1,2],[1015,32,-1,2],[1015,33,-1,2],[1015,37,-1,2],[1015,38,-1,2],[1015,53,-1,2],[1015,76,1,2],[1015,77,1,2],[1015,78,1,2],[1015,80,1,2],[1015,81,1,2],[1015,112,1,2],[1015,113,1,2],[1015,115,1,2],[1015,116,1,2],[1016,3,-1,2],[1016,15,-1,2],[1016,16,-1,2],[1016,17,-1,2],[1016,31,1,2],[1016,32,1,2],[1016,33,1,2],[1016,50,-1,2],[1016,77,1,2],[1016,78,1,2],[1016,79,1,2],[1016,83,1,2],[1016,85,-1,2],[1016,93,1,2],[1016,110,1,2],[1016,114,-1,2],[1016,115,-1,2],[1016,116,-1,2],[1017,4,1,2],[1017,13,1,2],[1017,14,1,2],[1017,17,1,2],[1017,29,-1,2],[1017,30,-1,2],[1017,33,-1,2],[1017,51,1,2],[1017,75,-1,2],[1017,76,-1,2],[1017,79,-1,2],[1017,82,-1,2],[1017,85,1,2],[1017,93,-1,2],[1017,111,-1,2],[1017,114,-1,2],[1017,117,1,2],[1017,118,1,2],[1018,5,1,2],[1018,13,1,2],[1018,14,1,2],[1018,17,1,2],[1018,29,-1,2],[1018,30,-1,2],[1018,33,-1,2],[1018,52,1,2],[1018,74,-1,2],[1018,76,-1,2],[1018,78,-1,2],[1018,81,-1,2],[1018,85,1,2],[1018,93,-1,2],[1018,112,-1,2],[1018,115,-1,2],[1018,117,-1,2],[1018,119,1,2],[1019,6,-1,2],[1019,9,1,2],[1019,12,-1,2],[1019,14,1,2],[1019,17,-1,2],[1019,30,1,2],[1019,33,-1,2],[1019,35,1,2],[1019,38,-1,2],[1019,53,-1,2],[1019,74,1,2],[1019,75,1,2],[1019,78,-1,2],[1019,79,-1,2],[1019,83,-1,2],[1019,114,1,2],[1019,115,1,2],[1019,118,1,2],[1019,119,1,2],[1020,8,1,1],[1020,9,1,1],[1020,10,1,1],[1020,11,1,1],[1020,13,-1,1],[1020,14,-1,1],[1020,15,-1,1],[1020,16,-1,1],[1020,29,1,1],[1020,30,1,1],[1020,31,1,1],[1020,32,1,1],[1020,34,-1,1],[1020,35,-1,1],[1020,36,-1,1],[1020,37,-1,1],[1021,7,1,1],[1021,11,-1,1],[1021,15,1,1],[1021,25,-1,1],[1021,28,1,1],[1021,32,-1,1],[1021,36,1,1],[1021,46,-1,1],[1021,49,1,1],[1021,50,1,1],[1021,56,-1,1],[1021,59,-1,1],[1021,65,1,1],[1021,68,1,1],[1021,77,-1,1],[1021,80,-1,1],[1022,0,1,1],[1022,1,1,1],[1022,2,1,1],[1022,3,1,1],[1022,11,-1,1],[1022,16,-1,1],[1022,20,-1,1],[1022,23,-1,1],[1022,31,1,1],[1022,36,1,1],[1022,40,1,1],[1022,43,1,1],[1022,61,-1,1],[1022,71,-1,1],[1022,77,-1,1],[1022,80,-1,1]],"post_source_inverse_gates":[],"pre_helper_inverse_gates":[[403,628,-1,1],[403,577,-1,2],[403,409,1,1],[355,619,-1,1],[355,556,-1,2],[355,356,1,1],[596,869,1,2],[869,596,-1,1],[593,871,1,2],[871,593,-1,1],[593,596,-1,1],[785,631,-1,2],[631,785,1,1],[782,733,-1,2],[733,782,1,1],[631,733,-1,1],[280,367,-1,2],[367,280,1,1],[277,358,-1,2],[358,277,1,1],[367,358,-1,1],[640,689,1,2],[689,640,-1,1],[447,601,-1,2],[601,447,1,1],[640,447,-1,1],[735,491,1,2],[491,735,-1,1],[730,721,1,2],[721,730,-1,1],[491,721,-1,1],[786,803,1,2],[803,786,-1,1],[781,567,-1,2],[567,781,1,1],[803,567,1,1],[794,801,-1,2],[801,794,1,1],[801,601,-1,1],[768,451,-1,2],[451,768,1,1],[756,716,-1,2],[716,756,1,1],[451,716,-1,1],[810,779,1,2],[779,810,-1,1],[805,602,1,2],[602,805,-1,1],[779,602,-1,1],[819,777,-1,2],[777,819,1,1],[814,255,-1,2],[255,814,1,1],[777,255,-1,1],[857,910,1,2],[910,857,-1,1],[809,616,1,2],[616,809,-1,1],[857,809,-1,1],[858,941,-1,2],[941,858,1,1],[858,785,-1,1],[848,837,1,2],[837,848,-1,1],[848,805,-1,1],[420,836,-1,2],[836,420,1,1],[420,781,-1,1],[991,821,-1,2],[821,991,1,1],[821,836,-1,1],[988,812,1,2],[812,988,-1,1],[812,689,-1,1],[931,839,-1,2],[839,931,1,1],[807,795,-1,2],[795,807,1,1],[839,795,-1,1],[942,840,-1,2],[840,942,1,1],[581,787,-1,2],[787,581,1,1],[840,787,-1,1],[992,796,1,2],[796,992,-1,1],[796,837,-1,1],[989,788,-1,2],[788,989,1,1],[425,607,1,2],[607,425,-1,1],[788,607,-1,1],[1014,691,-1,2],[691,1014,1,1],[1011,547,-1,2],[547,1011,1,1],[691,547,-1,1],[1013,603,1,2],[603,1013,-1,1],[1007,401,1,2],[401,1007,-1,1],[603,401,-1,1],[753,688,1,2],[688,753,-1,1],[595,374,1,2],[374,595,-1,1],[688,374,-1,1],[771,600,1,2],[600,771,-1,1],[866,287,-1,2],[287,866,1,1],[600,287,-1,1],[764,778,1,2],[778,764,-1,1],[816,764,-1,1],[581,764,-1,1],[766,780,1,2],[780,766,-1,1],[807,766,-1,1],[790,724,-1,2],[724,790,1,1],[625,724,-1,1],[288,770,-1,2],[770,288,1,1],[385,288,-1,1],[266,775,1,2],[775,266,-1,1],[583,266,-1,1],[806,734,1,2],[734,806,-1,1],[541,734,-1,1],[616,734,-1,1],[375,380,1,2],[380,375,-1,1],[307,380,-1,1],[804,748,1,2],[748,804,-1,1],[783,748,-1,1],[774,263,1,2],[263,774,-1,1],[558,263,-1,1],[953,550,-1,2],[550,953,1,1],[521,292,1,1],[292,521,-1,2],[550,521,-1,1],[274,257,1,2],[257,274,-1,1],[271,755,1,2],[755,271,-1,1],[257,755,-1,1],[755,257,1,1],[358,367,1,1],[257,367,-1,1],[425,814,1,1],[814,425,1,1],[447,640,-1,1],[425,640,1,1],[698,731,1,2],[731,698,-1,1],[698,806,-1,1],[806,698,1,1],[984,737,1,2],[737,984,-1,1],[740,719,1,2],[719,740,-1,1],[984,740,-1,1],[740,246,-1,1],[698,246,-1,1],[637,732,-1,2],[732,637,1,1],[637,782,-1,1],[782,637,-1,1],[985,738,-1,2],[738,985,1,1],[758,715,-1,2],[715,758,1,1],[985,758,-1,1],[758,249,1,1],[637,249,-1,1],[567,803,1,1],[601,801,-1,1],[567,601,1,1],[759,690,1,2],[690,759,-1,1],[690,780,-1,1],[780,690,1,1],[765,969,-1,2],[969,765,1,1],[760,714,-1,2],[714,760,1,1],[969,714,-1,1],[714,656,-1,1],[690,656,-1,1],[761,599,1,2],[599,761,-1,1],[599,778,-1,1],[778,599,1,1],[767,968,-1,2],[968,767,1,1],[968,715,-1,1],[715,654,-1,1],[599,654,-1,1],[602,779,-1,1],[255,777,-1,1],[602,255,-1,1],[367,453,2,1],[453,257,-1,2],[940,553,-1,2],[553,940,1,1],[305,544,-1,2],[544,305,1,1],[940,305,-1,1],[305,587,-1,1],[447,305,-1,1],[876,870,-1,2],[870,876,1,1],[244,868,-1,2],[868,244,1,1],[876,244,-1,1],[244,254,-1,1],[358,244,-1,1],[1014,771,-1,1],[771,867,1,1],[1013,753,-1,1],[753,435,-1,1],[867,435,-1,1],[435,493,2,1],[493,421,-1,2],[956,1010,-1,2],[1010,956,1,1],[954,835,-1,2],[835,954,1,1],[980,972,-1,2],[972,980,1,1],[1010,835,-1,1],[835,847,1,1],[980,768,-1,1],[768,411,-2,1],[847,411,-2,1],[411,683,-1,2],[744,1009,-1,2],[1009,744,1,1],[745,834,-1,2],[834,745,1,1],[973,750,-1,2],[750,973,1,1],[1009,834,-1,1],[834,842,1,1],[973,756,-1,1],[756,386,-2,1],[842,386,-2,1],[386,475,-1,2],[1001,993,1,2],[993,1001,-1,1],[1018,895,1,2],[895,1018,-1,1],[852,893,1,2],[893,852,-1,1],[1018,852,-1,1],[852,862,1,1],[1001,735,-1,1],[735,363,-2,1],[862,363,-2,1],[363,687,-1,2],[998,726,1,2],[726,998,-1,1],[1017,718,1,2],[718,1017,-1,1],[851,727,1,2],[727,851,-1,1],[1017,851,-1,1],[851,861,1,1],[998,730,-1,1],[730,361,-2,1],[861,361,-2,1],[361,501,-1,2],[1016,896,-1,2],[896,1016,1,1],[855,894,-1,2],[894,855,1,1],[1016,855,-1,1],[855,856,-1,1],[993,726,-1,1],[726,359,-2,1],[856,359,-2,1],[359,685,-1,2],[1012,720,1,2],[720,1012,-1,1],[849,736,1,2],[736,849,-1,1],[1012,849,-1,1],[849,850,1,1],[721,357,-2,1],[850,357,-2,1],[357,491,-1,2],[957,1008,1,2],[1008,957,-1,1],[955,838,1,2],[838,955,-1,1],[1008,838,-1,1],[838,841,-1,1],[972,750,-1,1],[750,353,-2,1],[841,353,-2,1],[353,681,-1,2],[762,1006,1,2],[1006,762,-1,1],[763,832,1,2],[832,763,-1,1],[1006,832,-1,1],[832,833,1,1],[716,300,-2,1],[833,300,-2,1],[300,451,-1,2],[965,915,-1,2],[915,965,1,1],[966,883,-1,2],[883,966,1,1],[967,875,1,2],[875,967,-1,1],[800,877,-1,2],[877,800,1,1],[825,872,1,2],[872,825,-1,1],[963,924,-1,2],[924,963,1,1],[769,891,-1,2],[891,769,1,1],[964,946,-1,2],[946,964,1,1],[1019,990,1,2],[990,1019,-1,1],[865,983,1,2],[983,865,-1,1],[967,825,-1,1],[825,830,-1,1],[596,593,-1,1],[965,769,-1,1],[769,516,1,1],[966,800,-1,1],[800,829,-1,1],[751,907,-1,2],[907,751,1,1],[1019,865,-1,1],[865,831,1,1],[964,751,-1,1],[963,751,-1,1],[751,566,1,1],[831,593,-1,1],[593,652,-1,1],[830,566,-1,1],[651,566,1,2],[566,651,-1,1],[829,516,-1,1],[516,500,-1,1],[652,500,-1,1],[651,500,-1,1],[502,500,1,2],[500,502,-1,1],[959,904,-1,2],[904,959,1,1],[958,935,-1,2],[935,958,1,1],[961,874,1,2],[874,961,-1,1],[960,882,-1,2],[882,960,1,1],[824,873,1,2],[873,824,-1,1],[799,878,-1,2],[878,799,1,1],[754,923,-1,2],[923,754,1,1],[962,889,1,2],[889,962,-1,1],[772,890,-1,2],[890,772,1,1],[1015,987,-1,2],[987,1015,1,1],[517,986,-1,2],[986,517,1,1],[958,754,-1,1],[754,563,1,1],[960,799,-1,1],[799,826,-1,1],[959,772,-1,1],[772,515,1,1],[1015,517,-1,1],[517,828,1,1],[962,824,-1,1],[961,824,-1,1],[824,827,-1,1],[828,596,-1,1],[596,648,-1,1],[827,563,-1,1],[647,563,1,2],[563,647,-1,1],[826,515,-1,1],[515,490,-1,1],[648,490,-1,1],[647,490,-1,1],[496,490,1,2],[490,496,-1,1],[952,944,-1,2],[944,952,1,1],[525,880,-1,2],[880,525,1,1],[303,926,-1,2],[926,303,1,1],[289,939,-1,2],[939,289,1,1],[951,932,-1,2],[932,951,1,1],[952,289,-1,1],[289,585,1,1],[951,303,-1,1],[303,572,1,1],[953,525,-1,1],[525,513,-1,1],[1011,866,-1,1],[866,823,1,1],[825,585,-1,1],[585,636,-1,1],[824,572,-1,1],[635,572,1,2],[572,635,-1,1],[823,513,-1,1],[513,474,-1,1],[636,474,-1,1],[635,474,-1,1],[482,474,1,2],[474,482,-1,1],[920,383,1,2],[383,920,-1,1],[389,373,1,2],[373,389,-1,1],[921,578,1,2],[578,921,-1,1],[920,375,-1,1],[375,554,1,1],[948,922,-1,2],[922,948,1,1],[1007,595,-1,1],[595,798,1,1],[922,389,-1,1],[921,389,-1,1],[389,543,1,1],[800,554,-1,1],[554,621,-1,1],[799,543,-1,1],[620,543,1,2],[543,620,-1,1],[798,525,-1,1],[525,450,-1,1],[621,450,-1,1],[620,450,-1,1],[462,450,1,2],[450,462,-1,1],[421,495,-2,1],[257,455,-2,1],[419,434,1,1],[488,492,-1,1],[486,494,-1,1],[440,452,-1,1],[438,454,-1,1],[947,903,-1,2],[903,947,1,1],[938,315,-1,2],[315,938,1,1],[925,655,1,2],[655,925,-1,1],[538,918,1,2],[918,538,-1,1],[534,906,1,2],[906,534,-1,1],[888,533,-1,2],[533,888,1,1],[392,479,1,1],[479,392,-1,2],[316,387,-1,1],[1022,387,-2,1],[1022,316,2,1],[448,354,-1,1],[354,448,1,2],[298,456,1,1],[456,298,-1,2],[945,934,-1,2],[934,945,1,1],[659,927,-1,2],[927,659,1,1],[296,905,-1,2],[905,296,1,1],[617,304,-1,2],[304,617,1,1],[885,273,1,1],[273,885,-1,2],[937,913,-1,2],[913,937,1,1],[613,290,-1,2],[290,613,1,1],[632,390,-1,2],[390,632,1,1],[302,879,1,2],[879,302,-1,1],[884,881,1,2],[881,884,-1,1],[887,279,1,1],[279,887,-1,2],[262,773,1,2],[773,262,-1,1],[258,270,1,1],[270,258,-1,2],[468,402,-1,1],[402,468,1,2],[311,324,-1,1],[1020,324,-2,1],[1020,311,2,1],[323,268,1,2],[268,323,-1,1],[441,704,-1,2],[704,441,1,1],[297,917,-1,2],[917,297,1,1],[293,757,-1,2],[757,293,1,1],[739,908,-1,2],[908,739,1,1],[584,892,1,2],[892,584,-1,1],[886,529,-1,2],[529,886,1,1],[442,551,1,2],[551,442,-1,1],[240,310,1,1],[310,240,-1,2],[489,705,-1,2],[705,489,1,1],[752,897,-1,2],[897,752,1,1],[569,291,1,2],[291,569,-1,1],[950,919,1,2],[919,950,-1,1],[776,267,1,2],[267,776,-1,1],[276,301,-1,1],[1021,301,-2,1],[1021,276,2,1],[949,321,-1,2],[321,949,1,1],[463,283,1,2],[283,463,-1,1],[483,368,1,2],[368,483,-1,1],[682,395,1,2],[395,682,-1,1],[680,337,1,2],[337,680,-1,1],[497,245,1,2],[245,497,-1,1],[503,251,1,2],[251,503,-1,1],[686,253,1,2],[253,686,-1,1],[684,248,1,2],[248,684,-1,1],[338,519,1,2],[519,338,-1,1],[793,928,-1,2],[928,793,1,1],[378,574,1,2],[574,378,-1,1],[381,399,-1,1],[399,381,1,2],[579,575,-1,2],[575,579,1,1],[573,406,1,1],[406,573,-1,2],[820,899,1,2],[899,820,-1,1],[526,326,1,1],[326,526,-1,2],[1002,978,1,2],[978,1002,-1,1],[747,975,1,2],[975,747,-1,1],[1003,970,-1,2],[970,1003,1,1],[996,728,1,2],[728,996,-1,1],[742,717,1,2],[717,742,-1,1],[997,729,-1,2],[729,997,1,1],[994,979,1,2],[979,994,-1,1],[749,974,1,2],[974,749,-1,1],[995,971,-1,2],[971,995,1,1],[1005,900,1,2],[900,1005,-1,1],[818,898,1,2],[898,818,-1,1],[1004,929,-1,2],[929,1004,1,1],[1000,722,1,2],[722,1000,-1,1],[815,725,1,2],[725,815,-1,1],[999,723,-1,2],[723,999,1,1],[982,901,1,2],[901,982,-1,1],[269,527,1,2],[527,269,-1,1],[981,912,1,2],[912,981,-1,1],[275,531,1,2],[531,275,-1,1],[811,909,1,2],[909,811,-1,1],[977,741,1,2],[741,977,-1,1],[976,743,1,2],[743,976,-1,1],[539,532,-1,2],[532,539,1,1],[802,746,1,2],[746,802,-1,1],[530,331,1,1],[331,530,-1,2],[946,534,-1,1],[534,666,1,1],[945,659,-1,1],[659,592,-1,1],[892,291,-1,1],[938,774,-1,1],[774,813,-1,1],[885,258,-1,1],[258,362,-1,1],[904,321,-1,1],[321,653,1,1],[874,533,-1,1],[533,342,2,1],[875,529,-1,1],[529,346,2,1],[950,584,-1,1],[584,671,-1,1],[927,544,-1,1],[544,377,-1,1],[918,775,-1,1],[775,797,-1,1],[887,301,2,1],[301,562,1,2],[903,578,-1,1],[578,545,1,1],[925,569,-1,1],[569,391,-1,1],[882,279,2,1],[279,576,1,2],[934,553,-1,1],[553,669,-1,1],[937,739,-1,1],[739,624,-1,1],[893,727,-1,1],[727,706,-1,1],[944,296,-1,1],[296,588,1,1],[919,655,-1,1],[655,559,-1,1],[883,273,2,1],[273,404,-1,1],[954,745,-1,1],[745,710,-1,1],[956,744,-1,1],[744,712,1,1],[949,776,-1,1],[776,822,-1,1],[872,310,2,1],[310,340,-1,1],[941,732,-1,1],[732,589,-1,1],[924,262,-1,1],[262,413,1,1],[931,759,-1,1],[759,808,-1,1],[733,414,2,1],[884,302,-1,1],[894,736,-1,1],[736,707,-1,1],[895,718,-1,1],[718,708,1,1],[898,725,-1,1],[725,351,2,1],[897,373,-1,1],[373,552,1,1],[900,722,-1,1],[722,546,-1,1],[873,316,2,1],[316,339,-1,1],[877,270,2,1],[270,397,-1,1],[905,757,-1,1],[757,611,-1,1],[886,240,-1,1],[240,415,2,1],[957,762,-1,1],[762,713,1,1],[955,763,-1,1],[763,711,-1,1],[917,770,-1,1],[770,605,-1,1],[939,293,-1,1],[293,591,1,1],[912,743,-1,1],[743,792,-1,1],[909,746,-1,1],[746,791,-1,1],[890,267,-1,1],[267,345,1,1],[878,276,2,1],[276,396,-1,1],[896,720,-1,1],[720,709,1,1],[1005,818,-1,1],[818,863,1,1],[1004,793,-1,1],[793,864,-1,1],[1003,765,-1,1],[765,665,1,1],[1002,747,-1,1],[747,663,-1,1],[1000,815,-1,1],[815,860,1,1],[999,790,-1,1],[790,859,-1,1],[997,760,-1,1],[760,662,1,1],[996,742,-1,1],[742,664,-1,1],[809,857,1,1],[785,858,-1,1],[995,767,-1,1],[767,661,1,1],[994,749,-1,1],[749,660,-1,1],[992,810,-1,1],[810,854,-1,1],[991,786,-1,1],[786,644,-1,1],[990,274,-1,1],[274,699,-1,1],[989,819,-1,1],[819,853,1,1],[988,794,-1,1],[794,697,1,1],[987,280,-1,1],[280,642,1,1],[986,277,-1,1],[277,696,1,1],[805,848,-1,1],[781,420,-1,1],[983,271,-1,1],[271,639,1,1],[982,820,-1,1],[820,845,-1,1],[981,811,-1,1],[811,846,-1,1],[979,737,-1,1],[737,670,1,1],[978,728,-1,1],[728,667,1,1],[836,821,1,1],[689,812,1,1],[977,804,-1,1],[804,844,1,1],[976,802,-1,1],[802,843,1,1],[975,717,-1,1],[717,370,-1,1],[974,719,-1,1],[719,388,-1,1],[795,839,-1,1],[787,840,-1,1],[971,738,-1,1],[738,657,1,1],[970,729,-1,1],[837,796,-1,1],[607,788,-1,1],[547,691,-1,1],[401,603,1,1],[374,688,1,1],[287,600,1,1],[948,752,-1,1],[947,752,-1,1],[752,630,-1,1],[943,761,-1,1],[942,761,-1,1],[761,817,-1,1],[764,816,-1,1],[936,538,-1,1],[935,538,-1,1],[538,570,1,1],[933,297,-1,1],[932,297,-1,1],[297,668,1,1],[930,723,-1,1],[929,723,-1,1],[723,577,-1,1],[766,807,-1,1],[928,724,-1,1],[724,409,2,1],[926,288,-1,1],[288,385,1,1],[923,266,-1,1],[266,583,1,1],[916,315,-1,1],[915,315,-1,1],[315,523,1,1],[914,383,-1,1],[913,383,-1,1],[383,658,1,1],[911,731,-1,1],[910,731,-1,1],[731,556,-1,1],[734,356,2,1],[908,380,-1,1],[380,307,1,1],[907,773,-1,1],[906,773,-1,1],[773,789,-1,1],[902,741,-1,1],[901,741,-1,1],[741,784,-1,1],[899,748,-1,1],[748,783,-1,1],[891,263,-1,1],[263,558,1,1],[889,387,2,1],[888,387,2,1],[387,422,-1,1],[881,521,-1,1],[521,382,2,1],[880,292,2,1],[879,292,2,1],[292,379,-1,1],[871,324,2,1],[870,324,2,1],[324,329,-1,1],[869,311,2,1],[868,311,2,1],[311,317,-1,1],[431,424,1,2],[424,431,-1,1],[487,594,-1,2],[594,487,1,1],[439,542,-1,2],[542,439,1,1],[864,665,-1,1],[665,703,1,1],[863,663,-1,1],[663,650,-1,1],[860,664,-1,1],[664,702,-1,1],[859,662,-1,1],[662,649,1,1],[858,661,-1,1],[661,701,1,1],[857,660,-1,1],[660,638,-1,1],[855,699,-1,1],[699,646,1,1],[854,644,-1,1],[644,700,-1,1],[853,697,-1,1],[697,645,1,1],[852,642,-1,1],[640,425,-1,1],[851,696,-1,1],[696,643,-1,1],[246,698,-1,1],[249,637,1,1],[849,639,-1,1],[639,597,-1,1],[848,420,-1,1],[420,641,-1,1],[846,670,-1,1],[670,695,1,1],[845,667,-1,1],[667,622,1,1],[844,370,-1,1],[370,694,-1,1],[843,388,-1,1],[840,657,-1,1],[657,693,1,1],[838,691,-1,1],[691,609,1,1],[837,607,-1,1],[607,692,-1,1],[836,689,-1,1],[689,608,1,1],[835,603,-1,1],[601,567,-1,1],[834,688,-1,1],[688,606,-1,1],[656,690,-1,1],[654,599,-1,1],[832,600,-1,1],[600,335,-1,1],[255,602,-1,1],[866,595,-1,1],[865,517,-1,1],[495,487,-1,2],[487,495,1,1],[455,439,-1,2],[439,455,1,1],[822,630,-1,1],[634,630,1,2],[630,634,-1,1],[821,671,-1,1],[671,679,-1,1],[820,666,-1,1],[666,480,1,1],[819,592,-1,1],[592,633,1,1],[818,588,-1,1],[588,473,-1,1],[470,590,1,2],[590,470,-1,1],[817,589,-1,1],[589,481,2,1],[816,414,2,1],[414,631,1,2],[472,412,-1,1],[412,472,1,2],[815,591,-1,1],[591,629,-1,1],[814,587,-1,1],[813,624,-1,1],[628,624,1,2],[624,628,-1,1],[812,584,-1,1],[584,627,-1,1],[811,570,-1,1],[570,477,1,1],[810,669,-1,1],[669,678,1,1],[809,668,-1,1],[668,469,-1,1],[626,376,-1,2],[376,626,1,1],[466,582,1,2],[582,466,-1,1],[808,577,-1,1],[577,478,2,1],[807,409,2,1],[409,625,1,2],[384,476,1,1],[476,384,-1,2],[806,385,-1,1],[385,677,-1,1],[805,377,-1,1],[377,467,1,1],[804,413,-1,1],[413,676,1,1],[803,391,-1,1],[391,471,-1,1],[802,583,-1,1],[583,623,1,1],[801,569,-1,1],[797,605,-1,1],[619,605,1,2],[605,619,-1,1],[796,559,-1,1],[559,618,-1,1],[795,523,-1,1],[523,460,1,1],[794,659,-1,1],[659,675,1,1],[793,658,-1,1],[658,449,-1,1],[446,557,1,2],[557,446,-1,1],[792,556,-1,1],[556,461,2,1],[791,356,2,1],[356,616,1,2],[306,459,1,1],[459,306,-1,2],[790,307,-1,1],[307,674,-1,1],[305,447,1,1],[789,611,-1,1],[615,611,1,2],[611,615,-1,1],[788,655,-1,1],[655,673,-1,1],[787,653,-1,1],[653,457,1,1],[786,553,-1,1],[553,614,1,1],[785,545,-1,1],[545,445,-1,1],[784,546,-1,1],[546,458,2,1],[783,351,2,1],[351,612,1,2],[444,344,-1,1],[344,444,1,2],[782,552,-1,1],[552,610,-1,1],[781,544,-1,1],[780,558,-1,1],[558,604,1,1],[778,345,-1,1],[345,672,1,1],[777,291,-1,1],[291,443,-1,1],[776,562,-1,1],[775,422,2,1],[422,514,1,2],[514,422,-1,1],[774,362,-1,1],[773,415,2,1],[415,250,1,2],[250,415,-1,1],[772,389,-1,1],[393,389,1,2],[389,393,-1,1],[770,387,2,1],[387,512,1,2],[512,387,-1,1],[769,375,-1,1],[403,375,1,2],[375,403,-1,1],[768,401,-1,1],[401,398,-1,1],[767,578,-1,1],[578,580,-1,1],[766,404,2,1],[404,407,-1,1],[765,383,-1,1],[764,576,-1,1],[576,581,-1,1],[763,382,2,1],[382,408,-1,1],[762,379,2,1],[379,405,-1,1],[761,396,2,1],[760,380,-1,1],[380,372,-1,1],[759,397,2,1],[397,400,-1,1],[758,373,-1,1],[757,240,-1,1],[240,369,1,1],[756,374,-1,1],[374,371,-1,1],[755,254,-1,1],[244,358,1,1],[754,303,-1,1],[355,303,1,2],[303,355,-1,1],[753,302,-1,1],[752,301,2,1],[301,524,1,2],[524,301,-1,1],[751,289,-1,1],[299,289,1,2],[289,299,-1,1],[750,547,-1,1],[547,549,-1,1],[749,297,-1,1],[297,294,-1,1],[748,346,2,1],[346,349,-1,1],[747,296,-1,1],[746,342,2,1],[342,350,-1,1],[745,521,-1,1],[521,550,-1,1],[518,348,1,1],[348,518,-1,2],[548,520,-1,2],[520,548,1,1],[341,295,-1,1],[295,341,1,2],[744,292,2,1],[743,339,2,1],[339,347,-1,1],[742,293,-1,1],[293,286,-1,1],[741,340,2,1],[340,343,-1,1],[740,288,-1,1],[288,285,-1,1],[739,258,-1,1],[258,284,1,1],[738,321,-1,1],[321,318,-1,1],[737,538,-1,1],[538,540,-1,1],[736,329,2,1],[329,332,-1,1],[735,280,-1,1],[734,533,-1,1],[533,541,-1,1],[733,279,2,1],[279,333,-1,1],[278,319,-1,1],[319,278,1,2],[732,276,2,1],[276,330,-1,1],[731,316,2,1],[730,277,-1,1],[277,265,-1,1],[729,315,-1,1],[315,312,-1,1],[728,534,-1,1],[534,536,-1,1],[727,324,2,1],[324,327,-1,1],[726,274,-1,1],[725,529,-1,1],[529,537,-1,1],[724,273,2,1],[273,328,-1,1],[272,313,-1,1],[313,272,1,2],[535,528,-1,2],[528,535,1,1],[723,270,2,1],[270,325,-1,1],[722,310,2,1],[721,271,-1,1],[271,261,-1,1],[720,317,2,1],[317,320,-1,1],[719,266,-1,1],[718,311,2,1],[311,314,-1,1],[717,262,-1,1],[716,287,-1,1],[715,267,-1,1],[267,264,-1,1],[714,263,-1,1],[263,260,-1,1],[713,431,-1,1],[712,431,-1,1],[427,431,-1,2],[431,427,1,1],[711,424,-1,1],[710,424,-1,1],[432,424,-1,2],[424,432,1,1],[709,323,-1,1],[708,323,-1,1],[282,323,-1,2],[323,282,1,1],[707,268,-1,1],[706,268,-1,1],[334,268,-1,2],[268,334,1,1],[598,594,1,2],[594,598,-1,1],[594,419,-1,1],[426,433,-1,1],[705,595,-1,1],[430,595,1,2],[595,430,-1,1],[433,430,1,2],[430,433,-1,1],[256,365,1,1],[568,542,1,2],[542,568,-1,1],[542,256,-1,1],[281,366,-1,1],[704,517,-1,1],[322,517,1,2],[517,322,-1,1],[366,322,1,2],[322,366,-1,1],[703,650,-1,1],[702,649,-1,1],[701,638,-1,1],[699,425,1,1],[698,637,-1,1],[697,597,1,1],[696,420,-1,1],[695,622,-1,1],[691,567,1,1],[690,599,-1,1],[689,335,1,1],[688,255,-1,1],[687,503,-1,1],[416,503,-1,2],[503,416,1,1],[686,501,-1,1],[418,501,-1,2],[501,418,1,1],[685,497,-1,1],[423,497,-1,2],[497,423,1,1],[684,491,-1,1],[429,491,-1,2],[491,429,1,1],[683,483,-1,1],[241,483,-1,2],[483,241,1,1],[682,475,-1,1],[243,475,-1,2],[475,243,1,1],[681,463,-1,1],[259,463,-1,2],[463,259,1,1],[680,451,-1,1],[309,451,-1,2],[451,309,1,1],[437,309,-1,2],[309,437,1,1],[679,480,-1,1],[480,511,-1,1],[678,469,-1,1],[469,510,-1,1],[677,467,-1,1],[676,471,-1,1],[675,449,-1,1],[449,509,-1,1],[674,447,-1,1],[673,457,-1,1],[457,508,-1,1],[672,443,-1,1],[671,413,-1,1],[413,507,-1,1],[670,370,-1,1],[669,385,-1,1],[408,398,1,2],[398,408,-1,1],[405,401,1,2],[401,405,-1,1],[404,372,1,2],[372,404,-1,1],[668,377,-1,1],[400,383,1,2],[383,400,-1,1],[397,380,1,2],[380,397,-1,1],[667,388,-1,1],[666,391,-1,1],[382,371,1,2],[371,382,-1,1],[379,374,1,2],[374,379,-1,1],[663,254,-1,1],[662,254,-1,1],[661,246,-1,1],[660,249,-1,1],[659,307,-1,1],[307,505,-1,1],[658,305,-1,1],[655,345,-1,1],[350,294,1,2],[294,350,-1,1],[347,297,1,2],[297,347,-1,1],[346,286,1,2],[286,346,-1,1],[343,296,1,2],[296,343,-1,1],[342,285,1,2],[285,342,-1,1],[340,293,1,2],[293,340,-1,1],[339,288,1,2],[288,339,-1,1],[654,302,-1,1],[333,318,1,2],[318,333,-1,1],[330,321,1,2],[321,330,-1,1],[329,265,1,2],[265,329,-1,1],[328,312,1,2],[312,328,-1,1],[325,315,1,2],[315,325,-1,1],[324,261,1,2],[261,324,-1,1],[320,280,1,2],[280,320,-1,1],[317,277,1,2],[277,317,-1,1],[314,274,1,2],[274,314,-1,1],[311,271,1,2],[271,311,-1,1],[653,291,-1,1],[279,264,1,2],[264,279,-1,1],[276,267,1,2],[267,276,-1,1],[273,260,1,2],[260,273,-1,1],[270,263,1,2],[263,270,-1,1],[650,418,-1,1],[499,418,-1,2],[418,499,1,1],[649,416,-1,1],[498,416,1,2],[416,498,-1,1],[646,427,-1,1],[645,427,-1,1],[494,427,-1,2],[427,494,1,1],[493,489,-1,2],[489,493,1,1],[644,432,-1,1],[643,432,-1,1],[492,432,1,2],[432,492,-1,1],[642,424,-1,1],[641,424,-1,1],[488,424,1,2],[424,488,-1,1],[640,431,-1,1],[639,431,-1,1],[486,431,-1,2],[431,486,1,1],[638,429,-1,1],[485,429,-1,2],[429,485,1,1],[637,423,-1,1],[484,423,1,2],[423,484,-1,1],[634,473,-1,1],[633,473,-1,1],[632,481,2,1],[481,470,1,2],[470,481,-1,1],[631,479,2,1],[479,472,1,2],[472,479,-1,1],[628,477,-1,1],[627,477,-1,1],[626,478,2,1],[478,466,1,2],[466,478,-1,1],[625,476,2,1],[476,468,1,2],[468,476,-1,1],[622,243,-1,1],[465,243,-1,2],[243,465,1,1],[464,241,1,2],[241,464,-1,1],[619,460,-1,1],[618,460,-1,1],[617,461,2,1],[461,446,1,2],[446,461,-1,1],[616,459,2,1],[459,448,1,2],[448,459,-1,1],[615,445,-1,1],[614,445,-1,1],[613,458,2,1],[458,442,1,2],[442,458,-1,1],[612,456,2,1],[456,444,1,2],[444,456,-1,1],[609,282,-1,1],[608,282,-1,1],[454,282,-1,2],[282,454,1,1],[453,441,-1,2],[441,453,1,1],[607,334,-1,1],[606,334,-1,1],[452,334,1,2],[334,452,-1,1],[603,268,-1,1],[602,268,-1,1],[440,268,1,2],[268,440,-1,1],[601,323,-1,1],[600,323,-1,1],[438,323,-1,2],[323,438,1,1],[599,259,-1,1],[436,259,1,2],[259,436,-1,1],[598,597,-1,1],[597,434,-1,1],[596,422,-1,1],[428,422,1,2],[422,428,-1,1],[595,420,-1,1],[426,420,1,2],[420,426,-1,1],[593,415,-1,1],[417,415,1,2],[415,417,-1,1],[592,393,-1,1],[591,393,-1,1],[590,414,2,1],[414,390,1,2],[390,414,-1,1],[589,412,2,1],[412,392,1,2],[392,412,-1,1],[588,389,-1,1],[587,389,-1,1],[586,411,-2,1],[411,395,-1,2],[395,411,1,1],[585,387,-1,1],[410,387,1,2],[387,410,-1,1],[584,403,-1,1],[583,403,-1,1],[582,409,2,1],[409,376,1,2],[376,409,-1,1],[581,406,2,1],[580,378,-1,1],[406,378,1,2],[378,406,-1,1],[578,381,-1,1],[577,402,2,1],[402,384,1,2],[384,402,-1,1],[576,399,2,1],[574,396,2,1],[573,373,-1,1],[396,373,1,2],[373,396,-1,1],[572,369,-1,1],[394,369,1,2],[369,394,-1,1],[571,386,-2,1],[386,368,-1,2],[368,386,1,1],[570,375,-1,1],[569,375,-1,1],[568,567,-1,1],[567,365,-1,1],[566,362,-1,1],[364,362,1,2],[362,364,-1,1],[565,363,-2,1],[363,253,-1,2],[253,363,1,1],[564,361,-2,1],[361,251,-1,2],[251,361,1,1],[563,358,-1,1],[562,358,-1,1],[360,358,1,2],[358,360,-1,1],[561,359,-2,1],[359,248,-1,2],[248,359,1,1],[560,357,-2,1],[357,245,-1,2],[245,357,1,1],[559,355,-1,1],[558,355,-1,1],[557,356,2,1],[356,304,1,2],[304,356,-1,1],[556,354,2,1],[354,306,1,2],[306,354,-1,1],[555,353,-2,1],[353,337,-1,2],[337,353,1,1],[554,301,-1,1],[352,301,1,2],[301,352,-1,1],[553,299,-1,1],[552,299,-1,1],[551,351,2,1],[351,290,1,2],[290,351,-1,1],[550,348,2,1],[549,338,-1,1],[348,338,1,2],[338,348,-1,1],[547,341,-1,1],[546,344,2,1],[344,298,1,2],[298,344,-1,1],[545,289,-1,1],[544,289,-1,1],[543,284,-1,1],[336,284,1,2],[284,336,-1,1],[541,331,2,1],[540,275,-1,1],[331,275,1,2],[275,331,-1,1],[538,278,-1,1],[537,326,2,1],[536,269,-1,1],[326,269,1,2],[269,326,-1,1],[534,272,-1,1],[533,319,2,1],[531,316,2,1],[530,266,-1,1],[316,266,1,2],[266,316,-1,1],[529,313,2,1],[527,310,2,1],[526,262,-1,1],[310,262,1,2],[262,310,-1,1],[525,258,-1,1],[524,258,-1,1],[308,258,1,2],[258,308,-1,1],[523,303,-1,1],[522,300,-2,1],[300,283,-1,2],[283,300,1,1],[521,295,2,1],[519,292,2,1],[518,287,-1,1],[292,287,1,2],[287,292,-1,1],[517,255,-1,1],[281,255,1,2],[255,281,-1,1],[516,250,-1,1],[252,250,1,2],[250,252,-1,1],[515,244,-1,1],[514,244,-1,1],[247,244,1,2],[244,247,-1,1],[513,240,-1,1],[512,240,-1,1],[242,240,1,2],[240,242,-1,1],[385,506,-1,1],[345,504,-1,1]],"pre_target_dirty_cancellation_gates":[[120,401,-1,2],[120,465,1,1],[120,474,1,4],[120,482,-1,2],[120,504,-1,3],[120,505,-1,3],[120,506,-1,3],[120,507,1,6],[120,508,1,6],[120,509,1,6],[120,510,1,6],[120,511,1,6],[120,586,-1,2],[120,773,1,2],[120,775,1,2],[121,374,-1,2],[121,464,-1,1],[121,474,1,4],[121,482,1,2],[121,504,-1,3],[121,505,-1,3],[121,506,1,6],[121,507,-1,3],[121,508,1,6],[121,509,1,6],[121,510,1,6],[121,511,1,6],[121,571,-1,2],[121,906,1,2],[121,918,1,2],[122,248,1,2],[122,257,1,4],[122,271,1,2],[122,274,-1,2],[122,277,1,2],[122,280,-1,2],[122,288,1,1],[122,358,1,4],[122,367,-1,4],[122,504,-1,3],[122,505,-1,3],[122,506,1,6],[122,507,1,6],[122,508,-1,3],[122,509,1,6],[122,510,1,6],[122,511,1,6],[122,578,-1,2],[122,755,1,4],[123,245,1,2],[123,257,1,2],[123,277,1,2],[123,280,-1,2],[123,297,1,1],[123,358,1,4],[123,367,-1,4],[123,373,-1,2],[123,504,-1,3],[123,505,-1,3],[123,506,1,6],[123,507,1,6],[123,508,1,6],[123,509,-1,3],[123,510,1,6],[123,511,1,6],[124,244,1,2],[124,253,1,2],[124,254,-1,2],[124,277,1,1],[124,280,-1,2],[124,293,1,1],[124,367,-1,4],[124,383,-1,2],[124,504,-1,3],[124,505,-1,3],[124,506,1,6],[124,507,1,6],[124,508,1,6],[124,509,1,6],[124,510,-1,3],[124,511,1,6],[124,868,-1,4],[125,244,1,2],[125,251,1,2],[125,254,-1,2],[125,277,1,2],[125,296,1,1],[125,358,1,4],[125,367,-1,2],[125,380,-1,2],[125,504,-1,3],[125,505,-1,3],[125,506,1,6],[125,507,1,6],[125,508,1,6],[125,509,1,6],[125,510,1,6],[125,511,-1,3],[125,868,-1,4],[126,334,1,1],[126,375,1,2],[126,380,-1,4],[126,438,1,1],[126,504,-1,3],[126,505,-1,3],[126,506,1,6],[126,507,1,6],[126,508,1,6],[126,509,1,6],[126,510,1,6],[126,511,1,6],[126,751,1,1],[126,914,-1,2],[126,962,-1,1],[127,263,1,2],[127,267,1,2],[127,437,1,1],[127,450,1,4],[127,462,-1,2],[127,504,-1,3],[127,505,1,6],[127,506,-1,3],[127,507,-1,3],[127,508,1,6],[127,509,1,6],[127,510,1,6],[127,511,1,6],[127,555,-1,2],[127,1011,-1,1],[128,504,-1,3],[128,505,1,6],[128,506,-1,3],[128,507,1,6],[128,508,-1,3],[128,509,1,6],[128,510,1,6],[128,511,1,6],[128,526,1,1],[128,656,1,2],[128,690,-1,4],[128,759,1,2],[128,766,1,2],[128,780,1,4],[128,804,-1,1],[128,849,-1,1],[129,504,-1,3],[129,505,1,6],[129,506,-1,3],[129,507,1,6],[129,508,1,6],[129,509,-1,3],[129,510,1,6],[129,511,1,6],[129,535,1,1],[129,656,1,2],[129,759,1,1],[129,855,1,1],[129,977,-1,1],[130,504,-1,3],[130,505,1,6],[130,506,-1,3],[130,507,1,6],[130,508,1,6],[130,509,1,6],[130,510,-1,3],[130,511,1,6],[130,530,1,1],[130,599,-1,4],[130,654,1,2],[130,761,1,2],[130,764,1,2],[130,778,1,4],[130,802,-1,1],[130,851,-1,1],[131,504,-1,3],[131,505,1,6],[131,506,-1,3],[131,507,1,6],[131,508,1,6],[131,509,1,6],[131,510,1,6],[131,511,-1,3],[131,539,1,1],[131,654,1,2],[131,761,1,1],[131,852,-1,1],[131,976,-1,1],[132,291,1,2],[132,441,1,1],[132,504,-1,3],[132,505,1,6],[132,506,-1,3],[132,507,1,6],[132,508,1,6],[132,509,1,6],[132,510,1,6],[132,511,1,6],[132,593,-1,2],[132,596,-1,2],[132,869,-1,4],[132,871,1,4],[132,980,-1,1],[133,313,-1,1],[133,504,-1,3],[133,505,1,6],[133,506,1,6],[133,507,-1,3],[133,508,-1,3],[133,509,1,6],[133,510,1,6],[133,511,1,6],[133,656,1,2],[133,690,-1,2],[133,820,-1,1],[133,1012,-1,1],[134,504,-1,3],[134,505,1,6],[134,506,1,6],[134,507,-1,3],[134,508,1,6],[134,509,-1,3],[134,510,1,6],[134,511,1,6],[134,527,1,2],[134,656,1,2],[134,690,-1,4],[134,759,1,2],[134,766,-1,2],[134,780,-1,4],[134,982,-1,1],[134,1016,1,1],[135,319,-1,1],[135,504,-1,3],[135,505,1,6],[135,506,1,6],[135,507,-1,3],[135,508,1,6],[135,509,1,6],[135,510,-1,3],[135,511,1,6],[135,599,-1,2],[135,654,1,2],[135,811,-1,1],[135,1017,-1,1],[136,504,-1,3],[136,505,1,6],[136,506,1,6],[136,507,-1,3],[136,508,1,6],[136,509,1,6],[136,510,1,6],[136,511,-1,3],[136,531,1,2],[136,599,-1,4],[136,654,1,2],[136,761,1,2],[136,764,-1,2],[136,778,-1,4],[136,981,-1,1],[136,1018,-1,1],[137,439,1,1],[137,504,-1,3],[137,505,1,6],[137,506,1,6],[137,507,-1,3],[137,508,1,6],[137,509,1,6],[137,510,1,6],[137,511,1,6],[137,596,-1,1],[137,892,1,2],[137,973,-1,1],[138,287,1,4],[138,337,1,2],[138,504,-1,3],[138,505,1,6],[138,506,1,6],[138,507,1,6],[138,508,-1,3],[138,509,-1,3],[138,510,1,6],[138,511,1,6],[138,600,1,4],[138,771,1,2],[138,774,-1,1],[138,866,1,2],[138,959,-1,1],[139,246,1,2],[139,504,-1,3],[139,505,1,6],[139,506,1,6],[139,507,1,6],[139,508,-1,3],[139,509,1,6],[139,510,-1,3],[139,511,1,6],[139,518,1,1],[139,698,-1,2],[139,731,-1,4],[139,734,1,4],[139,763,1,1],[139,806,-1,2],[139,815,-1,1],[140,246,1,2],[140,504,-1,3],[140,505,1,6],[140,506,1,6],[140,507,1,6],[140,508,-1,3],[140,509,1,6],[140,510,1,6],[140,511,-1,3],[140,548,1,1],[140,698,-1,1],[140,762,1,1],[140,818,-1,1],[141,255,1,2],[141,298,1,1],[141,504,-1,3],[141,505,1,6],[141,506,1,6],[141,507,1,6],[141,508,-1,3],[141,509,1,6],[141,510,1,6],[141,511,1,6],[141,777,-1,4],[141,779,1,4],[141,805,1,1],[141,810,-1,2],[141,814,1,1],[141,819,-1,2],[141,967,-1,1],[141,995,-1,1],[142,504,-1,3],[142,505,1,6],[142,506,1,6],[142,507,1,6],[142,508,1,6],[142,509,-1,3],[142,510,-1,3],[142,511,1,6],[142,520,1,2],[142,616,-1,4],[142,734,1,4],[142,806,-1,2],[142,809,-1,2],[142,1000,-1,1],[142,1006,-1,2],[143,348,1,1],[143,504,-1,3],[143,505,1,6],[143,506,1,6],[143,507,1,6],[143,508,1,6],[143,509,-1,3],[143,510,1,6],[143,511,-1,3],[143,616,-1,4],[143,809,-1,2],[143,832,-1,2],[143,857,-1,2],[143,910,1,4],[143,1005,-1,1],[144,255,1,2],[144,504,-1,3],[144,505,1,6],[144,506,1,6],[144,507,1,6],[144,508,1,6],[144,509,-1,3],[144,510,1,6],[144,511,1,6],[144,602,-1,4],[144,613,1,1],[144,777,-1,4],[144,779,1,2],[144,805,1,2],[144,814,1,1],[144,819,-1,2],[144,825,-1,1],[144,985,-1,1],[145,287,1,4],[145,504,-1,3],[145,505,1,6],[145,506,1,6],[145,507,1,6],[145,508,1,6],[145,509,1,6],[145,510,-1,3],[145,511,-1,3],[145,600,-1,4],[145,680,1,1],[145,771,-1,2],[145,776,-1,1],[145,866,1,2],[145,965,-1,1],[146,255,-1,4],[146,306,1,1],[146,425,1,2],[146,447,-1,2],[146,504,-1,3],[146,505,1,6],[146,506,1,6],[146,507,1,6],[146,508,1,6],[146,509,1,6],[146,510,-1,3],[146,511,1,6],[146,601,1,4],[146,607,1,4],[146,640,1,2],[146,689,1,4],[146,814,3,2],[146,961,-1,1],[146,1003,-1,1],[147,255,1,4],[147,504,-1,3],[147,505,1,6],[147,506,1,6],[147,507,1,6],[147,508,1,6],[147,509,1,6],[147,510,1,6],[147,511,-1,3],[147,617,1,1],[147,777,-1,4],[147,814,1,2],[147,819,1,2],[147,824,-1,1],[147,997,-1,1],[148,436,-1,1],[148,450,1,4],[148,462,1,2],[148,504,1,6],[148,505,-1,3],[148,506,-1,3],[148,507,-1,3],[148,508,1,6],[148,509,1,6],[148,510,1,6],[148,511,1,6],[148,522,-1,2],[148,866,-1,1],[148,938,1,1],[148,949,1,1],[149,504,1,6],[149,505,-1,3],[149,506,-1,3],[149,507,1,6],[149,508,-1,3],[149,509,1,6],[149,510,1,6],[149,511,1,6],[149,528,1,2],[149,720,-1,2],[149,741,-1,2],[149,766,1,2],[149,780,1,4],[149,795,-1,4],[149,807,-1,2],[150,326,1,1],[150,504,1,6],[150,505,-1,3],[150,506,-1,3],[150,507,1,6],[150,508,1,6],[150,509,-1,3],[150,510,1,6],[150,511,1,6],[150,748,-1,2],[150,795,-1,4],[150,807,-1,2],[150,839,-1,4],[150,896,-1,2],[150,931,1,2],[151,504,1,6],[151,505,-1,3],[151,506,-1,3],[151,507,1,6],[151,508,1,6],[151,509,1,6],[151,510,-1,3],[151,511,1,6],[151,532,1,2],[151,581,-1,2],[151,718,-1,2],[151,743,-1,2],[151,764,1,2],[151,778,1,4],[151,787,-1,4],[152,331,1,1],[152,504,1,6],[152,505,-1,3],[152,506,-1,3],[152,507,1,6],[152,508,1,6],[152,509,1,6],[152,510,1,6],[152,511,-1,3],[152,581,-1,2],[152,746,-1,2],[152,787,-1,4],[152,840,-1,4],[152,895,-1,2],[152,942,1,2],[153,451,1,4],[153,504,1,6],[153,505,-1,3],[153,506,-1,3],[153,507,1,6],[153,508,1,6],[153,509,1,6],[153,510,1,6],[153,511,1,6],[153,542,1,2],[153,655,1,2],[153,716,-1,4],[153,756,-1,2],[153,768,-1,2],[153,869,-1,2],[154,269,1,1],[154,504,1,6],[154,505,-1,3],[154,506,1,6],[154,507,-1,3],[154,508,-1,3],[154,509,1,6],[154,510,1,6],[154,511,1,6],[154,736,-1,2],[154,795,-1,4],[154,807,-1,2],[154,839,1,4],[154,901,-1,2],[154,931,-1,2],[155,272,1,1],[155,504,1,6],[155,505,-1,3],[155,506,1,6],[155,507,-1,3],[155,508,1,6],[155,509,-1,3],[155,510,1,6],[155,511,1,6],[155,766,-1,2],[155,780,-1,4],[155,795,-1,4],[155,807,-1,2],[155,894,-1,2],[155,899,-1,2],[156,275,1,1],[156,504,1,6],[156,505,-1,3],[156,506,1,6],[156,507,-1,3],[156,508,1,6],[156,509,1,6],[156,510,-1,3],[156,511,1,6],[156,581,-1,2],[156,727,-1,2],[156,787,-1,4],[156,840,1,4],[156,912,-1,2],[156,942,-1,2],[157,278,1,1],[157,504,1,6],[157,505,-1,3],[157,506,1,6],[157,507,-1,3],[157,508,1,6],[157,509,1,6],[157,510,1,6],[157,511,-1,3],[157,581,-1,2],[157,764,-1,2],[157,778,-1,4],[157,787,-1,4],[157,893,-1,2],[157,909,-1,2],[158,504,1,6],[158,505,-1,3],[158,506,1,6],[158,507,-1,3],[158,508,1,6],[158,509,1,6],[158,510,1,6],[158,511,1,6],[158,593,1,2],[158,596,-1,2],[158,704,1,2],[158,756,-1,1],[158,869,-1,4],[158,871,-1,4],[158,919,1,2],[159,283,1,2],[159,315,1,2],[159,504,1,6],[159,505,-1,3],[159,506,1,6],[159,507,1,6],[159,508,-1,3],[159,509,-1,3],[159,510,1,6],[159,511,1,6],[159,547,1,4],[159,691,-1,4],[159,772,-1,1],[159,1011,1,2],[159,1014,1,2],[160,246,1,2],[160,295,-1,1],[160,504,1,6],[160,505,-1,3],[160,506,1,6],[160,507,1,6],[160,508,-1,3],[160,509,1,6],[160,510,-1,3],[160,511,1,6],[160,722,-1,2],[160,731,-1,2],[160,838,1,2],[161,246,1,2],[161,504,1,6],[161,505,-1,3],[161,506,1,6],[161,507,1,6],[161,508,-1,3],[161,509,1,6],[161,510,1,6],[161,511,-1,3],[161,519,1,2],[161,698,-1,2],[161,731,-1,4],[161,734,-1,4],[161,806,1,2],[161,900,-1,2],[161,1008,1,2],[162,290,1,2],[162,504,1,6],[162,505,-1,3],[162,506,1,6],[162,507,1,6],[162,508,-1,3],[162,509,1,6],[162,510,1,6],[162,511,1,6],[162,602,1,4],[162,767,-1,1],[162,805,1,2],[162,837,1,4],[162,848,-1,2],[162,872,-1,2],[163,338,1,1],[163,504,1,6],[163,505,-1,3],[163,506,1,6],[163,507,1,6],[163,508,1,6],[163,509,-1,3],[163,510,-1,3],[163,511,1,6],[163,616,-1,4],[163,725,-1,2],[163,809,-1,2],[163,857,1,2],[163,910,-1,4],[163,957,-1,1],[164,341,1,1],[164,504,1,6],[164,505,-1,3],[164,506,1,6],[164,507,1,6],[164,508,1,6],[164,509,-1,3],[164,510,1,6],[164,511,-1,3],[164,616,-1,4],[164,734,-1,4],[164,806,1,2],[164,809,-1,2],[164,898,-1,2],[164,955,-1,1],[165,456,1,1],[165,504,1,6],[165,505,-1,3],[165,506,1,6],[165,507,1,6],[165,508,1,6],[165,509,-1,3],[165,510,1,6],[165,511,1,6],[165,758,-1,1],[165,796,1,4],[165,837,1,4],[165,848,-1,2],[165,875,-1,2],[165,992,1,2],[166,321,1,2],[166,463,1,1],[166,504,1,6],[166,505,-1,3],[166,506,1,6],[166,507,1,6],[166,508,1,6],[166,509,1,6],[166,510,-1,3],[166,511,-1,3],[166,547,1,4],[166,691,1,4],[166,769,-1,1],[166,1011,1,2],[166,1014,-1,2],[167,255,-1,2],[167,304,1,2],[167,447,-1,2],[167,504,1,6],[167,505,-1,3],[167,506,1,6],[167,507,1,6],[167,508,1,6],[167,509,1,6],[167,510,-1,3],[167,511,1,6],[167,601,1,4],[167,607,1,2],[167,640,1,2],[167,689,1,4],[167,765,-1,1],[167,814,1,1],[167,873,-1,2],[168,425,-1,2],[168,459,1,1],[168,504,1,6],[168,505,-1,3],[168,506,1,6],[168,507,1,6],[168,508,1,6],[168,509,1,6],[168,510,1,6],[168,511,-1,3],[168,607,1,4],[168,760,-1,1],[168,788,-1,4],[168,874,-1,2],[168,989,1,2],[169,257,-1,4],[169,271,1,2],[169,274,1,2],[169,277,-1,2],[169,280,1,2],[169,358,-1,4],[169,367,1,4],[169,504,1,6],[169,505,1,6],[169,506,-1,3],[169,507,-1,3],[169,508,-1,3],[169,509,1,6],[169,510,1,6],[169,511,1,6],[169,684,1,1],[169,752,1,1],[169,755,1,4],[169,951,-1,1],[170,274,1,1],[170,277,-1,2],[170,280,1,2],[170,303,-1,1],[170,358,-1,4],[170,367,1,4],[170,497,1,1],[170,504,1,6],[170,505,1,6],[170,506,-1,3],[170,507,-1,3],[170,508,1,6],[170,509,-1,3],[170,510,1,6],[170,511,1,6],[170,947,1,1],[171,244,-1,2],[171,254,1,2],[171,280,1,2],[171,358,-1,2],[171,367,1,4],[171,504,1,6],[171,505,1,6],[171,506,-1,3],[171,507,-1,3],[171,508,1,6],[171,509,1,6],[171,510,-1,3],[171,511,1,6],[171,686,1,1],[171,739,1,1],[171,868,1,4],[171,952,-1,1],[172,244,-1,2],[172,254,1,2],[172,277,-1,2],[172,280,1,1],[172,289,-1,1],[172,358,-1,4],[172,503,1,1],[172,504,1,6],[172,505,1,6],[172,506,-1,3],[172,507,-1,3],[172,508,1,6],[172,509,1,6],[172,510,1,6],[172,511,-1,3],[172,868,1,4],[172,937,1,1],[173,250,-1,2],[173,282,1,1],[173,288,-1,2],[173,440,-1,1],[173,504,1,6],[173,505,1,6],[173,506,-1,3],[173,507,-1,3],[173,508,1,6],[173,509,1,6],[173,510,1,6],[173,511,1,6],[173,514,-1,2],[173,647,-1,1],[173,651,-1,1],[173,770,1,4],[173,933,-1,2],[173,948,1,1],[174,262,1,1],[174,374,1,4],[174,395,1,2],[174,504,1,6],[174,505,1,6],[174,506,-1,3],[174,507,1,6],[174,508,-1,3],[174,509,-1,3],[174,510,1,6],[174,511,1,6],[174,595,-1,2],[174,688,-1,4],[174,753,-1,2],[174,958,-1,1],[175,249,-1,2],[175,504,1,6],[175,505,1,6],[175,506,-1,3],[175,507,1,6],[175,508,-1,3],[175,509,1,6],[175,510,-1,3],[175,511,1,6],[175,573,1,1],[175,637,1,2],[175,724,1,2],[175,732,-1,4],[175,733,3,4],[175,782,-1,2],[175,834,-1,2],[176,249,-1,2],[176,504,1,6],[176,505,1,6],[176,506,-1,3],[176,507,1,6],[176,508,-1,3],[176,509,1,6],[176,510,1,6],[176,511,-1,3],[176,579,1,1],[176,637,1,1],[176,733,1,2],[176,782,-1,1],[176,928,1,2],[176,1009,-1,2],[177,384,1,1],[177,447,1,1],[177,504,1,6],[177,505,1,6],[177,506,-1,3],[177,507,1,6],[177,508,-1,3],[177,509,1,6],[177,510,1,6],[177,511,1,6],[177,601,1,2],[177,781,1,1],[177,786,-1,2],[177,794,-1,2],[177,801,-1,4],[177,803,1,4],[177,883,1,2],[177,979,-1,2],[178,399,-1,1],[178,504,1,6],[178,505,1,6],[178,506,-1,3],[178,507,1,6],[178,508,1,6],[178,509,-1,3],[178,510,-1,3],[178,511,1,6],[178,631,1,4],[178,723,1,2],[178,733,1,4],[178,744,-1,1],[178,782,1,2],[178,785,-1,2],[179,504,1,6],[179,505,1,6],[179,506,-1,3],[179,507,1,6],[179,508,1,6],[179,509,-1,3],[179,510,1,6],[179,511,-1,3],[179,574,1,2],[179,631,1,4],[179,745,-1,1],[179,785,-1,2],[179,858,1,2],[179,929,1,2],[179,941,1,4],[180,447,1,1],[180,504,1,6],[180,505,1,6],[180,506,-1,3],[180,507,1,6],[180,508,1,6],[180,509,-1,3],[180,510,1,6],[180,511,1,6],[180,567,1,4],[180,601,1,2],[180,626,1,1],[180,737,-1,2],[180,781,1,2],[180,794,-1,2],[180,801,-1,4],[180,803,1,2],[180,877,1,2],[181,266,1,1],[181,374,1,4],[181,504,1,6],[181,505,1,6],[181,506,-1,3],[181,507,1,6],[181,508,1,6],[181,509,1,6],[181,510,-1,3],[181,511,-1,3],[181,595,-1,2],[181,682,1,1],[181,688,1,4],[181,753,1,2],[181,964,-1,1],[182,305,1,2],[182,392,1,1],[182,504,1,6],[182,505,1,6],[182,506,-1,3],[182,507,1,6],[182,508,1,6],[182,509,1,6],[182,510,-1,3],[182,511,1,6],[182,544,-1,4],[182,587,-1,2],[182,601,1,2],[182,640,1,2],[182,689,1,4],[182,882,1,2],[182,978,-1,2],[183,447,1,2],[183,504,1,6],[183,505,1,6],[183,506,-1,3],[183,507,1,6],[183,508,1,6],[183,509,1,6],[183,510,1,6],[183,511,-1,3],[183,601,1,4],[183,632,1,1],[183,728,-1,2],[183,794,1,2],[183,801,-1,4],[183,878,1,2],[184,368,1,2],[184,401,1,4],[184,504,1,6],[184,505,1,6],[184,506,1,6],[184,507,-1,3],[184,508,-1,3],[184,509,-1,3],[184,510,1,6],[184,511,1,6],[184,534,1,1],[184,603,-1,4],[184,754,-1,1],[184,1007,-1,2],[184,1013,-1,2],[185,249,-1,2],[185,504,1,6],[185,505,1,6],[185,506,1,6],[185,507,-1,3],[185,508,-1,3],[185,509,1,6],[185,510,-1,3],[185,511,1,6],[185,575,1,2],[185,732,-1,2],[185,733,1,2],[185,782,-1,1],[185,835,-1,2],[185,999,-1,1],[186,249,-1,2],[186,406,1,1],[186,504,1,6],[186,505,1,6],[186,506,1,6],[186,507,-1,3],[186,508,-1,3],[186,509,1,6],[186,510,1,6],[186,511,-1,3],[186,637,1,2],[186,732,-1,4],[186,733,1,4],[186,782,-3,2],[186,1004,-1,1],[186,1010,-1,2],[187,376,1,2],[187,420,-1,2],[187,504,1,6],[187,505,1,6],[187,506,1,6],[187,507,-1,3],[187,508,-1,3],[187,509,1,6],[187,510,1,6],[187,511,1,6],[187,567,-1,4],[187,781,1,2],[187,800,-1,1],[187,836,-1,4],[187,974,-1,2],[188,378,1,1],[188,504,1,6],[188,505,1,6],[188,506,1,6],[188,507,-1,3],[188,508,1,6],[188,509,-1,3],[188,510,-1,3],[188,511,1,6],[188,631,1,4],[188,785,-1,2],[188,790,-1,1],[188,858,-1,2],[188,941,-1,4],[188,956,-1,1],[189,381,1,1],[189,504,1,6],[189,505,1,6],[189,506,1,6],[189,507,-1,3],[189,508,1,6],[189,509,-1,3],[189,510,1,6],[189,511,-1,3],[189,631,1,4],[189,733,-1,4],[189,782,-1,2],[189,785,-1,2],[189,793,-1,1],[189,954,-1,1],[190,420,-1,2],[190,476,1,1],[190,504,1,6],[190,505,1,6],[190,506,1,6],[190,507,-1,3],[190,508,1,6],[190,509,-1,3],[190,510,1,6],[190,511,1,6],[190,719,-1,2],[190,821,-1,4],[190,836,-1,4],[190,966,-1,1],[190,991,1,2],[191,401,1,4],[191,483,1,1],[191,504,1,6],[191,505,1,6],[191,506,1,6],[191,507,-1,3],[191,508,1,6],[191,509,1,6],[191,510,-1,3],[191,511,-1,3],[191,538,1,1],[191,603,1,4],[191,963,-1,1],[191,1007,-1,2],[191,1013,1,2],[192,305,1,2],[192,390,1,2],[192,447,-1,2],[192,504,1,6],[192,505,1,6],[192,506,1,6],[192,507,-1,3],[192,508,1,6],[192,509,1,6],[192,510,-1,3],[192,511,1,6],[192,544,-1,4],[192,587,-1,2],[192,601,1,4],[192,640,1,1],[192,799,-1,1],[192,975,-1,2],[193,479,1,1],[193,504,1,6],[193,505,1,6],[193,506,1,6],[193,507,-1,3],[193,508,1,6],[193,509,1,6],[193,510,1,6],[193,511,-1,3],[193,640,1,2],[193,689,-1,4],[193,717,-1,2],[193,812,1,4],[193,960,-1,1],[193,988,1,2],[194,499,1,1],[194,500,1,4],[194,502,-1,2],[194,504,1,6],[194,505,1,6],[194,506,1,6],[194,507,1,6],[194,508,-1,3],[194,509,-1,3],[194,510,-1,3],[194,511,1,6],[194,565,-1,2],[194,757,-1,2],[194,908,1,2],[194,1015,-1,1],[195,498,-1,1],[195,500,1,4],[195,502,1,2],[195,504,1,6],[195,505,1,6],[195,506,1,6],[195,507,1,6],[195,508,-1,3],[195,509,-1,3],[195,510,1,6],[195,511,-1,3],[195,517,-1,1],[195,564,-1,2],[195,905,-1,2],[195,913,1,2],[196,266,-1,2],[196,432,1,1],[196,486,1,1],[196,504,1,6],[196,505,1,6],[196,506,1,6],[196,507,1,6],[196,508,-1,3],[196,509,-1,3],[196,510,1,6],[196,511,1,6],[196,512,-1,2],[196,524,-1,2],[196,620,-1,1],[196,635,-1,1],[196,775,-1,4],[196,907,-1,2],[196,936,-1,2],[197,485,1,1],[197,490,1,4],[197,496,-1,2],[197,504,1,6],[197,505,1,6],[197,506,1,6],[197,507,1,6],[197,508,-1,3],[197,509,1,6],[197,510,-1,3],[197,511,-1,3],[197,561,-1,2],[197,770,-1,2],[197,897,1,2],[197,990,-1,2],[198,292,1,2],[198,305,1,1],[198,489,1,1],[198,504,1,6],[198,505,1,6],[198,506,1,6],[198,507,1,6],[198,508,-1,3],[198,509,1,6],[198,510,-1,3],[198,511,1,6],[198,521,1,2],[198,550,1,4],[198,953,-1,2],[198,993,-1,2],[199,487,1,1],[199,504,1,6],[199,505,1,6],[199,506,1,6],[199,507,1,6],[199,508,-1,3],[199,509,1,6],[199,510,1,6],[199,511,-1,3],[199,659,1,1],[199,726,-1,2],[199,880,1,2],[200,484,-1,1],[200,490,1,4],[200,496,1,2],[200,504,1,6],[200,505,1,6],[200,506,1,6],[200,507,1,6],[200,508,1,6],[200,509,-1,3],[200,510,-1,3],[200,511,-1,3],[200,560,-1,2],[200,903,1,2],[200,917,-1,2],[200,983,-1,2],[201,491,-1,4],[201,504,1,6],[201,505,1,6],[201,506,1,6],[201,507,1,6],[201,508,1,6],[201,509,-1,3],[201,510,-1,3],[201,511,1,6],[201,525,-1,1],[201,594,1,2],[201,721,-1,4],[201,730,1,2],[201,735,-1,2],[201,940,1,1],[202,292,-1,2],[202,504,1,6],[202,505,1,6],[202,506,1,6],[202,507,1,6],[202,508,1,6],[202,509,-1,3],[202,510,1,6],[202,511,-1,3],[202,521,-1,2],[202,550,1,4],[202,705,1,2],[202,721,-1,2],[202,945,1,1],[202,953,-1,2],[203,263,-1,4],[203,427,1,1],[203,488,-1,1],[203,504,1,6],[203,505,1,6],[203,506,1,6],[203,507,1,6],[203,508,1,6],[203,509,1,6],[203,510,-1,3],[203,511,-1,3],[203,774,1,2],[203,889,-1,2],[203,916,-1,2],[203,922,1,2],[204,308,-1,1],[204,311,-1,1],[204,323,-1,1],[204,336,-1,1],[204,352,-1,1],[204,355,-1,1],[204,356,-1,1],[204,462,-1,1],[204,504,-1,2],[204,505,1,2],[204,556,1,2],[204,748,1,4],[204,804,-1,2],[204,902,1,2],[205,244,1,1],[205,257,-1,4],[205,271,-1,2],[205,274,1,2],[205,277,-1,2],[205,280,1,2],[205,322,-1,1],[205,358,-1,4],[205,367,1,4],[205,453,1,1],[205,504,-1,2],[205,506,1,2],[205,569,-1,1],[205,716,1,2],[205,755,1,4],[206,256,1,2],[206,451,1,4],[206,455,1,1],[206,504,-1,2],[206,507,1,2],[206,584,-1,1],[206,716,1,4],[206,756,1,2],[206,768,-1,2],[206,876,1,1],[207,240,1,1],[207,255,1,2],[207,344,-1,1],[207,504,-1,2],[207,508,1,2],[207,602,-1,2],[207,715,1,2],[207,777,-1,4],[207,779,1,4],[207,810,-1,2],[207,814,1,1],[207,819,-1,2],[208,255,1,2],[208,504,-1,2],[208,509,1,2],[208,551,1,2],[208,602,-1,4],[208,777,-1,4],[208,805,1,2],[208,810,-1,1],[208,814,1,1],[208,819,-1,2],[208,886,1,1],[208,968,1,2],[209,255,3,4],[209,316,-1,1],[209,354,-1,1],[209,425,-1,2],[209,447,1,2],[209,504,-1,2],[209,510,1,2],[209,601,-1,4],[209,607,-1,4],[209,640,-1,2],[209,689,-1,4],[209,714,1,2],[209,814,-1,2],[210,255,1,4],[210,504,-1,2],[210,511,1,2],[210,557,1,2],[210,777,1,4],[210,814,1,2],[210,819,-1,2],[210,888,1,1],[210,969,1,2],[211,259,1,1],[211,287,1,2],[211,300,1,1],[211,451,-1,4],[211,504,-1,2],[211,716,1,4],[211,756,1,2],[211,768,-1,2],[211,890,1,2],[211,891,1,2],[212,455,1,1],[212,505,-1,2],[212,506,1,2],[212,568,-1,1],[212,750,1,2],[212,870,-1,2],[212,925,-1,1],[213,257,-1,4],[213,271,-1,2],[213,274,1,2],[213,277,-1,2],[213,280,1,2],[213,281,-1,1],[213,358,-1,4],[213,367,1,4],[213,453,1,1],[213,505,-1,2],[213,507,1,2],[213,755,1,4],[213,868,-1,2],[213,950,-1,1],[213,972,1,2],[214,442,1,1],[214,505,-1,2],[214,508,1,2],[214,529,-1,2],[214,602,-1,4],[214,738,1,2],[214,805,-1,2],[214,837,1,4],[214,848,-1,2],[215,310,1,1],[215,444,1,1],[215,505,-1,2],[215,509,1,2],[215,796,-1,4],[215,837,1,4],[215,848,-1,2],[215,971,1,2],[215,992,-1,2],[216,255,1,2],[216,425,-1,1],[216,446,1,1],[216,447,1,2],[216,505,-1,2],[216,510,1,2],[216,533,-1,2],[216,601,-1,4],[216,640,-1,2],[216,689,-1,4],[216,729,1,2],[216,814,-1,1],[217,425,-1,2],[217,448,1,1],[217,505,-1,2],[217,511,1,2],[217,607,1,4],[217,788,1,4],[217,970,1,2],[217,989,-1,2],[217,1022,-1,2],[218,309,1,1],[218,353,1,1],[218,505,-1,2],[218,547,1,2],[218,681,-1,2],[218,904,1,2],[218,915,1,2],[219,242,-1,1],[219,268,1,2],[219,394,-1,1],[219,403,-1,1],[219,409,-1,1],[219,410,-1,1],[219,482,-1,1],[219,506,-1,2],[219,507,1,2],[219,577,1,2],[219,764,1,2],[219,778,1,4],[219,943,1,2],[219,1020,-1,2],[220,258,1,1],[220,402,-1,1],[220,447,1,1],[220,506,-1,2],[220,508,1,2],[220,567,1,2],[220,601,1,2],[220,740,-1,1],[220,786,-1,2],[220,794,-1,2],[220,801,-1,4],[220,803,1,4],[221,447,1,1],[221,506,-1,2],[221,509,1,2],[221,567,1,4],[221,582,1,2],[221,601,1,2],[221,749,-1,1],[221,781,1,2],[221,786,-1,1],[221,794,-1,2],[221,801,-1,4],[221,885,1,1],[222,276,-1,1],[222,305,-1,2],[222,412,-1,1],[222,447,1,1],[222,506,-1,2],[222,510,1,2],[222,544,1,4],[222,587,1,2],[222,640,-1,2],[222,689,-1,4],[222,742,-1,1],[223,447,1,2],[223,506,-1,2],[223,511,1,2],[223,590,1,2],[223,601,1,4],[223,747,-1,1],[223,794,-1,2],[223,801,1,4],[223,887,1,1],[224,241,1,1],[224,386,1,1],[224,475,-1,2],[224,506,-1,2],[224,595,-1,1],[224,923,1,2],[224,924,1,2],[225,273,1,1],[225,420,-1,2],[225,466,1,1],[225,507,-1,2],[225,508,1,2],[225,567,1,4],[225,781,-1,2],[225,836,-1,4],[225,984,-1,1],[226,270,1,1],[226,420,-1,2],[226,468,1,1],[226,507,-1,2],[226,509,1,2],[226,821,1,4],[226,836,-1,4],[226,991,-1,2],[226,994,-1,1],[227,279,1,1],[227,305,-1,2],[227,447,1,2],[227,470,1,1],[227,507,-1,2],[227,510,1,2],[227,544,1,4],[227,587,1,2],[227,601,-1,4],[227,689,-1,2],[227,996,-1,1],[228,472,1,1],[228,507,-1,2],[228,511,1,2],[228,640,1,2],[228,689,-1,4],[228,812,-1,4],[228,988,-1,2],[228,1002,-1,1],[228,1021,-1,2],[229,243,1,1],[229,411,1,1],[229,507,-1,2],[229,683,-1,2],[229,935,1,2],[229,946,1,2],[229,1007,-1,1],[230,247,-1,1],[230,299,-1,1],[230,360,-1,1],[230,428,-1,1],[230,431,-1,1],[230,496,-1,1],[230,508,-1,2],[230,509,1,2],[230,521,1,1],[230,615,1,1],[230,724,1,4],[230,790,1,2],[230,930,-1,2],[231,302,-1,1],[231,421,-1,2],[231,430,-1,1],[231,493,1,1],[231,508,-1,2],[231,510,1,2],[231,544,1,2],[231,730,-1,1],[232,491,-1,4],[232,495,1,1],[232,508,-1,2],[232,511,1,2],[232,598,-1,1],[232,721,1,4],[232,730,-1,2],[232,735,-1,2],[232,884,-1,1],[232,927,1,2],[233,357,1,1],[233,389,-1,1],[233,423,1,1],[233,491,-1,4],[233,508,-1,2],[233,721,1,4],[233,730,-1,2],[233,735,1,2],[233,865,-1,1],[233,926,1,2],[234,419,1,2],[234,495,1,1],[234,509,-1,2],[234,510,1,2],[234,553,1,2],[234,881,-1,2],[234,998,-1,1],[235,421,-1,2],[235,426,-1,1],[235,493,1,1],[235,509,-1,2],[235,511,1,2],[235,879,-1,2],[235,934,1,2],[235,1001,-1,1],[236,359,1,1],[236,429,1,1],[236,509,-1,2],[236,685,-1,2],[236,921,-1,1],[236,932,1,2],[236,1019,-1,1],[237,252,-1,1],[237,292,1,1],[237,364,-1,1],[237,393,-1,1],[237,417,-1,1],[237,424,1,2],[237,502,-1,1],[237,510,-1,2],[237,511,1,2],[237,634,1,1],[237,734,1,4],[237,806,-1,2],[237,911,-1,2],[238,361,1,1],[238,375,-1,1],[238,416,1,1],[238,501,-1,2],[238,510,-1,2],[238,939,1,2],[238,986,1,2],[239,363,1,1],[239,418,1,1],[239,511,-1,2],[239,687,-1,2],[239,920,-1,1],[239,944,1,2],[239,987,1,2]],"scope":"Exact rational scalar columns and emitted pre/post gates. Needs physical Clifford endpoint adapters, inverse orientation, changed bank phases and finite global invoice.","sinks":[355,403],"status":"PASS_EXACT_1023_COLUMN_ABSTRACT_FORWARD_HETEROGENEOUS_DIRTY_DECODER"} \ No newline at end of file diff --git a/research/e8-clean-r781/data/pr390/sink-audit.json b/research/e8-clean-r781/data/pr390/sink-audit.json new file mode 100644 index 0000000000..ef2b6f9ee9 --- /dev/null +++ b/research/e8-clean-r781/data/pr390/sink-audit.json @@ -0,0 +1,72 @@ +{ + "accepted": [ + { + "cut_group": 2030, + "dim": 8, + "exact_rational_zero_clean_row": true, + "frame": 206, + "normalized_moment_minus_volume_delta": 0, + "sink_helper": 355, + "uncompute": [ + [ + 356, + -1, + 1 + ], + [ + 556, + 1, + 2 + ], + [ + 619, + 1, + 1 + ] + ] + }, + { + "cut_group": 2045, + "dim": 8, + "exact_rational_zero_clean_row": true, + "frame": 221, + "normalized_moment_minus_volume_delta": 0, + "sink_helper": 403, + "uncompute": [ + [ + 409, + -1, + 1 + ], + [ + 577, + 1, + 2 + ], + [ + 628, + 1, + 1 + ] + ] + } + ], + "local_histogram_delta": { + "1": 2, + "3": 4, + "4": -4 + }, + "local_mass_delta": -2, + "new_helper_endpoint_dimensions": [ + [ + 8, + 2 + ], + [ + 9, + 781 + ] + ], + "rejected": [], + "scope": "EXACT_RATIONAL_CLEAN_SOURCE_AND_FRAME_WALK_ONLY; new dirtypreconditioning/cleanrepair and fullCliffordadmissionnotchecked" +} \ No newline at end of file diff --git a/research/e8-clean-r781/data/pr398/LICENSE-pr398 b/research/e8-clean-r781/data/pr398/LICENSE-pr398 new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-clean-r781/data/pr398/LICENSE-pr398 @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-clean-r781/data/pr398/VALIDATION.json b/research/e8-clean-r781/data/pr398/VALIDATION.json new file mode 100644 index 0000000000..3b1a9bb6a4 --- /dev/null +++ b/research/e8-clean-r781/data/pr398/VALIDATION.json @@ -0,0 +1,128 @@ +{ + "status": "PASS_SIGNED_PREFIX_CONDITIONAL_COMPOSITION", + "kappa": "125311832453733/125000000000000000", + "kappa_decimal": "0.001002494659629864", + "complex_coarse": "31359395740192012461/31250000000000000000000", + "bit_coarse": "255384852701747/250000000000000000", + "execution_checks": [ + { + "name": "reconstruct", + "seconds": 5.23399999999674, + "log_sha256": "8ae3dc20fd1d6ff08bae7474eeefa34816ed19193ace261251a9bfa2868b2e70" + }, + { + "name": "bit", + "seconds": 58.5, + "log_sha256": "9359c3f3473619ed6c41c8dbc1e5d9ae6a4fdf1e579b45628a1044eb15b00f6a" + }, + { + "name": "complex", + "seconds": 273.48499999998603, + "log_sha256": "bbf893c0ec8f70c180fd83a6dbd771a51904a83e01ae2f58e8f12ec662c8ea5b" + }, + { + "name": "outer", + "seconds": 0.5160000000032596, + "log_sha256": "818c1c91ebcb7f8ed31986fff8540b16f92e7735d13e753e39f7f2c666113f1a" + } + ], + "global_template_sha256": "3cfaf98834b588396fdf34fc4df404a784a628f8649094dd652c9d4ba684b8e6", + "candidate_json_sha256": "a4e42aa1663f5ad0da48cee6fe8514b205e43cf6e791b80674dbc7506a098a32", + "phase_recipe_sha256": "356211a16d179c8b4d37d0bc5d038b55b4d0397242b119f7b83a583b7f766e1a", + "outer_constraints": 47, + "executed_sources_sha256": { + "code/audit-global-template.py": "65c81031f9e08258f8292e8475d2c75814ecda29cd655e843e752db6ce26d405", + "code/bit-compose-replay.py": "553f29567694069526dd317f2c42ef4a235efbcec2d639c1692dcae50647ce04", + "code/complex-clifford.py": "4db146ece9092d201c2c5f35a83ed7a7cdf6bce5965cae1a0d3531952eccd760", + "code/complex-compose.py": "842510a0f72f4689bbf7e1251d1e3de7d7ea300eaa601138e4ecc9904ac1405b", + "code/data_phases.py": "04154b12eff7d762d12535663cfef5dcfe7a3dfa68801bf2f9b22c16a910a6a8", + "code/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "code/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "code/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "code/global-template.py": "5c96f7bc79abe8dc4eb716dc78523fadc87090450dd16da5c6fda9d7594a7527", + "code/join-admission.py": "209211abf94462ad7f9dcb6c2fc41759aeb65f2bbffaae4f3b2cf57ece540c60", + "code/outer.py": "1db8744f85e87cfaa5e2b3696d7f89a2972c668365318a7cb1b6695c537467ee", + "code/reconstruct.py": "ffb59962275189d8a22c9645ab1afb0a89168902b8beb400639ae3de2ea7d494", + "code/run-admission.py": "07c3316dd1a105b98f301d28aa84f3966dbec8948f24a05894f14a63d09fde38", + "data/bridge.json": "7f81358380939f27668563681eef7dab642528531a71c7eafe66b866207bd2c3", + "data/far783.json.gz": "f2664ee7bcdfb55893abe9f1be8ee6a394a602e8262e611de2a0328bbd508aa7", + "data/selection.json": "e1454092dd6ca887c90a9de4bb29484ebd028f92062d0947d968281dd2b4091c", + "data/signed25.json.gz": "495ec66be65bf66e3a5cd27b411df942cc7c92664807f93e25b88a71cb498d67", + "research-notes/basis-cut-readout.cpp": "8e370f1ee3d19b32b3674eeb52fe497f9fddf2ffac41d960aeff7c44d309a3b0", + "research-notes/prefix-search.cpp": "a08453ef3ae98ac3e381dd23acbc70fc45cf8a06b9b0831a5a7d499588936547", + "research-notes/quotient-stars.cpp": "c557e22bf4f74c04779623a6c05150571404a47da3e47c598514cea46d510383", + "research-notes/source-dual-verify.py": "0be08a002a8e342d1fff29741801a7d7195fe3193cdb3e6065a752633ab9e31f", + "research-notes/source-dual.cpp": "7f6dec4ef24c63070d30fd8c07cbb67dfbe5e4e74d76eaeef5faccf108f0a0cc", + "research-notes/structural-rational.hpp": "ae3f0cb2cee73d4e689e555c15e2ff31c3983548544f11525e2e1ef2d38163b0", + "vendor/bit/code/bit/checkers/certify_bit_g.py": "c9a31508126f34e7ac95d802c39e8919a872cd705314de5bf3538de1636ce8ce", + "vendor/bit/code/bit/checkers/certify_bit_k.py": "e68a81ef7981a90d613752003cd5cab5351e260f909b094f1668d8a4dfe480df", + "vendor/bit/code/bit/checkers/columns_h.cpp": "d1297f9052be4f2496e1ff2a77e4db2c0cdbd7d460d489b4c03e50bf317238ce", + "vendor/bit/code/bit/checkers/columns_k.cpp": "1c344d18fcd494eeca93e259f10cafae7705780e6592f6dcb35b34752dab9bc2", + "vendor/bit/code/bit/checkers/cost.py": "d55d2b865d1c3d35e343e1a38c592b9172ed8e2596d1107e34d92e2a80c7d03f", + "vendor/bit/code/bit/checkers/exactnd_h.py": "28a0d8ee29ac75b8a789705454987f07d618f135ed1f1bd45b97f18bcc4163e3", + "vendor/bit/code/bit/checkers/finite_g.py": "a591d8caa9ab50a4c7ec6934c71c93fc18fd14680180b43071e8d9d704f7ac9a", + "vendor/bit/code/bit/checkers/finite_k.py": "7e67dc75e63a11e38ac6d6615656c7cf6982e5a33dd404d04b967bf474cad02e", + "vendor/bit/code/bit/checkers/geometry_g.py": "b9fa3cd05f36f5fcebfdebfb4a86fb90e92ed3c1d9157c52918ee8c5b563b54f", + "vendor/bit/code/bit/checkers/geometry_k.py": "646b7e8773d9c99376cb00627f109a97319e6d72b439ff513c39035c28c3f70f", + "vendor/bit/code/bit/checkers/gram_frames.py": "223a5a07731fc315a90a3e48177796babc155c1d9985c7ae5017eff6af2a0608", + "vendor/bit/code/bit/checkers/json.hpp": "aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63", + "vendor/bit/code/bit/checkers/legality_h.cpp": "6c1ef2b24e57781d6951c172a1024fc4300e6fd392c9d6672079a7806ab663b3", + "vendor/bit/code/bit/checkers/tile_g.py": "8140eec180e42202f2c6a9f11f5c92885e60861c38a7611dd805c524e3438138", + "vendor/bit/code/bit/checkers/tile_k.py": "64255088821f601ede2c3006f08cb97c39a4fa10dbbeb93a8a71fcfa0e1d8d77", + "vendor/bit/code/bit/export_records.py": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3", + "vendor/bit/code/bit/independent/centres_sat.py": "f69379968367544807db2f0cf14359977e56299383b3edcc4469ddea7c7ecb40", + "vendor/bit/code/bit/independent/checkword.py": "11bf9620ca9db16d52d9fe806b814fc9ec9a89c4d7645354d1861d96f6e805ad", + "vendor/bit/code/bit/independent/mutate.py": "0ff65aace5da4b57d96235bf830f8f11969322e75134d498aeb70e9753ec6b0d", + "vendor/bit/code/bit/mutate_records.py": "b0e75d6550412a7be4017695e6b237392b611bb852ad8ff309d6682c9f166a4e", + "vendor/bit/code/bit/producer/compile.py": "60fea6a9d6617a3f87376d3fda040642e9cb70e7c179015e03ede8d289f30357", + "vendor/bit/code/bit/producer/compile2.py": "0e23d4282ceb75768e82631da016aaff9818aec53c7d75a6b2a28ee1b1160dc3", + "vendor/bit/code/bit/producer/e8lib.py": "4f8a6843e83bc4f7055d7337f33dbe12ce499051f46bee1b81bbf6b34c652574", + "vendor/bit/code/bit/producer/frames.py": "ba71f77dd3e3c1c54f361c066cebe9faadbc78db46376046e7af625bf1de8c24", + "vendor/bit/code/bit/producer/fullword.py": "0daf87599e9e48646b985ad87351c56c1b73cfc99cdf9eca081483846ddbfa90", + "vendor/bit/code/bit/producer/ham1.py": "359040fb432fd392472af6b8f5dca0234dd6c2be744a791df27ba62bc5da5175", + "vendor/bit/code/bit/producer/ham2.py": "fdf0af785ce697bd7f80b4e75f7163735f3b599d9dc42f652f0ffdbdf18ea8bf", + "vendor/bit/code/bit/producer/params-r865.json": "1256c54debe0a551da8e24896ab73ef0bd4a5233ff8e6fedf21a9e6301d6e6f3", + "vendor/bit/code/bit/producer/price.py": "46c858e60ba0a117bf8227b864abf55e85ebee2d56a0dce64472b706499ac405", + "vendor/bit/code/bit/producer/search2.py": "4999c5d6bac9757e4236c45435201631eae21f644dc9543d8c0b6e3cc8360daf", + "vendor/bit/code/bit/receipts_e8.py": "935ea65d9c6739e868ccf1aa439bd3c246657dfc887e4a0222a8f0901a5b41a5", + "vendor/bit/code/bit/receipts_k.py": "67f714e10a846e9cc62996342f825cd715055031e0b12591abdafd225717e195", + "vendor/bit/code/bit/regression/certify_bit.py": "fc03e8f7bf73d7d70346b87c835d44508b0581c9ff9aec708fbbd4f0121e0394", + "vendor/bit/code/bit/regression/columns_h_pr346.cpp": "26f5c9be3a7f545d50be458e3d17403921b5542a7dcd2986c848664a774977a8", + "vendor/bit/code/bit/regression/cost.py": "d55d2b865d1c3d35e343e1a38c592b9172ed8e2596d1107e34d92e2a80c7d03f", + "vendor/bit/code/bit/regression/json.hpp": "aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63", + "vendor/bit/code/bit/regression/legality_h_pr346.cpp": "5661d0b91e07d95736bde4c1824f27bebaecce0a84e38403f5391ebc51a52056", + "vendor/bit/code/bit/regression/prime_new.py": "7bd5cb48537621f1217d174274d42483da4e2d02feec238643c798c36b30366a", + "vendor/bit/code/bit/regression/prime_witnesses.py": "98cd03bc9582e7bd0ab194c191ea8eea940539e510051443ab9fd3e572a364ab", + "vendor/bit/code/bit/regression/stage_cohort.py": "6c288f6f234b528c1a7c0a4adfb724e91e0fe6b18c8dffad96af3f973de1829a", + "vendor/bit/code/bit/regression/tile_check.py": "38c3f78daac118395565a65fa3543b1c349638ff2519ce7fda0dad2d788e90ae", + "vendor/bit/code/complex/code/bridged.py": "5fe7174cd3a6580a74e4c1bf8fa7b426e8673f1c285603bf3076d4e758d70731", + "vendor/bit/code/pricing/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/bit/code/pricing/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/bit/code/pricing/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/bit/code/pricing/prime_witnesses.py": "98cd03bc9582e7bd0ab194c191ea8eea940539e510051443ab9fd3e572a364ab", + "vendor/bit/data/bit/bitE8-r865.json.gz": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/complex_basis.py": "52d68781eaf6d9decf02446a532a7336fcf15924a9f6781ba0833d038decb9f8", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/complex_gx.py": "ccc924537db0c0d55f0c1934e79b8cf4d85b4fb336473d7b42d69e12557aa9f2", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/complex_labels.py": "e000ee131389fec427388b85f632879cbaaf10e5e5d979a47d6307d64ce58982", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/complex_scalars.py": "38e985ebe8c8e7f8c83c03828abde0c80be418caf95e97afdf2d0c357c0ed919", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/complex_splice.py": "aaf46c8e5c68875b8315892e924e082b2f219f8d042dd14937e7cd2f72456dce", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/p10pins.py": "93b78a2e038b23264d04836928c78b6ebf33b87ff3dcc0e43ba0f1748fadd143", + "vendor/cx/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/scatter.py": "dfd1afbbb3ff86f54db6a0313916403ec8ee6f939caa62f3edcc9d7a151bff95", + "vendor/cx/work/odd-stages/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "vendor/cx/work/odd-stages/data_phases.py": "671d6f8144c6d31e1766c6a0e144172da661a63f86b3d4d17fe2710f3ef752c4", + "vendor/cx/work/odd-stages/global_nine.py": "7e33e6ca88b11e28544bf7d43b02252208d4355369a14adb2aa8baa15773e42a", + "vendor/cx/work/odd-stages/RECIPE-9.json": "abda2e4c73ecb48d29c30c12bc9a5c2db71d11a35667b4298788ec9154eeec7b", + "vendor/cx/work/pr361/code/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/cx/work/pr361/code/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/cx/work/pr361/code/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/helper/candidate_frames.py": "2b8d10ff732e030eb643478b3da0a91753dc77314eeb882a51eafdb871d935e2", + "vendor/helper/candidate_from378.py": "b97c57e03fb570caab63bd82bf00664b5abea7eda8db3adfed69fc20efd82fb6", + "vendor/helper/two_alias.py": "5046a050e168266aff6488d27ca6525469c844118fbaced9af2b3dde8e13065c", + "vendor/reuse/frame-selection.json": "a83d4880579fb1f8cffb701d1d685c157b7fa14ef9d6642e42ff1e4f5a1b8c5c", + "vendor/reuse/frame_replay.py": "6dc74f24323c717d9eff7c12f27c67a0531899e61a8ee340c98162b1e34f9531", + "vendor/reuse/reuse-selection.json": "0b300bab47cf0d69cbc7965bf01c2a27c96b97677ee651334470d8c968b603f1", + "vendor/reuse/reuse_replay.py": "e83251e3d49267fb5b53eda53c1be80118b7df0cc671c38cad1f300883cd1316", + "verify.py": "601dcf334abf668278b78d47d5480004e9b91054ea9b14e6078be40432c3e60d" + }, + "note": "End-to-end portable replay passed before adding this receipt and final provenance prose. All executable, vendor and witness bytes are unchanged. The final manifest additionally covers this receipt. Fresh verification regenerates receipts outside the package." +} diff --git a/research/e8-clean-r781/data/pr398/signed25.json.gz b/research/e8-clean-r781/data/pr398/signed25.json.gz new file mode 100644 index 0000000000..23a6396ded Binary files /dev/null and b/research/e8-clean-r781/data/pr398/signed25.json.gz differ diff --git a/research/e8-clean-r781/data/sinks-e8clean3.json b/research/e8-clean-r781/data/sinks-e8clean3.json new file mode 100644 index 0000000000..bd9e745969 --- /dev/null +++ b/research/e8-clean-r781/data/sinks-e8clean3.json @@ -0,0 +1,116 @@ +[ + { + "sink_helper": 301, + "cut_group": 1974, + "frame": 731, + "target": 276, + "uncompute": [ + [ + 1019, + 1, + 2 + ] + ] + }, + { + "sink_helper": 301, + "cut_group": 1974, + "frame": 731, + "uncompute": [ + [ + 276, + -1, + 2 + ] + ] + }, + { + "sink_helper": 301, + "cut_group": 1974, + "frame": 731, + "target": 276, + "uncompute": [ + [ + 1019, + -1, + 2 + ] + ] + }, + { + "sink_helper": 324, + "cut_group": 2005, + "frame": 744, + "target": 311, + "uncompute": [ + [ + 1018, + 1, + 2 + ] + ] + }, + { + "sink_helper": 324, + "cut_group": 2005, + "frame": 744, + "uncompute": [ + [ + 311, + -1, + 2 + ] + ] + }, + { + "sink_helper": 324, + "cut_group": 2005, + "frame": 744, + "target": 311, + "uncompute": [ + [ + 1018, + -1, + 2 + ] + ] + }, + { + "sink_helper": 387, + "cut_group": 2040, + "frame": 759, + "target": 316, + "uncompute": [ + [ + 1020, + 1, + 2 + ] + ] + }, + { + "sink_helper": 387, + "cut_group": 2040, + "frame": 759, + "uncompute": [ + [ + 316, + -1, + 2 + ] + ] + }, + { + "sink_helper": 387, + "cut_group": 2040, + "frame": 759, + "target": 316, + "uncompute": [ + [ + 1020, + -1, + 2 + ] + ] + } +] \ No newline at end of file diff --git a/research/e8-clean-r781/verify.sh b/research/e8-clean-r781/verify.sh new file mode 100644 index 0000000000..4c3b644a6f --- /dev/null +++ b/research/e8-clean-r781/verify.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# One-command verification of research/e8-clean-r781. usage: bash verify.sh [--quick] /fresh/output/dir +# python3 >= 3.11, standard library only. --quick skips the free-sink regeneration (~2 min). +set -euo pipefail +QUICK=0; if [ "${1:-}" = "--quick" ]; then QUICK=1; shift; fi +HERE=$(cd "$(dirname "$0")" && pwd); WD=$(mkdir -p "$1" && cd "$1" && pwd) +case "$WD" in "$HERE"*) echo "output dir must be outside the package"; exit 2;; esac +PY="${PYTHON:-python3} -I -B"; C=$HERE/code; GX=$HERE/complex/gx; D=$HERE/data + +echo "== 0. manifest"; (cd "$HERE" && $PY -c " +import hashlib,sys,os +bad=0;listed=set() +for line in open('MANIFEST.sha256'): + h,p=line.rstrip('\n').split(' ',1);listed.add(p) + if hashlib.sha256(open(p,'rb').read()).hexdigest()!=h: print('MISMATCH',p);bad+=1 +files={os.path.relpath(os.path.join(r,f)) for r,_,fs in os.walk('.') for f in fs if '__pycache__' not in r}-{'MANIFEST.sha256'} +if files-listed: print('UNLISTED',sorted(files-listed));bad+=1 +sys.exit(1 if bad else 0)") && echo " all files match MANIFEST.sha256" + +echo "== 1. pinned inputs (git blob ids)" +$PY -c " +import hashlib +def blob(p): + d=open(p,'rb').read();return hashlib.sha1(b'blob %d\0'%len(d)+d).hexdigest() +pins={'$GX/gx.py':('6d14c0a976146eb881c1e3897b2476f8633d4e9c','Sussman tools/gx/gx.py'), + '$GX/gxcore.py':('3e3f0a3076f3c326e7833c74eceecb3436dd3185','Sussman tools/gx/gxcore.py'), + '$D/gcert1-e8-r783-far.json.gz':('56708f99a48c3f86bfcabfc526c2ff224bdba66a','PR #378 far-retimed E8 word (ours)'), + '$D/pr390/prefix18.json.gz':('51f3ea73e0c1726351450e54e4873cfdd4d98d9e','PR #390 prefix18 word (Dugongue, 0e790f2)'), + '$D/pr390/sink-audit.json':('ef2b6f9ee9d4c0cdd3a3a3aa46e8cfaf2958bf6d','PR #390 sink-audit.json (sinks 355/403)'), + '$D/pr390/prewhite.json':('527a2ea46180a2e9464acbc7f8298474d5b78762','PR #390 prewhite.json (regression target only)'), + '$D/pr398/signed25.json.gz':('23a6396ded06ffdd27a94e60bb0fe5ce4bea42ad','PR #398 R781 signed25 word (Dugongue, c3251c8)'), + '$D/pr398/VALIDATION.json':('3b1a9bb6a400aed56ba08a2bdb8d90c9a4dace0d','PR #398 VALIDATION.json (kappa/b control)'), + '$D/bit/bitE8-kernel.json.gz':('22141be33d588ed9495feaeedda7efe205a5f8d0','PR #382 E8 bit word (ours)')} +for p,(h,what) in pins.items(): + assert blob(p)==h,(p,blob(p));print(' ',h[:12],what)" + +echo "== 2-6. bracket regression, words, local program (both orientations), banks, price (#398 control), kappa" +if [ $QUICK = 1 ]; then $PY $C/clean.py $HERE $GX $WD/kappa.json; else $PY $C/clean.py $HERE $GX $WD/kappa.json --regen; fi +echo "== 7. Sussman's checkers, flipped-sign control and source-span rule on #398's word and ours" +$PY $C/cxcheck.py $D/pr398/signed25.json.gz $GX +$PY $C/cxcheck.py $WD/gcert1-e8clean3.json.gz $GX +$PY -c " +import json;k=json.load(open('$WD/kappa.json')) +assert k['b']=='1003667444352030197427/1000000000000000000000000' and k['kappa']=='1002661106042177/1000000000000000000' and k['binding']=='complex' +assert k['kappa_398']=='125311832453733/125000000000000000' +print('PASS conditional kappa =',k['kappa'],'=',k['kappa_float'],'(complex-bound; #398 R781 signed-prefix component, #390 bracket, three padding-fused sinks)')" diff --git a/research/e8-far-nine-complex/LICENSE b/research/e8-far-nine-complex/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-far-nine-complex/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-far-nine-complex/MANIFEST.sha256 b/research/e8-far-nine-complex/MANIFEST.sha256 new file mode 100644 index 0000000000..3b8ff4b7cd --- /dev/null +++ b/research/e8-far-nine-complex/MANIFEST.sha256 @@ -0,0 +1,28 @@ +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE +4f2d5ada65cfddac05ae6c6b826b80e2930ad03102b03468f901ae6ab07e40ee NOTICE.md +acefbedcd58f631d06698235947320b7fd80e7c7fd5fdca663c0fe4f1c5bd9f4 PROOF.md +a41fae4ff443295a8ca4a66c23ad82cb1779394a55ba2f31685cba57c486e3c9 README.md +97b461509656798d30b2610b4755ce825b1f84ae8772b9b4efd5c84d7404385b code/cxcheck.py +316cbf7d7c777e1fbe8a5d5fb249f0970b591330f4c2769c6827965a0e9c1adf code/cxfar.py +7b2afb0be9591c72d31d7fbcce4e2d45bbe09daf7caa21123bca050b92cd2882 code/cxfinal.py +8fc2a43e70fa8c1ce3f3025c9568b562accc5cf25b2ed53d7c0a1cbf954a0599 code/cxkernel.py +2655e1e9ec94fb39512329ec86d261959ccd7c635c7535238f254a82861c2db1 code/cxop.py +1c78b3025203c802c3aab9cc4113c48a7357d582f5bc75c47bde7953787f2e82 code/cxpiece.py +e7e06595c12fbafb707a6846719c54b85e0c2bb105927e7e7ee20f028a37438b code/cxretime.py +9f6c0718f371120b015733983b3c91285a3825d306b557f0b9013059c6c88b0e code/cxsplit.py +1cb286196c1530d06f50f0997febc5993b388f33464e295611b920ba30a24eeb code/e8core.py +aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098 code/engines/base_two_moment.py +81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482 code/engines/moment.py +c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c code/engines/outer.py +ce5c8d4510c916f4b8ce122ddd9a45bb735d45dcbc1d2334cbf2e8793d6513aa code/far9.py +e650d16538db8d80495fda5109cdfa0775e1d5f3b56b0aa39e5c1efc660877e7 code/layout_bk.py +6a63cc4150a630ad5b3edc1df5e9ed4c6381cae887cca15dca192b793c3c13d4 code/nine.py +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 complex/LICENSE-wht-power-saving-lean +557c9ad4660eebd14a00583736c4d12d2c45f3fc9bc148845f9f3efec72c9434 complex/NOTICE-wht-power-saving-lean +4b92f00fc7454b9b15e6d71a3b05062792eacca0a0ca4efee46f87827d57c8aa complex/gcert1-e8-r783.json.gz +6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95 complex/gx/gx.py +eb972c06fe8c322db2d9a8d9a7d05596e8f40c4ca8e5f42eb6df3c7361b5d517 complex/gx/gxcore.py +947f6e1266f009c6c54647e0b348b1e2076bb584b54fae19016bc8086741876a data/bit/bitE8-kernel.json.gz +f2664ee7bcdfb55893abe9f1be8ee6a394a602e8262e611de2a0328bbd508aa7 data/gcert1-e8-r783-far.json.gz +5ab0d754c01500879dd6c2a70322d08016e2917b3f5f84655923d383729411ad data/pr377/GLOBAL-REVIEW.json +ea4fc79ca6149a35279f6a71f7d3510fd372f7e17f0d64de847261e0d6c818b4 verify.sh diff --git a/research/e8-far-nine-complex/NOTICE.md b/research/e8-far-nine-complex/NOTICE.md new file mode 100644 index 0000000000..99985159aa --- /dev/null +++ b/research/e8-far-nine-complex/NOTICE.md @@ -0,0 +1,20 @@ +# Notice + +Apache-2.0 (`LICENSE`). Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. + +- `complex/gcert1-e8-r783.json.gz`, `complex/gx/gx.py`, `complex/gx/gxcore.py`: Jacob Sussman, + jacobalansussman/wht-power-saving-lean at `9c94857`, Apache-2.0. These are byte-identical (by git blob id) to our #378 copies and those vendored in + #363/#365/#375. The certificate's sha256 equals the E8 certificate pinned by #377. The upstream LICENSE and NOTICE are kept as + `complex/LICENSE-wht-power-saving-lean` and `complex/NOTICE-wht-power-saving-lean`. +- `data/gcert1-e8-r783-far.json.gz`: our #378 certificate (`research/e8-complex-far-retiming/data/`, c248962), byte-identical. +- `data/pr377/GLOBAL-REVIEW.json`: jacklightChen's (Zhihao Chen) PR #377 receipt + `research/nine-stage-complex-e8-validation/GLOBAL-REVIEW.json` at `d0a620f`, byte-identical (git blob 332f011f), Apache-2.0. + Only its `profile`, `m`, `live` and `deficit` fields are read. #377's `complex_candidate.py` and `global_nine.py` were read as data, to derive + the profile rule that `code/nine.py` reimplements. None of #377's scripts were run. +- `data/bit/bitE8-kernel.json.gz`: our #382 bit word (`research/e8-kernel-bit-b3/data/final/`, 015f00b), byte-identical. It is derived + from utcorvusvolat-dotcom's (Dylan Crow) #370 E8 bit word (Apache-2.0). +- `code/engines/moment.py`, `base_two_moment.py`, `outer.py`: PR #315's engines (DreamingOfClouds; eumemic; the #144/#23 lineage), as + vendored in our #329/#359/#378/#382 packages. +- `code/layout_bk.py`: our reimplementation of DaysSky's B_K rule (#363). +- `code/e8core.py`, `cxcheck.py`, `cxop.py`, `cxretime.py`, `cxsplit.py`, `cxpiece.py`, `cxfar.py`, `cxfinal.py`, `cxkernel.py`: our own code, + copied unchanged from #378. `code/nine.py` and `code/far9.py` are new here: #377's profile rule with the swapped unit, and our search with #377's ledger. diff --git a/research/e8-far-nine-complex/PROOF.md b/research/e8-far-nine-complex/PROOF.md new file mode 100644 index 0000000000..ff481f82a9 --- /dev/null +++ b/research/e8-far-nine-complex/PROOF.md @@ -0,0 +1,19 @@ +# Why the swapped unit prices as claimed + +**1. #377's profile rule.** #377's `complex_candidate.py` builds its paid histogram as `H[r] += L*T*n` over every block and rank of the certificate's `blocks` field. It adds `2*v*T` children for each nonzero idle rank in `[16,8,32,8,48,8,48,32,16,0]` and `L*R` rank-1 paddings. Its `global_nine.py` asserts that the emitted local `climb`/`center` events reproduce the same profile. Here L = 9, T = 8, v = 120 and R = 783. `code/nine.py` rebuilds this profile from Sussman's certificate and checks equality with #377's `GLOBAL-REVIEW.json` for every rank. + +**2. What the certificate enters.** Outside the pooled local histogram, #377's construction reads the following from the local word: +- h = 9, v = 120, R = 783 and cst = 72 (stock, banks, deficit); +- the ports (data routes ρ_{s,q}, U_q, the terminal X_q); +- the start/final frames and retained totals (data levels and endpoint adapters); +- the invocation theorem, which depends on the operator and the dirty-gate block structure. + +#378's certificate keeps all of these, and `cxop.py` checks that the full rational operator on all 1,023 registers and the 8 retained totals are identical. The idle advances, banks, padding, bridges, exchange and cover correction δ(g) depend only on (h, v, R, k, L, T, m) and on the ports, so they are unchanged. + +**3. Same stock and deficit.** W = 8vT + LR = 14,727 and the deficit is m·W − mass = T(2kv − L·cst) = 2,496. Both are unchanged, because the local rank mass is N-determined: its per-invocation total is 9,039 on both certificates. The largest child is still 48, so the halving degree is 2, and #377's row and induction numbers (49B, 15,445) are unchanged. + +**4. Price.** b is the largest 10⁻¹⁸ grid point below the exact moment root. Both rational engines of PR #315 compute it, with the 10⁻¹⁶ fallback; the next grid point is excluded. Applied to #377's own profile, the same procedure returns #377's b, 999240641319551/10¹⁸, exactly. + +**5. Assembly.** PR #315's `outer.assembly`, with the bit c = 251726760077483/(2.5·10¹⁷) (#382) and this b, gives κ = 998634656132003/10¹⁸. It is complex-bound, all 47 strict constraints are positive, and κ + 10⁻¹⁸ is rejected. With #377's b the same call returns #382's κ = 998243154231047/10¹⁸. + +**Open.** The finite checks that #377 ran on Sussman's specific gates are not re-run for the new gates; the README lists them. diff --git a/research/e8-far-nine-complex/README.md b/research/e8-far-nine-complex/README.md new file mode 100644 index 0000000000..04f7763712 --- /dev/null +++ b/research/e8-far-nine-complex/README.md @@ -0,0 +1,100 @@ +κ = 9.98634656132003e-4 + +# #377's nine-stage complex E8 component with our re-timed E8 unit (#378), paired with our B₃ bit word (#382) + +A conditional finite construction with **κ = 998634656132003/10¹⁸ ≈ 9.98634656132003 × 10⁻⁴**. +That is +3.91502·10⁻⁷ (+0.0392 %) over our #382 (998243154231047/10¹⁸), which pairs the same bit word with #377's component as shipped. + +The complex side binds. Its coarse saving rises from #377's b = 999240641319551/10¹⁸ to **b = 999632926176283/10¹⁸ ≈ 9.99632926e-4** (+3.92285·10⁻⁷). +The bit side is our #382 word, unchanged, with c ≈ 1.006907e-3. + +| side | supplier | layout | coarse saving | +| --- | --- | --- | ---: | +| complex | jacklightChen's #377 nine-stage E8 component, with **our #378 re-timed unit `gcert1-e8-r783-far`** in place of Sussman's `gcert1-e8-r783` | m = 73, W = 14,727, deficit 2,496, max child 48, halving degree 2 (all as #377) | b = 999632926176283/10¹⁸ | +| bit | our #382 word (#370's E8 bit word + retime + shared-donor kernel) | B₃ unsplit: m = 56, max child 34, halving degree 2 | c = 251726760077483/(2.5·10¹⁷) | + +## Why the unit can be swapped + +#377 states that its component uses "the same pinned E8 local word". That word is Sussman's certificate, sha256 `4b92f00f…`, which is byte-identical to the original in this package. #377's paid profile is built from it (its `complex_candidate.py` and `global_nine.py`, read as data) as follows: + +- **Local children.** 9 stages × 8 replicas = 72 invocations, each paying the certificate's child histogram pooled over all blocks (x, y, s, c). +- **Idle data advances.** 2v·T children at each of the ranks 16, 8, 32, 8, 48, 8, 48, 32, 16. +- **Bank padding.** 9·R paid rank-1 paddings. + +Here m = 73 and W = 8vT + 9R = 14,727. Only the first term depends on the certificate beyond (h, v, R, cst, ports, start/final frames). #378's certificate keeps all of those, and the full rational operator on all 1,023 registers and the retained totals are identical. So the data routes, phases, banks, padding, bridges, exchange and cover corrections of #377 are unchanged, and only the pooled local histogram moves: + +| child rank | 1 | 2 | 3 | 4 | 6 | +| --- | ---: | ---: | ---: | ---: | ---: | +| per invocation | +2 | +2 | +6 | −21 | +10 | +| profile (× 72) | +144 | +144 | +432 | −1,512 | +720 | + +The rank mass, W, the deficit 2,496 and the largest child, 48, do not change. The new profile is + + 1:157743, 2:43632, 3:37728, 4:8568, 5:15480, 6:24552, 7:3096, 8:7488, 9:576, 16:3840, 32:3840, 48:3840. + +**Further moves.** We re-ran our whole move family with the χ ledger at #377's m = 73 and #377's pooled price. The family is far piece relocation, single, block and sub-block retiming, and in-group piece relocation. Started from Sussman's original, it converges to exactly #378's certificate, byte for byte. Started from #378's certificate, it finds no improving move. Pooling the blocks makes the ledger m-independent to first order (a·Σ r ln(m/r) at fixed mass), which explains why the B₃ optimum carries over. + +## Verify + + bash research/e8-far-nine-complex/verify.sh --quick /tmp/e8n-q # ~20 s + bash research/e8-far-nine-complex/verify.sh /tmp/e8n-full # adds the m = 73 regeneration (~40 s) + +Only Python 3.11+ and the standard library are needed. The steps are: + +0. `MANIFEST.sha256`: every file listed, none unlisted. +1. Inputs pinned by git blob id: + - Sussman's certificate, `gx.py` and `gxcore.py`; + - #378's certificate; + - #377's `GLOBAL-REVIEW.json`; + - #382's bit word. + + Sussman's certificate also has its sha256 checked against #377's pin. +2. On both certificates: + - Sussman's `gx.check1` (E0–E7, exact scalar replay E5) and the `gxcore` mirror histogram; + - a flipped-sign control, which must be rejected; + - the source-span rule. + + Then the full rational operator identity and the unchanged family data. +3. `code/nine.py`: + - rebuilds #377's profile from Sussman's certificate and checks it equals `GLOBAL-REVIEW.json` field for field. Both rational engines (with the 10⁻¹⁶ fallback, next grid point excluded) re-certify #377's b exactly; + - builds the profile with #378's certificate and prices b the same way; + - re-derives the bit c from #382's word in B₃ unsplit; + - runs PR #315's `outer.assembly` (47 strict constraints, adjacent κ rejected). The κ with #377's b equals #382's as a regression. +4. Full mode only: `code/far9.py` (our search with #377's ledger) from Sussman's original must regenerate the shipped certificate byte for byte (decompressed). + +## Admitted conditions and open obligations + +**Inherited from #377 (its claims, not re-proved here).** These include: +- the m = 73 compressed window lift and the arbitrary-bank dirty composition; +- the four-pair scalar chain, the idle advances and the paid padding; +- the exact Clifford data and cover phases (X_q, X_δ(g)), the injective owner routes, and the finite invoice; +- the two-level halving argument (73² > 2·48²) with its row coefficient 15,445 < 20,161; +- m = 73, which is beyond #375's m ≤ 72 cover bound; +- everything #377 retains from #352: the local E8 invocation theorem, the general Clifford/compiler interfaces, the tape primitives, precision and row allowances, and the analytic recurrence interfaces. + +None of #377's scripts were run. Only its receipt's `profile`, `m`, `live` and `deficit` are read, and its scripts were read as data. + +**#377's certificate-specific finite checks are not re-run on the new unit.** These are: +- the #352 emitter/splice and the scalar-word and lifetime replay (1,242,936 local events, 1,023 dirty columns); +- the local Clifford frame checks (946 frames, 3,120 transitions, 240 adapters); +- the finite invoice's local terms. + +The new unit has the same ports, start/final frames, retained totals and operator. Its gates and frames differ: there are 775/1,226 gates (against 773/1,220, +0.4 %) and 948 frames (two new). The new transitions are nested, as `gx.check1` E1 checks, so they fall under #377's general Clifford compiler interface. The finite invoice's exponents (router < 2³⁰⁰⁰⁰ against 7,984 bits used) leave far more slack than a 0.4 % change in the scalar-macro count consumes. Still, these are obligations of this package and are stated as such. + +**#378's own conditions** carry over: there is no Lean proof of the new certificate, which is checked by Sussman's `gx.check1`/`gxcore` and by the full operator identity. + +**The bit side is #382's claim**, including its halving-degree-two admission. Here we re-derive c from the word only. #382's stage replays, legality and B₃ formal-columns checks are in `research/e8-kernel-bit-b3/`. + +This is a conditional finite construction, not a formal verification of the multiplication theorem. + +## Credits + +- **jacklightChen (Zhihao Chen), #377:** the nine-stage compressed complex component, which is the whole complex construction used here. It covers the window, banks, padding, phases, invoice and the profile rule this package reproduces. +- **Jacob Sussman:** the E8 unit `gcert1-e8-r783`, `gx`/`gxcore` and the stage geometry (wht-power-saving-lean, Apache-2.0). +- **aliromman (#365):** the first coupled re-timing of this unit. #378's moves generalise it. +- **DaysSky (#363, #373, #375):** B_K, the seven-stage bit construction, and the halving-degree-two guard used on the bit side. +- **utcorvusvolat-dotcom (#370):** the E8 bit word under our #382 stages. +- PR #315's moment engines and outer assembly (DreamingOfClouds). +- **Ours:** the far-piece-relocation certificate (#378), the bit word stages (#382), and this substitution. + +Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. Apache-2.0 (`LICENSE`). See `NOTICE.md` and `PROOF.md`. diff --git a/research/e8-far-nine-complex/code/cxcheck.py b/research/e8-far-nine-complex/code/cxcheck.py new file mode 100644 index 0000000000..4973f511e5 --- /dev/null +++ b/research/e8-far-nine-complex/code/cxcheck.py @@ -0,0 +1,23 @@ +"""Complex certificate checks: Jacob Sussman's gx.check1 (E0-E7: sizes, labels/nesting, equal frames at gates, scatter +cut, gate shapes, bracket rule, exact scalar x-content replay E5, price data E6, exterior gauges E7) and his gxcore +mirror histogram, a flipped-sign control (must fail E5), and the source-span rule (our check: the x-content support of +every non-y operand, and of a slot destination after the gate, lies in the gate frame). +usage: cxcheck.py CERT.json.gz GXDIR""" +import sys, os, gzip, json, copy +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxretime import CX +c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx, gxcore +st = {}; gx.check1(c, scalar=True, stats=st) +Hinv = Counter() +for w in c['blocks'].values(): + for r, n in w.items(): Hinv[int(r)] += n +assert gxcore.mirror(gxcore.normal(copy.deepcopy(c)))['hist'] == dict(Hinv), 'gxcore histogram' +c2 = copy.deepcopy(c) +for g in c2['A']: + if g[0] in ('out', 'in') and g[3]: t, a, b = g[3][0]; g[3][0] = [t, -a, b]; break +try: gx.check1(c2, scalar=True); raise SystemExit('flipped sign accepted') +except AssertionError as e: assert str(e).startswith('E5'), str(e) +sv = CX(c).span_ok(); assert sv == 0, sv +print(' %s: gx.check1 PASS (E0-E7, exact scalar), gxcore mirror PASS, flipped sign rejected (E5), source-span violations 0 | h %d v %d R %d cst %d N %d, gates A/B %d/%d, frames %d' + % (os.path.basename(sys.argv[1]), c['h'], c['v'], c['R'], c['cst'], c['N'], len(c['A']), len(c['B']), len(c['frames']))) diff --git a/research/e8-far-nine-complex/code/cxfar.py b/research/e8-far-nine-complex/code/cxfar.py new file mode 100644 index 0000000000..a8e53204f9 --- /dev/null +++ b/research/e8-far-nine-complex/code/cxfar.py @@ -0,0 +1,85 @@ +"""Far piece relocation on a split gcert/1 program: an elementary piece (out: u += c s with s only read; in: s += c u with +u only read) moves forward/backward across gates that commute with it as scalar operations (they touch neither u, nor +write the read register; for an in-piece, other gates may only ADD into s from sources other than u, never read s), +within its phase, and gets its own best frame between the new neighbours. Greedy best move per pass. +usage: cxfar.py CERT(.json.gz or anneal output) GXDIR OUT [passes]""" +import sys, os, gzip, json, math, copy, random +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxpiece import * +from cxretime import sweep as bsweep + + +def rw(g): + """(reads, writes) of a gate""" + if g[0] == 'neg': return {g[2]}, {g[2]} + if g[0] == 'out': return {g[2]} | {t for t, _, _ in g[3]} | set(g[4]), {t for t, _, _ in g[3]} + return {g[2]} | {s for s, _, _ in g[3]}, {g[2]} + + +def far_pass(c, tag, a, m): + M = CX(c); d = lambda f: len(M.fr[f]); chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + G = M.gates; best = None + for i, (ph, g) in enumerate(G): + if g[0] == 'out' and len(g[3]) == 1 and not g[4]: u = g[3][0][0]; s = g[2]; kind = 'out' + elif g[0] == 'in' and len(g[3]) == 1: u = g[2]; s = g[3][0][0]; kind = 'in' # u written (dst), s read + else: continue + # registers: w = written register (u for out, u for in): naming: wreg written, rreg read + wreg, rreg = u, s + iw, ir = M.where[i][wreg], M.where[i][rreg] + f_i = M.gf[i] + pw, nw = M.F(wreg, iw - 1), M.F(wreg, iw + 1) + a_r, b_r = M.F(rreg, ir - 1), M.F(rreg, ir + 1) + rem_r = chi(d(f_i) - d(a_r)) + chi(d(b_r) - d(f_i)) - chi(d(b_r) - d(a_r)) + for step in (1, -1): + j = i + while True: + j += step + if j < 0 or j >= len(G) or G[j][0] != ph: break + rj, wj = rw(G[j][1]) + if wreg in rj or rreg in wj: break # does not commute (another addition into wreg also breaks: keep simple) + if rreg not in rj: continue # read register untouched: same neighbours + # new position just after j (forward) or just before j (backward): rreg neighbours change + jr = M.where[j][rreg] + if step == 1: ps, ns = M.F(rreg, jr), M.F(rreg, jr + 1) if jr + 1 != ir else b_r + else: ps, ns = (M.F(rreg, jr - 1) if jr - 1 != ir else a_r), M.F(rreg, jr) + if step == 1 and jr + 1 == ir: continue + loE = echelon(list(M.lb[i]) + list(M.fr[ps]) + list(M.fr[pw])) + hiV = span_vecs(M.fr[ns]) & span_vecs(M.fr[nw]) + if not all(x in hiV for x in loE): continue + cands = {M.fid(loE), M.fid(echelon(sorted(hiV))), ps, ns, pw, nw} + for x in sorted(hiV - span_vecs(loE))[:64]: cands.add(M.fid(echelon(loE + [x]))) + old_w = chi(d(f_i) - d(pw)) + chi(d(nw) - d(f_i)) + for F in cands: + if not (inside(M.fr[ps], M.fr[F]) and inside(M.fr[F], M.fr[ns]) and inside(M.fr[pw], M.fr[F]) and inside(M.fr[F], M.fr[nw]) and inside(loE, M.fr[F])): continue + gain = old_w - chi(d(F) - d(pw)) - chi(d(nw) - d(F)) + rem_r - (chi(d(F) - d(ps)) + chi(d(ns) - d(F)) - chi(d(ns) - d(ps))) + if gain > 1e-9 and (best is None or gain > best[0]): best = (gain, i, j, step, F) + if best is None: return c, tag, 0.0 + gain, i, j, step, F = best + gates = [copy.deepcopy(x) for x in G] + for k in range(len(gates)): gates[k][1][1] = M.gf[k] + gates[i][1][1] = F + order = [k for k in range(len(gates)) if k != i] + pos = order.index(j) + (1 if step == 1 else 0); order.insert(pos, i) + c2 = copy.deepcopy(c); c2['frames'] = [list(x) for x in M.fr]; c2['A'] = []; c2['B'] = []; tag2 = [] + for k in order: + c2[gates[k][0]].append(gates[k][1]); tag2.append(list(tag[k][:2]) + (['far', k] if k == i else list(tag[k][2:]))) + return rehist(c2), tag2, gain + + +if __name__ == '__main__': + src = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx + if 'cert' in src: c, tag = src['cert'], [tuple(t) for t in src['tag']] + else: c, tag = split(src) + K = 3; h = c['h']; m = (2 * K + 1) * h; b0 = price(c, K); a = float(b0); rng = random.Random(1) + print('start b3', b0, float(b0)); passes = int(sys.argv[4]) if len(sys.argv) > 4 else 100 + for p in range(passes): + c, tag, g = far_pass(c, tag, a, m) + M = CX(c) + for s in range(10): + m1, _ = single_sweep(M, a, m, rng); m2, _ = bsweep(M, a, m, rng) + if not (m1 or m2): break + c = rehist(to_cert(M)); c, tag, g2 = piece_pass(c, tag, a, m) + b = price(c, K); print('pass', p, 'far gain/a %.3f piece %.3f' % (g / a, g2 / a), 'b3', b, '%.12e' % float(b), flush=True) + if g == 0 and g2 == 0: break + gx.check1(c, scalar=True); print('gx.check1 PASS') + json.dump(dict(cert=c, tag=[list(t) for t in tag]), gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-far-nine-complex/code/cxfinal.py b/research/e8-far-nine-complex/code/cxfinal.py new file mode 100644 index 0000000000..3c55ca4c63 --- /dev/null +++ b/research/e8-far-nine-complex/code/cxfinal.py @@ -0,0 +1,29 @@ +"""Finalize an optimised split program: merge consecutive elementary gates of one phase that share kind, frame and the +read register (fan-out: same source, distinct targets) or the destination (fan-in: same destination, distinct sources), +drop unused appended frames, recompute the block histograms and N. usage: cxfinal.py IN(anneal/far output) ORIG OUT""" +import sys, os, gzip, json, copy +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxkernel import rehist +def finalize(c, c0): + c = copy.deepcopy(c) + for ph in ('A', 'B'): + out = [] + for g in c[ph]: + p = out[-1] if out else None + if p and p[0] == g[0] == 'out' and p[1] == g[1] and p[2] == g[2] and not ({t for t, _, _ in g[3]} | set(g[4])) & ({t for t, _, _ in p[3]} | set(p[4])): + p[3] = p[3] + g[3]; p[4] = p[4] + g[4] + elif p and p[0] == g[0] == 'in' and p[1] == g[1] and p[2] == g[2] and not {s for s, _, _ in g[3]} & {s for s, _, _ in p[3]}: + p[3] = p[3] + g[3] + else: out.append(copy.deepcopy(g)) + c[ph] = out + used = set(c['start']) | set(c['final']) | {g[1] for g in c['A'] + c['B']} | {f for _, _, f in c['ret']} + keep = list(range(len(c0['frames']))) + [i for i in range(len(c0['frames']), len(c['frames'])) if i in used] + ren = {o: n for n, o in enumerate(keep)}; c['frames'] = [c['frames'][i] for i in keep] + for ph in ('A', 'B'): + for g in c[ph]: g[1] = ren[g[1]] + c['derived_from'] = c0['derived_from'] + ' | e8st far piece relocation + block retiming (chafreaky)' + return rehist(c) +if __name__ == '__main__': + x = json.load(gzip.open(sys.argv[1])); c = x['cert'] if 'cert' in x else x; c0 = json.load(gzip.open(sys.argv[2])) + w = finalize(c, c0); print('gates A/B', len(w['A']), len(w['B']), 'frames', len(w['frames'])) + with gzip.GzipFile(sys.argv[3], 'wb', mtime=0) as f: f.write(json.dumps(w, separators=(',', ':')).encode()) diff --git a/research/e8-far-nine-complex/code/cxkernel.py b/research/e8-far-nine-complex/code/cxkernel.py new file mode 100644 index 0000000000..32b26a1755 --- /dev/null +++ b/research/e8-far-nine-complex/code/cxkernel.py @@ -0,0 +1,222 @@ +"""Shared-donor response kernel on a gcert/1 complex program (Sussman's format), via exterior gauges (rule E7/Q2). +Entry: pivot slot p, entrance E (a frame inside p's first frame and inside every donor's first frame), donors d with +rational coefficients c_d such that resp(p) + sum c_d resp(d) = 0, where resp(s) in Q^v = the column of slot s's +initial value in the y rows of the product (A, scatter, B). Transform: p starts at E (ext gauge [p, E]); at the start +of A each donor climbs to E and takes d += c_d p ('in' gate at E). Then Q2 holds for p. +Price (entrance-residual rule, as the bit side's #320/#329 lineage): W = 2Kv + sum_slots (h - dim ext)/h, deficit fixed. +usage: cxkernel.py CERT.json.gz GXDIR OUT.json.gz [K]""" +import sys, os, gzip, json, math, copy +from fractions import Fraction as Fr +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from e8core import coarse +from layout_bk import layout + + +def reduce(u, basis): + for b in basis: + if u >> (b.bit_length() - 1) & 1: u ^= b + return u +def inside(a, b): return all(reduce(u, b) == 0 for u in a) +def echelon(vecs): + """reduced echelon (descending pivots) of the F2 span of vecs""" + B = [] + for u in vecs: + u = reduce(u, B) + if u: + B = [b ^ u if b >> (u.bit_length() - 1) & 1 else b for b in B] + [u] + B.sort(reverse=True) + return B + + +def responses(c): + v, R = c['v'], c['R']; n = 2 * v + R + reg = [dict() for _ in range(n)] + for r in range(2 * v, n): reg[r] = {r: Fr(1)} + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: d[k] = w + else: d.pop(k, None) + def run(gates): + for g in gates: + if g[0] == 'neg': reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == 'out': + src = dict(reg[g[2]]) + for t, a, b in g[3]: axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: axpy(g[2], reg[s], Fr(a, b)) + run(c['A']) + tot = {k: dict(reg[s]) for k, s, _ in c['ret']} + for t in range(v): + for k, a, b in c['scat']['table'][t]: axpy(v + t, tot[k], Fr(a, b)) + run(c['B']) + resp = {s: {} for s in range(2 * v, n)} + for t in range(v): + for s, co in reg[v + t].items(): resp[s][t] = co + return resp + + +def first_frames(c): + v, R = c['v'], c['R']; n = 2 * v + R; first = {} + for ph in ('A', 'B'): + for g in c[ph]: + regs = [g[2]] + ([t for t, _, _ in g[3]] + list(g[4]) if g[0] == 'out' else [s for s, _, _ in g[3]] if g[0] == 'in' else []) + for r in regs: + if r >= 2 * v and r not in first and g[1] != 0: first[r] = g[1] + return first + + +class QBasis: + """incremental rational basis over Q^v with combination tracking (donor slots)""" + def __init__(self): self.rows = [] # (pivot, vec dict, combo dict) + def reduce(self, x): + x = dict(x); cm = {} + for p, vec, co in self.rows: + if p in x: + f = x[p] / vec[p] + for k, u in vec.items(): + w = x.get(k, 0) - f * u + if w: x[k] = w + else: x.pop(k, None) + for k, u in co.items(): + w = cm.get(k, 0) - f * u + if w: cm[k] = w + else: cm.pop(k, None) + return x, cm + def add(self, x, slot): + r, cm = self.reduce(x) + cm = {k: u for k, u in cm.items()}; cm[slot] = cm.get(slot, 0) + 1 + p = min(r); self.rows.append((p, r, cm)) + + +def select(c, a, K=3): + h, v, R = c['h'], c['v'], c['R']; m = (2 * K + 1) * h + fr = [tuple(f) for f in c['frames']]; dim = [len(f) for f in fr] + chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + resp = responses(c); first = first_frames(c) + ret = {s for _, s, _ in c['ret']} + H = [s for s in range(2 * v, 2 * v + R) if s not in ret and s in first and c['start'][s] == 0] + # candidate entrances: frames of the table inside some first frame, plus pairwise intersections not in table skipped + fset = sorted(set(first[s] for s in H)) + cand = [E for E in range(2, len(fr)) if dim[E] > 0 and dim[E] < h and any(inside(fr[E], fr[f]) for f in fset)] + ins = {} + def isin(E, f): + k = (E, f) + if k not in ins: ins[k] = inside(fr[E], fr[f]) + return ins[k] + groups = {E: [s for s in H if isin(E, first[s])] for E in cand} + avail_p = set(H); avail_d = set(H); donor_at = {} + def plan(E): + e = dim[E]; G = groups[E]; mem = [] + for s in G: + d1 = dim[first[s]] + dc = (0.0 if donor_at.get(s) == E else (chi(e) + chi(d1 - e) - chi(d1)) if s in avail_d else None) + if s in donor_at and donor_at[s] != E: dc = None + pg = chi(d1) - chi(d1 - e) if s in avail_p else None + if dc is None and pg is None: continue + mem.append((s, dc, pg)) + mem.sort(key=lambda t: (t[1] if t[1] is not None else 1e9, t[2] if t[2] is not None else -1)) + B = QBasis(); slots = {}; piv = [] + for s, dc, pg in mem: + r, cm = B.reduce(resp[s]) + if not r and pg is not None and pg > 0: piv.append((s, cm, pg)) + elif r and dc is not None: B.add(resp[s], s); slots[s] = dc + if not piv: return None + keep = list(piv) + def users(): + u = Counter() + for _, cm, _ in keep: + for k in cm: u[k] += 1 + return u + while keep: + u = users(); best = None + for i, (s, cm, pg) in enumerate(keep): + freed = sum(slots[k] for k in cm if u[k] == 1) + if freed > pg and (best is None or freed - pg > best[0]): best = (freed - pg, i) + if best is None: break + keep.pop(best[1]) + u = users(); gain = sum(pg for _, _, pg in keep) - sum(slots[k] for k in u) + if gain <= 1e-15: return None + # coefficients: resp(p) = sum cm_k resp(k) -> donor gate d += (-cm_d) p + return gain, [(s, {k: -x for k, x in cm.items()}) for s, cm, _ in keep] + plans = {E: plan(E) for E in cand} + chosen = []; total = 0.0 + while True: + live = [(p[0], E) for E, p in plans.items() if p] + if not live: break + g, E = max(live); _, ents = plans[E] + touched = set() + for p, cm in ents: + chosen.append((E, p, cm)); avail_p.discard(p); avail_d.discard(p); touched.add(p) + for d in cm: donor_at[d] = E; avail_p.discard(d); avail_d.discard(d); touched.add(d) + total += g + for E2 in cand: + if plans.get(E2) and any(s in touched for s in groups[E2]): plans[E2] = plan(E2) + plans[E] = plan(E) + return chosen, total + + +def apply(c, chosen): + c = copy.deepcopy(c); head = [] + ext = [] + for E, p, cm in chosen: + ext.append([p, E]); c['start'][p] = E + byd = {} + for E, p, cm in chosen: + for d, co in cm.items(): byd.setdefault((d, E), []).append([p, co.numerator, co.denominator]) + for (d, E), lst in sorted(byd.items()): head.append(['in', E, d, sorted(lst)]) + c['A'] = head + c['A']; c['ext'] = sorted(ext) + return c + + +def rehist(c): + """recompute block histograms and N exactly as gx.check1 counts them (climbs per class, COPY ranks)""" + v, R = c['v'], c['R']; n = 2 * v + R; dim = [len(f) for f in c['frames']] + cls = lambda r: 'x' if r < v else 'y' if r < 2 * v else 's' + cur = list(c['start']); H = {'x': Counter(), 'y': Counter(), 's': Counter(), 'c': Counter()} + def climb(r, f): + if cur[r] != f: H[cls(r)][dim[f] - dim[cur[r]]] += 1; cur[r] = f + for ph in ('A', 'B'): + if ph == 'B': + for k, s_, f in c['ret']: H['c'][dim[f]] += 1 + for g in c[ph]: + regs = [g[2]] + ([t for t, _, _ in g[3]] + list(g[4]) if g[0] == 'out' else [x for x, _, _ in g[3]] if g[0] == 'in' else []) + for r in regs: climb(r, g[1]) + for r in range(n): climb(r, c['final'][r]) + c['blocks'] = {k: {str(r): x for r, x in sorted(w.items())} for k, w in H.items()} + c['N'] = sum(r * x for w in H.values() for r, x in w.items()) + return c + + +def price(c, K): + """returns b in B_K with the entrance-residual W""" + h, v, R, cst = c['h'], c['v'], c['R'], c['cst'] + Hinv = Counter() + for w in c['blocks'].values(): + for r, n in w.items(): Hinv[int(r)] += n + s = 2 * K + 1; m = s * h; lay = layout(K, h, split=(m - 1) // 2 if K > 2 else None) + tails = sum(len(c['frames'][f]) for _, f in c['ext']) + T = 1 if tails % h == 0 else h + H = Counter({r: T * s * n for r, n in Hinv.items()}) + for r in lay['blocks']: H[r] += T * 2 * v + W = (2 * K * v + R) * T - tails * T // h; assert tails * T % h == 0 + assert m * W - sum(r * n for r, n in H.items()) == T * (2 * K * v - s * cst), 'deficit' + assert 2 * max(H) < m + return coarse(H, m, W) + + +if __name__ == '__main__': + c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx, gxcore + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3 + b0 = price(c, K); print('start b(B_%d) =' % K, b0, float(b0)) + chosen, tot = select(c, float(b0), K) + fr = c['frames'] + print('entries', len(chosen), 'chi %.5f' % tot, 'ranks', Counter(len(fr[E]) for E, _, _ in chosen), + 'donors', len({d for _, _, cm in chosen for d in cm})) + w = rehist(apply(c, chosen)); w['derived_from'] = c['derived_from'] + ' + shared-donor kernel via exterior gauges' + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 (E0-E7 incl. exact scalar E5 and Q2) PASS', st) + for K2 in (2, 3, 4): + b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-far-nine-complex/code/cxop.py b/research/e8-far-nine-complex/code/cxop.py new file mode 100644 index 0000000000..772d6698da --- /dev/null +++ b/research/e8-far-nine-complex/code/cxop.py @@ -0,0 +1,32 @@ +"""Full rational operator of a gcert/1 program (A, scatter, B) on all registers, every initial value a variable; +compare two programs. usage: cxop.py CERT1 CERT2 [GXDIR]""" +import sys, gzip, json +from fractions import Fraction as Fr +def load(p): + x = json.load(gzip.open(p)); return x['cert'] if 'cert' in x else x +def op(c): + v, R = c['v'], c['R']; n = 2 * v + R + reg = [{r: Fr(1)} for r in range(n)] + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: d[k] = w + else: d.pop(k, None) + def run(G): + for g in G: + if g[0] == 'neg': reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == 'out': + src = dict(reg[g[2]]) + for t, a, b in g[3]: axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: axpy(g[2], reg[s], Fr(a, b)) + run(c['A']); tot = {k: dict(reg[s]) for k, s, _ in c['ret']} + for t in range(v): + for k, a, b in c['scat']['table'][t]: axpy(v + t, tot[k], Fr(a, b)) + run(c['B']); return reg, tot +a, ta = op(load(sys.argv[1])); b, tb = op(load(sys.argv[2])) +assert ta == tb, 'retained totals differ' +diff = [r for r in range(len(a)) if a[r] != b[r]] +print('full rational operator on all %d registers (every initial value a variable) and the retained totals: %s' % (len(a), 'IDENTICAL' if not diff else 'DIFFER at %d registers' % len(diff))) +assert not diff diff --git a/research/e8-far-nine-complex/code/cxpiece.py b/research/e8-far-nine-complex/code/cxpiece.py new file mode 100644 index 0000000000..6cebe19c80 --- /dev/null +++ b/research/e8-far-nine-complex/code/cxpiece.py @@ -0,0 +1,64 @@ +"""Piece relocation on a split gcert/1 program: a fan-out piece (s -> t) or fan-in piece (t += s) of an original gate +moves to the end (frame F >= the group frame) or the start (F <= the group frame) of its group, with its own frame +F between the outside neighbours of the shared register and of its own register (source-span rule kept). +Pieces of one original gate commute (fan-out pieces read an unchanged source; fan-in pieces add into one destination).""" +import sys, os, gzip, json, math, random, copy +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxsplit import * + + +def piece_pass(c, tag, a, m, eps=1e-9): + M = CX(c); d = lambda f: len(M.fr[f]); chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + groups = {} + for gi, t in enumerate(tag): groups.setdefault(tuple(t[:2]), []).append(gi) + best = None + for t, gis in groups.items(): + if len(gis) < 2: continue + f = M.gf[gis[0]] + if any(M.gf[g] != f for g in gis): continue + g0 = M.gates[gis[0]][1]; shared = g0[2] + if any(M.gates[g][1][2] != shared for g in gis): continue + ish = [M.where[x][shared] for x in gis] + info = [] + for gi in gis: + uniq = [r for r in M.where[gi] if r != shared] + if len(uniq) != 1: info.append(None); continue + u = uniq[0]; iu = M.where[gi][u]; info.append((u, M.F(u, iu - 1), M.F(u, iu + 1))) + for side in ('end', 'start'): + if side == 'end': ps, ns = f, M.F(shared, max(ish) + 1) + else: ps, ns = M.F(shared, min(ish) - 1), f + cands = set() + for k, gi in enumerate(gis): + if info[k] is None: continue + u, pu, nu = info[k] + loE = echelon(list(M.lb[gi]) + list(M.fr[ps]) + list(M.fr[pu])) + hiV = span_vecs(M.fr[ns]) & span_vecs(M.fr[nu]) + if not all(x in hiV for x in loE): continue + cands |= {M.fid(loE), M.fid(echelon(sorted(hiV))), ps, ns, pu, nu} + for x in sorted(hiV - span_vecs(loE)): cands.add(M.fid(echelon(loE + [x]))) + for F in cands: + if not (inside(M.fr[ps], M.fr[F]) and inside(M.fr[F], M.fr[ns])): continue + chosen = []; gain = 0.0 + for k, gi in enumerate(gis): + if info[k] is None: continue + u, pu, nu = info[k] + if not (inside(M.fr[pu], M.fr[F]) and inside(M.fr[F], M.fr[nu]) and inside(M.lb[gi], M.fr[F])): continue + du = chi(d(f) - d(pu)) + chi(d(nu) - d(f)) - chi(d(F) - d(pu)) - chi(d(nu) - d(F)) + if du > eps: chosen.append(gi); gain += du + if not chosen or len(chosen) == len(gis): continue + gain -= chi(d(F) - d(ps)) + chi(d(ns) - d(F)) - chi(d(ns) - d(ps)) + if gain > eps and (best is None or gain > best[0]): best = (gain, chosen, side, F, gis) + if best is None: return c, tag, 0.0 + g_, chosen, side, F, gis = best + gates = [copy.deepcopy(M.gates[i]) for i in range(len(M.gates))] + for i in range(len(gates)): gates[i][1][1] = M.gf[i] + for gi in chosen: gates[gi][1][1] = F + rest = [i for i in range(len(gates)) if i not in set(chosen)] + anchor = max(set(gis) - set(chosen)) if side == 'end' else min(set(gis) - set(chosen)) + pos = rest.index(anchor) + (1 if side == 'end' else 0) + order = rest[:pos] + sorted(chosen) + rest[pos:] + c2 = copy.deepcopy(c); c2['frames'] = [list(x) for x in M.fr]; c2['A'] = []; c2['B'] = []; tag2 = [] + for i in order: + c2[gates[i][0]].append(gates[i][1]) + tag2.append(list(tag[i][:2]) + ([side, len(tag)] if i in chosen else [])) + return rehist(c2), tag2, g_ diff --git a/research/e8-far-nine-complex/code/cxretime.py b/research/e8-far-nine-complex/code/cxretime.py new file mode 100644 index 0000000000..06f79f8280 --- /dev/null +++ b/research/e8-far-nine-complex/code/cxretime.py @@ -0,0 +1,169 @@ +"""Retiming / descent on a gcert/1 complex program: move gate frames inside +[span(LB_g + prev frames of participants), AND of next frames] with the source-span rule (the x-content support of every +non-y operand, and of a slot destination after the gate, lies in the gate frame). Pins: start, scatter (y at 0, retained +slots at their ret frame), final. Greedy best-improvement with the chi ledger at m = (2K+1)h. +usage: cxretime.py CERT.json.gz GXDIR OUT.json.gz [K] [sweeps]""" +import sys, os, gzip, json, math, random, copy +from fractions import Fraction as Fr +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxkernel import reduce, inside, echelon, rehist, price + + +def regs_of(g): + if g[0] == 'neg': return [g[2]] + if g[0] == 'out': return [g[2]] + [t for t, _, _ in g[3]] + list(g[4]) + return [g[2]] + [s for s, _, _ in g[3]] + + +class CX: + def __init__(self, c): + self.c = c; v = c['v']; self.v = v; n = 2 * v + c['R']; self.n = n + self.fr = [tuple(f) for f in c['frames']]; self.key = {f: i for i, f in enumerate(self.fr)} + self.gates = [['A', g] for g in c['A']] + [['B', g] for g in c['B']] + self.gf = [g[1] for _, g in self.gates] + nA = len(c['A']) + occ = [[('p', c['start'][r])] for r in range(n)] + retf = {s: f for _, s, f in c['ret']} + for gi, (ph, g) in enumerate(self.gates): + if gi == nA: + for t in range(v): occ[v + t].append(('p', 0)) + for s, f in retf.items(): occ[s].append(('p', f)) + for r in regs_of(g): occ[r].append(('g', gi)) + for r in range(n): occ[r].append(('p', c['final'][r])) + self.occ = occ; self.where = [dict() for _ in self.gates] + for r in range(n): + for i, (k, x) in enumerate(occ[r]): + if k == 'g': self.where[x][r] = i + self.lb = self._lb() + + def _lb(self): + c = self.c; v = self.v; ports = c['ports'] + sup = [{r} if r < v else set() for r in range(self.n)] + lb = [] + for ph, g in self.gates: + need = set() + if g[0] == 'out': + for t, _, _ in g[3]: sup[t] |= sup[g[2]] + if g[2] < v or g[2] >= 2 * v: need |= sup[g[2]] + for t, _, _ in g[3]: + if t >= 2 * v: need |= sup[t] + elif g[0] == 'in': + for s, _, _ in g[3]: + sup[g[2]] |= sup[s] + if s < v or s >= 2 * v: need |= sup[s] + if g[2] >= 2 * v: need |= sup[g[2]] + lb.append(tuple(echelon([ports[x] for x in need]))) + return lb + + def fid(self, f): + f = tuple(f) + if f not in self.key: self.key[f] = len(self.fr); self.fr.append(f) + return self.key[f] + + def F(self, r, i): + k, x = self.occ[r][i]; return x if k == 'p' else self.gf[x] + + def span_ok(self): + return sum(1 for gi in range(len(self.gates)) if not inside(self.lb[gi], self.fr[self.gf[gi]])) + + +_sv = {} +def span_vecs(B): + B = tuple(B) + if B not in _sv: + out = {0} + for b in B: out |= {x ^ b for x in out} + _sv[B] = frozenset(out) + return _sv[B] + + +def block_of(M, gi): + f = M.gf[gi]; S = {gi}; stack = [gi] + while stack: + g = stack.pop() + for r, i in M.where[g].items(): + for j in (i - 1, i + 1): + k, x = M.occ[r][j] + if k == 'g' and x not in S and M.gf[x] == f: S.add(x); stack.append(x) + return S + + +def try_move(M, S, chi, d, temp=0.0, rng=None): + """move gate set S (all at one frame) to the best feasible frame; returns gain or None""" + old = M.gf[next(iter(S))]; regs = {} + for g in S: + for r, i in M.where[g].items(): regs.setdefault(r, []).append(i) + parts = [] + for r, ii in regs.items(): + lo_i, hi_i = min(ii), max(ii) + if len(ii) != hi_i - lo_i + 1: return None + parts.append((M.F(r, lo_i - 1), M.F(r, hi_i + 1))) + loE = echelon([u for g in S for u in M.lb[g]] + [u for p, _ in parts for u in M.fr[p]]) + hiV = None + for _, q in parts: + vs = span_vecs(M.fr[q]); hiV = vs if hiV is None else hiV & vs + if not all(u in hiV for u in loE): return None + cands = {M.fid(loE), M.fid(echelon(sorted(hiV)))} | {p for p, _ in parts} | {q for _, q in parts} + for u in sorted(hiV - span_vecs(loE)): cands.add(M.fid(echelon(loE + [u]))) + def ok(F): + return all(inside(M.fr[p], M.fr[F]) and inside(M.fr[F], M.fr[q]) for p, q in parts) and inside(loE, M.fr[F]) + def score(F): return sum(chi(d(F) - d(p)) + chi(d(q) - d(F)) for p, q in parts) + base = score(old); opts = [(score(F), F) for F in cands if F != old and ok(F)] + if not opts: return None + if temp > 0: + sc, F = rng.choice(opts) + if sc < base - 1e-12 or rng.random() < math.exp(-(sc - base) / temp): + for g in S: M.gf[g] = F + return base - sc + return None + sc, F = min(opts) + if sc < base - 1e-12: + for g in S: M.gf[g] = F + return base - sc + return None + + +def subblocks(M, S): + T = sorted(S); out = [S] + for k in range(1, len(T)): out.append(set(T[:k])); out.append(set(T[k:])) + out += [{g} for g in T] if len(T) > 1 else [] + return out + + +def sweep(M, a, m, rng, temp=0.0): + d = lambda f: len(M.fr[f]); chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + moved = 0; gain = 0.0; idx = list(range(len(M.gates))); rng.shuffle(idx); done = set() + for gi in idx: + if gi in done: continue + S = block_of(M, gi); done |= S + subs = subblocks(M, S) if len(S) <= 12 else [S] + if temp > 0: subs = [rng.choice(subs)] + for sub in subs: + g = try_move(M, sub, chi, d, temp, rng) + if g is not None: moved += 1; gain += g; break + return moved, gain + + +def to_cert(M): + c = copy.deepcopy(M.c); c['frames'] = [list(f) for f in M.fr] + A = []; B = [] + for gi, (ph, g) in enumerate(M.gates): + g2 = copy.deepcopy(g); g2[1] = M.gf[gi]; (A if ph == 'A' else B).append(g2) + c['A'] = A; c['B'] = B + return rehist(c) + + +if __name__ == '__main__': + c = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3; sw = int(sys.argv[5]) if len(sys.argv) > 5 else 20 + h = c['h']; m = (2 * K + 1) * h + M = CX(c); print('span violations on input', M.span_ok()) + b0 = price(c, K); print('start b', b0, float(b0)); rng = random.Random(1) + for s in range(sw): + mv, g = sweep(M, float(b0), m, rng); print('sweep', s, 'moved', mv, 'chi/a %.4f' % (g / float(b0)), flush=True) + if not mv: break + w = to_cert(M); print('span violations', M.span_ok()) + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 PASS') + for K2 in (2, 3): b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-far-nine-complex/code/cxsplit.py b/research/e8-far-nine-complex/code/cxsplit.py new file mode 100644 index 0000000000..e9cd44a1fe --- /dev/null +++ b/research/e8-far-nine-complex/code/cxsplit.py @@ -0,0 +1,92 @@ +"""Split every multi-addition gate of a gcert/1 program into elementary single-addition gates in the same order (same +scalar operator: fan-out pieces read an unchanged source, fan-in pieces add into one destination), then run block and +single-gate retiming (cxretime) on the split program, then re-merge adjacent pieces of one original gate that kept a +common frame. usage: cxsplit.py CERT.json.gz GXDIR OUT.json.gz [K] [sweeps] [seed]""" +import sys, os, gzip, json, math, random, copy +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxretime import * +from cxretime import sweep as block_sweep + + +def split(c): + c = copy.deepcopy(c); tag = [] + for ph in ('A', 'B'): + out = [] + for gi, g in enumerate(c[ph]): + if g[0] == 'out' and len(g[3]) + len(g[4]) > 1: + pieces = [['out', g[1], g[2], [x], []] for x in g[3]] + if g[4]: pieces[0][4] = list(g[4]) if pieces else None + for p_ in pieces: out.append(p_); tag.append((ph, gi)) + elif g[0] == 'in' and len(g[3]) > 1: + for x in g[3]: out.append(['in', g[1], g[2], [x]]); tag.append((ph, gi)) + else: out.append(g); tag.append((ph, gi)) + c[ph] = out + return c, tag + + +def merge(c, tag): + c = copy.deepcopy(c); k = 0 + for ph in ('A', 'B'): + out = []; prev = None + for g in c[ph]: + t = tag[k]; k += 1 + if prev is not None and prev[0] == t and out[-1][0] == g[0] and out[-1][1] == g[1] and out[-1][2] == g[2]: + out[-1][3] = out[-1][3] + g[3] + if g[0] == 'out': out[-1][4] = out[-1][4] + g[4] + else: out.append(copy.deepcopy(g)) + prev = (t,) + c[ph] = out + return c + + +def single_sweep(M, a, m, rng): + d = lambda f: len(M.fr[f]); chi = lambda r: 0.0 if r <= 0 else r * (math.exp(a * math.log(m / r)) - 1) + moved = 0; gain = 0.0; idx = list(range(len(M.gates))); rng.shuffle(idx) + for gi in idx: + old = M.gf[gi]; parts = [(M.F(r, i - 1), M.F(r, i + 1)) for r, i in M.where[gi].items()] + loE = echelon(list(M.lb[gi]) + [u for p, _ in parts for u in M.fr[p]]) + hiV = None + for _, q in parts: + vs = span_vecs(M.fr[q]); hiV = vs if hiV is None else hiV & vs + if not all(u in hiV for u in loE): continue + cands = {M.fid(loE), M.fid(echelon(sorted(hiV)))} | {p for p, _ in parts} | {q for _, q in parts} + loS = span_vecs(loE) + for u in sorted(hiV - loS): cands.add(M.fid(echelon(loE + [u]))) + def ok(F): return all(inside(M.fr[p], M.fr[F]) and inside(M.fr[F], M.fr[q]) for p, q in parts) and inside(loE, M.fr[F]) + def score(F): return sum(chi(d(F) - d(p)) + chi(d(q) - d(F)) for p, q in parts) + base = score(old); best, bs = old, base + for F in cands: + if F != old and ok(F): + sc = score(F) + if sc < bs - 1e-12: best, bs = F, sc + if best != old: M.gf[gi] = best; moved += 1; gain += base - bs + return moved, gain + + +def prune_frames(c): + """drop unused appended frames (keep the original table prefix), renumber""" + return c + + +if __name__ == '__main__': + c0 = json.load(gzip.open(sys.argv[1])); sys.path.insert(0, sys.argv[2]); import gx + K = int(sys.argv[4]) if len(sys.argv) > 4 else 3; sw = int(sys.argv[5]) if len(sys.argv) > 5 else 30 + rng = random.Random(int(sys.argv[6]) if len(sys.argv) > 6 else 1) + h = c0['h']; m = (2 * K + 1) * h; b0 = price(c0, K); print('start b', b0, float(b0)) + c, tag = split(c0); M = CX(c); a = float(b0) + for s in range(sw): + m1, g1 = single_sweep(M, a, m, rng); m2, g2 = block_sweep(M, a, m, rng) + print('sweep', s, 'single', m1, 'block', m2, 'chi/a %.4f' % ((g1 + g2) / a), flush=True) + if not (m1 or m2): break + w = to_cert(M); w = rehist(merge(w, tag)) + # drop unused frames beyond the original table + used = set(w['start']) | set(w['final']) | {g[1] for g in w['A'] + w['B']} | {f for _, _, f in w['ret']} + keep = list(range(len(c0['frames']))) + [i for i in range(len(c0['frames']), len(w['frames'])) if i in used] + ren = {o: n for n, o in enumerate(keep)}; w['frames'] = [w['frames'][i] for i in keep] + for ph in ('A', 'B'): + for g in w[ph]: g[1] = ren[g[1]] + w = rehist(w) + print('span violations', CX(w).span_ok(), '| gates A/B', len(w['A']), len(w['B']), 'vs', len(c0['A']), len(c0['B']), '| new frames', len(w['frames']) - len(c0['frames'])) + st = {}; gx.check1(w, scalar=True, stats=st); print('gx.check1 PASS (E0-E7, exact scalar E5)') + for K2 in (2, 3): b = price(w, K2); print('b(B_%d) =' % K2, b, float(b)) + json.dump(w, gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-far-nine-complex/code/e8core.py b/research/e8-far-nine-complex/code/e8core.py new file mode 100644 index 0000000000..78983b3687 --- /dev/null +++ b/research/e8-far-nine-complex/code/e8core.py @@ -0,0 +1,203 @@ +"""Our own engine for bitE8/1 words (E8 root-line labels, h = 8): frame algebra over Q via root-line masks, +legality/F2 replay, five-stage histogram, exact bit coarse saving and PR #315 outer assembly (our engine copies). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +import gzip, json, os, importlib.util +from fractions import Fraction as Q +from collections import Counter + +HERE = os.path.dirname(os.path.abspath(__file__)) +def _load(n): + s = importlib.util.spec_from_file_location('e8_' + n, os.path.join(HERE, "engines", n + ".py")) + m = importlib.util.module_from_spec(s); s.loader.exec_module(m); return m +moment = _load('moment'); other = _load('base_two_moment'); outer = _load('outer') + +B2 = Q(876248285600677, 10**18) # Sussman E8 five-stage (PR #352) +B3 = Q(932783231884153, 10**18) # DaysSky seven-stage B_3 (PR #363; no Lean proof) + + +def load_word(p): + with (gzip.open(p, 'rt') if p.endswith('.gz') else open(p)) as f: + return json.load(f) + + +def save_word(c, p): + with gzip.open(p, 'wt') as f: + json.dump(c, f, separators=(',', ':')) + + +def rank(vecs): + rows = [[Q(x) for x in r] for r in vecs]; rk = 0 + n = len(rows[0]) if rows else 0 + for col in range(n): + p = next((i for i in range(rk, len(rows)) if rows[i][col] != 0), None) + if p is None: continue + rows[rk], rows[p] = rows[p], rows[rk] + for i in range(len(rows)): + if i != rk and rows[i][col] != 0: + f = rows[i][col] / rows[rk][col]; rows[i] = [a - f * b for a, b in zip(rows[i], rows[rk])] + rk += 1 + return rk + + +class Lat: + """Root-spanned subspaces of Q^8 represented by the mask of root lines they contain.""" + def __init__(self, lines): + self.lines = [tuple(x) for x in lines]; self.v = len(lines) + self._dim = {0: 0}; self._close = {} + # Gram (form /2) for orthogonality + self.ip = [[sum(a * b for a, b in zip(x, y)) // 2 for y in self.lines] for x in self.lines] + + def close(self, mask): + """mask of all root lines in span(roots of mask)""" + if mask in self._close: return self._close[mask] + idx = [i for i in range(self.v) if mask >> i & 1] + basis = [] + for i in idx: + if rank([self.lines[j] for j in basis] + [self.lines[i]]) > len(basis): basis.append(i) + d = len(basis); out = 0 + if d == 8: out = (1 << self.v) - 1 + elif d: + B = [self.lines[j] for j in basis] + for i in range(self.v): + if rank(B + [self.lines[i]]) == d: out |= 1 << i + self._close[mask] = out; self._close[out] = out; self._dim[out] = d + return out + + def dim(self, mask): + if mask not in self._dim: self.close(mask) + return self._dim[mask] + + def basis(self, mask): + b = [] + for i in range(self.v): + if mask >> i & 1 and rank([self.lines[j] for j in b] + [self.lines[i]]) > len(b): b.append(i) + return b + + def perp(self, t): + return self.close(sum(1 << j for j in range(self.v) if self.ip[t][j] == 0)) + + +def to_masks(c, L): + return [L.close(sum(1 << i for i in fr)) for fr in c['frames']] + + +PHASES = ('D', 'A', 'B', 'C') + + +def replay(c, L=None, masks=None, check_f2=True, span=True, span_mode='z'): + """Exact legality + F2 replay + histogram of a bitE8/1 word. Returns dict(H_local, steps, ...). + Legality: each register's frames nested (mask inclusion = exact Q-subspace inclusion for root-spanned frames) and + strictly increasing at each move; every gate at one common frame; D compensation at frame 0; y at frame 0 at the + scatter; COPY of retained totals; final frames (x, helpers FULL; y_t at its cap t-perp). + Source-span: every non-target operand's x-support lies in the gate frame.""" + L = L or Lat(c['lines']); masks = masks or to_masks(c, L) + v, R, h = c['v'], c['R'], c['h']; n = 2 * v + R; FULL = (1 << v) - 1 + cur = [masks[f] for f in c['start']] + for r in range(v): assert cur[r] == L.close(1 << r), 'x start' + for r in range(v, 2 * v): assert cur[r] == 0, 'y start at 0' + sig = [L.dim(cur[r]) for r in range(n)] + H = Counter(); steps = 0; viol = [] + val = [1 << i for i in range(n)] + zsupp = [{i: 1} if i < v else {} for i in range(n)] # integer support of each register over the x columns (all ADDs are +1) + def climb(r, m): + nonlocal steps + if cur[r] == m: return + assert cur[r] & ~m == 0 and cur[r] != m, ('not nested', r) + H[L.dim(m) - L.dim(cur[r])] += 1; steps += 1; cur[r] = m + def run(gates, ph): + for k, (f, d, srcs) in enumerate(gates): + m = masks[f] + assert d >= v and d not in srcs and len(set(srcs)) == len(srcs), (ph, k) + for x in [d] + srcs: climb(x, m) + for s in srcs: + val[d] ^= val[s] + if span: + if s < v or s >= 2 * v: + ms = sum(1 << i for i in zsupp[s]) + if ms & ~m: viol.append((ph, k, s)) + zd = zsupp[d] + for i, a in zsupp[s].items(): + w = zd.get(i, 0) + a + if w: zd[i] = w + else: zd.pop(i, None) + if span_mode == 'f2': + zsupp[d] = {i: 1 for i in range(v) if val[d] >> i & 1} + if span and d >= 2 * v: + md = sum(1 << i for i in zsupp[d]) + if md & ~m: viol.append((ph, k, d)) + run(c['D'], 'D') + for r in range(v, n): assert cur[r] == masks[c['start'][r]], 'D compensation at frame 0 (helpers untouched otherwise)' + run(c['A'], 'A') + for t in range(v): assert cur[v + t] == 0, 'y at frame 0 at the scatter' + copies = [val[q] for q in c['ret']] + for q in c['ret']: + assert q >= 2 * v; H[L.dim(cur[q])] += 1 + for t, row in enumerate(c['scatter']): + for k in row: val[v + t] ^= copies[k] + run(c['B'], 'B'); run(c['C'], 'C') + for r in range(n): climb(r, masks[c['final'][r]]) + for r in range(v): assert cur[r] == FULL + for r in range(2 * v, n): assert cur[r] == FULL + for t in range(v): assert cur[v + t] == L.perp(t), 'y final at cap' + if check_f2: + for s in range(v): assert val[s] == 1 << s + for t in range(v): assert val[v + t] == (1 << (v + t)) | (1 << t), ('target', t) + for r in range(2 * v, n): assert val[r] == 1 << r, ('helper', r) + return dict(sig=sig, viol=viol, H=H, steps=steps, n=n, v=v, R=R, h=h, L=L, masks=masks, ncopy=len(c['ret'])) + + +def profile(H_local, v, h=8): + prof = Counter({j: 5 * c for j, c in H_local.items()}) + for j in (2 * h - 2, h - 1, 2 * h + 2, 4): prof[j] += 2 * v + return prof + + +def coarse(H, m, W): + grid = Q(1, 10**18) + root = moment.certify(dict(H), m, W, True); c = Q(int(Q(root['lower']) * 10**18), 10**18) + assert moment.moment(H, m, W, c, True)[1] < 1 < moment.moment(H, m, W, c + grid, True)[0] + fb = 32 * m * m * sum(H.values()) + _, up = other.moment(m, W, list(H.items()), c); _, bad = other.moment(m, W, [(1, fb)], c) + lo, _ = other.moment(m, W, list(H.items()), c + grid); blo, _ = other.moment(m, W, [(1, fb)], c + grid) + assert up + Q(1, 10**16) * bad < 1 < lo + Q(1, 10**16) * blo + return c + + +def kappa(c, b): + grid = Q(1, 10**18); eta = Q(1, 10**12); beta = Q(1, 10**9); cap = (1 - beta) * b + sv = min(c, Q(((cap - grid) * 10**18).__floor__(), 10**18)); binding = 'bit' if sv == c else 'complex' + chain = [Q(384599, 10**10)] + for _ in range(3): + a = (1 - sv) * sv + sv * chain[-1]; assert chain[-1] < a < sv < 1 - a; chain.append(a) + bit = chain[-1] + bridge = dict(proof='PROOF.md', representation='Exact powers with source-bound finite overcharges', + semantic=dict(G=dict(base=2, exponent=30000), E=dict(base=2, exponent=100000), B_upper=dict(base=2, exponent=100001), + C0=dict(base=2, exponent=210000), C1=1, strict_literal_gap=1, induction_gap_lower=1), + rows=dict(coefficient=20161, degree=10**6, suffix_slope=4 * 10**6, degree_gap=Q(10**6) - Q(51 * 20161, 25))) + q = bit * (1 - 2 * eta); mn = (1 - eta) * q / (1 + q); t = mn * 10**18; k = Q((t.numerator - 1) // t.denominator, 10**18) + asm = outer.assembly(bit, b, bridge, k, eta=eta, beta=beta) + assert len(asm['strict_constraints']) == 47 and min(asm['strict_constraints'].values()) > 0 + try: + outer.assembly(bit, b, bridge, k + grid, eta=eta, beta=beta); raise SystemExit('ADJACENT ADMITTED') + except AssertionError: pass + return k, binding + + +def price_word(c, **kw): + r = replay(c, **kw) + v, h, R = r['v'], r['h'], r['R']; m = 5 * h + resid = sum(h - r['sig'][x] for x in range(2 * v, 2 * v + R)) + T = 1 if resid % h == 0 else h + W = (4 * v * h + resid) * T // h; assert (4 * v * h + resid) * T % h == 0 + prof = Counter({j: T * k for j, k in profile(r['H'], v, h).items()}); mass = sum(a * b for a, b in prof.items()) + L_copy = h * r['ncopy'] + assert m * W - mass == T * (4 * v - 5 * L_copy), ('deficit', m * W - mass) + assert 2 * max(prof) < m + cc = coarse(prof, m, W) + return dict(c=cc, H=r['H'], prof=prof, W=W, T=T, resid=resid, m=m, deficit=m * W - mass, replay=r) + + +def phi_fn(m, W, a): + """linearized moment term per child of rank r (float), for search scoring""" + import math + return lambda r: r / (m * W) * math.exp(a * math.log(m / r)) diff --git a/research/e8-far-nine-complex/code/engines/base_two_moment.py b/research/e8-far-nine-complex/code/engines/base_two_moment.py new file mode 100644 index 0000000000..14a90fa0e7 --- /dev/null +++ b/research/e8-far-nine-complex/code/engines/base_two_moment.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Maintainer arithmetic cross-check of the pinned PR39 certificate. + +Uses no producer/checker imports. Counts are inputs, not proved by this script. +80-term rational logarithms and 12-term exponentials independently enclose +the two moments. The accompanying written review addresses their realization. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +GRID = 10**30 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def log_unit(x): + require(1 <= x <= 2, "logarithm range") + z = (x-1)/(x+1) + lo = 2*sum((z**(2*j+1)/(2*j+1) for j in range(80)), Q(0)) + return lo, lo+2*z**161/(161*(1-z*z)) + + +def log_bounds(x): + k = 0 + while x > 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/e8-far-nine-complex/code/engines/moment.py b/research/e8-far-nine-complex/code/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/e8-far-nine-complex/code/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/e8-far-nine-complex/code/far9.py b/research/e8-far-nine-complex/code/far9.py new file mode 100644 index 0000000000..69d6efc047 --- /dev/null +++ b/research/e8-far-nine-complex/code/far9.py @@ -0,0 +1,34 @@ +"""Our far-piece-relocation search (cxfar.py: far relocation, single/block retiming, in-group piece relocation), with the +chi ledger and the price taken in #377's nine-stage setting (m = 73, pooled profile of nine.py) instead of B_3 at m = 63. +usage: far9.py CERT.json.gz GXDIR OUT.json.gz [passes]""" +import sys, os, json, gzip, random +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from cxfar import far_pass, piece_pass, split, CX, rehist, to_cert, bsweep +from cxsplit import single_sweep +from e8core import coarse + + +def price9(c): + H = Counter() + for bl in c['blocks'].values(): + for r, n in bl.items(): H[int(r)] += 72 * n + for r in (16, 8, 32, 8, 48, 8, 48, 32, 16): H[r] += 1920 + H[1] += 7047; return coarse(H, 73, 14727) + + +if __name__ == '__main__': + sys.path.insert(0, sys.argv[2]); import gx + src = json.load(gzip.open(sys.argv[1])) + c, tag = (src['cert'], [tuple(t) for t in src['tag']]) if 'cert' in src else split(src) + m = 73; b0 = price9(c); a = float(b0); rng = random.Random(1); print('start b9', b0, float(b0), flush=True) + for p in range(int(sys.argv[4]) if len(sys.argv) > 4 else 120): + c, tag, g = far_pass(c, tag, a, m); M = CX(c) + for s in range(10): + m1, _ = single_sweep(M, a, m, rng); m2, _ = bsweep(M, a, m, rng) + if not (m1 or m2): break + c = rehist(to_cert(M)); c, tag, g2 = piece_pass(c, tag, a, m) + b = price9(c); print('pass', p, 'far/a %.3f piece/a %.3f' % (g / a, g2 / a), 'b9', b, '%.15e' % float(b), flush=True) + if g == 0 and g2 == 0: break + gx.check1(c, scalar=True); print('gx.check1 PASS') + json.dump(dict(cert=c, tag=[list(t) for t in tag]), gzip.open(sys.argv[3], 'wt')) diff --git a/research/e8-far-nine-complex/code/layout_bk.py b/research/e8-far-nine-complex/code/layout_bk.py new file mode 100644 index 0000000000..57aa98085b --- /dev/null +++ b/research/e8-far-nine-complex/code/layout_bk.py @@ -0,0 +1,63 @@ +"""Our own check of the bridged layout B_K (Sussman's B_2, Work/Bridge/Net.lean; DaysSky's B_K generalisation, PR #363), +reimplemented from the schedule stated in PR #363's README and Sussman's coordinate-frame stage geometry: +K bank pairs, 2K+1 stages on H + 2K.H (m = (2K+1)h). Pair 1: forward, backward, forward; pair p >= 2: backward, forward, +borrowing its first forward from pair p-1 through twin gates (+-1 additions at equal frames). +Checks: frames are coordinate sets; every climb nested; twin gates at equal frames; each invocation entered at its +stage frame; final frames; m-1 moves per data role; exchange identity X_p = -y_p, Y_p = x_p (exact integer +linear algebra on symbolic coefficient vectors). Returns the idle climbs per role pair (optionally split at s). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +def layout(K, h, split=None): + s = 2 * K + 1; m = s * h; l = 0 + blk = lambda name, skip=None: {(name, j) for j in range(h) if j != skip} + B0 = blk('b0'); F = ['F%d' % i for i in range(s - 1)] + ALL = set(B0).union(*[blk(f) for f in F]); assert len(ALL) == m + def enter(t, X): + if t == 0: return {('b0', l)} if X else set() + base = set(B0) if X else B0 - {('b0', l)} + for f in F[:t - 1]: base |= blk(f, l) + return base + def leave(t, X): + return (set(B0) if X else B0 - {('b0', l)}) if t == 0 else enter(t, X) | blk(F[t - 1], l) + sched = [(0, 'F', 1), (1, 'B', 1), (2, 'F', 1)] + for p in range(2, K + 1): sched += [(2 * p - 1, 'B', p), (2 * p, 'F', p)] + fr = {(X, p): enter(0, X) for p in range(1, K + 1) for X in (True, False)} + inv = {k: 0 for k in fr}; idle = {k: [] for k in fr} + # symbolic values: vector over symbols x1..xK, y1..yK + sym = lambda nm, p: tuple(int(q == (nm, p)) for q in [(a, b) for a in 'xy' for b in range(1, K + 1)]) + val = {(True, p): sym('x', p) for p in range(1, K + 1)} | {(False, p): sym('y', p) for p in range(1, K + 1)} + add = lambda u, w, c: tuple(a + c * b for a, b in zip(u, w)) + def go(k, new, is_idle): + assert fr[k] <= new, 'climb not nested' + if new != fr[k]: + (idle[k].append(len(new) - len(fr[k])) if is_idle else None) + if not is_idle: inv[k] += len(new) - len(fr[k]) + fr[k] = set(new) + def gate(d, s_, c): + assert fr[d] == fr[s_], 'twin gate at unequal frames' + val[d] = add(val[d], val[s_], c) + for t, kind, p in sched: + for X in (True, False): + go((X, p), enter(t, X), True); go((X, p), leave(t, X), False) + if kind == 'F': val[(False, p)] = add(val[(False, p)], val[(True, p)], 1) + else: val[(True, p)] = add(val[(True, p)], val[(False, p)], -1) + for q in range(2, K + 1): + if t in (2 * q - 3, 2 * q - 2): + for X in (True, False): go((X, q), fr[(X, q - 1)], True) + if t == 2 * q - 3: gate((True, q - 1), (True, q), 1); gate((False, q), (False, q - 1), -1) + else: gate((False, q), (False, q - 1), 1); gate((True, q - 1), (True, q), -1) + for k in fr: go(k, ALL if k[0] else ALL - {('b0', l)}, True) + for q in range(K, 1, -1): gate((False, q - 1), (False, q), -1); gate((True, q), (True, q - 1), 1) + for k in fr: assert inv[k] + sum(idle[k]) == m - 1 + for p in range(1, K + 1): + assert val[(True, p)] == tuple(-a for a in sym('y', p)) and val[(False, p)] == sym('x', p), ('exchange', p) + assert idle[(True, p)] == idle[(False, p)] + blocks = [r for p in range(1, K + 1) for r in idle[(True, p)]] + if split: + out = [] + for r in blocks: + while r > split: out.append(split); r -= split + if r: out.append(r) + blocks = out + return dict(m=m, per_pair={p: idle[(True, p)] for p in range(1, K + 1)}, blocks=blocks) +if __name__ == '__main__': + print(layout(2, 9)); print(layout(3, 9)); print(layout(3, 9, split=31)) diff --git a/research/e8-far-nine-complex/code/nine.py b/research/e8-far-nine-complex/code/nine.py new file mode 100644 index 0000000000..309c28228e --- /dev/null +++ b/research/e8-far-nine-complex/code/nine.py @@ -0,0 +1,76 @@ +"""Exact coarse savings for jacklightChen's PR #377 nine-stage complex component with the local E8 certificate swapped, +our bit word (PR #382) in B_3 unsplit, and PR #315's outer assembly. +#377's paid profile (its complex_candidate.py / global_nine.py, read as data) is + L*T * (sum over all local blocks x, y, s, c of the certificate's child histogram) [L = 9 stages, T = 8 replicas] + + 2*v*T * (idle ranks 2j(h-1), h-1 for j = 1..k-1, and 2(k-j)(h-1) for j = 1..k) [k = 4 pairs] + + L*R paid rank-1 bank paddings, +with m = 73, live W = 8*v*T + L*R = 14727. Only the pooled local histogram depends on the certificate. +usage: nine.py ORIG.json.gz OURS.json.gz PR377_GLOBAL_REVIEW.json BITWORD.json.gz OUT.json""" +import sys, os, json, gzip +from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from e8core import coarse, kappa, price_word, load_word, Q +from layout_bk import layout + +k, L, T = 4, 9, 8 + + +def nine_profile(c): + h, v, R = c['h'], c['v'], c['R']; assert (h, v, R, c['cst']) == (9, 120, 783, 72) + H = Counter() + for block in c['blocks'].values(): + for r, n in block.items(): H[int(r)] += L * T * n + idle = [x for j in range(1, k) for x in (2 * j * (h - 1), h - 1)] + [2 * (k - j) * (h - 1) for j in range(1, k + 1)] + assert idle == [16, 8, 32, 8, 48, 8, 48, 32, 16, 0] + for r in idle: + if r: H[r] += 2 * v * T + H[1] += L * R + m, W = h + 8 * (L - 1), 8 * v * T + L * R; assert (m, W) == (73, 14727) + assert m * W - sum(r * n for r, n in H.items()) == T * (2 * k * v - L * c['cst']) == 2496 + return H, m, W + + +def degree(H, m): + mx = max(H); t = 1 + while m ** t <= 2 * mx ** t: t += 1 + return mx, t + + +def bit_bk_unsplit(word, K=3): + p = price_word(word); h, v = 8, 120; s = 2 * K + 1; m = s * h; resid = p['resid'] + T8 = 1 if resid % h == 0 else h + lay = layout(K, h) + H = Counter({r: T8 * s * c for r, c in p['H'].items()}) + for r in lay['blocks']: H[r] += T8 * 2 * v + W = (2 * K * v * h + resid) * T8 // h; assert (2 * K * v * h + resid) * T8 % h == 0 + assert m * W - sum(r * c for r, c in H.items()) == T8 * (2 * K * v - s * 72), 'deficit' + mx, t = degree(H, m); assert m <= 72 + return coarse(H, m, W), mx, t, m + + +load = lambda p: json.load(gzip.open(p)) +orig, ours, g = load(sys.argv[1]), load(sys.argv[2]), json.load(open(sys.argv[3])) +H0, m, W = nine_profile(orig) +assert {str(r): n for r, n in sorted(H0.items())} == g['profile'] and (g['m'], g['live'], g['deficit']) == (m, W, 2496) +print(' #377 profile rebuilt from Sussman\'s certificate equals GLOBAL-REVIEW.json field for field (m %d, W %d, deficit 2496)' % (m, W)) +H1, _, _ = nine_profile(ours) +d = {r: H1.get(r, 0) - H0.get(r, 0) for r in sorted(set(H0) | set(H1)) if H1.get(r, 0) != H0.get(r, 0)} +print(' profile with the re-timed certificate:', dict(sorted(H1.items()))) +print(' profile delta (= 72 x pooled local delta):', d) +assert all(x % 72 == 0 for x in d.values()) and sum(r * x for r, x in d.items()) == 0 +mx0, t0 = degree(H0, m); mx1, t1 = degree(H1, m); assert (mx0, t0) == (mx1, t1) == (48, 2) +b0 = coarse(H0, m, W); assert b0 == Q(999240641319551, 10**18), b0 +b1 = coarse(H1, m, W) +print(' b (#377, Sussman\'s unit) = %s = %.15e [= #377]' % (b0, float(b0))) +print(' b (#377 with our re-timed unit) = %s = %.15e (+%.6e)' % (b1, float(b1), float(b1 - b0))) +assert b1 > b0 +word = load_word(sys.argv[4]); c, mxb, tb, mb = bit_bk_unsplit(word) +assert c == Q(251726760077483, 25 * 10**16) and (mxb, tb, mb) == (34, 2, 56), (c, mxb, tb) +print(' bit c (PR #382 word, B_3 unsplit, m %d, max child %d, halving degree %d) = %s = %.15e' % (mb, mxb, tb, c, float(c))) +k0, bd0 = kappa(c, b0); k1, bd1 = kappa(c, b1) +assert k0 == Q(998243154231047, 10**18) and bd0 == 'complex' +print(' kappa with #377 as shipped = %s = %.15e (%s-bound) [= PR #382]' % (k0, float(k0), bd0)) +print(' kappa with the re-timed unit = %s = %.15e (%s-bound)' % (k1, float(k1), bd1)) +json.dump(dict(b_377=str(b0), b=str(b1), b_float=float(b1), c=str(c), kappa_382=str(k0), kappa=str(k1), kappa_float=float(k1), binding=bd1, + profile={str(r): n for r, n in sorted(H1.items())}, profile_delta={str(r): x for r, x in d.items()}, max_child=mx1, halving_degree=t1), + open(sys.argv[5], 'w'), indent=1) diff --git a/research/e8-far-nine-complex/complex/LICENSE-wht-power-saving-lean b/research/e8-far-nine-complex/complex/LICENSE-wht-power-saving-lean new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-far-nine-complex/complex/LICENSE-wht-power-saving-lean @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-far-nine-complex/complex/NOTICE-wht-power-saving-lean b/research/e8-far-nine-complex/complex/NOTICE-wht-power-saving-lean new file mode 100644 index 0000000000..7008ce01c1 --- /dev/null +++ b/research/e8-far-nine-complex/complex/NOTICE-wht-power-saving-lean @@ -0,0 +1,489 @@ +Walsh-Hadamard power saving (wht-power-saving-lean) +Copyright 2026 Jacob Sussman + +Repository: https://github.com/jacobalansussman/wht-power-saving-lean + +This repository is not a project of OpenAI. OpenAI did not write, review or +endorse it. The package name "OAI" and the namespace "OAI.PowerSaving" are +those of openai/math and are kept only because the new files extend that +development. + +This repository is not a project of CrocSwap/integer-mult-bounds either. Its +authors did not write, review or endorse it. Section 6 says what is taken +from their repository. + +This repository contains files from, and files derived from, the repository +"openai/math" (https://github.com/openai/math), family 130, "Exact Fourier +transforms below n log n", at commit fd4aeeb2ee4fc729c18d98444fed42fd0529eeeb. +That repository is published under the Apache License, Version 2.0. A copy of +the licence is in the file LICENSE. The upstream repository has no NOTICE file +and its licence text names no copyright holder; the files are attributed here +to the authors of openai/math (OpenAI). + +1. Unmodified upstream files. + The 89 files under OAI/Computability/ are byte-for-byte copies of the files + with the same paths under lean/ in openai/math at the commit above. They + have not been changed. Modified copies of some of them are under + Work/Fourier/ and Work/FourierE8/ and are listed in section 7. + One more file of openai/math is here unchanged, outside the Lean build: + third-party/openai-math/lean/ComparatorChallenges/UniformFourier.lean is a + byte-for-byte copy of lean/ComparatorChallenges/UniformFourier.lean at the + commit above (the statement of OpenAI's Fourier challenge). It is included + so that the modified copy named in section 2 can be compared with it. + +2. Files that contain upstream text. + - Work/CarrierCheck/ChallengeB2Ke16x.lean, + Work/CarrierCheck/ChallengeB2Ke16xR.lean, + Work/GCert/Data/ChallengeB2Gp193x.lean, + Work/GCert/Data/ChallengeB2Ge8x.lean and the text template + tools/gen/templates/ChallengeB2L16x.lean.txt each contain, as their + lines 22-270, lines 9-257 of + lean/ComparatorChallenges/UniformFourier.lean of openai/math (the RAM cost + model), unchanged. Everything else in these files was written for this + repository. + - Work/Fourier/UniformFourierChallenge.lean is a modified copy of + lean/ComparatorChallenges/UniformFourier.lean of openai/math (the + statement of OpenAI's Fourier challenge, 336 lines). Changes: a comment + was added at the top; the exponent 1 - 1/(10^(13:ℕ)) was replaced by + 1 - 7474546/(10^(10:ℕ)); seven names received the suffix "Z" + (decimalExponent, decimalTime, TimeBounds, DFTGoal, ConvGoal, + transform_main, convolution_main). Everything else in the file is the + upstream text, unchanged. See section 7. + - Work/FourierE8/UniformFourierChallenge.lean is a second modified copy + of the same upstream file, for the fourth result, with the same three + kinds of change: a comment added at the top; the exponent replaced by + 1 - 8762478/(10^(10:ℕ)); the suffix "E8" on the same seven names. + Everything else in the file is the upstream text, unchanged. See + section 7. + - Work/Scratch/Engine.lean and Work/Block/Engine.lean contain copies of + proofs of openai/math, changed for this repository: sections 1, 2 and 5 + of Work/Scratch/Engine.lean are upstream proofs with the batch layout + renamed, and both files contain a copy of the private upstream theorem + "hills_project" (lean/OAI/Computability/FourierTransform/ + TensorProgram.lean) with its envelope generalised. The comments in the + two files mark these places. + - lakefile.lean is adapted from lean/lakefile.lean of openai/math: the same + package name, toolchain, package option and Mathlib pin; every other + dependency was removed and the libraries of this repository were added. + lean-toolchain is a byte-for-byte copy of lean/lean-toolchain. + lake-manifest.json lists Mathlib and its dependencies at the revisions of + lean/lake-manifest.json. + - RELATED-WORK.md reproduces the BibTeX entries of two manuscripts of + openai/math. + +3. New files that build on upstream proofs. + The other files under WHTCheck/ and Work/ were written for this + repository. They import the upstream files, and several of them generalise + or adapt proofs of upstream files (for example Work/Block/Recursion.lean, + which says so in its header). They are changes and additions made for this + repository and are not part of openai/math. + +4. How the new files were made. + Jacob Sussman made the new files on 2026-10-08, 2026-10-09 and 2026-10-10 + by directing a team of AI agents (Claude). The agents wrote the new Lean + files, the certificate data and the generator scripts. They made the + rebuild scripts under tools/rebuild/, in part by adapting programs of + CrocSwap/integer-mult-bounds (section 6): ten of the thirteen on + 2026-10-09, tidied for this repository on 2026-10-10, and three on + 2026-10-10. On 2026-10-10 they also wrote the search programs under + tools/e8/ and found with them the certificate of the fourth result + (section 8). See README.md, section 4. + +5. Ideas taken from other public work. + The network of the first result uses ideas published by others, among them + the helper circuit "NStar3" (Swapnil-jain/integer-mult-kappa, which credits + CrocSwap pull request #36 and Paureel for parts of it), its transfer to + family 130 (shea256/fourier-transform-below-nlogn), and "carrier links" and + "whole-residual batching" (pull requests to CrocSwap/integer-mult-bounds). + No file of Swapnil-jain/integer-mult-kappa or of + shea256/fourier-transform-below-nlogn is included here. One comment in + Work/Scratch/Engine.lean quotes three counts reported in + Swapnil-jain/integer-mult-kappa and names that source. The general frame + lemma that Work/GFrame proves is stated in + notes/general-clifford-frames.tex of CrocSwap/integer-mult-bounds; its Lean + proof was written for this repository. The credits, with links, are in + RELATED-WORK.md. + +6. Data derived from, and programs adapted from, + CrocSwap/integer-mult-bounds (second result). + The helper circuit of the second result is the paired-cube circuit of the + repository "CrocSwap/integer-mult-bounds" + (https://github.com/CrocSwap/integer-mult-bounds), in the state of its pull + request #193. It is the design of that community: icekylinx (pull requests + #144 and #184), eumemic (#168, and #117 behind its modules), ikeboy / + Avi Eisenberg (#191 and #193), with an664 (#128) credited there for the + workspace-sharing principle, and DaysSky (#162) and chafreaky (#163) + credited by #168 for its closure-compiled carrier arcs and for the + fusion of its single-target outputs. That repository is published under + the Apache + License, Version 2.0 (the same licence text as the file LICENSE). Its + NOTICE file begins "A sharper exponent for integer multiplication / + Copyright 2026 Douglas Colkitt" and says that the community release "is + not solely Douglas Colkitt's work". A complete copy of that NOTICE file, as + it is at the head of pull request #193, is in + third-party/CrocSwap-integer-mult-bounds/NOTICE. + + The data were taken from these files of that repository. They were loaded + as data by the programs under tools/rebuild/. No program of that + repository was run, and none is included here unchanged; six of the + programs under tools/rebuild/ are adapted from programs of that + repository ("Programs", below). + - at the head of pull request #168 (eumemic), + 4a3c769e5c5430e7114c4d3e099ff34664677f17: + references/paired-cube/sources/local_L1.json + references/paired-cube/sources/tmod_TE_TD_TB3_1_1_4_full_6.0617964e-4.json + references/paired-cube/sources/pmod_J0_full_6.0666810e-4.json + references/paired-cube/sources/qmod_climb3u_best.json + references/paired-cube/selected-module/matching-arcs.json + references/paired-cube/physical/frames.json + - at the head of pull request #193 (ikeboy), + 187e1010ac8b259af8e9b5166f68b64bc27b4b47: + research/source-assisted-v4/data/physical-pairs.json + + Two more files at the head of pull request #168 are read for comparison + only: the programs print whether their graph and their counts agree + with them. Nothing in the certificate is taken from them: + references/paired-cube/selected-module/SOURCE.json + certificates/paired-cube-complex-input.json + + One more file is fetched and read only on request. No certificate and + no Lean module of this repository is made from it; the documentation + gives its sha256 and the price that tools/gx/gxdry.py computes for + the certificate that the rebuild makes from it: + - at the head of pull request #233 (chafreaky), + 109a857a329d18ed5552d5573f17ddfa886ae57f: + research/source-assisted-v4-layer/witness/physical-pairs.json + + None of these ten files is included in this repository. + tools/rebuild/fetch_inputs.py fetches them and checks their sha256. + + Files of this repository that contain data derived from them: + tools/certificate/gcert1-p11-pr193.json.gz and the Lean data modules + generated from it, Work/GCert/Data/Gen/P193*.lean and the files they import + from Work/GCert/Data/Gen/P193/; its block counts are also in the generated + modules Work/GCert/Data/P193Price.lean, RateB2Gp193.lean, RateB2Gp193x.lean + and InstB2Gp193.lean. + Changes made: the circuit was rebuilt from those data as one explicit, + renumbered list of additions with a table of frames, in the certificate + format "gcert/1" of this repository; its 1,980 in-place steps were written + as pairs of additions with rescaled coefficients; the Lean data modules + were generated from that list. No file of that repository is included + unchanged, except the copy of its NOTICE file named above. + + Programs. The Python files under tools/rebuild/ were made by the agents + (section 4), who read programs of that repository as text and ran none + of them. Six of the thirteen files are adapted from those programs: + the parts named below follow the outside program statement by statement + or method by method, with the layout changed, some names changed and + the parts that this certificate does not use left out. Each of the six + says so in its first lines. + - tools/rebuild/compile.py: the function closure follows + compile_closure of scripts/paired_cube/closure.py; the function + select follows the first part of select of + scripts/paired_cube/gauges.py. + - tools/rebuild/graphgen.py: the class Gen follows the class Graph of + scripts/paired_cube/graph.py; its method fuse follows the branch + "f8:" of merge_outputs of scripts/paired_cube/modules.py, which + fuses the three single-target outputs of a port into one. That + branch came with pull request #168 (eumemic), which says of the + fusion that it "follows #163's same-singleton fusion" and credits + it so: "Same-singleton output fusion: @chafreaky (#163); the fold + orders here come from our own search." + - tools/rebuild/aligned.py: the functions op_tags, local_values and + build follow op_tags, local_values and main of + research/source-assisted-v4/source_aligned_local_v4.py, except its + search for pairs and the records it writes. + - tools/rebuild/stage.py: the order of the events, the backward pass + (responses) and many names are those of + research/terminal-sinks/sinks_gate.py and of + scripts/paired_cube_physical.py; the event records and the exact + arithmetic were written for this repository, and the frame scan + was rewritten so that it returns every block. + - tools/rebuild/build.py: the function target_hist and the field names + of profile follow the last part of select of + scripts/paired_cube/gauges.py; the calls that make the graph and its + hash follow regenerate of scripts/paired_cube_producer.py. + - tools/rebuild/f2.py: the function perp follows perp, and the second + half of the function rref follows the second half of basis, of + scripts/paired_cube/frames.py. + The outside programs are those at the two commits named above + (source_aligned_local_v4.py at the second, the others at the first). + Of the other seven files, rebuild.py, fetch_inputs.py, rbpaths.py, + rewrite.py, phys.py and emit.py were written for this repository. + modules.py was written for this repository too; for the three module + files it checks the contract that the outside + scripts/paired_cube/modules.py states for them in its functions + triple_module_from, pair_module_from and all_but_one_from, each of + which is marked there "eumemic, Claude assistance; Apache-2.0". + + Notices and attribution sentences in the first lines of those outside + programs, quoted with the line numbers of each file at its commit. + The other lines of each header say what the program does and name no + person: + + scripts/paired_cube/closure.py, lines 4-5 (pull request #168, + eumemic; from pull request #162, DaysSky): + Copyright 2026 DaysSky (PR162, + research/extended-links/cxlinks.py), Apache-2.0; moved here + unchanged apart from this header and the imports (eumemic, Claude + assistance). + + scripts/paired_cube/graph.py, modules.py, frames.py, gauges.py and + scripts/paired_cube_producer.py (pull request #144, icekylinx; + graph.py, modules.py and paired_cube_producer.py changed in #168, + eumemic), the two comment lines at the top of each: + Copyright 2026 icekylinx. Apache-2.0. + Developed with GPT-6 Astra assistance; integrated with Codex + assistance. + graph.py, lines 6-9: + The coarse positive query modules restrict the already adopted + PR117 DAG (eumemic; Apache-2.0; Claude assistance; + cbb05ce504d571546d9b7794c186a613c659c3bf). The paired-channel + decomposition and this assembly are new work for icekylinx with + OpenAI GPT-6 Astra assistance. + modules.py, lines 6-7: + The pair-disjoint module is a specialization of the already + adopted PR117 positive DAG (eumemic, Apache-2.0, pinned + cbb05ce504d571546d9b7794c186a613c659c3bf). + modules.py, line 272, above merge_outputs: + Output merging (pmerge.py variants; eumemic, Claude assistance; + Apache-2.0). + frames.py, line 7: + New work for icekylinx, OpenAI GPT-6 Astra assistance. + paired_cube_producer.py, line 8: + Copyright 2026 icekylinx, Apache-2.0; OpenAI GPT-6 Astra + assistance, inherited PR117 notices. + + scripts/paired_cube_physical.py, lines 4-7 (pull request #168, + eumemic): + Prepared by eumemic with Anthropic Claude assistance. Apache-2.0. + The signed word, frozen arcs, gauges, chronology and shared-core + accounting are icekylinx's PR144. Frame descent under PR130's + general Clifford frames and compensated birth-cut reuse follow + PR131 and jamesyc's PR124; deadline (late) compensation reads + follow PR143. + + research/terminal-sinks/sinks_gate.py, lines 4-6 (pull request + #168, eumemic): + The substitution is the terminal-sink lemma of PR #166 by jamesyc + (closed by its author), independently audited here: this gate's + own frame scans, replay and controls carry the soundness argument + and do not use #166's checker. Gate, audit and integration by + eumemic with Anthropic Claude assistance. Apache-2.0. + + research/source-assisted-v4/source_aligned_local_v4.py, lines 4-9 + (pull requests #191 and #193, ikeboy / Avi Eisenberg): + Derived from + research/source-assisted/decision/source_aligned_local.py + (icekylinx, GPT-6 Astra assistance, Apache-2.0). Only the three + frozen query modules change: this copy reads PR168 v4's selected + modules (eumemic, Claude assistance) from + references/paired-cube/sources instead of the PR168 fd25adb7 + modules. The local configuration, arc transport, frame + inheritance and physical layer code are unchanged. + + Notices of that NOTICE file that pertain to these data, quoted: + + Paired-cube and shared-core extension, 9 October 2026 + Copyright 2026 icekylinx + + Source-assisted common-frame extension (2026-10-09) + Copyright 2026 icekylinx. Apache-2.0. + Substantial dependency: eumemic PR168, + fd25adb7fbaa12ee761d02c733c54d1d2a7687ee + + The full text of both notices, and the notices of the work they build on, + are in the copy named above. The credits, with links and with the words of + pull request #193 about its own sources, are in README.md ("Whose circuit + this is") and in RELATED-WORK.md, section 1. + +7. Modified copies of upstream files (third and fourth results). + The files listed below are copies of files of openai/math at the commit + above, changed for this repository. Each begins with a comment that names + the upstream file it is derived from and states what was changed. The + upstream originals under lean/OAI/Computability/ are in this repository + as well, unchanged (section 1), and the copies import them. The upstream + challenge file lean/ComparatorChallenges/UniformFourier.lean is in this + repository in both forms: unchanged under third-party/openai-math/ + (section 1) and modified (section 2). + + - Work/Fourier/ArbitraryLength.lean: modified copy of + lean/OAI/Computability/FourierTransform/ArbitraryLength.lean (224 + lines; 159 of them unchanged in the copy). Changes: identifiers renamed + on 64 lines (18 names: 15 with the suffix Z, 3 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/Asymptotics.lean: modified copy of + lean/OAI/Computability/FourierTransform/Asymptotics.lean (187 lines; + 112 of them unchanged in the copy). Changes: identifiers renamed on 74 + lines (32 names: 26 with the suffix Z, 6 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + - Work/Fourier/Axioms.lean: written for this repository (not a copy of an + upstream file). + - Work/Fourier/ConvolutionProgram.lean: modified copy of + lean/OAI/Computability/FourierTransform/ConvolutionProgram.lean (100 + lines; 77 of them unchanged in the copy). Changes: identifiers renamed + on 22 lines (10 names: 9 with the suffix Z, 1 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/Goal.lean: written for this repository; contains lines of + upstream files: of its 7 code lines, 6 are lines of + lean/OAI/Computability/FourierTransform/Goal.lean (original lines 35, + 75-77, 79, 81): unchanged: its lines 25; with identifiers renamed: its + lines 21, 24, 26, 28, 30. + - Work/Fourier/Main.lean: modified copy of + lean/OAI/Computability/FourierTransform/Main.lean (151 lines; 90 of + them unchanged in the copy). Changes: identifiers renamed on 59 lines + (40 names: 35 with the suffix Z, 5 with Z inserted); 1 import line + replaced by 2; 24 comment lines added; other code lines changed: 1 of + the original, 1 of the copy (copy line 59). + - Work/Fourier/Seam.lean: written for this repository; contains lines of + upstream files: of its 122 code lines, 15 are lines of + lean/OAI/Computability/FourierTransform/TensorProgram.lean (original + lines 36-37, 95-96): unchanged: its lines 93-94, 113-114, 141-142, + 163-164, 185-187, 194-196; with identifiers renamed: its lines 184; 3 + are lines of lean/OAI/Computability/FourierTransform/TensorSaving.lean + (original lines 83-84, 114): with identifiers renamed: its lines 45-46, + 59; 1 is a line of lean/OAI/Computability/FourierTransform/Main.lean + (original line 60): with identifiers renamed: its lines 213. + - Work/Fourier/SectorAlgorithm.lean: modified copy of + lean/OAI/Computability/FourierTransform/SectorAlgorithm.lean (224 + lines; 162 of them unchanged in the copy). Changes: identifiers renamed + on 61 lines (17 names: 13 with the suffix Z, 4 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/SynchronizedAlgorithm.lean: modified copy of + lean/OAI/Computability/FourierTransform/SynchronizedAlgorithm.lean (126 + lines; 94 of them unchanged in the copy). Changes: identifiers renamed + on 31 lines (12 names: 10 with the suffix Z, 1 with Z inserted, 1 + other), the other being "canopy" to "Grove.canopy" (5 lines); 1 import + line replaced by 1; 16 comment lines added; no other change to the + code. + - Work/Fourier/TransformProgram.lean: modified copy of + lean/OAI/Computability/FourierTransform/TransformProgram.lean (146 + lines; 94 of them unchanged in the copy). Changes: identifiers renamed + on 51 lines (21 names: 19 with the suffix Z, 2 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/UniformBounds.lean: modified copy of + lean/OAI/Computability/FourierTransform/UniformBounds.lean (183 lines; + 115 of them unchanged in the copy). Changes: identifiers renamed on 67 + lines (29 names: 25 with the suffix Z, 4 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + - Work/Fourier/UniformFourierChallenge.lean: modified copy of + lean/ComparatorChallenges/UniformFourier.lean (336 lines; 328 of them + unchanged in the copy). Changes: identifiers renamed on 7 lines (7 + names: 7 with the suffix Z); 12 comment lines added; other code lines + changed: 1 of the original, 1 of the copy (copy line 281). + - Work/Fourier/WorkingCompiler.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingCompiler.lean (153 + lines; 104 of them unchanged in the copy). Changes: identifiers renamed + on 48 lines (14 names: 14 with the suffix Z); 1 import line replaced by + 1; 15 comment lines added; no other change to the code. + - Work/Fourier/WorkingPreparation.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingPreparation.lean (212 + lines; 156 of them unchanged in the copy). Changes: identifiers renamed + on 55 lines (30 names: 28 with the suffix Z, 2 with Z inserted); 1 + import line replaced by 1; 15 comment lines added; no other change to + the code. + - Work/Fourier/WorkingTransform.lean: modified copy of + lean/OAI/Computability/FourierTransform/WorkingTransform.lean (119 + lines; 91 of them unchanged in the copy). Changes: identifiers renamed + on 27 lines (9 names: 8 with the suffix Z, 1 with Z inserted); 1 import + line replaced by 1; 15 comment lines added; no other change to the + code. + + Changes made to the eleven copied proof files: every declaration received + the letter "Z" in its name (as a suffix of its own name, or of the name + of the declaration it belongs to), so that it does not collide with the + upstream declaration of the same name; the upstream exponent "alpha" + (1 - 2/10^11) and the bound "hills" defined from it were replaced by + "alphaZ" (1 - 7474547/10^10) and "hillsZ", which are defined in + Work/Fourier/Seam.lean, and the single use of the upstream theorem + "hills_program" by "hillsZ_program"; the five definitions of the upstream + statement that contain its exponent (decimalExponent, decimalTime, + TimeBounds, DFTGoal, ConvGoal) were replaced by the versions of + Work/Fourier/Goal.lean, whose exponent is 1 - 7474546/(10^(10:ℕ)); + the import lines point to the copies; a header comment was added. + Two further changes: in the copy of Main.lean the same constant stands + once as the literal 2/10^11 and was replaced there too, and the two + final theorems of that copy received a documentation comment; in the + copy of SynchronizedAlgorithm.lean the name "canopy" was written out as + "Grove.canopy" in 5 places, because the short name is shadowed in the + larger environment of the copy. The script also renamed three names + inside upstream comments; the comments are otherwise the upstream ones + and describe the upstream network. + The proofs are those of openai/math. The copies were made by the script + tools/fourier/mkchain.py of this repository. + + Work/Fourier/Goal.lean contains copies of those five definitions of + lean/OAI/Computability/FourierTransform/Goal.lean, with the exponent + replaced and the suffix "Z" on the five names. + + Work/Fourier/Seam.lean was written for this repository. It repeats the + statement of the upstream theorem "hills_program" (TensorProgram.lean) and + the definition of "hills" (TensorSaving.lean) with the two names replaced; + its header says so. + + Fourth result. The 15 files under Work/FourierE8/ repeat the 15 files + under Work/Fourier/ for the kernel program of the fourth result, file + for file and under the same file names: ArbitraryLength.lean, + Asymptotics.lean, ConvolutionProgram.lean, Goal.lean, Main.lean, + SectorAlgorithm.lean, SynchronizedAlgorithm.lean, TransformProgram.lean, + UniformBounds.lean, UniformFourierChallenge.lean, WorkingCompiler.lean, + WorkingPreparation.lean, WorkingTransform.lean, Seam.lean and + Axioms.lean. The eleven copied proof files, + Goal.lean and UniformFourierChallenge.lean are modified copies of the + same upstream files as their namesakes above, made by the script + tools/fourier/mkchain_e8.py (a copy of tools/fourier/mkchain.py with + its constants changed). The changes are those described above with + three differences: the suffix is "E8" where the copies of the third + result have "Z"; "alphaE8" is 1 - 8762479/10^10; and the exponent of + Work/FourierE8/Goal.lean is 1 - 8762478/(10^(10:ℕ)). Each of these + files begins with a comment that names the upstream file it is derived + from and states what was changed. Work/FourierE8/Seam.lean and + Work/FourierE8/Axioms.lean were written for this repository: they are + Work/Fourier/Seam.lean and Work/Fourier/Axioms.lean with names and + numbers replaced, and the seam repeats the same upstream statement and + definition as the seam of the third result. The proofs are those of + openai/math. + + The work of others that the third result follows (danadran01, shea256, + eumemic) is credited in README.md ("Whose reduction this is") and in + RELATED-WORK.md, section 1. No file of their repositories is included + here. + +8. The certificate of the fourth result and the search programs. + tools/certificate/gcert1-e8-r783.json.gz, the Lean data modules + generated from it (Work/GCert/Data/Gen/E8*.lean, Work/GCert/Data/Gen/E8/ + and the modules of Work/GCert/Data/ with E8 or B2Ge8 in their names) and + the Python programs under tools/e8/ were made by the agents for this + repository on 2026-10-10 (section 4). The circuit in that certificate + is not the circuit of section 6, and no data file of + CrocSwap/integer-mult-bounds was loaded to make it. It uses three + devices that were published by others in pull requests to that + repository: + - the in-place pair, a + b and a - b formed on the two arrays that held + a and b: icekylinx (#184), carried in #191 and #193 (ikeboy); + - the re-use of a finished helper with a compensating read: jamesyc + (#124) and eumemic (#143); + - the late pairing rule, the choice of which finished helper a new + value takes: Chafik Boukhalfa (the account chafreaky), #200 and #233, + and pull request #2 of this repository. The search programs apply the + idea with a greedy rule of their own; his program, his pairs and his + certificate were not used. + No program of that repository is included in tools/e8/, imported or + run by it. The programs of tools/e8/ have not been compared statement + by statement with the programs of that repository, as those of + tools/rebuild/ were (section 6). The integer programme of + tools/e8/ is solved with the open-source solver HiGHS, called through + SciPy (scipy.optimize.milp), with NumPy; none of the three is included + here. The credits, with links, are in README.md ("Whose ideas the new + unit uses") and in RELATED-WORK.md, section 8. + +Not included in this repository and fetched by the build: Mathlib +(https://github.com/leanprover-community/mathlib4, Apache License 2.0) and its +dependencies. The comparator (https://github.com/leanprover/comparator) is a +separate tool and is not included. diff --git a/research/e8-far-nine-complex/complex/gcert1-e8-r783.json.gz b/research/e8-far-nine-complex/complex/gcert1-e8-r783.json.gz new file mode 100644 index 0000000000..0bd0bacf74 Binary files /dev/null and b/research/e8-far-nine-complex/complex/gcert1-e8-r783.json.gz differ diff --git a/research/e8-far-nine-complex/complex/gx/gx.py b/research/e8-far-nine-complex/complex/gx/gx.py new file mode 100644 index 0000000000..6d14c0a976 --- /dev/null +++ b/research/e8-far-nine-complex/complex/gx/gx.py @@ -0,0 +1,296 @@ +#!/usr/bin/python3 -I +"""gx.py. OWN code (imports nothing of port-producer, nothing outside). +(1) convert(c0): gcert/0 (port-producer's event list) -> gcert/1, the LEAN-FACING NORMAL FORM: + only the main phase (no read0 / undo / uninj: the invocation theorem derives the dirt gate and the undo + gate from the product), every gate an elementary fan-out or fan-in add, the 4x4 K block written as three + such adds plus a sign carried by one register, the star scatter as a table. +(2) check1(c1): the local decidable conditions of EXTENDED-CERT-SPEC.md on a gcert/1 file: + E0 sizes, E1 labels (nested subspaces by containment, equal frame at a gate), E2 scatter cut, + E3 shape (kinds of gates; X1; S1), E4 bracket rule S2, E5 scalar (x-content replay: hid and X3), + E6 price data (block histograms, N), E7 exterior gauges only (Q2). Raises AssertionError(": ..."). +""" +from fractions import Fraction as Fr +from collections import Counter +from math import lcm + + +def need(c, msg): + if not c: + raise AssertionError(msg) + + +def reduce(u, basis): + """basis: reduced echelon, pivot = leading bit, descending. Returns u modulo the span.""" + for b in basis: + if u >> (b.bit_length() - 1) & 1: + u ^= b + return u + + +def echelon_ok(f): + piv = [b.bit_length() - 1 for b in f] + if any(b == 0 for b in f) or piv != sorted(piv, reverse=True) or len(set(piv)) != len(piv): + return False + return all(not (b >> p & 1) for i, b in enumerate(f) for j, p in enumerate(piv) if i != j) + + +def inside(a, b): + return all(reduce(u, b) == 0 for u in a) + + +def par(x): + return bin(x).count("1") & 1 + + +KJ = [[[1, 2] if i == j else [-1, 2] for j in range(4)] for i in range(4)] + + +def convert(c0): + need(c0["format"] == "gcert/0", "input is not gcert/0") + v, h, R = c0["v"], c0["h"], c0["R"] + ev = c0["events"] + cen = [n for n, e in enumerate(ev) if e[0] == "centre"] + need(cen == list(range(cen[0], cen[0] + len(cen))), "centres are not contiguous: no single scatter cut") + A, B, ret = [], [], [] + neg = set() # x registers currently holding MINUS their value (between the two K blocks) + openq = {} + for n, e in enumerate(ev): + k = e[0] + out = A if n < cen[0] else B + if k in ("read0", "undo", "uninj"): + continue + if k == "inj": + need(e[2] not in neg, "inj reads a negated x register") + out.append(["out", e[3], e[2], [[e[1], 1, 1]], []]) + elif k == "op": + if e[3] == -1: + out.append(["neg", e[5], e[1]]) + else: + need(e[3] == 1, "op ca") + out.append(["out", e[5], e[2], [[e[1], e[4], 1]], []]) + elif k == "centre": + ret.append([e[2], e[1], e[3]]) + elif k == "gread": + hit = set(t for t, _, _ in e[3]) + out.append(["out", e[2], e[1], [[v + t, a, b] for t, a, b in e[3]], [v + t for t in e[4] if t not in hit]]) + elif k == "rread": + out.append(["out", e[2], e[1], [[v + t, a, b] for t, a, b in e[3]], []]) + elif k == "ysh": + out.append(["out", e[4], e[2], [[e[1], e[3], 1]], []]) + elif k == "yw": + out.append(["out", e[4], e[2], [[e[1], e[3][0], e[3][1]]], []]) + elif k == "kd": + out.append(["out", e[3], e[2], [[e[1], -1 if e[2] in neg else 1, 1]], []]) + elif k == "ktr": + q = tuple(e[1]) + need(e[2] == KJ, "ktr matrix is not 1 - J/2") + x1, rest = q[0], list(q[1:]) + if q not in openq: # first block: x := M x, register x1 keeps the sign + out.append(["in", e[3], x1, [[r, 1, 1] for r in rest]]) + out.append(["out", e[3], x1, [[r, -1, 2] for r in rest], []]) + out.append(["in", e[3], x1, [[r, 1, 1] for r in rest]]) + openq[q] = n + neg.add(x1) + else: # second block: the three adds undone in reverse order + out.append(["in", e[3], x1, [[r, -1, 1] for r in rest]]) + out.append(["out", e[3], x1, [[r, 1, 2] for r in rest], []]) + out.append(["in", e[3], x1, [[r, -1, 1] for r in rest]]) + del openq[q] + neg.discard(x1) + else: + raise AssertionError("unknown event kind %r" % k) + need(not openq and not neg, "a K block is not closed") + ext = sorted([z[3], z[1]] for z in c0["gauge"] if z[5]) + c1 = dict(format="gcert/1", derived_from=c0["name"] + " (gcert/0)", p=c0["p"], h=h, v=v, R=R, cst=c0["cst"], + N=c0["N"], ports=c0["ports"], frames=c0["frames"], start=c0["start"], final=c0["final"], + ext=ext, ret=sorted(ret), scat=dict(inside=c0["scat"]["inside"], outside=c0["scat"]["outside"]), + A=A, B=B, blocks=c0["blocks"]) + return c1 + + +def scat_row(c, t): + """the scatter of target t: [(k, coefficient)], from the table or from the star rule""" + sc = c["scat"] + if "table" in sc: + return [(k, Fr(a, b)) for k, a, b in sc["table"][t]] + sin, sout = Fr(*sc["inside"]), Fr(*sc["outside"]) + return [(k, sin if c["ports"][t] >> k & 1 else sout) for k in range(c["h"])] + + +def gate_regs(g): + if g[0] == "neg": + return [g[2]], [], [] + if g[0] == "out": + return [g[2]] + [t for t, _, _ in g[3]] + list(g[4]), [(t, g[2], Fr(a, b)) for t, a, b in g[3]], g[4] + if g[0] == "in": + return [g[2]] + [s for s, _, _ in g[3]], [(g[2], s, Fr(a, b)) for s, a, b in g[3]], [] + raise AssertionError("E0: unknown gate kind %r" % (g[0],)) + + +def check1(c, scalar=True, stats=None): + need(c.get("format") == "gcert/1", "E0: format") + h, v, R = c["h"], c["v"], c["R"] + nreg = 2 * v + R + ports, fr = c["ports"], [tuple(f) for f in c["frames"]] + need(len(ports) == v == len(set(ports)) and all(par(q) and 0 < q < 1 << h for q in ports), "E0: ports") + need(fr[0] == () and fr[1] == tuple(1 << i for i in range(h - 1, -1, -1)), "E0: frames 0 and 1") + need(all(echelon_ok(f) for f in fr) and len(set(fr)) == len(fr), "E0: frame table not reduced echelon / repeats") + dim = [len(f) for f in fr] + start, final = c["start"], c["final"] + need(len(start) == len(final) == nreg, "E0: start / final") + ext = {r: f for r, f in c["ext"]} + for t in range(v): + need(fr[start[t]] == (ports[t],) and final[t] == 1, "E1: x start / final") + f = fr[final[v + t]] + need(start[v + t] == 0 and len(f) == h - 1 and all(par(u & ports[t]) == 0 for u in f), "E1: y start / final") + for r in range(2 * v, nreg): + need(start[r] == ext.get(r, 0) and final[r] == 1, "E1: slot start / final") + cls = lambda r: "x" if r < v else "y" if r < 2 * v else "s" + cur = list(start) + H = {"x": Counter(), "y": Counter(), "s": Counter(), "c": Counter()} + steps = set() + + def climb(r, f, where): + o = cur[r] + if o != f: + if (o, f) not in steps: + need(dim[o] < dim[f] and inside(fr[o], fr[f]), "E1: step not nested (%s, register %d)" % (where, r)) + steps.add((o, f)) + H[cls(r)][dim[f] - dim[o]] += 1 + cur[r] = f + okind = {("x", "s"), ("s", "s"), ("s", "y"), ("x", "y"), ("x", "x"), ("y", "y")} + ysum, piv, ytg = Counter(), set(), set() + inc = 0 + for ph, gates in (("A", c["A"]), ("B", c["B"])): + if ph == "B": # ---- E2: the scatter cut + need(sorted(k for k, _, _ in c["ret"]) == list(range(len(c["ret"]))), "E2: retained totals numbered 0..") + if "table" in c["scat"]: + need(len(c["scat"]["table"]) == v and all(0 <= k < len(c["ret"]) for row in c["scat"]["table"] for k, _, _ in row), + "E2: scatter table") + else: + need(len(c["ret"]) == h, "E2: one retained total per coordinate (star rule)") + for k, s, f in c["ret"]: + need(cls(s) == "s" and cur[s] == f, "E2: retained slot %d is not at its frame" % s) + H["c"][dim[f]] += 1 + need(all(cur[v + t] == 0 for t in range(v)), "E2: a y role left frame 0 before the scatter") + for i, g in enumerate(gates): + regs, pairs, _ = gate_regs(g) + need(all(0 <= r < nreg for r in regs) and len(set(regs)) == len(regs), "E3: registers of gate %s%d" % (ph, i)) + inc += len(regs) + for r in regs: + climb(r, g[1], "%s%d" % (ph, i)) + for t, s, co in pairs: + kd = (cls(s), cls(t)) + need(kd in okind, "E3: gate kind %s -> %s (gate %s%d)" % (kd + (ph, i))) + need(ph == "B" or kd in {("x", "s"), ("s", "s")}, "E3: bank gate before the scatter (gate A%d)" % i) + if kd == ("y", "y"): + ysum[s, t] += co + piv.add(s) + ytg.add(t) + need(ph == "B" or all(cls(r) != "y" for r in regs), "E2: y role named in phase A") + for r in range(nreg): + climb(r, final[r], "final") + need(not (piv & ytg), "E4: a pivot is the target of a gate reading y") + need(all(x == 0 for x in ysum.values()), "E4: y-reads of a (pivot, target) pair do not cancel") + Hs = {k: {str(r): n for r, n in sorted(w.items())} for k, w in H.items()} + need(Hs == c["blocks"], "E6: block histograms") + N = sum(r * n for w in H.values() for r, n in w.items()) + tails = sum(dim[f] for f in ext.values()) + need(N == c["N"] and N + tails == R * h + 2 * v * (h - 1) + c["cst"], "E6: N") + if stats is not None: + stats.update(steps=len(steps), incidences=inc, blocks=sum(sum(w.values()) for w in H.values()), + step_work=sum(dim[a] * dim[b] for a, b in steps), ysh_pairs=len(ysum)) + if scalar: + scal(c, stats) + q2(c) + return True + + +def scal(c, stats=None): + """E5: exact replay of the x-content of every register through A, scatter, B.""" + h, v, R = c["h"], c["v"], c["R"] + nreg = 2 * v + R + reg = [({r: Fr(1)} if r < v else {}) for r in range(nreg)] + den = {"x": 1, "y": 1, "s": 1} + mx = {"x": Fr(0), "y": Fr(0), "s": Fr(0)} + cls = lambda r: "x" if r < v else "y" if r < 2 * v else "s" + + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: + d[k] = w + kk = cls(t) + if w.denominator != 1: + den[kk] = lcm(den[kk], w.denominator) + if abs(w) > mx[kk]: + mx[kk] = abs(w) + else: + d.pop(k, None) + + def run(gates): + for g in gates: + if g[0] == "neg": + reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == "out": + src = dict(reg[g[2]]) + for t, a, b in g[3]: + axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: + axpy(g[2], reg[s], Fr(a, b)) + run(c["A"]) + tot = {k: dict(reg[s]) for k, s, _ in c["ret"]} + for t in range(v): + for k, co in scat_row(c, t): + axpy(v + t, tot[k], co) + run(c["B"]) + need(all(reg[t] == {t: 1} for t in range(v)), "E5: an x role is not restored (X3)") + need(all(reg[v + t] == {t: 1} for t in range(v)), "E5: a target does not receive exactly its source (hid)") + if stats is not None: + stats.update(den=dict(den), maxabs={k: str(x) for k, x in mx.items()}, + gates_A=len(c["A"]), gates_B=len(c["B"])) + + +def q2(c): + """E7 (only for files with exterior gauges, rule (2)): for every slot q that starts off the zero frame, the + column of q in the y rows of the product is zero (its dirt is removed in line, the derived dirt gate at + frame 0 does not touch it). Replay with the gauged slots as variables, x = 0.""" + h, v, R = c["h"], c["v"], c["R"] + ext = [r for r, _ in c["ext"]] + if not ext: + return True + reg = [dict() for _ in range(2 * v + R)] + for r in ext: + reg[r] = {r: Fr(1)} + + def axpy(t, src, co): + d = reg[t] + for k, u in src.items(): + w = d.get(k, 0) + co * u + if w: + d[k] = w + else: + d.pop(k, None) + + def run(gates): + for g in gates: + if g[0] == "neg": + reg[g[2]] = {k: -u for k, u in reg[g[2]].items()} + elif g[0] == "out": + src = dict(reg[g[2]]) + for t, a, b in g[3]: + axpy(t, src, Fr(a, b)) + else: + for s, a, b in g[3]: + axpy(g[2], reg[s], Fr(a, b)) + run(c["A"]) + tot = {k: dict(reg[s]) for k, s, _ in c["ret"]} + for t in range(v): + for k, co in scat_row(c, t): + if tot[k]: + axpy(v + t, tot[k], co) + run(c["B"]) + need(all(not reg[v + t] for t in range(v)), "E7: the dirt of an exterior-gauged slot reaches a y role (Q2)") + return True diff --git a/research/e8-far-nine-complex/complex/gx/gxcore.py b/research/e8-far-nine-complex/complex/gx/gxcore.py new file mode 100644 index 0000000000..3e3f0a3076 --- /dev/null +++ b/research/e8-far-nine-complex/complex/gx/gxcore.py @@ -0,0 +1,375 @@ +"""gxcore.py: gcert/1 JSON -> normal data D, PYTHON MIRROR of the two Lean checks +(label side: E0 frames, E1 pairs, E1/E2/E6 replay in segments; scalar side: E3 kinds, E4 bracket, E5 replay +in source batches, E7), derived data (distinct climbs, cut states, block histogram) and kernel sizes. +Own code; the reference is gx.py (check1), not imported. Python 3, standard library only.""" +import json, gzip +from collections import Counter +from math import gcd + + +class Reject(Exception): + pass + + +def need(c, msg): + if not c: + raise Reject(msg) + + +def load(path): + c = json.load(gzip.open(path, "rt") if path.endswith(".gz") else open(path)) + need(c.get("format") == "gcert/1", "E0: format is not gcert/1") + return c + + +def co(num, den): + need(den > 0, "E0: denominator") + return (num < 0, abs(num), den) + + +def normal(c): + """the Lean-facing data: gates as tuples, coefficients (neg, num, den), ret by total""" + def gate(g): + if g[0] == "out": + return ("out", g[1], g[2], [(t, co(a, b)) for t, a, b in g[3]], list(g[4])) + need(g[0] == "in", "E0: unknown gate kind %r" % (g[0],)) + return ("in", g[1], g[2], [(s, co(a, b)) for s, a, b in g[3]]) + ret = sorted(c["ret"]) + need([k for k, _, _ in ret] == list(range(len(ret))), "E2: retained totals numbered 0..") + sc = c["scat"] + scat = ("table", [[(k, co(a, b)) for k, a, b in row] for row in sc["table"]]) if "table" in sc else \ + ("star", co(*sc["inside"]), co(*sc["outside"])) + return dict(h=c["h"], v=c["v"], R=c["R"], N=c["N"], cst=c["cst"], ports=list(c["ports"]), + frames=[list(f) for f in c["frames"]], start=list(c["start"]), final=list(c["final"]), + ext=[tuple(e) for e in c.get("ext", [])], ret=[(s, f) for _, s, f in ret], scat=scat, + A=[gate(g) for g in c["A"]], B=[gate(g) for g in c["B"]], + blocks={k: {int(r): n for r, n in c["blocks"][k].items()} for k in "xysc"}) + + +def regs(g): + return [g[2]] + [t for t, _ in g[3]] + (g[4] if g[0] == "out" else []) + + +def adds(g): + """single adds (tgt, src, coef) in order""" + return [(t, g[2], k) for t, k in g[3]] if g[0] == "out" else [(g[2], s, k) for s, k in g[3]] + + +def reduce(u, basis): + for b in basis: + if u >> (b.bit_length() - 1) & 1: + u ^= b + return u + + +def echelon_ok(f): + piv = [b.bit_length() - 1 for b in f] + if any(b == 0 for b in f) or any(piv[i] <= piv[i + 1] for i in range(len(piv) - 1)): + return False + return all(not (b >> p & 1) for i, b in enumerate(f) for j, p in enumerate(piv) if i != j) + + +def par(x): + return bin(x).count("1") & 1 + + +def cls(D, r): + return "x" if r < D["v"] else "y" if r < 2 * D["v"] else "s" + + +# ---- label side ------------------------------------------------------------------------------------------ +def chk_frames(D): + """E0: ports; frame table reduced echelon, no repeats, zero first, full second""" + h, v, fr = D["h"], D["v"], D["frames"] + p = D["ports"] + need(len(p) == v == len(set(p)) and all(par(q) and 0 < q < 1 << h for q in p), "E0: ports") + need(len(fr) >= 2 and fr[0] == [] and fr[1] == [1 << i for i in range(h - 1, -1, -1)], "E0: frames 0 and 1") + need(all(echelon_ok(f) and all(b < 1 << h for b in f) for f in fr), "E0: frame table not reduced echelon") + need(len(set(map(tuple, fr))) == len(fr), "E0: frame table has repeats") + return [len(f) for f in fr] + + +def derive(D): + """distinct climbs in order of first use (NOT a check: plain replay of the frame ids)""" + cur, seen, pairs = list(D["start"]), set(), [] + + def go(r, f): + o = cur[r] + if o != f: + if (o, f) not in seen: + seen.add((o, f)) + pairs.append((o, f)) + cur[r] = f + for g in D["A"] + D["B"]: + for r in regs(g): + go(r, g[1]) + for r, f in enumerate(D["final"]): + go(r, f) + return pairs + + +def chk_pairs(D, dim, pairs): + """E1, level 2: every listed pair is a nested pair of the table; returns the mask-operation count""" + fr, n, work = D["frames"], len(D["frames"]), 0 + for a, b in pairs: + need(a < n and b < n and dim[a] < dim[b], "E1: pair (%d, %d) does not climb" % (a, b)) + need(all(reduce(u, fr[b]) == 0 for u in fr[a]), "E1: pair (%d, %d) is not nested" % (a, b)) + work += dim[a] * dim[b] + return work + + +def cut_points(D, gmax, wmax=210000): + """replay segments: each phase (A, B) is cut into k pieces of equal gate count, k = the least number with at + most `gmax` gates AND at most `wmax` work per piece on average (work = sum over gates of the dimension of the + gate's frame; measured at h = 22: about 1 ms of kernel time per unit, NOTES.md). + Cut points = gate counts in A ++ B (always 0, |A| and the end).""" + nA, nB = len(D["A"]), len(D["B"]) + cuts = [0] + for off, gs in ((0, D["A"]), (nA, D["B"])): + n = len(gs) + k = max(1, -(-n // gmax), -(-sum(len(D["frames"][g[1]]) for g in gs) // wmax)) + cuts += [off + (n * i) // k for i in range(1, k + 1)] + return sorted(set(cuts)) + + +def label_data(D, dim, cuts): + """for gx-labels (gcert-interface.md LABELS v1): ordered block ranks per replay segment, the final climbs as + gates without adds (same final frame, at most 32 registers, only registers that still climb), their ranks, + the largest number of registers named by one gate. Plain replay (the mirror has accepted the file).""" + cur, G = list(D["start"]), D["A"] + D["B"] + rs, most = [], 0 + for a, b in zip(cuts, cuts[1:]): + r = [] + for g in G[a:b]: + most = max(most, len(regs(g))) + for x in regs(g): + if cur[x] != g[1]: + r.append(dim[g[1]] - dim[cur[x]]) + cur[x] = g[1] + rs.append(r) + by = {} + for x, f in enumerate(D["final"]): + if cur[x] != f: + by.setdefault(f, []).append(x) + fins, rF = [], [] + for f in sorted(by): + for i in range(0, len(by[f]), 32): + xs = by[f][i:i + 32] + fins.append(("out", f, xs[0], [], xs[1:])) + rF += [dim[f] - dim[cur[x]] for x in xs] + return dict(rs=rs, fins=fins, rF=rF, most=max(most, 32 if fins else 0)) + + +def chk_replay(D, dim, pairs, cuts): + """E1 (labels), E2 (scatter cut), E6 (price), in the segments given by `cuts`. + Returns (states at the cuts, histogram by class, visits per segment).""" + h, v, R, fr = D["h"], D["v"], D["R"], D["frames"] + n = 2 * v + R + start, final, ext = D["start"], D["final"], dict(D["ext"]) + need(len(start) == len(final) == n, "E0: start / final") + for t in range(v): + need(fr[start[t]] == [D["ports"][t]] and final[t] == 1, "E1: x start / final") + f = fr[final[v + t]] + need(start[v + t] == 0 and len(f) == h - 1 and all(par(u & D["ports"][t]) == 0 for u in f), "E1: y start / final") + for r in range(2 * v, n): + need(start[r] == ext.get(r, 0) and final[r] == 1, "E1: slot start / final") + ok = set(pairs) + need(len(ok) == len(pairs), "E1: pair list has repeats") + cur = list(start) + H = {k: Counter() for k in "xysc"} + + def climb(r, f, where): + o = cur[r] + if o != f: + need((o, f) in ok, "E1: climb (%d, %d) is not a tested pair (%s, register %d)" % (o, f, where, r)) + H[cls(D, r)][dim[f] - dim[o]] += 1 + seg[dim[f] - dim[o]] += 1 + cur[r] = f + seg, segs = Counter(), [] + G, nA = D["A"] + D["B"], len(D["A"]) + states, visits = [], [] + need(cuts[0] == 0 and cuts[-1] == len(G) and cuts == sorted(cuts), "cut points") + for a, b in zip(cuts, cuts[1:]): + states.append(list(cur)) + vs = 0 + for i in range(a, b): + if i == nA: + scatter_cut(D, cur, dim, H, seg) + g = G[i] + rs = regs(g) + need(all(0 <= r < n for r in rs) and len(set(rs)) == len(rs), "E3: registers of gate %d" % i) + need(i >= nA or all(r < v or r >= 2 * v for r in rs), "E2: y role named in phase A (gate %d)" % i) + vs += len(rs) + for r in rs: + climb(r, g[1], "gate %d" % i) + visits.append(vs) + if b < len(G): + segs.append(seg) + seg = Counter() + if nA == len(G): + scatter_cut(D, cur, dim, H, seg) + states.append(list(cur)) + for r in range(n): + climb(r, final[r], "final") + segs.append(seg) + Hb = {k: dict(sorted(w.items())) for k, w in H.items()} + need(Hb == D["blocks"], "E6: block histogram differs from `blocks`") + N = sum(r * c for w in H.values() for r, c in w.items()) + need(N == D["N"] and N + sum(dim[f] for f in ext.values()) == R * h + 2 * v * (h - 1) + D["cst"], "E6: N") + need(sum(r * c for r, c in H["c"].items()) == D["cst"], "E6: cst") + return states, Hb, visits, [[w[r] for r in range(h + 1)] for w in segs] + + +def scatter_cut(D, cur, dim, H, seg): + v = D["v"] + if D["scat"][0] == "table": + need(len(D["scat"][1]) == v and all(k < len(D["ret"]) for row in D["scat"][1] for k, _ in row), "E2: scatter table") + else: + need(len(D["ret"]) == D["h"], "E2: one retained total per coordinate (star rule)") + for s, f in D["ret"]: + need(s >= 2 * v and cur[s] == f, "E2: retained slot %d is not at its frame" % s) + H["c"][dim[f]] += 1 + seg[dim[f]] += 1 + need(all(cur[v + t] == 0 for t in range(v)), "E2: a y role left frame 0 before the scatter") + + +# ---- scalar side ----------------------------------------------------------------------------------------- +SC = 6 # all scalar entries are kept as integers in units of 1/6 +KINDS = {("x", "s"), ("s", "s"), ("s", "y"), ("x", "y"), ("x", "x"), ("y", "y")} + + +def chk_shape(D): + """E3 kinds, E4 bracket""" + ysum, piv, ytg = Counter(), set(), set() + for ph in "AB": + for i, g in enumerate(D[ph]): + for t, s, (ng, a, b) in adds(g): + kd = (cls(D, s), cls(D, t)) + need(kd in KINDS and t != s, "E3: gate kind %s -> %s (gate %s%d)" % (kd + (ph, i))) + need(ph == "B" or kd in {("x", "s"), ("s", "s")}, "E3: bank gate before the scatter (gate A%d)" % i) + if kd == ("y", "y"): + need(SC % b == 0, "E4: denominator beyond sixths") + ysum[s, t] += (-a if ng else a) * (SC // b) + piv.add(s) + ytg.add(t) + need(not (piv & ytg), "E4: a pivot is the target of a gate reading y") + need(all(x == 0 for x in ysum.values()), "E4: y-reads of a (pivot, target) pair do not cancel") + return len(ysum) + + +def scat_row(D, t): + sc = D["scat"] + if sc[0] == "table": + return sc[1][t] + return [(k, sc[1] if D["ports"][t] >> k & 1 else sc[2]) for k in range(D["h"])] + + + +def replay(D, init, count=None): + """exact replay through A, scatter, B of sparse vectors with entries in sixths; `init` = register -> {key: 6}""" + v = D["v"] + reg = [dict(init.get(r, ())) for r in range(2 * v + D["R"])] + + def axpy(t, src, k): + ng, a, b = k + d = reg[t] + for key, u in src.items(): + w = u * a + need(w % b == 0, "E5: an entry needs a denominator beyond sixths (register %d)" % t) + w = w // b + w = d.get(key, 0) + (-w if ng else w) + if count is not None: + count[key] += 1 + if w: + d[key] = w + else: + d.pop(key, None) + + def run(gates): + for g in gates: + if g[0] == "out": + src = dict(reg[g[2]]) + for t, k in g[3]: + axpy(t, src, k) + else: + for s, k in g[3]: + axpy(g[2], reg[s], k) + run(D["A"]) + afterA = sum(len(d) for d in reg) + tot = [dict(reg[s]) for s, _ in D["ret"]] + for t in range(v): + for k, cf in scat_row(D, t): + if tot[k]: + axpy(v + t, tot[k], cf) + run(D["B"]) + return reg, afterA + + +def chk_scalar(D, batches=1): + """E5 (+ E7 when `ext` is non-empty). Returns stats: denominators and largest numerators per class in the + units of the spec (x halves, y sixths, slots integers), updates per source batch, entries after A.""" + v = D["v"] + count = Counter() + reg, afterA = replay(D, {t: {t: SC} for t in range(v)}, count) + need(all(reg[t] == {t: SC} for t in range(v)), "E5: an x role is not restored (X3)") + need(all(reg[v + t] == {t: SC} for t in range(v)), "E5: a target does not receive exactly its source (hid)") + if D["ext"]: + rg, _ = replay(D, {r: {r: SC} for r, _ in D["ext"]}) + need(all(not rg[v + t] for t in range(v)), "E7: the dirt of an exterior-gauged slot reaches a y role") + step = -(-v // batches) + per = [sum(count[k] for k in range(lo, min(lo + step, v))) for lo in range(0, v, step)] + return dict(updates=sum(count.values()), per_batch=per, afterA=afterA, + batches=[(lo, min(lo + step, v)) for lo in range(0, v, step)]) + + +def digits(D): + """largest |entry| met and denominators per class, by a second replay that watches every write (slow path + kept separate from the check): returns {class: (lcm of denominators, largest |numerator| in units 1/den)}""" + v = D["v"] + den = {"x": 1, "y": 1, "s": 1} + mx = {"x": 0, "y": 0, "s": 0} + reg = [({r: SC} if r < v else {}) for r in range(2 * v + D["R"])] + + def axpy(t, src, k): + ng, a, b = k + d, kk = reg[t], cls(D, t) + for key, u in src.items(): + w = d.get(key, 0) + (-(u * a // b) if ng else u * a // b) + if w: + d[key] = w + q = SC // gcd(w, SC) + if den[kk] % q: + den[kk] = den[kk] * q // gcd(den[kk], q) + if abs(w) > mx[kk]: + mx[kk] = abs(w) + else: + d.pop(key, None) + for g in D["A"]: + for t, s, k in adds(g): + axpy(t, reg[s], k) + tot = [dict(reg[s]) for s, _ in D["ret"]] + for t in range(v): + for k, cf in scat_row(D, t): + axpy(v + t, tot[k], cf) + for g in D["B"]: + for t, s, k in adds(g): + axpy(t, reg[s], k) + return {k: (den[k], mx[k] * den[k] // SC if (mx[k] * den[k]) % SC == 0 else "%d/6" % mx[k]) for k in "xys"} + + +def mirror(D, gmax=12000, batches=1, pairs=None, cuts=None): + """both checks; returns everything the generator and the dry run need""" + dim = chk_frames(D) + pairs = derive(D) if pairs is None else pairs + work = chk_pairs(D, dim, pairs) + cuts = cut_points(D, gmax) if cuts is None else cuts + states, H, visits, segH = chk_replay(D, dim, pairs, cuts) + ysh = chk_shape(D) + S = chk_scalar(D, batches) + hist = Counter() + for k in "xysc": + for r, n in H[k].items(): + hist[r] += n + return dict(dim=dim, pairs=pairs, pair_work=work, cuts=cuts, states=states, H=H, visits=visits, ysh=ysh, + scal=S, hist=dict(sorted(hist.items())), segH=segH, + lab=label_data(D, dim, cuts)) diff --git a/research/e8-far-nine-complex/data/bit/bitE8-kernel.json.gz b/research/e8-far-nine-complex/data/bit/bitE8-kernel.json.gz new file mode 100644 index 0000000000..22141be33d Binary files /dev/null and b/research/e8-far-nine-complex/data/bit/bitE8-kernel.json.gz differ diff --git a/research/e8-far-nine-complex/data/gcert1-e8-r783-far.json.gz b/research/e8-far-nine-complex/data/gcert1-e8-r783-far.json.gz new file mode 100644 index 0000000000..56708f99a4 Binary files /dev/null and b/research/e8-far-nine-complex/data/gcert1-e8-r783-far.json.gz differ diff --git a/research/e8-far-nine-complex/data/pr377/GLOBAL-REVIEW.json b/research/e8-far-nine-complex/data/pr377/GLOBAL-REVIEW.json new file mode 100644 index 0000000000..332f011f05 --- /dev/null +++ b/research/e8-far-nine-complex/data/pr377/GLOBAL-REVIEW.json @@ -0,0 +1,70 @@ +{ + "status": "PASS_NINE_STAGE_SOURCE_BOUND_TEMPLATE_OWNERS_PROFILE_AND_FINITE_INVOICE", + "m": 73, + "live": 14727, + "physical": 15520, + "invocations": 72, + "local_source_events": 1242936, + "paid_calls": 310455, + "rank_mass": 1072575, + "deficit": 2496, + "profile": { + "1": 157599, + "2": 43488, + "3": 37296, + "4": 10080, + "5": 15480, + "6": 23832, + "7": 3096, + "8": 7488, + "9": 576, + "16": 3840, + "32": 3840, + "48": 3840 + }, + "whole_residual_assignments": 56376, + "bank_padding_calls": 7047, + "bridge_additions": 17280, + "terminal_shift_calls": 3840, + "terminal_complete_stream_movements": 7680, + "work_lifetimes_freshly_revalidated": true, + "owner_injections": true, + "cover_route_bijections": "Explicit invertible right factors; roles sharing a bank have different disjoint block images, hence different right factors.", + "template_sha256": "fb51fe86a8299b4c5f3d03d90e8766e321d534f29fe4ab9d093fdfb8b9826a13", + "finite_invoice": { + "local_primitive_bound": 7040446135448, + "local_adapters": 271472, + "compiler": 25934336, + "scalar_primitives_all_invocations": 5057712, + "outside_adapter_bound": 1988400, + "pervertex": 558479956303543, + "group_bits": 2628, + "live_stock_bits": 2642, + "physical_stock_bits": 2642, + "logical_groups_bits": 2677, + "router_bits": 7984, + "literal_bits": 35284, + "required_C0_bits": 200012, + "G_exponent": 30000, + "E_exponent": 100000, + "C0_exponent": 210000, + "halving_degree": 2, + "halving_integer_inequality": [ + 5329, + 4608 + ], + "induction_gap_multiple_B": 49, + "physical_row_coefficient": 15445, + "retained_row_coefficient": 20161 + }, + "source_hashes": { + "/Users/chenzhihao/Documents/Codex/2026-10-11/integer-mult-joint-breakthrough/work/complex-nine-pr-audit/work/native358/vendor/complex-reserve/upstream/pr352/code/complex/code/complex_splice.py": "aaf46c8e5c68875b8315892e924e082b2f219f8d042dd14937e7cd2f72456dce", + "work/complex-nine-native/local-admission/UPSTREAM-GUARD.json": "9cc4b3819eda28a1fd1fa5e9913c36fd3041ec69608474a3be8b812945d69944", + "work/complex-nine-native/local-admission/INDEPENDENT-AUDIT.json": "2912f82f8cad02fd166f7c328e96a51451e8c960178b226173ace3338cf6a60c", + "work/complex-nine-native/CLIFFORD-REVIEW.json": "da4eb36041e4793a83500a5e3e40c15ded2dba0a1fcb1296ca977e5e6bc6063a", + "work/complex-nine-native/DATA-PHASES.json": "f621f6d4296cb215f334830356c5f79fe10d6d04d15b3ccda76ba0885ab67d0a" + }, + "seconds": 22.21225808293093, + "scope": "Finite source-bound global recipe, exact owner factors, paid histogram and conservative scalar/tape/precision/row invoice. Requires explicit mathematical integration of the compressed window lift and arbitrary-bank dirty composition; this is not a Lean proof or final multiplication exponent certificate.", + "cover_correction_calls": 14727 +} \ No newline at end of file diff --git a/research/e8-far-nine-complex/verify.sh b/research/e8-far-nine-complex/verify.sh new file mode 100755 index 0000000000..7a6ec7c956 --- /dev/null +++ b/research/e8-far-nine-complex/verify.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# One-command verification of research/e8-far-nine-complex. usage: bash verify.sh [--quick] /fresh/output/dir +# python3 >= 3.11, standard library only. --quick skips step 4 (regeneration of the certificate under #377's ledger). +set -euo pipefail +QUICK=0; if [ "${1:-}" = "--quick" ]; then QUICK=1; shift; fi +HERE=$(cd "$(dirname "$0")" && pwd); WD=$(mkdir -p "$1" && cd "$1" && pwd) +case "$WD" in "$HERE"*) echo "output dir must be outside the package"; exit 2;; esac +PY="${PYTHON:-python3} -I -B"; C=$HERE/code; GX=$HERE/complex/gx +ORIG=$HERE/complex/gcert1-e8-r783.json.gz; OURS=$HERE/data/gcert1-e8-r783-far.json.gz +G377=$HERE/data/pr377/GLOBAL-REVIEW.json; WORD=$HERE/data/bit/bitE8-kernel.json.gz + +echo "== 0. manifest"; (cd "$HERE" && $PY -c " +import hashlib,sys,os +bad=0;listed=set() +for line in open('MANIFEST.sha256'): + h,p=line.rstrip('\n').split(' ',1);listed.add(p) + if hashlib.sha256(open(p,'rb').read()).hexdigest()!=h: print('MISMATCH',p);bad+=1 +files={os.path.relpath(os.path.join(r,f)) for r,_,fs in os.walk('.') for f in fs if '__pycache__' not in r}-{'MANIFEST.sha256'} +if files-listed: print('UNLISTED',sorted(files-listed));bad+=1 +sys.exit(1 if bad else 0)") && echo " all files match MANIFEST.sha256" + +echo "== 1. pinned inputs (git blob ids)" +$PY -c " +import hashlib +def blob(p): + d=open(p,'rb').read();return hashlib.sha1(b'blob %d\0'%len(d)+d).hexdigest() +pins={'$ORIG':('0bd0bacf744f1c31419e05b834e34a92be77ae57','Sussman gcert1-e8-r783 (wht-power-saving-lean 9c94857; = #363/#365/#375/#378 vendored copy)'), + '$GX/gx.py':('6d14c0a976146eb881c1e3897b2476f8633d4e9c','Sussman tools/gx/gx.py'), + '$GX/gxcore.py':('3e3f0a3076f3c326e7833c74eceecb3436dd3185','Sussman tools/gx/gxcore.py'), + '$OURS':('56708f99a48c3f86bfcabfc526c2ff224bdba66a','PR #378 re-timed certificate gcert1-e8-r783-far (c248962)'), + '$G377':('332f011f05f1b433e184e207ddf2c724de735514','PR #377 receipt GLOBAL-REVIEW.json (jacklightChen, d0a620f)'), + '$WORD':('22141be33d588ed9495feaeedda7efe205a5f8d0','PR #382 E8 bit word bitE8-kernel (015f00b)')} +for p,(h,what) in pins.items(): + assert blob(p)==h,(p,blob(p));print(' ',h[:12],what) +assert hashlib.sha256(open('$ORIG','rb').read()).hexdigest()=='4b92f00fc7454b9b15e6d71a3b05062792eacca0a0ca4efee46f87827d57c8aa' +print(' Sussman certificate sha256 4b92f00f... = the E8 certificate pinned by #377 (its README and native358 sources)')" + +echo "== 2. complex certificates: Sussman's checkers, the source-span rule, and the full operator identity" +$PY $C/cxcheck.py $ORIG $GX +$PY $C/cxcheck.py $OURS $GX +$PY $C/cxop.py $ORIG $OURS +$PY -c " +import gzip,json +a=json.load(gzip.open('$ORIG'));b=json.load(gzip.open('$OURS')) +assert (a['h'],a['v'],a['R'],a['cst'],a['N'],a['ports'],a['start'],a['final'],a['ret'],a['scat'],a['ext'])==(b['h'],b['v'],b['R'],b['cst'],b['N'],b['ports'],b['start'],b['final'],b['ret'],b['scat'],b['ext']) +assert b['frames'][:len(a['frames'])]==a['frames'] +print(' same h, v, R, cst, N = %d, ports, start/final frames, retained totals, scatter table; frame table extended by %d frames'%(b['N'],len(b['frames'])-len(a['frames'])))" + +echo "== 3. #377's nine-stage profile, rebuilt from the certificate, with the swapped unit; bit c; PR #315 outer assembly" +$PY $C/nine.py $ORIG $OURS $G377 $WORD $WD/kappa.json +$PY -c " +import json;k=json.load(open('$WD/kappa.json')) +assert k['b']=='999632926176283/1000000000000000000' and k['kappa']=='998634656132003/1000000000000000000' and k['binding']=='complex' +assert k['max_child']==48 and k['halving_degree']==2 +print('PASS conditional kappa =',k['kappa'],'=',k['kappa_float'],'(complex-bound: #377 nine-stage component with the re-timed E8 unit; bit PR #382)')" + +if [ $QUICK = 0 ]; then + echo "== 4. regeneration: our search re-run from Sussman's original with #377's ledger (m = 73) reaches the shipped certificate" + $PY $C/far9.py $ORIG $GX $WD/regen-split.json.gz 120 > $WD/regen.txt + tail -2 $WD/regen.txt + $PY $C/cxfinal.py $WD/regen-split.json.gz $ORIG $WD/regen.json.gz + $PY -c " +import gzip;assert gzip.open('$WD/regen.json.gz').read()==gzip.open('$OURS').read();print(' regenerated certificate equals the shipped one (decompressed bytes): no further move of this family helps at m = 73')" +fi diff --git a/research/e8-kernel-bit-b3/LICENSE b/research/e8-kernel-bit-b3/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-kernel-bit-b3/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-kernel-bit-b3/MANIFEST.sha256 b/research/e8-kernel-bit-b3/MANIFEST.sha256 new file mode 100644 index 0000000000..df08149d21 --- /dev/null +++ b/research/e8-kernel-bit-b3/MANIFEST.sha256 @@ -0,0 +1,26 @@ +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE +da54f1e15ee7da323d2307aa047ae4cd009dd01f831121e44dbcf65af60c4e46 NOTICE.md +081314056d87e086669afeeb2f181053cf11d0694c904de60b12ceca9069f1f4 README.md +51908262576163a64815def96ff39b62aef3d52daaad9c561505c4293ff88e18 code/checkers/bits/stdc++.h +0c455ea497412fce02d2689c6e32cefa0b2a56c1624a1a1648900cd39b8f45fb code/checkers/columns_h.cpp +f96cb88097adf7112cf122008aecc795605b41c57e0cd019db2b5f91682d9b76 code/checkers/columns_k.cpp +aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63 code/checkers/json.hpp +07eb27106c8f43e4ffb6916facc2508035de51e4ce343fb6371fc35116889aeb code/checkers/legality_h.cpp +ec9923314e2245739fa68a2bd3a3d7309db7d21cf45e0dded72f555cb22bc453 code/controls.py +1cb286196c1530d06f50f0997febc5993b388f33464e295611b920ba30a24eeb code/e8core.py +aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098 code/engines/base_two_moment.py +81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482 code/engines/moment.py +c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c code/engines/outer.py +6d9817f7c431573aff695e1eacfa7c2ca6d3a2a10baa3a2ea814ab9b9f7b13ab code/export249.py +14b39d08ec5a9723195beb28b19c0d489458e47efe362460ccb826ae2c315f9b code/guard.py +1fe7818b492c68565286d8b35f7413093de88266e46a4b1ea468b55bb7b7b48b code/kappa.py +e650d16538db8d80495fda5109cdfa0775e1d5f3b56b0aa39e5c1efc660877e7 code/layout_bk.py +157f9d1cd0c3160a9fc4a2fd2a7460e03cd0473967da93c4b9a5f97bc53bbdfb code/nondeg.py +e37ccfdd0bf60a93fb0150d9810674b37409b161046fea268df87d6372e15f8a code/stages.py +d6ae4a556472d403773cd2117c992bfc10e1187112da1b3893f3fae628a131dd code/tile_m.py +947f6e1266f009c6c54647e0b348b1e2076bb584b54fae19016bc8086741876a data/final/bitE8-kernel.json.gz +1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55 data/input/bitE8-r865.json.gz +5ab0d754c01500879dd6c2a70322d08016e2917b3f5f84655923d383729411ad data/pr377/GLOBAL-REVIEW.json +9a05666d6a0607a599c683fc3d51d6fa1fc9eb8ea2c040d160cca565212e58a7 stages/kernel-selection.json +29cc4e68d8c8026e9652171656d8c5bf35ff4dc67ef1d03fd057162d1be6d78a stages/retime-selection.json +79f156d22a9163f244b4716c71e110259584988dc232c4a37a59abc3bfff5d58 verify.sh diff --git a/research/e8-kernel-bit-b3/NOTICE.md b/research/e8-kernel-bit-b3/NOTICE.md new file mode 100644 index 0000000000..1080cf4fe6 --- /dev/null +++ b/research/e8-kernel-bit-b3/NOTICE.md @@ -0,0 +1,18 @@ +# Notice + +Apache-2.0 (`LICENSE`). Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. + +- `data/input/bitE8-r865.json.gz`: utcorvusvolat-dotcom's (Dylan Crow) PR #370 E8 bit word, byte-identical (git blob 8bec1751) + to #370's and #373's `data/bit` (Apache-2.0). +- `data/pr377/GLOBAL-REVIEW.json`: jacklightChen's (Zhihao Chen) PR #377 receipt `research/nine-stage-complex-e8-validation/GLOBAL-REVIEW.json` + at `d0a620f`, byte-identical (git blob 332f011f), Apache-2.0. Only its `profile`, `m`, `live` and `deficit` fields are read. None of #377's scripts were run. +- `data/final/bitE8-kernel.json.gz`, `stages/*.json`: this package's stages and final word. +- `code/checkers/legality_h.cpp`, `columns_h.cpp`, `json.hpp`: PR #266's official cohort checkers, as vendored in our #312/#359 + packages. Only the copy count (NCOPY, default h) and the constants h, v and R are parameterised; `bits/stdc++.h` is a portability shim. + `columns_k.cpp` is our port of `columns_h.cpp` to the bridged word B_K. Its schedule and bridge tables are generated from DaysSky's #363 rule. + #373's `columns_k.cpp` was read as data for reference only. +- `code/engines/*`: PR #315's engines (DreamingOfClouds; eumemic; #144/#23 lineage), as vendored in our #329/#359 packages. +- `code/layout_bk.py`: our reimplementation of #363's B_K rule. `code/guard.py` evaluates #375's generalised guard form at the bit + parameters; it is our own code, and #375 was read as data. +- `code/e8core.py`, `stages.py`, `export249.py`, `nondeg.py`, `controls.py`, `tile_m.py`, `kappa.py`: our own code. `tile_m.py`'s `tile()` and + `economy_tile()` are verbatim from our #329 `bank_template.py`. diff --git a/research/e8-kernel-bit-b3/README.md b/research/e8-kernel-bit-b3/README.md new file mode 100644 index 0000000000..1b684db798 --- /dev/null +++ b/research/e8-kernel-bit-b3/README.md @@ -0,0 +1,90 @@ +κ = 9.98243154231047e-4 + +# A staged E8 bit word in the seven-stage bridged word B₃, paired with #377's nine-stage E8 complex component + +A conditional finite construction with **κ = 998243154231047/10¹⁸ ≈ 9.98243154231047 × 10⁻⁴**. It is complex-bound, at the cap of jacklightChen's #377 complex component. + +The bit side is utcorvusvolat-dotcom's #370 E8 bit word with two of our transcript stages: retiming and a shared-donor response kernel. It runs in DaysSky's B₃ (#363/#373). The idle climbs are unsplit, at halving degree two (#375's guard). + +| side | supplier | layout | coarse saving | +| --- | --- | --- | ---: | +| bit | **#370's word + our retime (44 gates) + kernel (171 entries, entrance rank 320)** | B₃ unsplit: m = 56, max child 34, halving degree 2, deficit 216 | c = 251726760077483/(2.5·10¹⁷) ≈ 1.006907e-3 | +| complex | #377 nine-stage E8 component (its claim; re-certified from its profile) | m = 73, W = 14,727, deficit 2,496, halving degree 2 | b = 999240641319551/10¹⁸ ≈ 9.99241e-4 | + +The bit side exceeds b, so the complex side binds. All 47 constraints of `outer.assembly` hold, and the adjacent 10⁻¹⁸ κ is rejected. + +**Without the bit-side halving-degree-two admission** (B₃ split at 27, degree 1, as #373) the same word gives +**κ = 245546943425791/(2.5·10¹⁷) ≈ 9.82187773703164e-4**, bit-bound. That result needs no new admission. + +| bit word with #377's b | B₃ split (degree 1) | B₃ unsplit (degree 2) | +| --- | ---: | ---: | +| #370 / #373 | c 9.68198e-4 → κ 9.67261e-4 | c 9.91226e-4 → κ 9.90245e-4 | +| **this word** | c 9.83153e-4 → **κ 9.82188e-4** | c 1.006907e-3 → **κ 9.98243e-4** (complex-bound) | + +## The bit word + +The stages are those of our #329/#359 stack, ported to the E8 frames, which are root-spanned subspaces of Q⁸ under the positive definite form ⟨x,y⟩ = x·y/2. Each stage is applied from a frozen selection bound to its exact input word, and the full exact replay runs after each one (`code/stages.py`). + +1. **Retiming** (#287/#291/#299 descent lineage). 44 gates of #370's word move to new frames inside their feasible intervals. A gate's interval runs from the join of its source spans and its participants' previous frames to the meet of their next frames. +2. **Shared-donor response kernel** (#272/#299/#319/#320/#329 lineage). + - **Response.** resp(h) is the set of targets whose frame-0 completion reads read helper h. An entry is a pivot p, an entrance E (inside the first frame of p and of every donor), and donors D with resp(p) = ⊕ resp(D) over F₂. + - **Pivot.** p starts at E and loses its completion reads. + - **Donors.** Each donor climbs to E at the start of A and adds its pivots there. After C it adds them again at FULL (over F₂ this subtracts them). + - **Selection.** 171 entries with entrance ranks 1/2/4 and total rank 320 (= 0 mod 40), using 97 donor slots. Pivots are never donors, and a donor serves one entrance. +3. **Residuals.** The residual census is {8: 694, 7: 120, 6: 2, 4: 49}. It tiles exactly into width-56 banks with 7 replicas (825 banks), and into width-40 banks with 1 replica. + +## Verify + + bash research/e8-kernel-bit-b3/verify.sh --quick /tmp/e8b-q + bash research/e8-kernel-bit-b3/verify.sh /tmp/e8b-full + +The checks need Python 3.11+ (standard library), a C++17 compiler and Boost headers. + +0. `MANIFEST.sha256`. +1. Pinned inputs by git blob id: #370's word (= #373's `data/bit`) and #377's `GLOBAL-REVIEW.json`. In full mode, our engine also reproduces #370's c, κ(b₂) and κ(b₃). +2. The two stages from the frozen selections, each followed by our exact replay: + - legality: nested root-spanned frames, common gate frames, completion reads at frame 0, y at frame 0 at the scatter, the 9 retained totals at FULL, and the final frames; + - F₂ on all 1,105 columns, dirty helpers included; + - the integer source-span rule. + + The rebuilt word must equal the shipped one. Five mutation controls are rejected. +3. Labels and frames, then the official checkers: + - the 120 E8 root lines, and exact Gram determinants > 0 on all 945 frames (prime 2 only); + - our own export to PR249 records, and PR #266's official cohort legality at h = 8 with NCOPY = 9; + - the unmodified copy count NCOPY = 8 is rejected; + - **our port of #266's five-stage columns checker to B_K** (`columns_k.cpp`). At K = 2 it reproduces the #266 receipt field for field, except the original's h = 20 literal `fresh_center_copies`. At K = 3 it checks all **1,585 physical columns over F₂ through 7 invocations, 12 twin bridges and the terminal exchange**, and the 12 omitted-bridge controls are rejected. + + The columns check simulates invocations and bridges. It does not depend on how the idle climbs are split, so it covers the split and unsplit layouts alike. +4. The layout and the guard: + - our B_K layout reimplementation (#363's rule): B₂ gives (2h+2 | 2h−2, h−1, 4), and B₃ gives #373's [34] | [14, 7, 20] | [28, 7, 6]; + - the exact bank tilings; + - **the halving-degree guard at the bit parameters** (`code/guard.py`, #375's form). Unsplit: m = 56, max child 34, least t = 2 (56² = 3,136 > 2·34² = 2,312), stock 1,551 bits, row coefficient 2·1551 + 9909 + 252 = **13,263 < 20,161**, induction gap 43·B, m ≤ 72. Split: t = 1, row 11,712, gap 57·B. +5. #377's b is re-certified by our two rational engines from its own profile (m 73, W 14,727, deficit 2,496). Then the bit c (split and unsplit) and #315's outer assembly. + +## Admitted conditions and open obligations + +- **Bit-side halving degree two** (unsplit B₃ idle climbs, max child 34 of 56). It is admitted under #375's generalised finite-bridge guard and #375's own precedent list: + - #144's integration review: degree 4, row 4·2571 + 9909 + 252; + - the copied-centres assembly: degrees 9 and 20, with D_j(e) = t_j⌈log₂ e⌉; + - PR234 on the bit side: "the proper child ratio 5/6 requires halving degree four". + + Step 4 gives the exact guard numbers at the bit parameters. Without this admission the result is the split κ ≈ 9.82188e-4. +- **#377's b is #377's claim.** That includes its m = 73 setting, which is beyond #375's m ≤ 72 cover bound, its compressed window lift, its padding and its finite invoice. It is re-certified here only from its profile, with our engines. #377's own checks are not re-run. +- **No Lean proof** of B₃, or of this bit word or its stages. +- **#373's PR234-style port geometry on 7 blocks and its finite bill at m = 56** are not re-run on this word. The ports and their isometries are #370's, and only helpers change. The kernel entrances (σ > 0 for 171 helpers) need the entrance completion P_σ + (I − P_E) of our #329 lineage, which is not re-proved here for the E8 family. +- **Everything #370 admits:** 9 retained totals at h = 8, PR234's banks for a non-paired-cube family, and the inherited bit interfaces. +- This is a conditional finite construction, not a formal verification of the multiplication theorem. + +## Credits + +- **utcorvusvolat-dotcom (#370):** the E8 bit word, its format and the generalized bit checkers this package mirrors. +- **jacklightChen (#377):** the nine-stage E8 complex component. +- **DaysSky (#363, #373, #375):** B_K, the seven-stage bit construction and the halving-degree-two guard. +- **Jacob Sussman:** the E8 family, the bridged five-stage word and the stage geometry. +- **Our stage lineage:** + - retiming: #287/#291/#299, via our #329/#359; + - the shared-donor kernel: #272/#299/#319/#320, via our #329/#359; + - PR #266's official checkers (ported); + - PR #315's engines and outer assembly (DreamingOfClouds). + +Prepared by Chafik Boukhalfa (chafreaky) with substantial Anthropic Claude assistance. Apache-2.0 (`LICENSE`). See `NOTICE.md`. diff --git a/research/e8-kernel-bit-b3/code/checkers/bits/stdc++.h b/research/e8-kernel-bit-b3/code/checkers/bits/stdc++.h new file mode 100644 index 0000000000..09fc11939d --- /dev/null +++ b/research/e8-kernel-bit-b3/code/checkers/bits/stdc++.h @@ -0,0 +1,11 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/research/e8-kernel-bit-b3/code/checkers/columns_h.cpp b/research/e8-kernel-bit-b3/code/checkers/columns_h.cpp new file mode 100644 index 0000000000..b6173ec570 --- /dev/null +++ b/research/e8-kernel-bit-b3/code/checkers/columns_h.cpp @@ -0,0 +1,45 @@ +#ifndef NCOPY +#define NCOPY HDIM +#endif +#include "json.hpp" +#include +#include +using boost::multiprecision::cpp_int; +#include +#include +#include +#include +#include +#include +#include +using J=nlohmann::json; +struct E{int kind,dst,src,c;}; +void need(bool x,const char*s){if(!x)throw std::runtime_error(s);} +int main(int argc,char**argv){try{ +need(argc==3,"usage RAW6_RECORDS OUTPUT");std::string pre=argv[1];int v=VPORTS,r=RHELP,loc=2*v+r,global=4*v+r,temp=global; +struct Raw{int op,a,b,c,f,z;};std::ifstream f(pre,std::ios::binary|std::ios::ate);size_t sz=f.tellg();need(sz%sizeof(Raw)==0,"stream alignment");std::vectorp(sz/sizeof(Raw));f.seekg(0);f.read((char*)p.data(),sz);std::vectore;std::mapH;for(auto q:p){if(q.op==0){if(q.f)H[q.f]++;}else if(q.op==1)e.push_back({0,q.a,q.b,q.c});else if(q.op==2){H[q.z]++;e.push_back({1,loc,q.a,0});}else if(q.op==3)e.push_back({2,loc,q.a,0});else need(false,"opcode");} +J prefix=J::array();cpp_int largestF=0,largestB=0;for(int rev=0;rev<2;rev++){std::vectornorms(loc+1,1);cpp_int maxrow=1;bool isopen=false;for(size_t z=0;zmaxrow)maxrow=norms[q.dst];}else if(k==1){need(!isopen,"boundcopy");norms[loc]=norms[q.src];isopen=true;}else {need(isopen,"bounderase");norms[loc]=0;isopen=false;}}need(!isopen,"prefix copy closure");if(rev)largestB=maxrow;else largestF=maxrow;prefix.push_back({{"reverse",bool(rev)},{"cancellation_free_signed_row_l1_upper",maxrow.convert_to()},{"bits",boost::multiprecision::msb(maxrow)+1}});} +cpp_int payload=64*largestF*largestF*largestF*largestB*largestB;need(payload<(cpp_int(1)<<104),"payloadfiniteprefix2^104"); +long long copies=0,adds=0,odd=0;bool open=false;int center=-1;long long reverseCopies=0; +for(auto q:e){need(q.kind>=0&&q.kind<=2,"kind");need(q.dst>=0&&q.dst<=loc,"local dst");if(q.kind==0){need(q.src>=0&&q.src<=loc&&q.dst!=q.src,"source distinct");need(q.dst!=loc,"copy immutable");need(q.src!=loc||open,"temp not open");if(open)need(q.dst!=center,"source changes inside copied-center block");adds++;odd+=q.c&1;} +else if(q.kind==1){need(!open&&q.dst==loc&&q.src>=0&&q.srca((size_t)(global+1)*words);auto row=[&](int i){return a.data()+(size_t)i*words;};for(int i=0;i=v&&i<2*v&&w==(size_t)(i-v)/64)want^=1ull<<((i-v)%64);need(x[w]==want,"local defining-decoder full formal column");}}} +if(stage==1||stage==2||stage==4){int b=stage==1?0:stage==2?1:2;for(auto q:bridges[b])for(int i=0;i(std::chrono::steady_clock::now()-t0).count()<<"s\n";} +for(int bank=0;bank<4;bank+=2)for(int i=0;i()},{"payload_prefix_bits",boost::multiprecision::msb(payload)+1},{"new_Q_categories",{28,29}},{"local_raw_H",H},{"negative_controls",controls},{"seconds",std::chrono::duration(std::chrono::steady_clock::now()-t0).count()}};std::ofstream(argv[2])< +#include +using boost::multiprecision::cpp_int; +#include +#include +#include +#include +#include +#include +#include +using J=nlohmann::json; +struct E{int kind,dst,src,c;}; +void need(bool x,const char*s){if(!x)throw std::runtime_error(s);} +int main(int argc,char**argv){try{ +need(argc==3,"usage RAW6_RECORDS OUTPUT");std::string pre=argv[1];int v=VPORTS,r=RHELP,loc=2*v+r,global=2*KPAIRS*v+r,temp=global; +struct Raw{int op,a,b,c,f,z;};std::ifstream f(pre,std::ios::binary|std::ios::ate);size_t sz=f.tellg();need(sz%sizeof(Raw)==0,"stream alignment");std::vectorp(sz/sizeof(Raw));f.seekg(0);f.read((char*)p.data(),sz);std::vectore;std::mapH;for(auto q:p){if(q.op==0){if(q.f)H[q.f]++;}else if(q.op==1)e.push_back({0,q.a,q.b,q.c});else if(q.op==2){H[q.z]++;e.push_back({1,loc,q.a,0});}else if(q.op==3)e.push_back({2,loc,q.a,0});else need(false,"opcode");} +J prefix=J::array();cpp_int largestF=0,largestB=0;for(int rev=0;rev<2;rev++){std::vectornorms(loc+1,1);cpp_int maxrow=1;bool isopen=false;for(size_t z=0;zmaxrow)maxrow=norms[q.dst];}else if(k==1){need(!isopen,"boundcopy");norms[loc]=norms[q.src];isopen=true;}else {need(isopen,"bounderase");norms[loc]=0;isopen=false;}}need(!isopen,"prefix copy closure");if(rev)largestB=maxrow;else largestF=maxrow;prefix.push_back({{"reverse",bool(rev)},{"cancellation_free_signed_row_l1_upper",maxrow.convert_to()},{"bits",boost::multiprecision::msb(maxrow)+1}});} +cpp_int payload=64*largestF*largestF*largestF*largestB*largestB;need(payload<(cpp_int(1)<<104),"payloadfiniteprefix2^104"); +long long copies=0,adds=0,odd=0;bool open=false;int center=-1;long long reverseCopies=0; +for(auto q:e){need(q.kind>=0&&q.kind<=2,"kind");need(q.dst>=0&&q.dst<=loc,"local dst");if(q.kind==0){need(q.src>=0&&q.src<=loc&&q.dst!=q.src,"source distinct");need(q.dst!=loc,"copy immutable");need(q.src!=loc||open,"temp not open");if(open)need(q.dst!=center,"source changes inside copied-center block");adds++;odd+=q.c&1;} +else if(q.kind==1){need(!open&&q.dst==loc&&q.src>=0&&q.src>active;std::vectorbackward;std::vector>>after(S); +for(int t=0;t=3&&t%2==1);backward.push_back(b);active.push_back(b?std::array{Y(p),X(p)}:std::array{X(p),Y(p)});} +for(int q=2;q<=KPAIRS;q++){after[2*q-3].push_back({X(q-1),X(q),1});after[2*q-3].push_back({Y(q),Y(q-1),-1});after[2*q-2].push_back({Y(q),Y(q-1),1});after[2*q-2].push_back({X(q-1),X(q),-1});} +for(int p=KPAIRS;p>=2;p--){after[S-1].push_back({Y(p-1),Y(p),-1});after[S-1].push_back({X(p),X(p-1),1});} +int nbridges=0;for(auto&z:after)nbridges+=z.size();need(nbridges==6*(KPAIRS-1),"twin bridge count"); +size_t words=(global+63)/64;std::vectora((size_t)(global+1)*words);auto row=[&](int i){return a.data()+(size_t)i*words;};for(int i=0;i=v&&i<2*v&&w==(size_t)(i-v)/64)want^=1ull<<((i-v)%64);need(x[w]==want,"local defining-decoder full formal column");}}} +for(auto q:after[stage])for(int i=0;i(std::chrono::steady_clock::now()-t0).count()<<"s\n";} +for(int bank=0;bank<2*KPAIRS;bank+=2)for(int i=0;ib(2*KPAIRS);for(int z=0;z<2*KPAIRS;z++)b[z]=1u<()},{"payload_prefix_bits",boost::multiprecision::msb(payload)+1},{"new_Q_categories",{28,29}},{"local_raw_H",H},{"negative_controls",controls},{"seconds",std::chrono::duration(std::chrono::steady_clock::now()-t0).count()}};std::ofstream(argv[2])< +// SPDX-License-Identifier: MIT + +/****************************************************************************\ + * Note on documentation: The source files contain links to the online * + * documentation of the public API at https://json.nlohmann.me. This URL * + * contains the most recent documentation and should also be applicable to * + * previous versions; documentation for deprecated functions is not * + * removed, but marked deprecated. See "Generate documentation" section in * + * file docs/README.md. * +\****************************************************************************/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#ifndef JSON_NO_IO + #include // istream, ostream +#endif // JSON_NO_IO +#include // random_access_iterator_tag +#include // unique_ptr +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// This file contains all macro definitions affecting or depending on the ABI + +#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK + #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) + #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 + #warning "Already included a different version of the library!" + #endif + #endif +#endif + +#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_MINOR 12 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_PATCH 0 // NOLINT(modernize-macro-to-enum) + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + +#ifndef JSON_DIAGNOSTIC_POSITIONS + #define JSON_DIAGNOSTIC_POSITIONS 0 +#endif + +#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 +#endif + +#if JSON_DIAGNOSTICS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS +#endif + +#if JSON_DIAGNOSTIC_POSITIONS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS _dp +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS +#endif + +#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp +#else + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION + #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 +#endif + +// Construct the namespace ABI tags component +#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c +#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \ + NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) + +#define NLOHMANN_JSON_ABI_TAGS \ + NLOHMANN_JSON_ABI_TAGS_CONCAT( \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ + NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS) + +// Construct the namespace version component +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ + _v ## major ## _ ## minor ## _ ## patch +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) + +#if NLOHMANN_JSON_NAMESPACE_NO_VERSION +#define NLOHMANN_JSON_NAMESPACE_VERSION +#else +#define NLOHMANN_JSON_NAMESPACE_VERSION \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \ + NLOHMANN_JSON_VERSION_MINOR, \ + NLOHMANN_JSON_VERSION_PATCH) +#endif + +// Combine namespace components +#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b +#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \ + NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) + +#ifndef NLOHMANN_JSON_NAMESPACE +#define NLOHMANN_JSON_NAMESPACE \ + nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN +#define NLOHMANN_JSON_NAMESPACE_BEGIN \ + namespace nlohmann \ + { \ + inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) \ + { +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_END +#define NLOHMANN_JSON_NAMESPACE_END \ + } /* namespace (inline namespace) NOLINT(readability/namespace) */ \ + } // namespace nlohmann +#endif + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // nullptr_t +#include // exception +#if JSON_DIAGNOSTICS + #include // accumulate +#endif +#include // runtime_error +#include // to_string +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // declval, pair +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +// https://en.cppreference.com/w/cpp/experimental/is_detected +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +struct is_detected_lazy : is_detected { }; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + + +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-FileCopyrightText: 2016 - 2021 Evan Nemerson +// SPDX-License-Identifier: MIT + +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 15 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(JSON_HEDLEY_MSVC_VERSION) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #undef JSON_HEDLEY_INTEL_CL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) + #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #undef JSON_HEDLEY_MCST_LCC_VERSION +#endif +#if defined(__LCC__) && defined(__LCC_MINOR__) + #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK) + #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_CRAY_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) && \ + !defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if \ + defined(__has_attribute) && \ + ( \ + (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ + ) +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunused-function") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#else + #define JSON_HEDLEY_FLAGS +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if \ + (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions (except those affecting ABI) +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// #include + + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +// if the user manually specified the used c++ version this is skipped +#if !defined(JSON_HAS_CPP_23) && !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11) + #if (defined(__cplusplus) && __cplusplus > 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG > 202002L) + #define JSON_HAS_CPP_23 + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201703L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201402L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201103L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 + #endif + // the cpp 11 flag is always specified because it is the minimal required version + #define JSON_HAS_CPP_11 +#endif + +#ifdef __has_include + #if __has_include() + #include + #endif +#endif + +#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM) + #ifdef JSON_HAS_CPP_17 + #if defined(__cpp_lib_filesystem) + #define JSON_HAS_FILESYSTEM 1 + #elif defined(__cpp_lib_experimental_filesystem) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif !defined(__has_include) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #endif + + // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/ + #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__clang_major__) && __clang_major__ < 7 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support + #if defined(_MSC_VER) && _MSC_VER < 1914 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before iOS 13 + #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before macOS Catalina + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + #endif +#endif + +#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_FILESYSTEM + #define JSON_HAS_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_THREE_WAY_COMPARISON + #if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L \ + && defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L + #define JSON_HAS_THREE_WAY_COMPARISON 1 + #else + #define JSON_HAS_THREE_WAY_COMPARISON 0 + #endif +#endif + +#ifndef JSON_HAS_RANGES + // ranges header shipping in GCC 11.1.0 (released 2021-04-27) has syntax error + #if defined(__GLIBCXX__) && __GLIBCXX__ == 20210427 + #define JSON_HAS_RANGES 0 + #elif defined(__cpp_lib_ranges) + #define JSON_HAS_RANGES 1 + #else + #define JSON_HAS_RANGES 0 + #endif +#endif + +#ifndef JSON_HAS_STATIC_RTTI + #if !defined(_HAS_STATIC_RTTI) || _HAS_STATIC_RTTI != 0 + #define JSON_HAS_STATIC_RTTI 1 + #else + #define JSON_HAS_STATIC_RTTI 0 + #endif +#endif + +#ifdef JSON_HAS_CPP_17 + #define JSON_INLINE_VARIABLE inline +#else + #define JSON_INLINE_VARIABLE +#endif + +#if JSON_HEDLEY_HAS_ATTRIBUTE(no_unique_address) + #define JSON_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else + #define JSON_NO_UNIQUE_ADDRESS +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wdocumentation-unknown-command" +#endif + +// allow disabling exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow overriding assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +// allow to access some private functions (needed by the test suite) +#if defined(JSON_TESTS_PRIVATE) + #define JSON_PRIVATE_UNLESS_TESTED public +#else + #define JSON_PRIVATE_UNLESS_TESTED private +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + /* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + /* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on */ \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + /* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + /* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on */ \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType, \ + class CustomBaseClass> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); +#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = !nlohmann_json_j.is_null() ? nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1) : nlohmann_json_default_obj.v1; + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT +@since version 3.11.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE +@since version 3.11.3 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT +@since version 3.11.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE +@since version 3.11.3 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +// inspired from https://stackoverflow.com/a/26745591 +// allows calling any std function as if (e.g., with begin): +// using std::begin; begin(x); +// +// it allows using the detected idiom to retrieve the return type +// of such an expression +#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \ + namespace detail { \ + using std::std_name; \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + } \ + \ + namespace detail2 { \ + struct std_name##_tag \ + { \ + }; \ + \ + template \ + std_name##_tag std_name(T&&...); \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + \ + template \ + struct would_call_std_##std_name \ + { \ + static constexpr auto const value = ::nlohmann::detail:: \ + is_detected_exact::value; \ + }; \ + } /* namespace detail2 */ \ + \ + template \ + struct would_call_std_##std_name : detail2::would_call_std_##std_name \ + { \ + } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + +#ifndef JSON_DISABLE_ENUM_SERIALIZATION + #define JSON_DISABLE_ENUM_SERIALIZATION 0 +#endif + +#ifndef JSON_USE_GLOBAL_UDLS + #define JSON_USE_GLOBAL_UDLS 1 +#endif + +#if JSON_HAS_THREE_WAY_COMPARISON + #include // partial_ordering +#endif + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +#if JSON_HAS_THREE_WAY_COMPARISON + inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* +#else + inline bool operator<(const value_t lhs, const value_t rhs) noexcept +#endif +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); +#if JSON_HAS_THREE_WAY_COMPARISON + if (l_index < order.size() && r_index < order.size()) + { + return order[l_index] <=> order[r_index]; // *NOPAD* + } + return std::partial_ordering::unordered; +#else + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +#endif +} + +// GCC selects the built-in operator< over an operator rewritten from +// a user-defined spaceship operator +// Clang, MSVC, and ICC select the rewritten candidate +// (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) +#if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + return std::is_lt(lhs <=> rhs); // *NOPAD* +} +#endif + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief replace all occurrences of a substring by another string + +@param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t +@param[in] f the substring to replace with @a t +@param[in] t the string to replace @a f + +@pre The search string @a f must not be empty. **This precondition is +enforced with an assertion.** + +@since version 2.0.0 +*/ +template +inline void replace_substring(StringType& s, const StringType& f, + const StringType& t) +{ + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != StringType::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +/*! + * @brief string escaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to escape + * @return escaped string + * + * Note the order of escaping "~" to "~0" and "/" to "~1" is important. + */ +template +inline StringType escape(StringType s) +{ + replace_substring(s, StringType{"~"}, StringType{"~0"}); + replace_substring(s, StringType{"/"}, StringType{"~1"}); + return s; +} + +/*! + * @brief string unescaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to unescape + * @return unescaped string + * + * Note the order of escaping "~1" to "/" and "~0" to "~" is important. + */ +template +static void unescape(StringType& s) +{ + replace_substring(s, StringType{"~1"}, StringType{"/"}); + replace_substring(s, StringType{"~0"}, StringType{"~"}); +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // size_t + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-FileCopyrightText: 2018 The Abseil Authors +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // index_sequence, make_index_sequence, index_sequence_for + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +using uncvref_t = typename std::remove_cv::type>::type; + +#ifdef JSON_HAS_CPP_14 + +// the following utilities are natively available in C++14 +using std::enable_if_t; +using std::index_sequence; +using std::make_index_sequence; +using std::index_sequence_for; + +#else + +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +// The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h +// which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. + +//// START OF CODE FROM GOOGLE ABSEIL + +// integer_sequence +// +// Class template representing a compile-time integer sequence. An instantiation +// of `integer_sequence` has a sequence of integers encoded in its +// type through its template arguments (which is a common need when +// working with C++11 variadic templates). `absl::integer_sequence` is designed +// to be a drop-in replacement for C++14's `std::integer_sequence`. +// +// Example: +// +// template< class T, T... Ints > +// void user_function(integer_sequence); +// +// int main() +// { +// // user_function's `T` will be deduced to `int` and `Ints...` +// // will be deduced to `0, 1, 2, 3, 4`. +// user_function(make_integer_sequence()); +// } +template +struct integer_sequence +{ + using value_type = T; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +// index_sequence +// +// A helper template for an `integer_sequence` of `size_t`, +// `absl::index_sequence` is designed to be a drop-in replacement for C++14's +// `std::index_sequence`. +template +using index_sequence = integer_sequence; + +namespace utility_internal +{ + +template +struct Extend; + +// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. +template +struct Extend, SeqSize, 0> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; +}; + +template +struct Extend, SeqSize, 1> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; +}; + +// Recursion helper for 'make_integer_sequence'. +// 'Gen::type' is an alias for 'integer_sequence'. +template +struct Gen +{ + using type = + typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; +}; + +template +struct Gen +{ + using type = integer_sequence; +}; + +} // namespace utility_internal + +// Compile-time sequences of integers + +// make_integer_sequence +// +// This template alias is equivalent to +// `integer_sequence`, and is designed to be a drop-in +// replacement for C++14's `std::make_integer_sequence`. +template +using make_integer_sequence = typename utility_internal::Gen::type; + +// make_index_sequence +// +// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, +// and is designed to be a drop-in replacement for C++14's +// `std::make_index_sequence`. +template +using make_index_sequence = make_integer_sequence; + +// index_sequence_for +// +// Converts a typename pack into an index sequence of the same length, and +// is designed to be a drop-in replacement for C++14's +// `std::index_sequence_for()` +template +using index_sequence_for = make_index_sequence; + +//// END OF CODE FROM GOOGLE ABSEIL + +#endif + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static JSON_INLINE_VARIABLE constexpr T value{}; +}; + +#ifndef JSON_HAS_CPP_17 + template + constexpr T static_const::value; +#endif + +template +constexpr std::array make_array(Args&& ... args) +{ + return std::array {{static_cast(std::forward(args))...}}; +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // numeric_limits +#include // char_traits +#include // tuple +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // random_access_iterator_tag + +// #include + +// #include + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); + +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); + +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ + #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + #include // int64_t, uint64_t + #include // map + #include // allocator + #include // string + #include // vector + + // #include + + + /*! + @brief namespace for Niels Lohmann + @see https://github.com/nlohmann + @since version 1.0.0 + */ + NLOHMANN_JSON_NAMESPACE_BEGIN + + /*! + @brief default JSONSerializer template argument + + This serializer ignores the template arguments and uses ADL + ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) + for serialization. + */ + template + struct adl_serializer; + + /// a class to store JSON values + /// @sa https://json.nlohmann.me/api/basic_json/ + template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector, // cppcheck-suppress syntaxError + class CustomBaseClass = void> + class basic_json; + + /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document + /// @sa https://json.nlohmann.me/api/json_pointer/ + template + class json_pointer; + + /*! + @brief default specialization + @sa https://json.nlohmann.me/api/json/ + */ + using json = basic_json<>; + + /// @brief a minimal map-like container that preserves insertion order + /// @sa https://json.nlohmann.me/api/ordered_map/ + template + struct ordered_map; + + /// @brief specialization that maintains the insertion order of object keys + /// @sa https://json.nlohmann.me/api/ordered_json/ + using ordered_json = basic_json; + + NLOHMANN_JSON_NAMESPACE_END + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +NLOHMANN_JSON_NAMESPACE_BEGIN +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ + +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +// used by exceptions create() member functions +// true_type for pointer to possibly cv-qualified basic_json or std::nullptr_t +// false_type otherwise +template +struct is_basic_json_context : + std::integral_constant < bool, + is_basic_json::type>::type>::value + || std::is_same::value > +{}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +template +using detect_key_compare = typename T::key_compare; + +template +struct has_key_compare : std::integral_constant::value> {}; + +// obtains the actual object key comparator +template +struct actual_object_comparator +{ + using object_t = typename BasicJsonType::object_t; + using object_comparator_t = typename BasicJsonType::default_object_comparator_t; + using type = typename std::conditional < has_key_compare::value, + typename object_t::key_compare, object_comparator_t>::type; +}; + +template +using actual_object_comparator_t = typename actual_object_comparator::type; + +///////////////// +// char_traits // +///////////////// + +// Primary template of char_traits calls std char_traits +template +struct char_traits : std::char_traits +{}; + +// Explicitly define char traits for unsigned char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = unsigned char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(std::char_traits::eof()); + } +}; + +// Explicitly define char traits for signed char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = signed char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(std::char_traits::eof()); + } +}; + +/////////////////// +// is_ functions // +/////////////////// + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional(B::value), conjunction, B>::type {}; + +// https://en.cppreference.com/w/cpp/types/negation +template struct negation : std::integral_constant < bool, !B::value > { }; + +// Reimplementation of is_constructible and is_default_constructible, due to them being broken for +// std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367). +// This causes compile errors in e.g. clang 3.5 or gcc 4.9. +template +struct is_default_constructible : std::is_default_constructible {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_constructible : std::is_constructible {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +template +struct is_range +{ + private: + using t_ref = typename std::add_lvalue_reference::type; + + using iterator = detected_t; + using sentinel = detected_t; + + // to be 100% correct, it should use https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator + // and https://en.cppreference.com/w/cpp/iterator/sentinel_for + // but reimplementing these would be too much work, as a lot of other concepts are used underneath + static constexpr auto is_iterator_begin = + is_iterator_traits>::value; + + public: + static constexpr bool value = !std::is_same::value && !std::is_same::value && is_iterator_begin; +}; + +template +using iterator_t = enable_if_t::value, result_of_begin())>>; + +template +using range_value_t = value_type_t>>; + +// The following implementation of is_complete_type is taken from +// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ +// and is written by Xiang Fan who agreed to using it in this library. + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + is_constructible::value && + is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type +{ + static constexpr auto value = + is_constructible::value; +}; + +template +struct is_constructible_string_type +{ + // launder type through decltype() to fix compilation failure on ICPC +#ifdef __INTEL_COMPILER + using laundered_type = decltype(std::declval()); +#else + using laundered_type = ConstructibleStringType; +#endif + + static constexpr auto value = + conjunction < + is_constructible, + is_detected_exact>::value; +}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < + is_detected::value&& + is_iterator_traits>>::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 + !std::is_same>::value >> +{ + static constexpr bool value = + is_constructible>::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + !is_compatible_string_type::value&& + is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_iterator_traits>>::value&& +is_detected::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 +!std::is_same>::value&& +is_complete_type < +detected_t>::value >> +{ + using value_type = range_value_t; + + static constexpr bool value = + std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, + value_type >::value; +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; + +template +struct is_json_iterator_of : std::false_type {}; + +template +struct is_json_iterator_of : std::true_type {}; + +template +struct is_json_iterator_of : std::true_type +{}; + +// checks if a given type T is a template specialization of Primary +template