Skip to content

Apply a per-test patch set in the coverage worker - #219

Merged
m3dwards merged 1 commit into
masterfrom
determinism/per-test-patches
Nov 12, 2026
Merged

m3dwards merged 1 commit into
masterfrom
determinism/per-test-patches

Conversation

@m3dwards

Copy link
Copy Markdown
Member

Applies a set of test-only patches to the bitcoin checkout inside the worker, one patch per test, so a line that a test always executes stops appearing as a coverage change on files a pull request never touched.

Each patch is applied on its own: one that no longer applies is named in a COVERAGE_TEST_PATCH_MISSING: line and skipped, and the run still builds and tests with the rest. The patches are staged when the stored pull-request diff is built, so they never show up as changes in a pull request, and the set that was applied is written to tests-patches.json beside coverage.json.

The set is pinned to a06515e9 and will need rebasing as bitcoin moves. Nothing here touches Bitcoin production code — 25 patches, 24 test cases, 15 files, all under src/test/ and test/functional/.

@netlify

netlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for corecheckprod canceled.

Name Link
🔨 Latest commit 8b821f7
🔍 Latest deploy log https://app.netlify.com/projects/corecheckprod/deploys/6af5f8924a8a37d9c9bacda8

@m3dwards
m3dwards merged commit ca4bc76 into master Nov 12, 2026
4 checks passed
@m3dwards
m3dwards deleted the determinism/per-test-patches branch November 12, 2026 17:37
+ WriteCompactSize(stream, MAX_SIZE + 1);
+ BOOST_CHECK_EXCEPTION(ReadCompactSize(stream), std::ios_base::failure,
+ HasReason{"ReadCompactSize(): size too large"});
+}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but why is it not deterministic?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've no idea. I should have said in the description that this is a highly speculative set of LLM generated patches that I personally have very low confidence in. I expect this patch set to change a lot but I was just trying to be an optimist and hoping to get somewhat cleaner reports until the patch by patch evaluation has been done.

They have been somewhat locally shown to reduce coverage flips so the hope is that it would be useful to deploy something early while the testing and evaluation continues.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't help as a temporary measure then I'll revert.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this one is funny: It happens intermittently due to bitcoin/bitcoin@3333077 errors when a zero-input tx fails to decode the "witness" due to failing to decode random trailing bytes as compact size.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Will take a look

+ with self.nodes[0].assert_debug_log(['Timing mishap']):
+ no_pong_node.send_and_ping(msg_pong(ping_nonce))
+ self.check_peer_info(pingtime=ping_delay, minping=ping_delay, pingwait=None)
+

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. happy to review a pull

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I will get a PR put together

Comment on lines +15 to +18
+ self.log.info('generatetoaddress with maxtries=0 mines nothing')
+ block_count = node.getblockcount()
+ assert_equal(self.generatetoaddress(node, 1, 'mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ', 0), [])
+ assert_equal(node.getblockcount(), block_count)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This non-det is from signet, I guess

+// A functional run only reaches that branch when a peer sends a block we previously found invalid,
+// which happens in a small fraction of runs (mempool_reorg.py, feature_bip68_sequence.py); here the
+// invalidity is staged in the block index and the block is delivered over the real message path.
+BOOST_FIXTURE_TEST_CASE(cached_invalid_block_discourages_outbound_peer, TestChain100Setup)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this maybe be a functional test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah probably, will fold it into function for next batch

@m3dwards

Copy link
Copy Markdown
Member Author

Thanks @maflcko for giving your input on the patches!

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.

2 participants