Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

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

Daniel Han4f4305ea10c4
diff --git a/tests/studio/studiobench/fixture/selftest/test_studiobench_parity_digest.py b/tests/studio/studiobench/fixture/selftest/test_studiobench_parity_digest.py
index f8b7f02094c..9737919dfd2 100644
--- a/tests/studio/studiobench/fixture/selftest/test_studiobench_parity_digest.py
+++ b/tests/studio/studiobench/fixture/selftest/test_studiobench_parity_digest.py
@@ -211,6 +211,31 @@ def test_a_volatile_attribute_keeps_its_presence_even_though_its_value_is_droppe
assert a == b
+def test_every_data_id_attribute_is_volatile():
+ """The turn navigator's data-turn-id carries message ids: a null control differed on every action
+ until it was dropped. Any data-*-id is an instance id; only its presence is structure."""
+ a, b, plain = sigs(
+ {"tag": "button", "attrs": {"data-turn-id": "Xk2pQ9a"}},
+ {"tag": "button", "attrs": {"data-turn-id": "Bm7rT4c"}},
+ {"tag": "button", "attrs": {}},
+ )
+ assert a == b
+ assert a != plain
+ one, two = sigs(
+ {"tag": "li", "attrs": {"data-queue-item-id": "q1"}},
+ {"tag": "li", "attrs": {"data-queue-item-id": "q2"}},
+ )
+ assert one == two
+
+
+def test_a_data_attribute_that_is_not_an_id_still_moves_the_signature():
+ one, two = sigs(
+ {"tag": "button", "attrs": {"data-turn": "1"}},
+ {"tag": "button", "attrs": {"data-turn": "2"}},
+ )
+ assert one != two
+
+
def test_the_shared_signature_still_sees_virtualization_bookkeeping():
"""Visible-region digest drops aria-posinset and aria-setsize; the shared signature keeps them."""
plain, numbered = sigs(
diff --git a/tests/studio/studiobench/scene/parity.js b/tests/studio/studiobench/scene/parity.js
index 03279b62283..fb59de0e322 100644
--- a/tests/studio/studiobench/scene/parity.js
+++ b/tests/studio/studiobench/scene/parity.js
@@ -20,6 +20,11 @@
"data-tool-call-id", "data-checkpoint-id",
]);
+ // Any other data-*-id names an instance too: the turn navigator's data-turn-id (#16300) carries
+ // message ids and differed on every action of a null control. Presence is still compared.
+ const ID_ATTR_RE = /^data-[a-z0-9-]+-id$/;
+ const isVolatile = (name) => VOLATILE_ATTRS.has(name) || ID_ATTR_RE.test(name);
+
const IGNORED_ATTRS = new Set(["data-react-checksum", "data-reactroot"]);
// Dropped only from the visible-region digest; see parityVisible.capture().
@@ -132,7 +137,7 @@
}
names.sort();
for (const name of names) {
- if (VOLATILE_ATTRS.has(name)) {
+ if (isVolatile(name)) {
parts.push(" " + name + "=*");
} else {
parts.push(" " + name + "=" + attrValue(el, name));