You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codegen emits external global declarations in nondeterministic order (IR differs run to run) #11409
Compiling the same source twice with the same perry binary can produce different LLVM IR. The difference is ordering: two external global declarations swap places. This weakens the object cache's "only the IR bytes decide the object" contract (#7131) and makes byte-level IR comparisons unreliable.
Reproduce (seen with a perry-dev build of main as of 2026-09-26):
< @perry_class_shape_id__helpers_h2_wire_ts__RawServerPeer = external global i32
…
> @perry_class_shape_id__helpers_h2_wire_ts__RawServerPeer = external global i32
Also reproduces on test_gap_10485_class_member_var_captures (both its _ts.ll and its _helpers_…_cjs.ll). In a 60-file sample, these 2 programs / 4 modules varied between runs; the rest were stable. The pattern (imported class shape-id globals) suggests a HashMap/HashSet iteration feeding external-global emission.
Found while checking that the WASI codegen work (#11406) leaves host IR byte-identical.
Activity
fix(codegen): emit imported globals in deterministic order (#11409)