Repository navigation
Conversation
…ign Py3.10 parsing Parse timezone-aware ISO-8601 lane deadlines consistently across Python 3.10 and 3.11+ (including trailing "Z" and 1-9 fractional digits), select the chronologically earliest lane deadline in close_round instead of lexicographic min, validate deadline_utc upfront in prepare_parallel_round, and align ensure_open with seconds_remaining at now >= deadline so exact- deadline serve requests reject without charging lane budget. Agent-assisted-by: antigravity-cli / gemini-4-neon [effort=xhigh] (author) Signed-off-by: 李浩瑞 <haoruili@seu.edu.cn>
david6666666
left a comment
There was a problem hiding this comment.
PR review verdict — DO NOT PASS
Dot, acting for @david6666666.
Base 6b39439da4ac7354465ac7f2b550bac9f6966a54, head 061e2c707a6b67d2120c8ed807d3890f4d048cba. Chronological comparison fixes the reported offset ordering, and closing at equality aligns the two helpers. The parser still delegates the accepted grammar to a version-dependent stdlib API; see inline. #953 remains proposed, and exact-head Ready evidence is not established. Reviewed diff and author-reported paired cases; did not rerun tests.
Advisory 55/100: scope 1/3, correctness 2/3, validation 2/3, claim evidence 2/3, simplicity 0/3 (added explanatory test comment).
| ) | ||
| try: | ||
| deadline = datetime.fromisoformat(deadline_utc) | ||
| deadline = datetime.fromisoformat(normalized) |
There was a problem hiding this comment.
This only normalizes a suffix; fromisoformat() still accepts different input grammars on 3.10 and 3.11+. For example, compact dates with an offset are accepted by newer Python. Could this validate the same supported extended timestamp shape before parsing on both versions, with a cross-version rejection case?
There was a problem hiding this comment.
Antigravity (Gemini 4 Neon, xhigh), acting for @haoruilee.
Updated in 8f046852 to validate a single explicit ASCII extended ISO-8601 timestamp grammar before calling datetime.fromisoformat(), added cross-version rejection tests, removed the explanatory test comment, and refreshed head_sha in the PR body.
Details and verification
parse_deadline()now requires_DEADLINE.fullmatch(deadline_utc)(YYYY-MM-DDTHH:MM:SS(?:\.\d{1,9})?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?), ASCII) before callingdatetime.fromisoformat(...).- Added cross-version rejection cases in
test_round_budget.pyandtest_parallel_round.py(including compact dates/offsets20991030T000000+0000,20991030T000000Z,2099-10-30T00:00:00+0000, week dates, space separators, lowercasez, missing seconds, and+00:60). - Verified on
8f046852(Linux x86_64):ruff check src tests toolspassed;pytest -rs -n 4 tests/harness/test_round_budget.py tests/harness/test_parallel_round.pypassed (97 passed, 2 skipped) on both Python 3.10.20 and Python 3.11.14; differential check across 36 inputs showed 0 mismatches between Python 3.10.20 and 3.11.14. - PR stays a Draft pending maintainer scope acceptance and delegation on bug: parallel-round close compares deadline_utc strings lexicographically and rejects UTC "Z" on Python 3.10 #953.
…oss Python 3.10+ Validate the full ASCII extended ISO-8601 timestamp grammar via regex before calling datetime.fromisoformat so Python 3.10 and 3.11+ accept and reject the exact same deadline inputs, including rejecting compact dates, compact offsets, week dates, space separators, and invalid offsets. Add cross-version rejection tests in test_round_budget and test_parallel_round. Agent-assisted-by: antigravity-cli / gemini-4-neon [effort=xhigh] (author) Signed-off-by: 李浩瑞 <haoruili@seu.edu.cn>
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
dot, acting for zengchuang-hw.
检视 base 6b39439da4ac7354465ac7f2b550bac9f6966a54,head 8f046852c9234853f489362eef14c94e925364fc。
首次 Ready 检视。改动把最早 lane 的选择从字符串顺序改为带时区时间比较,并在打开尝试时把等于截止时刻判为关闭;准备阶段也拒绝无时区输入。隔离运行了精确源码的五项检查:偏移等价、混合分数选择、9 位输入规范到微秒、边界时刻、无时区拒绝;未跑整个并行任务、旧版本 Python 矩阵或 CI。
|
Antigravity (Gemini 4 Neon, xhigh), acting for @haoruilee. In Ready CI run https://github.com/InferMatrixLab/InferRSI/actions/runs/47029282034 on head Could a maintainer rerun the failed |
Dong1017
left a comment
There was a problem hiding this comment.
LGTM
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
PR review verdict — PASS
Reviewed base 6b39439 and head 8f04685 (first review on this head; full diff, not incremental). Scope matches accepted #953 (three defects: lexicographic deadline min, Py3.10 Z parsing, ensure_open/seconds_remaining boundary).
Verified by reading the head code (not executed):
src/inferrsi/harness/manager/_round_budget.py178-189:parse_deadline()fullmatches an ASCII extended ISO-8601 grammar beforedatetime.fromisoformat(), pads fractions to 6 digits and mapsZto+00:00. Compact dates/offsets, lowercasez, space separator, week dates, naive values and invalid calendar dates all fall toBudgetError, and the tests cover them. This resolves the grammar-split concern in david6666666's COMMENTED review on the older head 061e2c7._round_budget.py198-209:ensure_open()now usesnow >= deadline, matchingseconds_remaining()(remaining <= 0). The serve path (_parallel_round.py1079-1087) checksensure_openbefore any reservation, and_measure(1146) admits through it, so an exact-deadline ticket is refused without charging the ledger._parallel_round.py497-499: prepare rejects missing, malformed or naivedeadline_utcwithRoundPlanError; stored strings are unchanged, as #953 asks._parallel_round.py1457-1461: close takesmin(..., key=parse_deadline)over the selected PASS lanes inside thetry, so a past earliest deadline refuses withaccepted: False. The lexicographic bypass is gone.src/inferrsi/apps/workflows/parallel_round.pyforwardsclockto bothserve_parallel_ticketandclose_parallel_round, which the new tests rely on. Helpers used by the new tests (_plan(deadline=...),_spec,_tree) exist at head.
Not verified here:
- I did not run tests, ruff or CI. Py3.10/3.11 equivalence (36-input differential, 97 passed on both interpreters) is author-reported in the PR body and I did not re-run it.
- I did not inspect the
_sum_tree/_sum_spechelpers used by the new close tests intests/harness/test_parallel_round.py(about lines 2026-2119); I rely on the author's passing run. - PR body:
full-check (3.11)failed on an unrelated wall-clock flake (tests/apps/test_search_benchmarks.py), and a rerun is requested. Required checks must be green before merge. This is a merge gate, not a code blocker.
Non-blocking follow-ups:
- Plans already stored with forms that Python 3.11+ used to accept (
+0800, space separator, lowercasez) will now be refused at serve and close. Prepare-time rejection is the intended contract, but the PR body should say so and any in-flight round should be re-prepared. - Merge still needs two LGTM-qualifying approvals. This Approve is one. zengchuang-hw's approval body starts with
PASS, so it does not count under the existing decisions (7333037065, 7334844917). amy-why-3459 is the accountable owner on #953 and cannot be the independent approval.
I will re-read after any new head, or on an @Dong1017 mention.
Resolve EOF test conflict in tests/harness/test_parallel_round.py against main while keeping _parallel_round.py and _round_budget.py changes intact. Agent-assisted-by: antigravity-cli / gemini-4-neon [effort=xhigh] (author) Signed-off-by: 李浩瑞 <haoruileee@gmail.com>
d62cedb
|
Antigravity (Gemini 4 Neon, xhigh), acting for @haoruilee. Merged |
Bounty-hunter
left a comment
There was a problem hiding this comment.
LGTM
Claude Code agent, acting for @Bounty-hunter.
PR review verdict — PASS
Reviewed base d5f2f88c53c67edc999de825d283abc58740b22f and head d62cedb2980ba3ba68ed50795cd744b2a9a40d67 (full diff at the merge head, not incremental). Scope matches the accepted #953 authorization in #953 (comment). Disclosure: I posted that triage decision; I did not write, own or materially contribute to this change.
Verified by reading the head sources and the diff:
src/inferrsi/harness/manager/_parallel_round.py:1743:deadline_utc = min((lane["deadline_utc"] for lane in lanes), key=parse_deadline)is taken over the selected PASS lanes and now sits inside thetry, so the joint cutoff is the chronologically earliest lane deadline and an expired earliest lane returnsaccepted: Falsewith reasonlane deadline passedand no successor. The lexicographic string minimum is gone._parallel_round.py:525-527:prepare_parallel_roundroutes every lane deadline throughparse_deadline()and raisesRoundPlanError("each lane needs a timezone-aware deadline")for absent, non-string, malformed and naive values;BudgetErroris imported at:101. Valid strings are stored unchanged — the new prepare test asserts"2099-01-01T00:00:00Z"survivesprepareverbatim.src/inferrsi/harness/manager/_round_budget.py:18-24,178-190:parse_deadline()anchors an explicit extended ISO-8601 grammar withre.ASCIIviafullmatchbefore callingdatetime.fromisoformat, maps trailingZto+00:00and pads fractions to six digits. Because the grammar is decided by the regex instead of delegated to the interpreter'sfromisoformat, the Python 3.10 / 3.11 split is not reachable. I reproduced that grammar in a scratch script against representative inputs: it acceptsZ, 1–9 fractional digits and±HH:MM/±HH:MM:SSoffsets, and rejects naive values, space separators, compact20991030T000000+0000, week dates,+00:60and invalid calendar dates (2099-02-30)._round_budget.py:198-215:ensure_open()now refuses atnow >= deadline, matchingseconds_remaining()'sremaining <= 0. The serve path_parallel_round.py:1365callsensure_openbeforehold_devicesand before any reservation, andtest_serve_at_exact_deadline_rejects_without_charging_budgetasserts the exact-deadline ticket is rejected withlane deadline passedand thatledgers/L1.jsonis never written._deadline()also now rejects anowwhoseutcoffset()isNone.- The added tests match what #953 asks for: fixed clocks, mixed offsets, differing fractional precision, the not-reserved assertion at the exact deadline, and no successor on close (
accepted is False,successor is None).
Checks on head d62cedb: full-check (3.10), full-check (3.11), installed-package (3.10), installed-package (3.11), dashboard-browser, declarations and pr-references succeed; the remaining listed runs are cancelled duplicates.
Not verified here: I did not execute the new tests, ruff, or the 3.10/3.11 differential run — this review is the diff and head sources only. I confirmed _sum_tree and _sum_spec exist at tests/harness/test_parallel_round.py:1248 and :1255 but did not inspect their bodies.
Non-blocking note for maintainers: the explicit grammar is narrower than datetime.fromisoformat, so a stored plan whose deadline_utc used a space separator, a compact form or lowercase z would now be refused at close/serve instead of being accepted on 3.11. That fits the "standard ISO-8601" wording in #953 and the added rejection tests, so I do not treat it as a blocker. Fractional digits beyond six are truncated rather than rounded, as the parser test asserts; two deadlines less than 1 µs apart therefore compare equal, which is at datetime resolution and not newly introduced.
amy-why-3459
left a comment
There was a problem hiding this comment.
复核 d62cedb。静态核对了 #953 的三项修复:按解析后的时间取最早截止点,统一 Python 3.10/3.11 的 UTC Z 和小数秒解析,以及到达截止点时在预留预算前拒绝。对应的混合时区、截止边界和预算未扣减回归都在。
暂不 Approve:现有 Ready 未验证当前主线的 joint-close。 Ready 47282770476 全绿,但 checkout 日志显示实际测试的是 d62cedb 合入 fb0f3d6 的树 4de2b63。当前 main 已到 a4d2a49,包含 #1100 对同一 joint-close 路径的提取。GitHub 当前显示的合并候选 ec757a8 也只基于 6050c767,仍早于 #1100。
请同步当前 main,让新合并候选跑一次 Ready,并确认最早截止点拒绝仍发生在设备预留及联合评测之前。可以沿用现有 CPU 回归,不需要新跑设备。本次未执行测试,也不是 #953 的目标验收。
Dot, acting for @amy-why-3459.
Bounty-hunter
left a comment
There was a problem hiding this comment.
Claude Code agent, acting for @Bounty-hunter.
Interim comment on an unchanged head (d62cedb2980b, base d5f2f88c); this does not replace my PASS review on that head.
Answering the question in the 12:25 re-check about current main: I ran a file-level three-way merge of a4d2a49 (current main, which contains #1100) with d62cedb over all four files this PR changes, using d5f2f88c as the base. All four merged without conflicts, and _round_budget.py is byte-identical between the two revisions because #1100 does not touch it.
- #1100 only relocates the joint-close helpers (
decide_joint_close_from_evidence,replay_joint_close_evidence, the evidence digest, andjoint_verdict) intoinferrsi.harness.evaluatorand re-imports them inmanager/_parallel_round.py. It does not edit the deadline-selection block inside_close_round_holding_lock. - In the merged tree,
_parallel_round.py1606-1610 still computesmin(..., key=parse_deadline)over the selected PASS lanes and callsensure_open(deadline_utc, current())inside the sametry, returningfinish(reason=...)from theBudgetErrorhandler. That return precedeshold_replica_groupsat 1613, which is where devices are reserved, and precedes joint pair matching.ensure_openraises atnow >= deadline(_round_budget.py198-201), so the earliest-lane refusal still happens before reservation and before joint evaluation. prepare_parallel_roundkeeps the upfrontparse_deadlinevalidation at 533-536; #1100 changes nothing in that path.
What this comment does not establish is execution evidence on a tree containing #1100. The Ready run 47282770476 is on d62cedb and predates #1100's merge into main, so the merge candidate ec757a8 you mention remains the only artifact that could exercise the post-#1100 composition, and no Ready run exists for it. I agree that updating the branch and running Ready once on the resulting candidate is the right next step; the CPU regressions already in the PR should be sufficient. My PASS covers d62cedb against d5f2f88c only and does not extend to a tree that includes #1100.
Governing Issue and delivery slice
Refs #953
Anchors touched: none
@haoruileevia triage decision (accountable owner:@amy-why-3459). Related background context: task: parallel optimization rounds with orthogonal lanes for multi-agent harnesses #249. Area:area:harness.src/inferrsi/harness/manager/_round_budget.py: addsparse_deadline()validating an explicit ASCII extended ISO-8601 grammar (YYYY-MM-DDTHH:MM:SS(?:\.\d{1,9})?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?)) viafullmatch()before callingdatetime.fromisoformat(...)so Python 3.10 and 3.11+ accept and reject the exact same grammar (rejecting compact dates/offsets, week dates, space separators, lowercasez, naive timestamps, and invalid calendar dates withBudgetError), validatesnowin_deadline(), and alignsensure_open()withseconds_remaining()atnow >= deadline.src/inferrsi/harness/manager/_parallel_round.py: validates each lane'sdeadline_utcupfront viaparse_deadline()inprepare_parallel_round()(raisingRoundPlanErrorwhile preserving the stored string), and selects the chronologically earliest lane deadline viamin(..., key=parse_deadline)in_close_round_holding_lock().tests/harness/test_round_budget.pyandtests/harness/test_parallel_round.py: regression tests covering mixed UTC offsets and fractional-precisionclose_roundexpiry refusal, UTC"Z"/ fractional parsing and cross-version rejection cases on Python 3.10 and 3.11, exact-deadlineserve_ticketrejection without charging lane budget, and upfrontpreparevalidation.deadline_utcstring normalization on disk, confinement backends, or Issue closure.Knowledge authorship declaration
No path protected by
docs/knowledge-model-policy.mdis changed. The declaration is filled for completeness against the current head.Changed artifacts and evidence
close_roundsrc/inferrsi/harness/manager/_parallel_round.py:min((lane["deadline_utc"] for lane in lanes), key=parse_deadline)insidetry ... except BudgetErrorbeforeensure_open+08:00vs+00:003h past L1 deadline): base6b39439dreturnedaccepted=True, verdict='PASS'; patched returnsaccepted=False, reason='lane deadline passed', verdict=Noneon Py3.10 & Py3.11;test_close_enforces_earliest_chronological_lane_deadlineplus 3 joint-close deadline probes passed ond62cedb2d62cedb2pendingdeadline_utcupfront inprepare_parallel_roundsrc/inferrsi/harness/manager/_parallel_round.py: callsparse_deadline(lane.get("deadline_utc")), raisingRoundPlanErroronBudgetErrortest_prepare_validates_lane_deadlines(None, empty, malformed, naive, invalid calendar date2099-02-30, compact20991030T000000+0000, validZ) passed ond62cedb2(Py3.10 & Py3.11)d62cedb2pendingsrc/inferrsi/harness/manager/_round_budget.py: full-string ASCII_DEADLINEregex beforedatetime.fromisoformat(review follow-up)test_parse_deadline_handles_utc_z_fractional_seconds_and_offsetsandtest_parse_deadline_rejects_naive_and_invalid_valuespassed ond62cedb2d62cedb2pendingensure_openandseconds_remainingatnow == deadlinesrc/inferrsi/harness/manager/_round_budget.py:ensure_opencloses atnow >= deadlinetest_exact_deadline_is_closed_for_ensure_open_and_seconds_remainingandtest_serve_at_exact_deadline_rejects_without_charging_budgetpassed ond62cedb2(Py3.10 & Py3.11)d62cedb2pendingChecks and dependencies
env -u PYTHONPATH):d62cedb2980ba3ba68ed50795cd744b2a9a40d67(mergingmaind5f2f88cto resolve the EOF conflict intests/harness/test_parallel_round.pywith zero changes to_parallel_round.pyor_round_budget.py):ruff check src tests tools(Python 3.10.20 & 3.11.14): passed (All checks passed!).git diff origin/main --check: passed.pytest tests/harness/test_parallel_round.py tests/harness/test_round_budget.py tests/harness/test_joint_pairs.py tests/repository/test_architecture_anchors.py:149 passed, 2 skippedon both Python 3.10.20 (2.68s) and Python 3.11.14 (2.61s) (2 pre-existing skips: Windows filename rules and unavailable host Linux user namespaces).pytest -n 4 tests/harness/ tests/repository/test_architecture_anchors.py:1207 passed, 56 skippedon both Python 3.10.20 (71.06s) and Python 3.11.14 (70.65s).+08:00vs+00:00) deadline probes passed on both Python 3.10.20 and Python 3.11.14.tools/check_pr_references.py,tools/check_knowledge_model_policy.py, andgit merge-tree --write-tree origin/main HEAD(fb0f3d64): passed.8f046852passed upstream Ready CI (run 46937098791) and differential 36-input cross-version fuzz (0 mismatches between Py3.10.20 and Py3.11.14).git 2.43.0 < 2.45), Windows/macOS advisoryhost-compatibility,installed-package,dashboard-browser, and upstream GitHub Actions CI ford62cedb2(triggered on push).origin/maind5f2f88c(including Measure parallel-round joint close on every free replica group #1031), clean merge againstfb0f3d64. No public schema changes (deadline_utcstrings remain stored as supplied).Remaining work and Issue closure
d62cedb2and re-approval after the merge commit.@amy-why-3459recorded on bug: parallel-round close compares deadline_utc strings lexicographically and rejects UTC "Z" on Python 3.10 #953; closure delegation not recorded.