Skip to content

studiobench parity: treat every data-*-id attribute as an instance id - #16464

Merged
danielhanchen merged 1 commit into
mainfrom
dh/parity-turn-id-volatile
Nov 2, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/parity-turn-id-volatile

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Parity verdict, scored against the null fails on unrelated PRs whose base includes #16300 (d56738f404, the turn navigator at the chat's left edge). In the last two hours it failed on #16458 (a backend-only change) and on staging for #16463 and #16435, each time the same way:

matched:                    0
unstable actions differing: 32  (expected to vary; not a verdict)
NOTHING WAS COMPARED. ... This is not a pass.

In the null control (the same build on both arms), every action's thread scaffold digest differs, even between two repetitions on the same arm, while its length stays equal (thread scaffolding outside any message (24167->24167c)). That is an instance id leaking into the structural signature.

#16300 renders the navigator inside the thread root, outside every message, as one button per turn with data-turn-id={openerId}. openerId is the turn's opening message id (thread-turns.ts pushes message.id). scene/parity.js already drops the values of data-message-id, data-thread-id and the other id attributes it knew about, but not this new one. Studio's message ids are short and random, so ID_RE does not catch them in the value either.

The product is fine; the instrument fell behind the DOM.

Change

  • tests/studio/studiobench/scene/parity.js: an attribute is volatile if it is in VOLATILE_ATTRS, or if its name matches data-*-id. A volatile attribute keeps its presence in the signature and loses only its value, as before.
    • Every data-*-id in the frontend names an instance, e.g. data-turn-id, data-queue-item-id, data-bookmark-id, data-entry-id.
    • So the next one added inside the thread cannot silently empty the verdict the way this one did.
    • Non-id data attributes (data-turn, data-role, data-state, ...) still compare by value.
  • tests/studio/studiobench/fixture/selftest/test_studiobench_parity_digest.py (these run the shipped parity.js under node):
    • test_every_data_id_attribute_is_volatile: two different data-turn-id values sign the same, a button with the attribute still differs from one without it, and the same holds for data-queue-item-id.
    • test_a_data_attribute_that_is_not_an_id_still_moves_the_signature: data-turn="1" against "2" still differs.

Testing

  • tests/studio/studiobench/fixture/selftest, sweep/selftest and analysis/selftest: 606 passed.
  • Sabotage: with main's parity.js, test_every_data_id_attribute_is_volatile fails; the other new test passes on both.
  • Not proven here: I did not rerun the full parity sweep locally. The PR's own parity job is the end-to-end check. On main's harness it should report a non-zero matched count on this PR, as the runs before Studio: turn navigator at the chat's left edge, building on #11668 #16300 did (28 or 29).

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T08:02:28.802787Z df7cab6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: df7cab60d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 4f4305e into main Nov 2, 2026
@danielhanchen
danielhanchen deleted the dh/parity-turn-id-volatile branch November 2, 2026 09:41
oobabooga pushed a commit to oobabooga/unsloth that referenced this pull request Nov 3, 2026
…othai#16468)

Opening the same Studio session in two windows can log both windows out when their access tokens expire together. Refresh tokens are single-use, but refresh coordination was limited to each window: the losing 401 could clear shared credentials before the successful refresh saved its rotated pair.

This branch includes the reviewed unslothai#16471 spacing fix as a shared frontend CI dependency. The Settings component is byte-identical to that PR. Merge unslothai#16471 first to keep the remaining diffs focused; the dependency is already present here for validation.

Serialize refresh across same-origin windows using Web Locks, then reuse a peer's rotated token only within the same session. Lock acquisition is bounded without cancelling a submitted refresh request. Existing sessions retain their session marker, and logout and account-switch boundaries remain enforced. Browsers without Web Locks retain the existing behavior.

Validation:

- Matching-head scoped staging passes 21 Python auth/font checks and 75 Node checks on each of [Linux](https://github.com/LeoBorcherding/unsloth/actions/runs/41583927636), [Apple Silicon macOS](https://github.com/LeoBorcherding/unsloth/actions/runs/41583927585) and [Windows](https://github.com/LeoBorcherding/unsloth/actions/runs/41583927734), with zero failures or skips. Raw logs and exact source-head ancestry were checked. The real frontend/backend reproductions below provide the actual Studio UI evidence.
- The current head also carries unslothai#16471's rich-paste badge correction for the font-contract CI regression introduced by unslothai#16298. Both Settings components are byte-identical to the parent. Local validation passes 21 Python checks, 75 Node checks and the full frontend suite: 14,747 passing, zero failing and one existing skip. Refreshed cross-platform checks include the Python font contract. The first expanded frontend run used symlinked dependencies outside Vite's root and is excluded; the passing run uses a normal local dependency installation.
- Full Studio pages and the real backend refresh endpoint reproduce the race in Chromium. Seeded invalid access plus a real refresh token and a controlled two-second successful-response delivery delay produce base responses 401 / 200, both windows at `/login`, and credentials cleared. This branch produces one 200, both windows at `/chat`, and credentials retained. The delay forces ordering; it is not a claim about natural frequency or backend task survival.
- Two real pages running the production auth modules against a single-use refresh endpoint reproduce the failure in Chromium, Firefox, WebKit and Edge. Base sends two refresh requests and loses credentials; this branch sends one, both pages return `ok`, and the rotated credentials remain stored.
- Identical differential tests against refreshed merge base `242f14b1d`: base 27 pass / 6 fail; branch 33 pass / 0 fail / 0 skip. Five are behavioral fixes; one calls a new session helper and is counted as a new API check, rather than a repaired baseline defect. Base production sources and test-file hashes were verified. The broader original focused auth selection passes 72 tests.
- The local switchboard reports `NO_REGRESSION` for auth, settings and route crawling: 38 same steps and one zero-pixel Hub DOM variation. The signed-in chat route, composer and stored session also survive a real reload on both sides.
- Linux, macOS and Windows staging checks complete. Paired Studio journeys pass the functional gate on Linux and macOS Intel. The original Apple Silicon paired arms were cancelled before acquiring runners; macOS smoke checks ran separately. The final paired native run with the hardened test client passes all ten Desktop steps on both sides, with exact `rc=0` receipts and a passing strict evidence gate. One dropped body-text response is recovered on the base arm; navigation, clicks and assertions are not replayed. Earlier native transport failures remain recorded, and the client hardening is isolated in unslothai/scripts#790. One baseline route screenshot is missing after a dropped GET response; that visual comparison is not claimed.
- The refreshed combined application tree with unslothai#16470 and unslothai#16471 passes its production build and all 62 actual Tauri command tests. Its frontend Git tree equals this branch's tested tree.
- The CPU auth fixture now exports the two session helpers that its production module imports. Its nine redirect checks pass without relaxing their assertions. The merged parity normalizer from unslothai#16464 is included. Current organization CI remains queued or running; the completed owned staging results above provide scoped evidence.

This fixes a demonstrated refresh race; the report of backend jobs actually being cancelled has not been reproduced. Plain HTTP LAN origins without Web Locks retain the existing race limitation. Core inference, notebooks, backend token rules and model prompts are unchanged.

Two real Studio windows after the controlled refresh race:

![Two-window refresh before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16468/pr16468_two_window_refresh-96fd1500f631.png)

The shared spacing dependency below is the exact unslothai#16471 change; this comparison validates that dependency.

![Shared Settings spacing dependency before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16471/pr16471_before_after-a78db41ffd5e.png)

The inherited rich-paste badge correction is also byte-identical to unslothai#16471. At the enlarged font setting it scales from the previous fixed 10 px to 15 px, with the feature and switch retained:

![Shared rich-paste font-scaling dependency before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16471/pr16471_before_after-3e473cadeed6.png)
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.

1 participant