Skip to content

Fix sync() when fork(1) - #412

Merged
hnyls2002 merged 3 commits into
mainfrom
fix-sync
May 8, 2024
Merged

hnyls2002 merged 3 commits into
mainfrom
fix-sync

Conversation

@hnyls2002

@hnyls2002 hnyls2002 commented May 7, 2024 •

Copy link
Copy Markdown
Collaborator

This pr fixes #410 due to missing sync() operation when fork(1).

History review:

  • This commit 67be11c removes the fork > 1 condition, which tries to resolve the racing condition. This can be done by only a sync(?)
  • This PR Reduce overhead when fork(1) #375 reverts the condition to reduce the overhead of caching in benchmark react, but it brings a racing condition back.

To solve these two problems, we always sync before forking and only commit lazily when fork num > 1.

@Ying1123 Ying1123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit lazy is a legacy feature. I suspect we can remove it as well.

@hnyls2002
hnyls2002 merged commit d5de20a into main May 8, 2024
@hnyls2002
hnyls2002 deleted the fix-sync branch May 8, 2024 07:15
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 19, 2026
…host tier (scaffolding)

NEITHER FLAG ALONE DEGENERATES; THE PAIR DOES. Measured as a 2x2 on the
short-prompt gate, identical temperature-0 requests scored for REPETITION
rather than for wording:

    hierarchical off, interval off -> 0/16 REP, 2 distinct
    hierarchical off, interval ON  -> 0/16 REP, 1 distinct   (full pass)
    hierarchical ON,  interval off -> 0/16 REP, 6 distinct
    hierarchical ON,  interval ON  -> 10/16 REP

The failure is repetition -- ' France is France is France is' -- permanent once
it starts, which is a correctness fault rather than the run-to-run drift the
sgl-project#412 determinism certificate documents as expected behaviour.

THE UNDERSTOOD HALF IS ALREADY REPAIRED and this refusal is not a substitute
for it: the branching-state fill now runs under a host tier (fa68dcb), so the
interval's grid-gated inserts and its anchor-establishing fill are no longer
separated. That did not clear the REP (6/16 with the fill in, against a 6-11
run-to-run band), and neither did dropping the affected matches outright
(ec48743), so the match-time mismatch is a SYMPTOM and the producer is still
unidentified.

Until it is found, the combination must not ship silently wrong -- a confident
wrong answer is the worst class this corpus tracks. Both features are wanted
together, so this is scaffolding written to be deleted by the commit that finds
the producer, and it says so in its own docstring.

ruff: 357 pre-existing F722 in this file at HEAD and after, none added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat role prefixes for SRT backend broken in latest

2 participants