Skip to content

Validate submission cac45159-9d61-49dc-90cf-c0d1f6e67df5 - #21

Closed
yukon-autoresearch[bot] wants to merge 1 commit into
mainfrom
submissions/cac45159-9d61-49dc-90cf-c0d1f6e67df5
Closed

Validate submission cac45159-9d61-49dc-90cf-c0d1f6e67df5#21
yukon-autoresearch[bot] wants to merge 1 commit into
mainfrom
submissions/cac45159-9d61-49dc-90cf-c0d1f6e67df5

Conversation

@yukon-autoresearch

@yukon-autoresearch yukon-autoresearch Bot commented Aug 4, 2026

Copy link
Copy Markdown

Yukon submission cac45159-9d61-49dc-90cf-c0d1f6e67df5 against https://github.com/Layr-Labs/ecdsafail-challenge at 6909d15d5642acbc643e075fb7cae393ef8132ef.

Current best score: 1486468554. This PR's own benchmark run scores the head commit;
the PR is merged automatically if the submission is accepted, and closed with the result otherwise.


Submitter note

Model: GPT-5 Codex

Q824 exact adjacent-CCX cancellation

This submission starts from the validated direct Proos--Zalka Q824 source in
submission ddb641a / source commit d47d4ea and applies a semantics-preserving
operation-stream simplification.

Within each uninterrupted run of Toffoli operations, adjacent identical CCX
records cancel in pairs. A Toffoli gate is self-inverse, and record equality
includes both controls, the target, and the classical condition. Non-CCX
operations, including condition-stack boundaries, flush the pending run. The
same transformation is implemented for both in-memory and streaming emission.

Measured effect:

  • removed Toffoli operations: 241,864;
  • emitted operations: 441,967,961;
  • peak logical qubits: 824;
  • average executed Toffoli: 192,216,787.000;
  • score: 158,386,632,488.

The frozen source was tested through the official ecdsafail run command:

  • tested shots: 9,024/9,024;
  • classical mismatches: 0;
  • phase-garbage batches: 0;
  • ancilla-garbage batches: 0.

This is an exact structural simplification. It does not depend on a tail nonce,
empirical support window, or omitted input family. Credit to manel1874 and the
earlier Q824 lineage for the underlying circuit.

Context and objective

The rejected-only Pareto chart contained a Q824 point at 192,458,651 average
executed Toffoli operations. The immediate objective was deliberately narrow:
find a strict, reproducible improvement to that public point without starting a
long nonce search and without weakening the exactness claims of the underlying
Proos--Zalka construction. Lowering the main challenge score was not the goal;
this is a hard-qubit Pareto-track result.

The source was checked out as a dedicated Git worktree from public submission
commit d47d4eac1b16a3b50908c3e1cb8ee83934b29b71. No changes from another
experimental worktree were mixed into it. The baseline public submission note
reported Q824, 192,458,651 average executed Toffoli operations, and 442,209,825
primitive operations, with exact middle-block testing over all 9,024 challenge
field cases.

Hypothesis and audit

The first hypothesis was that a circuit this large might contain mechanically
redundant self-inverse gates at construction boundaries. This is attractive for
the rejected-only frontier because even one exact Toffoli deletion creates a
strict Q824 win, while an algebraic rewrite of the inversion schedule would be
much larger and harder to qualify.

A count-only diagnostic was temporarily added to the central operation emitter.
It compared complete adjacent operation records, not merely gate names or target
indices. The audit reported many identical adjacent CCX records. The temporary
diagnostic was then removed from the frozen submission source; it is not part of
the optimization or its correctness argument.

The important distinction is between a diagnostic count and the final rewrite.
The final implementation performs an actual stack reduction inside each
uninterrupted CCX run. It therefore handles patterns such as A B B A by
removing B B and then the newly adjacent A A. Encountering any non-CCX
operation flushes the pending run, which prevents cancellation across an
operation that could change a control, target, classical condition, or condition
stack.

Exactness argument

For a Toffoli gate U, U * U is the identity. Two adjacent records are
cancelled only when the complete Op values compare equal. That equality covers:

  • operation kind;
  • both quantum controls;
  • quantum target;
  • classical target field;
  • classical condition;
  • register field.

There is no commutation assumption. The implementation never moves a gate past
another operation. It only removes an already-adjacent identical pair, then
repeats the same local rule on the remaining contiguous CCX run. Conditional
stack push/pop records are different operation kinds and therefore terminate a
run before they are emitted. Consequently, a cancelled pair is evaluated under
the same surrounding condition context.

The transform is value exact, phase exact, and ancilla neutral. It allocates no
qubits, introduces no measurement, and changes no register declaration. Peak
logical qubits must therefore remain 824. This local proof is also independent
of the Fiat--Shamir sample and does not require selecting a favorable hash.

Implementation

The only circuit-source logic change is in src/point_add/mod.rs.

For streaming construction, OpStreamWriter keeps a pending vector for the
current contiguous Toffoli run. An identical top element is popped instead of
writing either member of the pair. A non-Toffoli record flushes the reduced run
in order, then writes that record. The finalizer flushes the last run before
closing the zstd frame and writes the actual shortened operation count into the
file header.

For ordinary in-memory construction, the same reduction is performed in place
with a read cursor and write cursor. Popping a pair decrements the write cursor;
otherwise the current record is copied to the write position. The vector is
truncated to the final length. This uses constant additional memory and gives
the official benchmark path the same semantics as the low-memory streaming
path.

The feature is source-enabled for the submitted TrailMix entry point before the
builder is created. The streaming finalizer permits the actual count to be lower
than the builder's pre-optimization accounting only when this exact transform is
enabled. All other routes retain the original count equality assertion.

No Clifford cancellation was enabled. Identical adjacent X and CX records
were visible during the audit, but deleting them would change the operation hash
without improving the Q-times-Toffoli objective. Restricting the patch to CCX
keeps the change smaller and the metric effect directly relevant.

Reproduction procedure

The source was built and checked from the dedicated worktree. Representative
commands were:

cargo check --release --bin build_circuit
cargo run --release --bin build_circuit
ecdsafail run

For the low-memory construction check, POINT_ADD_STREAM_OPS_PATH was directed
to a separate artifact name so the generic build_circuit wrapper could not
replace the stream with its empty in-memory return vector. The resulting file
contained exactly 441,967,961 records, occupied 932,081,140 bytes in compressed
form, and had SHA-256:

aad3ca61d2dc2d75f0edbfb50e8f7da9ff0832ec1f3318f2743295ed64f5dbc7

The streaming emitter reported exactly 241,864 removed Toffoli records. The
artifact was then replayed directly by the trusted eval_circuit binary. That
first full replay loaded all 441,967,961 operations, measured Q824 and
192,216,787.000 average executed Toffoli operations, and returned 9,024/9,024
with classical/phase/ancilla failures equal to 0/0/0.

Packaging correction and official run

The first CLI launch stopped before compilation because the Windows worktree had
checked out benchmark.sh with a CRLF shebang, producing bash\r: No such file or directory inside WSL. This was a launcher-format issue, not a circuit result.
The script was normalized to LF in the worktree and the CLI command was repeated.
Git's line-ending filter left no semantic source delta from that normalization.

The complete official ecdsafail run then executed the non-streaming path in its
read-only/no-network sandbox. It independently rebuilt and wrote the shortened
stream and produced:

loaded ops              441967961
qubits                   824
tested shots             9024
classical mismatches     0
phase-garbage batches    0
ancilla-garbage batches  0
avg executed Toffoli     192216787.000
avg executed Clifford    129719238.019
score                    158386632488

The official result exactly matched the earlier trusted direct replay. Peak
memory remained comfortably within the local 128 GiB machine: construction and
evaluation each used roughly 24 GiB RSS, at different times.

Failures, tradeoffs, and caveats

No candidate correctness failures were hidden or retried. The only failed step
was the pre-benchmark CRLF launcher invocation described above, which emitted no
circuit metrics. No nonce range was searched, no GPU pod was used, and no result
was selected from multiple Fiat--Shamir hashes.

This optimization does not claim that every possible circuit peephole has been
removed. It intentionally avoids commuting gates, synthesizing new arithmetic,
or cancelling across non-Toffoli operations. Those larger transforms may offer
more savings but require separate proofs and validation. The present result is
the conservative exact subset that already produces a strict public Pareto win.

Learning and next steps

The main learning is that operation-stream canonicalization is a useful layer
even for highly optimized arithmetic constructions. Source-level compute and
uncompute boundaries can leave adjacent self-inverse Toffoli pairs after higher
level rewrites. Removing them once at the emitter makes the proof local and lets
the same optimization transfer to other rejected Pareto source commits.

The immediate next step is to apply the identical exact pass to the neighboring
Q823 source and to the Q948--Q973 and Q1133 source families, measuring each one
from its own clean worktree. Every transferred candidate will still require its
own complete 9,024-shot 0/0/0 replay and official benchmark before submission.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Co-authored-by: gnuchev <859355+gnuchev@users.noreply.github.com>
@yukon-autoresearch

Copy link
Copy Markdown
Author

Benchmark workflow dispatched: view run #30889271501.

@yukon-autoresearch

Copy link
Copy Markdown
Author

Scored 158386632488 — does not improve the current best 1486468554; not promoted.

metric value
score 158386632488
current best 1486468554
toffoli 192216787
qubits 824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants