Repository navigation
Publish exact global certificate and reproducible replay for Erdős Problem 23 - #1
Conversation
…blem 23 Add the exact rational dual certificate, independent exact-arithmetic verifiers, full and compact replay bundles, manuscript source/PDF, checksums, review guide, and a GitHub Actions workflow that replays every proof artifact.
PR Summary by QodoPublish exact certificate and reproducible replay for Erdős Problem 23
AI Description
Diagram
High-Level Assessment
Files changed (29)
|
Code Review by Qodo
1. Unsafe pickle certificate load
|
| else: | ||
| with args.certificate.open("rb") as handle: | ||
| certificate = pickle.load(handle) |
There was a problem hiding this comment.
1. Unsafe pickle certificate load 🐞 Bug ⛨ Security
verifier/verify_exact_fixed_gram_dual.py will pickle.load() any non-JSON --certificate, enabling arbitrary code execution if a user points the verifier at an untrusted .pkl file. The replay script explicitly iterates over erdos23_global_exact_dual.pkl, encouraging this unsafe path by default.
Agent Prompt
### Issue description
`verify_exact_fixed_gram_dual.py` treats any non-`.json` certificate as a pickle and unpickles it. Pickle is not a safe interchange format and can execute arbitrary code during deserialization.
### Issue Context
This verifier is positioned as an "independent exact replay" tool and is likely to be run by third parties. The repo’s own replay script also runs the verifier over a `.pkl` certificate, making the unsafe path the default.
### Fix Focus Areas
- verifier/verify_exact_fixed_gram_dual.py[106-123]
- scripts/run_full_replay.sh[26-33]
### Suggested fix
- Make JSON the only accepted certificate format by default.
- If you must keep pickle support for legacy/internal artifacts, require an explicit opt-in flag such as `--allow-unsafe-pickle` (and otherwise fail fast with a clear error message).
- Update `scripts/run_full_replay.sh` to either:
- verify only the JSON certificate, or
- pass `--allow-unsafe-pickle` explicitly when verifying the `.pkl` file (so the risk is visible and intentional).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
|
||
| with (flagsdp / "cache_n9.pkl").open("rb") as handle: | ||
| cache = pickle.load(handle) | ||
| lift = np.load(flagsdp / "c5lift_cache.npz", allow_pickle=True) |
There was a problem hiding this comment.
2. Numpy allow_pickle enabled 🐞 Bug ⛨ Security
Both verifiers load c5lift_cache.npz with allow_pickle=True, which will unpickle object arrays and can execute code if the .npz is attacker-controlled. This unnecessarily expands the trust boundary for --flagsdp inputs.
Agent Prompt
### Issue description
`np.load(..., allow_pickle=True)` enables deserializing pickled Python objects embedded in `.npz` files. That is unsafe if inputs can be swapped.
### Issue Context
The verifiers accept `--flagsdp` paths and then load `c5lift_cache.npz` with `allow_pickle=True`. The code then accesses only numeric arrays (`nJ`, `Dval`, `Drow`, `Dcol`), which typically do not require pickling.
### Fix Focus Areas
- verifier/verify_exact_fixed_gram_dual.py[136-139]
- verifier/verify_moment_vector.py[83-89]
### Suggested fix
- Switch to `np.load(..., allow_pickle=False)`.
- If the current upstream `.npz` truly requires pickling, add a safer guard:
- load with `allow_pickle=False` first; if it fails, exit with an explicit message that the file format is unsupported rather than enabling pickle.
- alternatively, validate that all loaded arrays have non-object dtypes before proceeding.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| context = mp.get_context("fork") | ||
| pool = context.Pool(processes=jobs) |
There was a problem hiding this comment.
3. Fork-only multiprocessing context 🐞 Bug ☼ Reliability
verifier/verify_moment_vector.py hard-codes mp.get_context("fork") when --jobs > 1, which
fails on Windows (no fork start method) and will break multi-core verification on that platform.
This is a reliability/portability issue because docs and CI set --jobs above 1.
Agent Prompt
### Issue description
Using `mp.get_context("fork")` is not portable: Windows does not support the `fork` start method, causing an exception when `--jobs` is greater than 1.
### Issue Context
The verifier supports parallel execution via `--jobs`, and the full replay guidance/workflow uses multiple jobs.
### Fix Focus Areas
- verifier/verify_moment_vector.py[167-178]
### Suggested fix
- Use a platform-aware start method:
- Prefer `fork` where available for performance, but fall back to `spawn` when `fork` is unavailable.
- Example pattern: try `mp.get_context("fork")`, except `ValueError` then use `mp.get_context("spawn")`.
- Optionally print a short note when falling back (so reviewers understand performance differences).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
This PR publishes an externally reviewable, computer-assisted proof candidate for the Erdős–Győri–Simonovits triangle-free bipartization conjecture.
The exact order-10 dual objective is
[
\delta_\star=-9.878886951679021\ldots\times 10^{-4}<-9/10000<0.
]
Included
Verification already completed locally
Run:
Review status
The finite computation has been replayed exactly, but the proof bridge and certificate have not yet received independent third-party peer review. The repository deliberately labels the result a proof candidate and identifies the mathematical trust boundary in
README.md,REVIEW_GUIDE.md, anddocs/VERIFICATION_REPORT.md.