[BUG]: verify_segment accepts empty, wrong-phase, or non-positive fork exclusions as MATCH
Maintainers usually reply within 1 day
@Arnav0107 is already working on this.
Since Nov 26, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, machine-learning
Research direction
Start in simple/ovl.py at verify_segment() around lines 544–552, then read how excluded() parses control["exclude"]. Check the fork validation against the expected rules in this issue, including empty or wrong-phase exclusions and non-positive counts. Done when the supplied CPU reproduction rejects all four malformed cases while valid fork exclusions still match.
Written by the indexing model from the issue text.
Description
Summary
In simple/ovl.py, verify_segment() handles want["kind"] == "fork" by checking:
added = {key: v for key, v in want["control"].items() if key != "exclude"}
ok = (
want["state"] == chain[k]["state"]
and want["model"] == chain[k]["model"]
and added == chain[k]["control"]
and "exclude" not in chain[k]["control"]
and all(s >= chain[k]["control"]["cursor"] for s, _ in excluded(want["control"]))
)
Because excluded(ctl) only reads ctl.get("exclude", {}).get(ctl["phase"], []) and the check never inspects exclude keys or n in [s, n], verify_segment() returns True (MATCH) for forged or malformed "fork" entries whose control["exclude"] is:
- empty (
{}or{"wikipedia": []}), whereall(...)is vacuouslyTrue, - for a different phase (
{"conversation": [[150, 25]]}), whichexcluded()ignores whilephase == "wikipedia", - non-positive target counts (
{"wikipedia": [[150, 0]]}or[[150, -5]]).
Source
simple/ovl.py(verify_segment, lines 544–552)
Reproduction (CPU)
import hashlib, json, os, sys, tempfile
from pathlib import Path
import torch
os.environ["OVL_DEVICE"] = "cpu"
sys.path.insert(0, "simple")
import ovl
with tempfile.TemporaryDirectory() as tmp:
d = Path(tmp)
model, opt = ovl.fresh()
sd, opt_sd = model.state_dict(), opt.state_dict()
m_dig, s_dig = ovl.model_digest(sd), ovl.state_digest(model, opt)
ctl0 = {**ovl.initial_control(), "cursor": 100}
e0 = {"index": 0, "kind": "initial", "control": ctl0, "state": s_dig, "model": m_dig, "previous": None}
h0 = hashlib.sha256(json.dumps(e0, sort_keys=True).encode()).hexdigest()
torch.save({"control": ctl0, "model": sd, "opt": opt_sd}, d / "ckpt-00000.pt")
for bad_exclude in ({}, {"conversation": [[150, 25]]}, {"wikipedia": [[150, 0]]}, {"wikipedia": [[150, -5]]}):
ctl1 = {**ctl0, "exclude": bad_exclude}
e1 = {"index": 1, "kind": "fork", "control": ctl1, "state": s_dig, "model": m_dig, "previous": h0}
torch.save({"control": ctl1, "model": sd, "opt": opt_sd}, d / "ckpt-00001.pt")
print(bad_exclude, "->", ovl.verify_segment(None, d, [e0, e1], 0))
All four cases print True (segment 0->1 (fork): MATCH).
Expected Behavior
For want["kind"] == "fork", verify_segment() should require control["exclude"] to be a dict keyed only by {want["control"]["phase"]}, with at least one [s, n] range where s >= chain[k]["control"]["cursor"] and n > 0.
- Dominant language
- Python
- Stars
- 27
- Forks
- 72
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 45
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/OpenVerifiableLLM
-
[BUG]: ovl.py verify --weights crashes with AttributeError on checkpoint .pt filesPossibly taken @Anurag1428 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/OpenVerifiableLLM#387 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG]: preparation.lock install fails on macOSPossibly taken @darshith2527-sketch claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/OpenVerifiableLLM#357 · 3 comments ·
Maintainers usually reply within 1 day
-
[BUG]: Forked runs omit timestamps for inherited chain entriesPossibly taken @pavithra-r06 claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/OpenVerifiableLLM#334 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[BUG]: review_ckpt.py passes a run that has .pt files no chain entry coversPossibly taken @arshil42 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/OpenVerifiableLLM#332 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[BUG]: DigiCert timestamp verification fails on Windows because system_ca() ignores Windows CA bundlesPossibly taken @pavithra-r06 claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/OpenVerifiableLLM#290 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in AOSSIE-Org/OpenVerifiableLLM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
bad-antics/lateralus-lang#1140 ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
fixture good first issue help wanted vendor:cisco
Difficulty 1/5 1-3 hours Newbie friendliness 85/100