Skip to content
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

Deltablue crashes register allocator if YKD_OPT=0 #1590

Open
vext01 opened this issue Feb 6, 2025 · 7 comments
Open

Deltablue crashes register allocator if YKD_OPT=0 #1590

vext01 opened this issue Feb 6, 2025 · 7 comments
Assignees

Comments

@vext01
Copy link
Contributor

vext01 commented Feb 6, 2025

Using yk a4488568e0:

===> 1: timeout 30 /home/vext01/research/yklua/src/lua harness.lua DeltaBlue 1 12000
Starting DeltaBlue benchmark ...

thread '<unnamed>' panicked at ykrt/src/compile/jitc_yk/codegen/x64/lsregalloc.rs:1009:22:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread '<unnamed>' panicked at ykrt/src/compile/jitc_yk/codegen/x64/lsregalloc.rs:1009:22:
called `Option::unwrap()` on a `None` value

thread '<unnamed>' panicked at ykrt/src/compile/jitc_yk/codegen/x64/lsregalloc.rs:1009:22:
called `Option::unwrap()` on a `None` value
^[[ADeltaBlue: iterations=1 runtime: 2418808us
DeltaBlue: iterations=1 average: 2418808us total: 2418808us

Total Runtime: 2418808us
fatal runtime error: failed to initiate panic, error 5
@ltratt
Copy link
Contributor

ltratt commented Feb 6, 2025

Does this happen deterministically?

@vext01
Copy link
Contributor Author

vext01 commented Feb 6, 2025

Appears to be.

@ltratt
Copy link
Contributor

ltratt commented Feb 6, 2025

How did this get through CI? I thought we tried the AWFY benchmarks in release mode?

@vext01
Copy link
Contributor Author

vext01 commented Feb 6, 2025

We don't benchmark with the optimiser off. That's a requirement for this crash.

@vext01
Copy link
Contributor Author

vext01 commented Feb 6, 2025

Here's a reduced test case for this one:

C = {}
do
	function C.A()
		getmetatable({})
	end
end
B = {}
do
	function B.A(A)
		for A = 0, A * 3 do
			C.A()
		end
	end
	function A(A)
		B.A(A)
	end
end
A(40000)

It crashes about 50% of the time.

@ltratt
Copy link
Contributor

ltratt commented Feb 6, 2025

This fails 100% of the time for me (as I would expect for a register allocator bug).

@vext01
Copy link
Contributor Author

vext01 commented Feb 6, 2025

It crashes every time if you serialise compilation, but not if you don't. Probably the program can end before the trace is compiled if you don't block on compilation.

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

No branches or pull requests

2 participants