This commit is contained in:
Barrett Ruth 2025-11-04 23:39:43 -05:00
parent 6a1534124d
commit 127de3d6a5
3 changed files with 18 additions and 6 deletions

View file

@ -40,15 +40,17 @@ COMMANDS *cp-commands*
Execution modes:
• :CP run Combined: single execution with all tests
(auto-switches to individual when multiple samples)
• :CP run all Individual: N separate executions
• :CP run n Individual: run test n only
• :CP run n,m,... Individual: run specific tests (e.g. nth and mth)
--debug: Use debug build (builds to build/<name>.dbg)
Combined mode mimics platform behavior in order to accurately
simulate online judge environments. Individual mode provides
per-test verdicts.
Combined mode runs all test inputs in one execution (matching
platform behavior for multi-test problems). When a problem has
multiple independent sample test cases, :CP run auto-switches to
individual mode to run each sample separately.
Examples: >
:CP run " Combined: all tests, one execution
@ -556,18 +558,20 @@ Execution Modes ~
The I/O view supports two execution modes:
Combined Mode (default: :CP run)
Combined Mode (:CP run with single sample)
• Single execution with all test inputs concatenated
• Matches platform behavior (e.g. Codeforces multi-test format)
• Shows one verdict for the entire execution
• Input split: All test inputs concatenated
• Output split: Single program output + verdict
• Used when problem has one sample containing multiple test cases
Individual Mode (:CP run all / :CP run n / :CP run n,m,...)
• Separate execution for each test case
• Per-test verdicts for debugging
• Input split: Selected test inputs concatenated
• Output split: All test outputs concatenated + per-test verdicts
• Auto-selected when problem has multiple independent samples
Layout ~

View file

@ -358,6 +358,13 @@ function M.run_io_view(test_indices_arg, debug, mode)
return
end
if mode == 'combined' then
local test_cases = cache.get_test_cases(platform, contest_id, problem_id)
if test_cases and #test_cases > 1 then
mode = 'individual'
end
end
M.ensure_io_view()
local run = require('cp.runner.run')

View file

@ -71,7 +71,7 @@ def _retry_after_requests(details):
on_backoff=_retry_after_requests,
)
def _fetch(url: str) -> str:
r = _session.get(url, headers=HEADERS, timeout=TIMEOUT_SECONDS)
r = _session.get(url, headers=HEADERS, timeout=TIMEOUT_SECONDS, verify=False)
if r.status_code in RETRY_STATUS:
raise requests.HTTPError(response=r)
r.raise_for_status()
@ -243,7 +243,8 @@ def _to_problem_summaries(rows: list[dict[str, str]]) -> list[ProblemSummary]:
async def _fetch_all_contests_async() -> list[ContestSummary]:
async with httpx.AsyncClient(
limits=httpx.Limits(max_connections=100, max_keepalive_connections=100)
limits=httpx.Limits(max_connections=100, max_keepalive_connections=100),
verify=False,
) as client:
first_html = await _get_async(client, ARCHIVE_URL)
last = _parse_last_page(first_html)