Repository navigation
Description
Is there an existing issue for this?
- Existing issues were searched. #154 and #164 introduced the fuzz work; this is a later source-anchor mismatch after #163.
Current behaviour
At 1.x.x commit c4b254e2d39f3a430b8b4a85798dd03ed47c3d98, the qbit fuzz coverage checker fails while resolving the pqc_sign_refused anchor. It cannot evaluate the required named-seed coverage until this mismatch is corrected.
The anchor definition expects:
if (!IsValid() || counter_inout >= PQC_MAX_SIGNATURES) return false;The current signing code, changed by #163, is:
if (!IsValid() || counter_inout >= PQC_MAX_SIGNATURES) return finish(false);The checker requires a unique textual match, so it raises an assertion before coverage evaluation. This is a test-tool failure; it does not demonstrate a PQC verification or signing-correctness failure.
Expected behaviour
The refusal-path anchor resolves uniquely to the current refusal branch, and the coverage checker continues to enforce its existing named-seed hit/miss expectations.
Steps to reproduce
From the repository root at the commit above:
python3 test/fuzz/test_qbit_fuzz_coverage.py --anchors-onlyThis reproduction does not need a node, wallet, or coverage-instrumented executable.
Relevant log output
AssertionError: anchor Anchor(file='src/crypto/pqc.cpp', lines=('if (!IsValid() || counter_inout >= PQC_MAX_SIGNATURES) return false;',), token='return') matched 0 times in src/crypto/pqc.cpp
Verified on September 23, 2026, on native Apple Silicon macOS 26.4 against the source checkout. The mismatch is in repository text, not a macOS command-compatibility issue.
Proposed scope and acceptance
- Update
pqc_sign_refusedto the current refusal branch without removing or relaxing the coverage expectation. -
--anchors-onlyexits successfully and all named anchors resolve uniquely. Missing or ambiguous matches must still fail. - Run the checker's documented coverage-instrumented path with the named corpus; verify the refusal region is mapped to the intended branch and the existing expected hits/misses pass.
- Retain the instrumentation/corpus results as release evidence, including replay/mutation evidence from the corresponding fuzz runner. A passing anchor-only check must not be presented as proof of measured coverage or mutation.
- Existing fuzz runner/corpus contract tests continue to pass.
Keep the change in fuzz tooling unless investigation identifies a separate defect. No consensus, signing behavior, wallet format, or published release artifact changes are required by this issue.
How did you obtain qbit?
Compiled from source. Tested source is the full commit above; the binary version string remains v1.0.0.
Release tracking
Tracked by #174 — v1.0.1 release readiness.
Activity
kiwidream commentedon Sep 25, 2026
Instrumented coverage and mutation evidence for the #173 acceptance items. It was produced on the PR #176 head
b617ceb1e4(the anchor fix on top of1.x.xc4b254e2) with the official LLVM 20.1.8 release. The toolchain's SHA-256 and sigstore attestation were verified.test_qbit_fuzz_coverage.py --fuzz-binarypath exited 0, and every hit, miss and at-least expectation in all 17 CASES was met.pqc_sign_refusedis a HIT onlegacy-import-corrupted-secretatpqc.cpp:132:60.slh_dsa_sign-failure return on line 139 is never taken by any seed.--require_qbit_corpus:p2mr_scriptandpqc. No crashes or sanitizer reports.p2mr_scriptandpqc: at most 532 and 271 mutated execs, because SLH-DSA is slow.libfuzzer-nosanrun, and no macOS or other LLVM versions.#173 should close once #176 merges into
1.x.x. The evidence applies to that source; if #176 changes, re-run it on the final release source (#174).Full evidence record (LLVM-EVIDENCE.md)
#173 evidence: llvm-cov coverage + libFuzzer replay/mutation for qbit fuzz targets
Host: minidev-alex1 (Linux 7.0.0-31-generic x86_64, glibc 2.43, Python 3.14.4, cmake 4.2.3). Date: 2026-09-25.
Source: b617ceb (PR #176, branch kiwidream/fix-pqc-sign-refused-anchor,
the pqc_sign_refused anchor fix on top of 1.x.x c4b254e). Worktree clean (
git status --shortempty;only the gitignored build-fuzz-llvm/ and build-fuzzcov-llvm/ dirs were added). No repository changes, no commit.
Logs and helper scripts are in
evidence-173/llvm/. This supersedes section 4 ("NOT RUN") and themutation part of section 6 of EVIDENCE.md.
Result summary
-fprofile-instr-generate -fcoverage-mapping, BUILD_FOR_FUZZING)test_qbit_fuzz_coverage.pywith llvm-profdata/llvm-cov: all 17 CASES, incl.pqc_sign_refusedHITpqc_sign_refusedexpectations make the checker fail--require_qbit_corpus, 6 targets--require_qbit_corpus--build-dirlibFuzzer 18 tests)1. Toolchain
(2 021 269 412 bytes), extracted to
~/.local/opt/LLVM-20.1.8-Linux-X64. No sudo, apt or Docker.sha256sum:1ead36b3dfcb774b57be530df42bec70ab2d239fbce9889447c7a29a4ddc1ae6. Matches the GitHub release asset digest.gh attestation verify LLVM-20.1.8-Linux-X64.tar.xz --bundle LLVM-20.1.8-Linux-X64.tar.xz.jsonl --repo llvm/llvm-project→ rc 0 (gh 2.101.0). Sigstore bundle (sha256
00beee3c…a75d) is from the release. The verified subject digest is the tarball's.Signer:
https://github.com/llvm/llvm-project/.github/workflows/release-binaries.yml@refs/tags/llvmorg-20.1.8, source digest87f0227cb60147a26a1eeb4fb06e3b505e9c7261(llvm/attestation-verify.json).clang --version:clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261).llvm-cov/llvm-profdata/llvm-symbolizer 20.1.8 come from the same tarball. libclang_rt fuzzer/profile/asan/ubsan
are under
lib/clang/20/lib/x86_64-unknown-linux-gnu/. The C++ standard library is the system libstdc++ (GCC 15).2. Builds
Both builds used
export PATH=$HOME/.local/opt/LLVM-20.1.8-Linux-X64/bin:$PATHandTMPDIR=<build>/tmp, with ccache ON.Coverage build, exactly as documented in doc/development/developer-notes.md "Compiling for Fuzz Coverage".
The default build type gives -O2 -g, and there is no sanitizer, so the native fuzz engine is used:
libFuzzer build for replay and mutation. It uses the
libfuzzerpreset (ASan+UBSan+fuzzer and-ftrivial-auto-var-init=pattern)with the binary dir overridden:
3. Coverage checker (the documented llvm-cov path)
--path-equivalencewas not needed.-fdebug-prefix-mapdoes not rewrite coverage-mapping filenames.Ran 6 tests, OK: 5 AnchorResolutionTest cases plus CoverageContractTest over all 17 named seeds.
Every hit, miss and at-least expectation passed. Per-case counts:
The at-least bounds are met exactly: p2mr_fixture_sign=6 (≥6), p2mr_verify_accept=7 (≥7), ctv_match=3 (≥3),
pqc_fixture_sign=4 (≥4), pqc_verify_call=6 (≥6).
3a. Refusal region mapping (independent of the checker)
llvm/refusal_regions.pyruns each of the 16 pqc seeds alone. For each seed it exportssrc/crypto/pqc.cppwith llvm-covand prints the raw segments for lines 132 and 136–139 (
refusal-regions.log). The anchor resolves topqc.cpp:132:60,the
returnofif (!IsValid() || counter_inout >= PQC_MAX_SIGNATURES) return finish(false);.Results for legacy-import-corrupted-secret:
given the wrong answer.
return finish(false);(line 139) is 0 for every seed, so the anchor cannot be confused with it.and legacy-counter-exhausted. It is 0 for both valid sign/verify seeds and all 10 fixture seeds.
!IsValid()(the 132:23 counter check runs 2 of 3 times).For counter-exhausted it comes from the counter check (132:23 runs 3 of 3 times).
This matches the gcov substitute in EVIDENCE.md §5.
3b. Negative control
llvm/negative_control.pyloads the unmodified checker module and replaces CASES in memory with two inverted expectations:legacy-import-corrupted-secret
pqc_sign_refused: MISSand legacy-generated-valid-sign-verifypqc_sign_refused: HIT.It then runs the checker's own
main()against the same binary. Both subtests failed withpqc_sign_refused executed 1 timesandpqc_sign_refused not executed, and the checker exited 1 as expected(
negative-control.log). This shows the checker is not vacuous on real llvm-cov data.4. libFuzzer replay and mutation (build-fuzz-llvm, ASan+UBSan)
Runs used
LLVM_SYMBOLIZER_PATH=$L/llvm-symbolizer. The runner sets the UBSAN_OPTIONS/ASAN_OPTIONS used in CI(ubsan suppressions, halt_on_error=1, detect_leaks=1). The working directory was
evidence-173/llvm/artifacts/,where libFuzzer writes crash artifacts; it is still empty.
Replay (files present / inputs replayed): asert_chain_transition 5/5, asert_edge_cases 5/5, asert_math 5/5, auxpow 6/6,
p2mr_script 16/16, pqc 16/16.
Under ASan, SLH-DSA keygen and signing are slow: seed initialization took about 21–23 s and each later execution took roughly 1–2 s.
The 120 s budget therefore gave p2mr_script and pqc under 100 mutated executions. A supplementary longer run followed:
Crashes: none. The logs contain 0 matches for
ERROR: (AddressSanitizer|libFuzzer|LeakSanitizer)|runtime error|deadly signal|SUMMARY:in the replay and both mutation logs,and no crash, leak or timeout artifacts were written.
Contract tests:
Not verified / caveats
This is evidence that the mutation phase runs and does not crash on these inputs. It is not evidence of meaningful exploration of the
PQC paths. A longer campaign (hours) or a
libfuzzer-nosanbuild would be needed for that and was not run.BUILD_FOR_FUZZING, noSANITIZERS=fuzzer),not under libFuzzer, as the checker's docstring and developer-notes.md describe. It was not repeated with a libFuzzer+coverage build.
ci/test/03_test_script.shwithQBIT_FUZZ_MUTATE_MIN_TIME, qa-assets overlay) was not run. The runner waspointed directly at
test/fuzz/qbit_corpora.fuzz: repair stale pqc_sign_refused coverage anchor (#176)
kiwidream commentedon Sep 25, 2026
Fixed by #176, merged into
1.x.xas a9e1554. The acceptance items are met:pqc_sign_refusedresolves uniquely to the refusal branch atpqc.cpp:132:60. Missing, ambiguous and token-less anchors still fail, and new resolution tests cover that.b617ceb1e4, and the merged source differs from that commit only indoc/release-trust-1.0.0.md, so it applies unchanged.Caveat for the release record (#174): mutation depth under ASan was shallow for
p2mr_scriptandpqc. No multi-hour campaign was run.doc: draft v1.0.1 release notes
doc: record v1.0.1 fuzz evidence and its depth limits
doc: add v1.0.1 release notes
doc: add v1.0.1 release notes
doc: add v1.0.1 release notes
doc: add v1.0.1 release notes
doc: add v1.0.1 release notes
doc: add v1.0.1 release notes
release: prepare v1.0.1 (#181)
fuzz: repair stale pqc_sign_refused coverage anchor (#176)
release: prepare v1.0.1 (#181)