Repository navigation
tests: native command-after probe checks each journal event once - #548
Merged
Merged
Conversation
… once per cursor The probe in test_native_command_after compared has_command_after and first_command_after against a scan that walked the retained journal from its oldest event for every cursor at every callback. The journal is paged, so each old event is a paged read, and the cost grew with the square of the journal length: one long row took about 560 s on CI while the other rows took a few seconds. The probe now verifies the ordinals of the retained window once, incrementally (each event is read once, from the newest back to the first position not yet checked, plus the junction with the previous check), and answers the per-cursor question from the newest event, which the order check makes equivalent to the old scan. Both CHECK lines are unchanged. A planted wrong answer in has_command_after (> changed to >=) still fails the row. The long row now finishes in well under a minute on the same host class.
# Conflicts: # tests/test_native_command_after.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The probe in
tests/test_native_command_after.cppcomparedhas_command_afterandfirst_command_afteragainst a scan that walked the retained journal from its oldest event for every cursor at every callback. The journal is paged, so each old event is a paged read, and the cost grew with the square of the journal length: one long row took about 560 s on CI while the other rows took seconds.The probe now verifies the ordinals of the retained window once, incrementally (each event is read once, from the newest back to the first position not yet checked, plus the junction with the previous check), and answers the per-cursor question from the newest event, which the order check makes equivalent to the old scan. Both
CHECKlines (fast == searched,fast == scanned) are unchanged.Test-only change: one file, +24/-9. No engine source changes.
Evidence
has_command_afterfrom>to>=(a planted wrong answer, not committed) makes the row FAIL, with both CHECK lines firing attest_native_command_after.cpp:170-171.main(the 8-slice split of this test): all 8 slices pass on the merged tree, 772 s total for the job.Notes
has_command_afteruses; the independent parts are the full-window order proof (every event, once) and thefirst_command_aftersearch.🤖 Generated with Claude Code