Commit graph

38 commits

Author SHA1 Message Date
Barrett Ruth
a202725cc5
fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305)
## Problem

After the initial submit hardening, two issues remained: source code was
read in Lua and piped as stdin to the scraper (unnecessary roundtrip
since
the file exists on disk), and CF's `page.fill()` timed out on the hidden
`textarea[name="source"]` because CodeMirror owns the editor state.

## Solution

Pass the source file path as a CLI arg instead — AtCoder calls
`page.set_input_files(file_path)` directly, CF reads it with
`Path(file_path).read_text()`. Fix CF source injection via
`page.evaluate()`
into the CodeMirror instance. Extract `BROWSER_SUBMIT_NAV_TIMEOUT` as a
per-platform `defaultdict` (CF defaults to 2× nav timeout). Save the
buffer
with `vim.cmd.update()` before submitting.
2026-03-05 14:34:14 -05:00
865e3b5928 refactor: rename epsilon to precision in runner
Problem: the tolerance field for floating-point comparison was named
`epsilon`, which is an implementation detail, not the user-visible concept.

Solution: rename to `precision` in run.lua type annotations, internal
variables, and comparison logic.
2026-03-03 15:09:41 -05:00
24b088e8e9 style(runner): add luacats to compare_outputs 2026-02-26 23:02:40 -05:00
e685a8089f feat: add epsilon tolerance for floating-point output comparison
Problem: output comparison used exact string equality after whitespace
normalisation, causing correct solutions to fail on problems where
floating-point answers are accepted within a tolerance (e.g. 1e-6).

Solution: add an optional ui.panel.epsilon config value. When set,
actual and expected output are compared token-by-token: numeric tokens
are compared with math.abs(a - b) <= epsilon, non-numeric tokens fall
back to exact string equality. Per-problem epsilon can also be stored
in the cache and takes precedence over the global default.
2026-02-26 23:00:35 -05:00
585cf2a077 feat(runner): run test cases in parallel
Problem: test cases were executed sequentially, each waiting for the
previous process to finish before starting the next. On problems with
many test cases this meant wall-clock run time scaled linearly.

Solution: fan out all test case processes simultaneously. A remaining
counter fires on_done once all callbacks have returned. on_each is
called per completion as before; callers that pass on_each ignore its
arguments so the index semantics change is non-breaking.
2026-02-26 22:55:50 -05:00
4c5c44742e feat: refactors 2026-01-27 14:23:23 -05:00
ba26cee7f9 feat(run): make running entirely asynchronous 2026-01-27 12:55:35 -05:00
445059a498 fix(runner): proper debug msg 2025-12-18 14:43:03 -06:00
3a0c0de599 another log statement 2025-12-14 16:30:10 -06:00
Barrett Ruth
aab211902e feat: multi-test case view 2025-11-04 21:32:40 -05:00
Barrett Ruth
48d4c6f113 feat: language 2025-10-24 01:21:16 -04:00
Barrett Ruth
6a6cf2c594 feat: bindings and --debug flag 2025-10-23 23:36:09 -04:00
Barrett Ruth
c312ccbb4d fix: highlighting 2025-10-23 18:16:36 -04:00
Barrett Ruth
018d801121 fix: rename run panel to panel 2025-10-23 09:54:55 -04:00
d2bde9bad8 fix(config): better file org 2025-10-04 19:54:53 -04:00
a76d228e3f feat(doc): update for new config 2025-10-04 19:04:49 -04:00
aae98a5796 disable scraper disabling 2025-10-04 17:45:49 -04:00
b9a2c7a4ff fix(scrapers): fix 2025-10-04 15:00:37 -04:00
179b333505 update pyproject 2025-10-03 22:38:24 -04:00
d35ed0450b fix table 2025-10-03 09:27:52 -04:00
357d1601b4 add rss to table 2025-10-02 23:46:54 -04:00
bfcf2242ee fix(runner): cleanup cache logic 2025-10-02 23:31:26 -04:00
d9537e72ba many fixes 2025-10-02 22:35:30 -04:00
db98153b11 fix(ansi): annotate highlights too 2025-10-02 14:20:26 -04:00
1974addbd2 fix(lua): bunch of typing 2025-10-02 14:18:26 -04:00
6b8a1e2087 more docs 2025-10-01 21:36:53 -04:00
a925686a17 fix(log): improve logging 2025-10-01 16:41:24 -04:00
b406c0ce4e fix: synchronous problem fetch 2025-10-01 12:25:07 -04:00
975e829f78 fix: remove version 2025-09-24 18:28:41 -04:00
9e84d57b8a feat: context, not config 2025-09-24 18:21:34 -04:00
79e1f1096b lint 2025-09-23 12:29:12 -04:00
8df8c16a72 fix(ci): selene lint 2025-09-23 12:25:53 -04:00
8a9bc7434f fix: remove comments 2025-09-23 10:22:02 -04:00
f9cf5b1614 possibly working 2025-09-23 10:17:22 -04:00
9b443459e2 fix(runner): use state methods 2025-09-22 19:22:51 -04:00
138f5bb2a2 this is not why 2025-09-22 19:20:35 -04:00
78fb4f8f4b feat(cache): cache clearing, updating and resetting 2025-09-21 15:08:55 -04:00
965e47a1df feat: refactor file structure 2025-09-21 14:29:01 -04:00
Renamed from lua/cp/run.lua (Browse further)