feat: stress testing (generator + brute force) #257
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/cp.nvim#257
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Stress testing is one of the most important debugging techniques in competitive programming above Div.2 level. The workflow: a random input generator produces cases, a correct-but-slow brute force solution and the optimized candidate solution are both run on each case, and outputs are compared to find a counterexample. No existing Neovim CP plugin supports this natively.
Proposed solution
Add
:CP stress [GENERATOR_CMD] [BRUTE_CMD](or configurable via hooks). The command:GENERATOR_CMDto produce stdinBRUTE_CMDon the generated input concurrentlyThis reuses
execute.runand the existing diff UI. A config keystress = { max_iterations = 1000 }controls the loop limit.The most common case — Python brute force against C++ optimized — is trivially supported since
BRUTE_CMDis justpython brute.py.Alternatives considered
Using
oj generate-input+oj generate-outputexternally. This works but requires leaving Neovim and loses the inline diff visualization.