Skip to content

Take tree-sitter-language-pack 1.24.0: oracle reads fused macro statements, baselines move (Part of #8481) - #8938

Merged
squid-shepherd[bot] merged 10 commits into
mainfrom
churn/8481-20261121T1958Z
Nov 22, 2026
Merged

squid-shepherd[bot] merged 10 commits into
mainfrom
churn/8481-20261121T1958Z

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Part of #8481 (the dependabot unhold and the CI triggers are the second slice, below)

What

Takes tree-sitter-language-pack 1.24.0 deliberately (it was reverted in e1ad80e after php / powershell / srb2 moved):

  • ci/requirements/treesitter.* and solver.* pin 1.24.0 again (hash-pinned, pin_requirements.py --check OK).
  • tests/tree_sitter_accuracy_baseline_php.json / _powershell.json take CI's measured numbers (php 1706 -> 1707; powershell real 487 -> 489, args exact 484 -> 486).
  • language_standards/__init__.py: the summary table's Php row (99.9% -> 100.0%), regenerated.
  • The srb2 call-graph drift was an oracle regression, not an engine change: see below. The srb2 golden does not move.
  • tests/golden_doom_rosetta/gzdoom.json.gz is re-blessed (generated): the oracle fix, not the pack, moves gzdoom (see below).

The three srb2 edges (AM_* -> FixedMul)

1.24.0's C grammar reads a bare macro statement (a macro with no semicolon, NOHUD / INLEVEL) followed by an if ... else f(x); as ONE declaration with an ERROR child, and else f(L); as a declaration of a function f returning type else. The oracle (callgraph_oracle._macro_prefixed_call, #6266) only recognised the 1.22 shape (MACRO f(x);), so the calls in the fused span vanished from the oracle while the engine, which does not use the grammar, still found them: engine-only "absent" edges, precision 0.9999 -> 0.9966.
The fix recovers calls from that fused declaration (macro-named type, or else / do, with function declarators and ERROR children only), with the same broken / desynced bookkeeping the ERROR branch uses. With it doom_rosetta_check.py --only srb2 is ok against the unchanged golden on 1.24.0.

gzdoom golden (Opus rescue)

On pack 1.24.0, main's oracle leaves gzdoom ok, and this PR's oracle moves it: callgraph_precision 0.9665 -> 0.9667, callgraph_unscored 3891 -> 3879 (the shard 2 failure). I diffed per-function oracle calls, old predicate against new, over the whole gzdoom clone. 27 function bodies change, every change is an addition (none removed), and each added call is a real call in a macro-fused span: else Tick(); / else BeginPlay(); / else return Die(...) after gzdoom's IFVIRTUAL blocks (p_mobj, dthinker, p_interaction, hudmessages, shared_sbar), and the VMA_DEBUG_GLOBAL_MUTEX_LOCK bodies in vk_mem_alloc.h (allocator->Map(...) etc.). The new predicate also matches ASMJIT_API Error emit(...); class-member declarations, but none of them is inside a function body the oracle reads, so they add no calls. Blessed --only gzdoom. After the bless, doom_rosetta_check.py --only gzdoom,srb2 is ok on 1.24.0.

Regression test

test_a_bare_macro_statement_fused_with_the_calls_after_it_keeps_every_call_8481 (the srb2 shape, generic names). Fails on 1.24.0 without the fix (lua_pushnil missing), passes with it.

Class / Sibling gaps

Class: a newer grammar changing how a statement-shaped construct parses silently shifts an oracle built on it. Sibling gaps: none found in the other oracles with the pack on 1.24.0 (php / powershell accuracy audits both match their baselines). gzdoom (C++) has the same shape (IFVIRTUAL + else f();) and is re-blessed above. The other ports passed in CI shard 2 with the fix.

Remaining slices

  • Second PR (5-file cap): remove the tree-sitter-language-pack ignore entry in .github/dependabot.yml (the hold stays in place until then), and
    the CI triggers: a PR changing ci/requirements/treesitter.* / solver.* should run the tree-sitter accuracy, history, tri-comparison and doom-rosetta checks (they miss it today, which is why this bump went unnoticed). Patch: accuracy_audit_plan.py (+ test) and the four workflows' paths: / Scope grep; it needs a ci_experiments_log.md entry and the runner-minutes / PR-share measurement.

Facts checked

  • pack 1.24.0 reproduces the issue's srb2 numbers locally (private install in scratch); with the fix, the check is ok on the unchanged golden.
  • php and powershell tree_sitter_accuracy_audit.py --ci match the committed baselines on 1.24.0.
  • pr_gates --fast 9/9, audit_check.py all clear; ruff format --check clean on changed files.
  • Unexplained, left open: the powershell melek corpus is 123 files locally vs 124 in CI.

Lessons for agents

  • python -I drops PYTHONPATH: a private pack install is silently ignored (you get the venv's old pack).
  • A tree-sitter grammar bump can move an oracle with no engine change: diff the engine-only edge list old pack vs new pack before blessing.

🤖 Generated with Claude Code

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 21, 2026 20:20
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 20:49
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 21, 2026 21:11
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #8938 @ 90f3ad8: 2 failed check(s)

== shard 2 (1669485 LOC) (failure) -- main
https://github.com/squid-protocol/gitgalaxy/actions/runs/44945733853/job/136976412723
repro: stale base (main changed engine source since this branch, and this PR touches none of it): git merge origin/main; if the test still fails after the merge it is this PR's
failing tests: tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[gzdoom]
errors:
E AssertionError:
tests/doom_rosetta/test_doom_rosetta.py:47: AssertionError
FAILED tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[gzdoom] - AssertionError:
##[error]Process completed with exit code 1.
log tail:
FAILED tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[gzdoom] - AssertionError:
gzdoom: 2 difference(s) from the golden
summary.callgraph_precision: 0.9665 -> 0.9667
summary.callgraph_unscored: 3891 -> 3879
(bless an intended change with tests/tools/doom_rosetta_check.py --update --yes)
assert not 'gzdoom: 2 difference(s) from the golden\n summary.callgraph_precision: 0.9665 -> 0.9667\n summary.callgraph_unscored: 3891 -> 3879'
1 failed, 10 passed, 28 deselected in 196.75s (0:03:16)
##[error]Process completed with exit code 1.
##[group]Run s=$(( $(date +%s) - T0 ))
s=$(( $(date +%s) - T0 ))
echo "shard 2 (1669485 LOC): ${s}s" >> "$GITHUB_STEP_SUMMARY"
shell: /usr/bin/bash -e {0}
env:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
DOOM_SPEEDRUN_WORK: /home/runner/work/gitgalaxy/gitgalaxy/../doom-work
DOOM_ROSETTA_PORTS: agentic-cobol-doom-codex,dartdoom,doomgeneric,edge-classic,fps-cob,gzdoom,mood,odamex,room4doom,rust-doom,sdl-doom
T0: 1795294183
pythonLocation: /opt/hostedtoolcache/Python/3.12.16/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.16/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.16/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.16/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.16/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.16/x64/lib
##[endgroup]
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/16e11f79-90d7-48f1-8d27-2075fd687e73' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== tree-sitter-accuracy-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/44945733756/job/136977802845
repro: python tests/tools/pr_gates.py --fast
errors:
##[error]gitgalaxy/standards/language_standards/init.py's summary table is stale.
##[error]Process completed with exit code 1.
log tail:
pythonLocation: /opt/hostedtoolcache/Python/3.12.16/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.16/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.16/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.16/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.16/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.16/x64/lib
##[endgroup]
tree_sitter_accuracy_audit: updated the summary table in gitgalaxy/standards/language_standards/init.py.
diff --git a/gitgalaxy/standards/language_standards/init.py b/gitgalaxy/standards/language_standards/init.py
index 7ea2236..cd02749 100644
--- a/gitgalaxy/standards/language_standards/init.py
+++ b/gitgalaxy/standards/language_standards/init.py
@@ -49,7 +49,7 @@ for the same metrics tracked over time across pushes to main.
| Matlab | 100.0% | 100.0% | N/A | N/A |
| Objective-C | 100.0% | 99.4% | 100.0% | 100.0% |
| Perl | 100.0% | 100.0% | 100.0% | 100.0% |
-| Php | 100.0% | 99.9% | 100.0% | 100.0% |
+| Php | 100.0% | 100.0% | 100.0% | 100.0% |
| Powershell | 100.0% | 100.0% | 100.0% | 100.0% |
| Python | 100.0% | 99.6% | 100.0% | 100.0% |
| Ruby | 98.5% | 100.0% | 100.0% | 100.0% |
##[error]gitgalaxy/standards/language_standards/init.py's summary table is stale.
Run 'python tests/tools/tree_sitter_accuracy_audit.py --summary-table' and commit the result.
##[error]Process completed with exit code 1.
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/1e0c4b75-67d1-4f0c-84ef-ba2c22067f50' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 21, 2026
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (c6141bc) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 21, 2026 21:24
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 21, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Nov 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 21, 2026 21:37
@squid-shepherd squid-shepherd Bot added the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 21, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 21:51
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 21, 2026 22:17
@squid-shepherd squid-shepherd Bot added shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md and removed shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md labels Nov 22, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 22, 2026 13:31
@squid-shepherd squid-shepherd Bot removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Nov 22, 2026
@squid-shepherd
squid-shepherd Bot merged commit 7baee5c into main Nov 22, 2026
75 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8481-20261121T1958Z branch November 22, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant