Skip to content

Reduce method redefinition warning noise in model interface tests#212

Merged
lukem12345 merged 3 commits into
mainfrom
copilot/fix-method-redefinition-warnings
May 4, 2026
Merged

Reduce method redefinition warning noise in model interface tests#212
lukem12345 merged 3 commits into
mainfrom
copilot/fix-method-redefinition-warnings

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor

Tests were passing but emitting ~34 method overwrite warnings, which obscured meaningful new warnings. This PR narrows the warning surface by removing repeated method definitions in test/models/ModelInterface.jl without changing production behavior.

  • Isolate negative @instance cases by model type

    • Replaced reuse of FinSetC′ across multiple failure-mode tests with dedicated marker model structs (e.g. missing methods, bad sort labels, wrong signatures).
    • Prevents repeated registration of overlapping methods on the same WithModel{FinSetC′} specialization.
  • Decouple monoidal tests from base category test model

    • Added a dedicated FinSetC′Monoidal model fixture for ThStrictMonCat tests.
    • Added a corresponding ThCategory instance for FinSetC′Monoidal by delegating to the existing FinSetC′ category operations.
  • Preserve test intent while avoiding overwrite paths

    • Kept existing assertion semantics (@test_throws, implements, @withmodel) and adjusted only fixture typing/signatures where needed to validate the same failure modes without redefinition collisions.
@struct_hash_equal struct FinSetC′Monoidal end

@instance ThCategory{Ob=Int, Hom=Vector{Int}} [model::FinSetC′Monoidal] begin
  Ob(i::Int) = Ob[FinSetC′()](i)
  Hom(f::Vector{Int}, n::Int, m::Int) = Hom[FinSetC′()](f, n, m)
  id(m::Int) = id[FinSetC′()](m)
  compose(f::Vector{Int}, g::Vector{Int}) = compose[FinSetC′()](f, g)
  dom(f::Vector{Int}) = dom[FinSetC′()](f)
end

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/AlgebraicJulia/AlgebraicInterfaces.jl/tarball/28cca88bde1068ccf57f950e639df67975517c25
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/4e1fe97fdaed23e9dc21d4d664bea76b65fc50a0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/Parsers.jl/tarball/5d5e0a78e971354b1c7bff0655d11fdc1b0e12c8
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGraphics/ColorTypes.jl/tarball/67e11ee83a43eb71ddc950302c53bf33f0690dfe
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaGraphics/Colors.jl/tarball/37ea44092930b1811e666c3bc38065d7d87fcc74
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaIO/JSON.jl/tarball/31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/FixedPointNumbers.jl/tarball/05882d6995ae5c12bb5f36dd2ed3f61c98cbb172
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/8b770b60760d4451834fe79dd483e318eee709c4
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/jolin-io/StructEquality.jl/tarball/192a9f1de3cfef80ab1a4ba7b150bb0e11ceedcf
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/thautwarm/MLStyle.jl/tarball/bc38dff0548128765760c79eb7388a4b37fae2c8
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (http block)
  • pkg.julialang.org
    • Triggering command: /usr/bin/julia julia --project -e using Pkg; Pkg.test() (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue May 4, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 4, 2026 17:02
Copilot AI changed the title [WIP] Fix method re-definition warnings in test logs Reduce method redefinition warning noise in model interface tests May 4, 2026
Copilot AI requested a review from lukem12345 May 4, 2026 17:06
@lukem12345 lukem12345 marked this pull request as ready for review May 4, 2026 17:10
@lukem12345 lukem12345 requested a review from jpfairbanks May 4, 2026 17:10
@lukem12345

Copy link
Copy Markdown
Member

@jpfairbanks If I merge this and #210 then GATlab will be at 0 warnings for docs and tests. LGTY?

@lukem12345 lukem12345 merged commit 9b50b92 into main May 4, 2026
8 of 9 checks passed
@lukem12345 lukem12345 deleted the copilot/fix-method-redefinition-warnings branch May 4, 2026 17:14
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

Successfully merging this pull request may close these issues.

Method re-definition warnings

2 participants