Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyre/bench/synth/bound_method_builtin_fold.cranelift.jitstats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ fbw_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=458
guard_failures=468
internal_compile_panics=0
loops_aborted=0
loops_compiled=7
loops_aborted=1
loops_compiled=9
retraces_compiled=0
7 changes: 4 additions & 3 deletions pyre/bench/synth/bound_method_builtin_fold.dynasm.jitstats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ fbw_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=458
guard_failures=468
internal_compile_panics=0
loops_aborted=0
loops_compiled=7
loops_aborted=1
loops_compiled=9
retraces_compiled=0
6 changes: 3 additions & 3 deletions pyre/bench/synth/bound_method_builtin_fold.wasm.jitstats
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ fbw_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=458
guard_failures=468
internal_compile_panics=0
loops_aborted=0
loops_compiled=7
loops_aborted=1
loops_compiled=9
retraces_compiled=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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=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=1786
internal_compile_panics=0
loops_aborted=9
loops_compiled=3
retraces_compiled=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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=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=1786
internal_compile_panics=0
loops_aborted=9
loops_compiled=3
retraces_compiled=0
39 changes: 39 additions & 0 deletions pyre/bench/synth/exception_with_exit_self_null_slot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# A `with` block whose handler runs on most iterations of a hot `while` loop.
# LOAD_SPECIAL pushes the resolved `__exit__` and the call's `self_or_null`
# slot; that NULL is a live value, and the dense virtualizable shadow cannot
# tell it from an unwritten slot. Carried as a mirror hole rather than as a
# constant, the slot was omitted from the resume image and a blackhole
# resuming into WITH_EXCEPT_START read the bound `__exit__` the same opcode had
# pushed one slot below, calling it with the receiver twice
# ("__exit__() takes 4 positional arguments but 5 were given").
#
# No FOR_ITER: this is the shape that reaches the defect with no opcode gate
# involved, so it stays a witness independently of what the FOR_ITER body scan
# admits. Kept at module scope, where it was first reproduced.
N = 20000


class Context:
def __init__(self):
self.exits = 0

def __enter__(self):
return 3

def __exit__(self, exc_type, exc_value, traceback):
self.exits += 1
return exc_type is ValueError


context = Context()
total = 0
i = 0
while i < N:
with context as value:
total += value
if i % 10 == 0:
raise ValueError
total += i
i += 1
print(total, context.exits)
# Expected: 180060000 20000
15 changes: 15 additions & 0 deletions pyre/bench/synth/exception_with_exit_self_null_slot.wasm.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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=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=1786
internal_compile_panics=0
loops_aborted=9
loops_compiled=3
retraces_compiled=0
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_call_function_ex_body.cranelift.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=1
internal_compile_panics=0
loops_aborted=0
loops_compiled=1
retraces_compiled=0
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_call_function_ex_body.dynasm.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=1
internal_compile_panics=0
loops_aborted=0
loops_compiled=1
retraces_compiled=0
19 changes: 19 additions & 0 deletions pyre/bench/synth/foriter_call_function_ex_body.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# CALL_FUNCTION_EX in a hot FOR_ITER body. The starred call is the same
# MayForce boundary as CALL and CALL_KW for the whole-frame safety gate.
N = 20000


def add(a, b):
return a + b


def main():
total = 0
for i in range(N):
args = (i, 1)
total += add(*args)
print(total)


main()
# Expected: 200010000
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_call_function_ex_body.wasm.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=1
internal_compile_panics=0
loops_aborted=0
loops_compiled=1
retraces_compiled=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=1
internal_compile_panics=0
loops_aborted=0
loops_compiled=1
retraces_compiled=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=1
internal_compile_panics=0
loops_aborted=0
loops_compiled=1
retraces_compiled=0
14 changes: 14 additions & 0 deletions pyre/bench/synth/foriter_call_intrinsic1_unary_positive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# CALL_INTRINSIC_1/UnaryPositive in a hot FOR_ITER body. This is one of the two
# variants with a codewriter residual; the other variants remain gate declines.
N = 20000


def main():
total = 0
for i in range(N):
total += +i
print(total)


main()
# Expected: 199990000
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=1
internal_compile_panics=0
loops_aborted=0
loops_compiled=1
retraces_compiled=0
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_load_special_with.cranelift.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_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=0
loops_compiled=2
retraces_compiled=0
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_load_special_with.dynasm.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_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=0
loops_compiled=2
retraces_compiled=0
34 changes: 34 additions & 0 deletions pyre/bench/synth/foriter_load_special_with.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A `with` block in a hot FOR_ITER body, whose handler runs every tenth
# iteration. The whole-frame FOR_ITER gate declines LOAD_SPECIAL, so this frame
# runs interpreted; the answer is recorded here for the day it is admitted.
# `exception_with_exit_self_null_slot` is the same shape written as a `while`
# loop, where no gate stands between it and the JIT.
N = 20000


class Context:
def __init__(self):
self.exits = 0

def __enter__(self):
return 3

def __exit__(self, exc_type, exc_value, traceback):
self.exits += 1
return exc_type is ValueError


def main():
context = Context()
total = 0
for i in range(N):
with context as value:
total += value
if i % 10 == 0:
raise ValueError
total += i
print(total, context.exits)


main()
# Expected: 180060000 20000
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_load_special_with.wasm.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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_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=0
loops_compiled=2
retraces_compiled=0
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_make_function_body.cranelift.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bridges_compiled=47
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=9480
internal_compile_panics=0
loops_aborted=0
loops_compiled=2
retraces_compiled=0
15 changes: 15 additions & 0 deletions pyre/bench/synth/foriter_make_function_body.dynasm.jitstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bridges_compiled=47
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_rolled_back_with_effects=0
fbw_store_journal_rollback_failed=0
field_pos_attached_misplaced=0
field_pos_spec_misplaced=0
guard_failures=9480
internal_compile_panics=0
loops_aborted=0
loops_compiled=2
retraces_compiled=0
18 changes: 18 additions & 0 deletions pyre/bench/synth/foriter_make_function_body.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# MAKE_FUNCTION plus SET_FUNCTION_ATTRIBUTE in a hot FOR_ITER body. The default
# value forces the companion attribute initializer onto the definition path.
N = 20000


def main():
total = 0
for i in range(N):

def add(value=i):
return value + 1

total += add()
print(total)


main()
# Expected: 200010000
Loading
Loading