Skip to content
Draft
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
2 changes: 1 addition & 1 deletion src/difference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Base.nameof(::Difference) = :Difference
function Base.:(==)(D1::Difference, D2::Difference)
return isequal(D1.t, D2.t) && isequal(D1.dt, D2.dt) && isequal(D1.update, D2.update)
end
Base.hash(D::Difference, u::UInt) = hash(D.dt, hash(D.t, xor(u, 0x055640d6d952f101)))
Base.hash(D::Difference, u::UInt) = hash(D.dt, hash(D.t, xor(u, 0x055640d6d952f101 % UInt)))
4 changes: 4 additions & 0 deletions test/Core/implicit_basis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ end
discrete_prob = DiscreteDataDrivenProblem(x)

d = Difference(get_iv(basis), dt = 1.0)
# On 32-bit builds (UInt == UInt32) the hash seed literal in Base.hash(::Difference, ::UInt)
# used to widen to UInt64 via `xor`, breaking SymbolicUtils hashconsing
# (https://github.com/SciML/DataDrivenDiffEq.jl/actions/runs/35188714123).
@test typeof(hash(d, UInt(1))) === UInt
@test Symbolics.symtype(d(first(states(basis)))) === Real
@test isempty(Symbolics.shape(d(first(states(basis)))))
∂ = Differential(get_iv(basis))
Expand Down
Loading