Coerce FNTYPE_SEED to UInt to unbreak 32-bit Julia precompile#895
Open
dpsanders wants to merge 1 commit into
Open
Coerce FNTYPE_SEED to UInt to unbreak 32-bit Julia precompile#895dpsanders wants to merge 1 commit into
dpsanders wants to merge 1 commit into
Conversation
The bare `0x8b414291138f6c45` literal is a `UInt64`. Its only use (`hash(...)::UInt ⊻ FNTYPE_SEED`, hashconsing.jl:349) widens the XOR result to `UInt64` on 32-bit Julia, which then fails to fit back into a `::UInt` (= `UInt32`) hash field — breaking `using SymbolicUtils` on every 32-bit target. Matches the style already used for `SYM_SALT`/`DIV_SALT` on lines 225-226. No-op on 64-bit, truncates to `UInt32` on 32-bit. Fixes JuliaSymbolics#894.
Contributor
Benchmark Results (Julia vlts)Time benchmarks
Memory benchmarks
|
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
Member
|
open a PR to add 32-bit as well, that would be helpful, or just add here |
Author
|
You mean to add it to CI? |
Member
|
yes |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
One-line fix for #894:
FNTYPE_SEED(src/hashconsing.jl:310) was a bareUInt64literal. Its only use site (hash(...)::UInt ⊻ FNTYPE_SEEDat line 349) widens the XOR result toUInt64on 32-bit Julia, which then fails to fit back into a::UInt(=UInt32) hash field — sousing SymbolicUtilserrors out withInexactError: trunc(UInt32, 0x8b4142913acd1c23)during@compile_workload.Matches the style already used for
SYM_SALT/DIV_SALT(lines 225-226). No-op on 64-bit, truncates the constant toUInt32on 32-bit.See #894 for the full diagnostic (XOR fingerprint, versions, downstream impact).
Closes #894.
CI note (not in this PR)
This slipped through because
ci.ymlruns only onubuntu-latest × x64(noarchkey in the matrix). Addingarch: [x64, x86](with a macOS-x86 exclude) would catch this class of 32-bit regressions. Not touching that here — happy to open a separate PR if the maintainers want it.