Breakwater

Codeflash / rendercv#18

⚡️ Speed up function validate_date_field by 47%

IanHollow/rendercv#18 · merged 2026-08-10 · base 9ec5e7bd90 → head d5f419015d · ran on Sandboxes

PASS

No unintended behaviour change found.

† Merged after Nemotron 3 Ultra was released (2026-06-04): the model cannot have seen this PR or its fixes.

Counterexamples · 1 class: 1 intended

P2

Exception behaviour changed

inputget_date_object(["!!!!"])
baseraises TypeError
headraises ValueError

Neither exception type subclasses the other.

Intendedvotes: 3 intended

The refactored `get_date_object` now explicitly raises `ValueError` with a clear message for invalid inputs, matching the function’s documented contract, whereas the previous implementation raised an unexpected `TypeError`. The change was a deliberate performance refactor (regex replaced by manual checks) and the new exception type aligns with the library’s own error handling.

message = (
raise ValueError(message)

Found by: Nemotron strategy search, search sample · no baseline found it

ran onToken Factory Sandboxes · image 54410864-aefc-4bb1-bbeb-5b5c15c9eda6

No regression test: adjudicated intended: no test pins the old behaviour.

Performance · get_date_object

Worst family with mostly valid inputs: 1.11× the instructions of base (present_literal).

head slowerhead faster0.59×0.71×0.84×1×1.2×input size (characters)F6F6: 1.10× at ~11 charsF6: 1.11× at ~11 charsF6: 1.11× at ~11 charsF6: 1.11× at ~11 charsF6: 1.11× at ~11 charsF6: 1.11× at ~11 charsF6: 1.11× at ~11 charsR1R1: 1.10× at ~11 charsR1: 1.11× at ~11 charsR1: 1.11× at ~11 charsR1: 1.11× at ~11 charsR1: 1.11× at ~11 charsR1: 1.11× at ~11 charsR1: 1.11× at ~11 charsF5F5: 1.10× at ~11 charsF5: 1.11× at ~11 charsF5: 1.11× at ~11 charsF5: 1.11× at ~11 charsF5: 1.11× at ~11 charsF5: 1.11× at ~11 charsF5: 1.11× at ~11 charsF4F4: 1.10× at ~11 charsF4: 1.11× at ~11 charsF4: 1.11× at ~11 charsF4: 1.11× at ~11 charsF4: 1.11× at ~11 charsF4: 1.11× at ~11 charsF4: 1.11× at ~11 charsF3F3: 0.66× at ~14 charsF3: 0.65× at ~14 charsF3: 0.64× at ~14 charsF3: 0.64× at ~14 charsF3: 0.64× at ~14 charsF3: 0.64× at ~14 charsF3: 0.64× at ~14 chars
  • F6
  • R1
  • F5
  • F4
  • F3
Head/base cachegrind instructions per call, by input size (log-log). Each line is one input family Nemotron proposed; points above 1× are where the "faster" code does more work.
FamilyInputsRatio range Slope base → headVerdict
F6The literal string "present"suspected slowdown · plan1.10× – 1.11×0.00 → 0.00slower
R1present_stringsuspected slowdown · archive1.10× – 1.11×0.00 → 0.00slower
F5present-stringsuspected slowdown · plan1.10× – 1.11×0.00 → 0.00slower
F4present_literalsuspected slowdown · plan1.10× – 1.11×0.00 → 0.00slower
F3ISO full dates (YYYY-MM-DD)claimed speedup · plan0.64× – 0.66×0.00 → 0.00faster

Receipt

TargetBackendImageRun AuditAdjudication
rendercv.data.models.computers:get_date_objectToken Factory Sandboxes54410864-aefc-4bb1-bbeb-5b5c15c9eda6bt-rendercv#18-9197ee$0.062$0.022

Nemotron cost on Nebius Token Factory. Backend: where the untrusted code ran. Token Factory Sandboxes (a microVM branched from a kept image, cited by its UUID). Every image is content-addressed (repo at each commit + harness), so every card re-runs from the image and seed 0. Raw data: audit, adjudication.