-
Notifications
You must be signed in to change notification settings - Fork 19
gc: put the per-thread GC box behind a gc_box feature and gate its remaining dynasm probes
#1098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4b4b1ca
jit: restore the vstack mirror across a layout excursion that returns…
youknowone 331de1d
jit(dynasm): gate the remaining per-thread GC-box probes on gc_box_in…
youknowone 567f50c
comment: cite the upstream decision points behind three structural ad…
youknowone bce38e0
jit(gc): put the per-thread GC box behind a `gc_box` feature
youknowone 9fa47aa
comment: name `install_gc_standalone` as what the JIT driver initiali…
youknowone 92e1279
jit: run the shadow hole-fill after the vstack arm-point restore
youknowone be37ba0
jit(gc): reach the per-thread GC box through one accessor module per …
youknowone be1f980
posix: answer Windows fstat from StatStruct, not std::fs::Metadata
youknowone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
pyre/bench/synth/getframe_method_call_residual_body_once.cranelift.jitstats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| bridges_compiled=0 | ||
| descr_set_absent=0 | ||
| descr_set_ambiguous=0 | ||
| descr_set_stale_absent=0 | ||
| fbw_blackhole_adopted_multi_frame=0 | ||
| fbw_blackhole_adopted_single_frame=10 | ||
| fbw_rolled_back_with_effects=0 | ||
| fbw_store_journal_rollback_failed=0 | ||
| field_pos_attached_misplaced=0 | ||
| field_pos_spec_misplaced=0 | ||
| guard_failures=0 | ||
| internal_compile_panics=0 | ||
| loops_aborted=10 | ||
| loops_compiled=0 |
14 changes: 14 additions & 0 deletions
14
pyre/bench/synth/getframe_method_call_residual_body_once.dynasm.jitstats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| bridges_compiled=0 | ||
| descr_set_absent=0 | ||
| descr_set_ambiguous=0 | ||
| descr_set_stale_absent=0 | ||
| fbw_blackhole_adopted_multi_frame=0 | ||
| fbw_blackhole_adopted_single_frame=10 | ||
| fbw_rolled_back_with_effects=0 | ||
| fbw_store_journal_rollback_failed=0 | ||
| field_pos_attached_misplaced=0 | ||
| field_pos_spec_misplaced=0 | ||
| guard_failures=0 | ||
| internal_compile_panics=0 | ||
| loops_aborted=10 | ||
| loops_compiled=0 |
57 changes: 57 additions & 0 deletions
57
pyre/bench/synth/getframe_method_call_residual_body_once.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # A method-form `LOAD_ATTR` + `CALL` whose callee forces the calling frame and | ||
| # then raises, caught in the loop body. The callee's own body is outside every | ||
| # journal, so a walk that cannot commit makes the legacy entry replay run it a | ||
| # second time per trace attempt: `Force.hits` climbs past the iteration count | ||
| # while `total` and `len(seen)` — both journaled — stay correct. That asymmetry | ||
| # is the whole oracle; a bench that only checked the loop result saw nothing. | ||
| # | ||
| # The shape matters, not the effect. `f.raiser()` lowers to `LOAD_ATTR` (method | ||
| # form) followed by `CALL`, and the CALL's lowering re-enters the LOAD_ATTR | ||
| # source segment, so the walk's py_pc floor reports the earlier opcode again | ||
| # after the later one. That backward step is no CFG successor, so it arms the | ||
| # out-of-order region and every following boundary reseeds the operand mirror | ||
| # from the virtualizable shadow — which mid-expression holds the NULLs the | ||
| # in-flight opcode already popped, and so cannot return the callable. The | ||
| # mirror came back one slot short with the callable in the `self_or_null` slot, | ||
| # the escape flush declined on the hole, and the portal replayed the frame from | ||
| # its entry. | ||
| # | ||
| # N is sized to reach the tracing thresholds on its own rather than for | ||
| # throughput: at 200 the loop never gets hot and the bench passes with the | ||
| # defect in place. Measured against a binary without the fix, N=2000 reports | ||
| # 2001 hits and N=20000 reports 20005 — the overshoot is the trace-attempt | ||
| # count, so only the fixed value (exactly N) is stable enough to pin. No | ||
| # `max-pypy-ratio` for the same reason `exception_reused_object_tb_not_doubled` | ||
| # has none — this is a shape oracle, not a workload. | ||
| # | ||
| # Expected output: (20000, 20000, 20000) | ||
| import sys | ||
|
|
||
| N = 20000 | ||
|
|
||
|
|
||
| class Force: | ||
| hits = 0 | ||
|
|
||
| def raiser(self): | ||
| _ = sys._getframe(1).f_back | ||
| Force.hits += 1 | ||
| raise ValueError(1) | ||
|
|
||
|
|
||
| f = Force() | ||
|
|
||
|
|
||
| def main(): | ||
| seen = [] | ||
| total = 0 | ||
| for i in list(range(N)): | ||
| try: | ||
| total += f.raiser() | ||
| except ValueError: | ||
| total += 1 | ||
| seen.append(i) | ||
| return total, len(seen), Force.hits | ||
|
|
||
|
|
||
| print(main()) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a normal downstream build, calling the still-public
JitDriverPair::set_gc_allocatoror any backend'sset_gc_allocatorreaches this unconditional panic because none of those crates exposes or enablesmajit-gc/gc_box; the backend crates' new dev-dependencies only affect their own tests and do not participate when the crates are consumed as dependencies. Thus the advertised custom-allocator API now always aborts outside those test targets unless consumers discover that they must add a direct feature-unifyingmajit-gcdependency; propagate an explicit feature through the public crate or restrict/remove the API rather than leaving it operational but panicking.Useful? React with 👍 / 👎.