-
Notifications
You must be signed in to change notification settings - Fork 19
jit: admit LIST_APPEND in a call-bearing FOR_ITER body, and stop booking _operator.index as a body effect
#1382
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
Open
youknowone
wants to merge
45
commits into
main
Choose a base branch
from
str
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
07f6510
jit-trace: classify `_operator.index` on an int operand as replay-safe
youknowone 83d9076
jit: admit LIST_APPEND in a FOR_ITER body that also contains a call
youknowone e55b510
check.py: refuse a --no-build run whose artefacts predate the sources
youknowone 28e99fd
check.py: key the --no-build freshness gate on input content, not mtime
youknowone d352657
check.py: derive the build-input set from the tree alone
youknowone 6eea7bf
jit-trace: source a branch-guard kept slot from the guard pc's own co…
youknowone 9d8d478
interpreter: force the caller frame in type()'s __module__ fill
youknowone e2d74fc
check.py: count untracked inputs, re-read the digest per build, and b…
youknowone 4a9c4e1
jit, bench: say which of LIST_APPEND and its body is admitted uncondi…
youknowone e2f7813
bench: record type_name_surrogate_reject's dynasm and cranelift jit-s…
youknowone 29d604d
bench: record pickle_terminal_raise_resume's wasm loops_aborted at th…
youknowone 199b750
parity: halve re_jit_call_resume's trip count
youknowone 908a2bc
check.py: frame each file's content in the build-input digest, and ga…
youknowone 7a54a68
object: cite rutf8's upstream members by symbol alone
youknowone a33f5f2
jit-trace: resolve a blackhole codepoint index through the string's i…
youknowone a0b4b99
object: port rutf8's check_utf8 and move the invalid-byte predicates …
youknowone 8ca197c
pickle, marshal, time: check bytes from outside the runtime with chec…
youknowone 9b9d43c
bytes.hex: read a separator's ASCII test off its WTF-8 payload
youknowone cd8db33
_json: bound scanstring's and scan_once's index by the code point count
youknowone 351f1a3
parity: add utf8_check_untrusted_bytes
youknowone d6579ff
object: keep the crate's scan in wtf8_from_bytes, restoring only its …
youknowone 8d5cca6
bytes.fromhex: read the hex scan off the WTF-8 payload
youknowone e5fee43
codecs: take allow_surrogates as an argument instead of deriving it
youknowone c3ef9ef
codecs: try the check before the state machine, as str_decode_utf8 does
youknowone 7263668
bytes.decode: stop copying the codec name, the error mode and the fold
youknowone 4fa594c
rustfmt
youknowone 9955b59
gate-triage: stop naming the retired FOR_ITER gate in a live section
youknowone edaaaa2
check.py: fail open when the root manifest cannot be read
youknowone 7a20d34
marshal, pickle: report the byte the surrogatepass validator stopped at
youknowone af6f843
codecs: narrow the surrogate allowance to a complete encoded surrogate
youknowone e8cfdcb
jit-trace: keep a guard-owned stack slot's NULL register value
youknowone 2d6b9a0
object: pin the invariant surrogate_bytes is read under
youknowone cb032e9
Revert "jit-trace: keep a guard-owned stack slot's NULL register value"
youknowone a9b24a2
object: drop the unused mut on the agreement test's probe closure
youknowone 31ecb68
jit-trace: refuse a blackhole item index that does not convert to an …
youknowone 409ca9f
bench: record the two fixtures at the size and gate counting main now…
youknowone 8d8c71b
jit-trace: carry an in-flight FOR_ITER item through an aborted sub-walk
youknowone 41b6a53
jit-trace: test the blackhole item index conversion
youknowone 4ea6c20
check.py: fingerprint files a member crate embeds from outside the me…
youknowone 734ed07
check.py: check the wasm module the runner will load on the build path
youknowone 3930eed
check.py: fingerprint the build recipe, and refuse to vouch for a bui…
youknowone 27c15e7
check.py: require a selfcheck run to have compiled a loop
youknowone 744986c
check.py: resolve a relative LLBC override from the package whose bui…
youknowone 495a884
bench: document the selfcheck JIT floor and its opt-out
youknowone 19c381e
bench: record pickle_terminal_raise_resume's wasm guard_failures on t…
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
40 changes: 40 additions & 0 deletions
40
pyre/bench/synth/foriter_operator_index_replay_regression.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,40 @@ | ||
| # pyre-check: selfcheck | ||
| # `operator.index(x)` reaches `space.index`, whose first test is | ||
| # `is_int_or_long`: an int is returned as-is, before any `__index__` lookup, so | ||
| # that call runs no user code and is replay-safe. Every other argument | ||
| # dispatches through `__index__`, which IS user code — so the replay-safe class | ||
| # must observe the argument, not merely pin the callable. | ||
| # | ||
| # `helper` is admitted into the surrounding FOR_ITER body. The trailing opaque | ||
| # `id` call makes the first inline sub-walk abort and replay `helper`. The int | ||
| # call is the arm being admitted; the object call must stay opaque. Admitting | ||
| # the object call too would let the replay run `__index__` a second time, and | ||
| # `hits` would read N + 1. | ||
|
|
||
| from operator import index as _index | ||
|
|
||
| N = 5000 | ||
| hits = [0] | ||
|
|
||
|
|
||
| class C: | ||
| def __index__(self) -> int: | ||
| hits[0] += 1 | ||
| return 3 | ||
|
|
||
|
|
||
| def helper(obj, n): | ||
| a = _index(n) | ||
| b = _index(obj) | ||
| id(obj) | ||
| return a + b | ||
|
|
||
|
|
||
| obj = C() | ||
| total = 0 | ||
| for _ in range(N): | ||
| total += helper(obj, 1) | ||
|
|
||
| assert hits[0] == N, f"__index__ ran {hits[0]} times, expected {N}" | ||
| assert total == 4 * N, f"total {total}, expected {4 * N}" | ||
| print("PASS") | ||
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
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
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
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
9 changes: 5 additions & 4 deletions
9
pyre/bench/synth/type_name_surrogate_reject.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 |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| bridges_compiled=1 | ||
| 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=0 | ||
| fbw_blackhole_adopted_single_frame=1 | ||
| fbw_rolled_back_with_effects=0 | ||
| fbw_store_journal_rollback_failed=0 | ||
| field_pos_attached_misplaced=0 | ||
| field_pos_spec_misplaced=0 | ||
| guard_failures=201 | ||
| guard_failures=17799 | ||
| internal_compile_panics=0 | ||
| loops_aborted=0 | ||
| loops_aborted=1 | ||
| loops_compiled=2 | ||
| retraces_compiled=0 |
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 |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| bridges_compiled=1 | ||
| 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=0 | ||
| fbw_blackhole_adopted_single_frame=1 | ||
| fbw_rolled_back_with_effects=0 | ||
| fbw_store_journal_rollback_failed=0 | ||
| field_pos_attached_misplaced=0 | ||
| field_pos_spec_misplaced=0 | ||
| guard_failures=201 | ||
| guard_failures=17799 | ||
| internal_compile_panics=0 | ||
| loops_aborted=0 | ||
| loops_aborted=1 | ||
| loops_compiled=2 | ||
| retraces_compiled=0 |
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
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.
Uh oh!
There was an error while loading. Please reload this page.