Skip to content

fix(server/checkin): address outstanding nondeterminisim in graph creation#798

Merged
nitsky merged 6 commits intomainfrom
repro/symmetric-nodes-different-entrypoints
Jan 27, 2026
Merged

fix(server/checkin): address outstanding nondeterminisim in graph creation#798
nitsky merged 6 commits intomainfrom
repro/symmetric-nodes-different-entrypoints

Conversation

@deciduously
Copy link
Member

Publishing packages from different entry points produced different IDs for the same package (e.g., tg publish std then tg publish jq would give std different IDs).

Root causes:

  1. When computing initial labels for the Weisfeiler-Leman algorithm, external pointers (references to nodes
    outside the SCC) retained ephemeral checkin graph indices instead of resolved object IDs. These indices differ based on entry point.
  2. Symmetric nodes with identical content produce identical WL labels, and the sort preserves non-deterministic input order from Tarjan's SCC discovery.

Fix:

  1. In checkin_graph_node_initial_label, resolve external pointers to their object/artifact IDs.
  2. Use file paths as a tiebreaker when sorting nodes with identical canonical labels.

// External pointer: resolve to artifact ID.
let external_node = graph.nodes.get(&p.index).unwrap();
external_node.artifact.as_ref().map_or_else(
|| edge.clone(),
Copy link
Member

Choose a reason for hiding this comment

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

this falls back to the case that caused the bug where edge has the pointer to the index, we should explicitly error.

@nitsky nitsky merged commit 6363ed8 into main Jan 27, 2026
@nitsky nitsky deleted the repro/symmetric-nodes-different-entrypoints branch January 27, 2026 21:19
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.

3 participants