Skip to content

test(runtime): isolate symbol Bloom filter state - #9383

Closed
proggeramlug wants to merge 2 commits into
PerryTS:mainfrom
proggeramlug:fix/9344-stable-symbol-probe
Closed

proggeramlug wants to merge 2 commits into
PerryTS:mainfrom
proggeramlug:fix/9344-stable-symbol-probe

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes the symbol Bloom-filter probe regression independent of process-wide test order and population. Test builds now isolate the filter with the SYMBOL_POINTERS registry it guards, while production keeps the same process-global static.

Changes

  • Declare SYMBOL_ADDR_FILTER with per_test_global!, which preserves the existing static in non-test builds.
  • Make the regression deterministic by priming the exact false-positive address on an unrelated worker thread; the old global filter leaks that admission, while the isolated test filter does not.
  • Keep the positive assertion that a registered symbol is admitted and reaches SYMBOL_POINTERS.
  • Add the required changelog fragment without changing the workspace version.

Related issue

Fixes #9344

Test plan

  • cargo build --release clean (not run; targeted production-mode cargo check passed)
  • Full host-compatible workspace test command (not run; full affected runtime library suite passed)
  • Added or updated a #[test] in the affected crate
  • Documentation update not required; test-only behavior changed
  • Platform UI backends not touched

Additional checks run:

  • cargo fmt --all -- --check
  • cargo check --release -p perry-runtime --lib
  • cargo test --release -p perry-runtime --lib — 2,890 passed, 4 ignored, 0 failed
  • python3 scripts/global_sink_isolation.py --self-test
  • python3 scripts/global_sink_isolation.py
  • cargo clippy --release -p perry-runtime --lib

Screenshots / output

Not applicable.

Checklist

  • I have NOT bumped the workspace version or edited CLAUDE.md / CHANGELOG.md (maintainer handles these at merge)
  • My commits follow the loose feat: / fix: / docs: / chore: prefix convention used in the log
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability of symbol-address filtering by preventing stale state from leaking between test runs.
    • Added coverage for false-positive symbol matches in worker-thread scenarios.
  • Tests

    • Strengthened test isolation and determinism for runtime symbol registry checks.
    • Production behavior remains unchanged; these updates improve confidence in internal validation without affecting end-user functionality.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 8065286d-f9fd-4c59-81e3-9543c0203c80

📥 Commits

Reviewing files that changed from the base of the PR and between e284cab and e183c01.

📒 Files selected for processing (3)
  • changelog.d/9383-symbol-filter-test-isolation.md
  • crates/perry-runtime/src/registry_latch_probes.rs
  • crates/perry-runtime/src/symbol.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The symbol address Bloom filter now has per-test lifetime in test builds. The regression test populates a worker thread's filter with a controlled false positive before checking registry access. Production retains the process-global filter.

Changes

Symbol filter isolation

Layer / File(s) Summary
Per-test filter lifetime
crates/perry-runtime/src/symbol.rs
SYMBOL_ADDR_FILTER now uses per_test_global! in test builds and the existing process-global storage in production. SymbolAddrRangeGuard documentation describes the updated lifetime.
Controlled false-positive regression test
crates/perry-runtime/src/registry_latch_probes.rs, changelog.d/9383-symbol-filter-test-isolation.md
The test admits FAR_OUTSIDE_ANY_WINDOW from a worker thread, joins the thread, and checks rejection before allocating its own symbol. The changelog records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to e183c

This PR isolates the symbol Bloom-filter regression test without changing production behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: isolating symbol Bloom-filter state during tests.
Description check ✅ Passed The description includes the required Summary, Changes, Related issue, Test plan, Screenshots / output, and Checklist sections. It documents the implementation, issue reference, validation results, an…
Linked Issues check ✅ Passed The changes address issue #9344 by isolating SYMBOL_ADDR_FILTER per test, making the false-positive regression deterministic, and preserving the registered-symbol admission assertion.
Out of Scope Changes check ✅ Passed The changes are limited to the symbol filter declaration, its regression test, and the required changelog fragment. No unrelated code changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 …
Full details: Description check

Explanation

The description includes the required Summary, Changes, Related issue, Test plan, Screenshots / output, and Checklist sections. It documents the implementation, issue reference, validation results, and intentionally skipped full commands.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

proggeramlug added a commit that referenced this pull request Sep 1, 2026
* test(runtime): isolate symbol Bloom filter state (#9344)

* docs(changelog): note symbol filter test isolation

* fix: land the symbol-filter isolation and fix CONCAT_MEMO's thread-local

check_thread_locals.py is red on main from #9373's raw thread_local!.

---------

Co-authored-by: Ralph Küpper <ralph@skelpo.com>
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Superseded by #9390, which lands your change with the conflict resolved in its favour — details there and on #9344. The per_test_global! isolation plus the planted false positive is the right shape: it makes the assertion able to fail, where the reset-guard workaround already on main only stopped the flake.

@proggeramlug
proggeramlug deleted the fix/9344-stable-symbol-probe branch September 1, 2026 12:18
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.

Flaky: symbol_probe_rejects_a_filtered_address_without_touching_the_registry depends on Bloom filter population

1 participant