Wrong "Redundant conformance constraint" warning

I have something to do right now, but I just wanted to say that compiling the current Turf target throws me an Abort trap: 6. I'll commit and share the build log ASAP.

Edit:

Passing -requirement-machine-inferred-signatures=on should fix that assertion. I'll take a look at the build time issue shortly.

Unfortunately it does not :confused: I tried the flag before reporting the error came back (I don't want to spam you with already addressed problems :wink:)

How are you passing the flag?

Here are the results on my end. If I run

% rm -rf .build
% time env SWIFT_EXEC=$HOME/src/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swiftc swift build -Xswiftc -Xfrontend -Xswiftc -requirement-machine-protocol-signatures=on -Xswiftc -Xfrontend -Xswiftc -requirement-machine-inferred-signatures=on -Xswiftc -Xfrontend -Xswiftc -requirement-machine-abstract-signatures=on

The build succeeds in 30 seconds.

Without those flags, it runs for 5 minutes then crashes:

% rm -rf .build
% time env SWIFT_EXEC=$HOME/src/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swiftc swift build
...
Right hand side does not have a canonical parent: same_type: τ_0_0.[CoordinateSystem]BoundingBox τ_0_0.[CoordinateSystem]BoundingBox.[BoundingBox]CoordinateSystem.[CoordinateSystem]BoundingBox.[BoundingBox]CoordinateSystem.[CoordinateSystem]BoundingBox
...
10.	While checking generic signature <τ_0_0, τ_1_0 where τ_0_0 : CoordinateSystemAlgebra, τ_1_0 : Collection, τ_0_0.BoundingBox == τ_0_0.BoundingBox.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.BoundingBox.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.BoundingBox.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.BoundingBox.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Line.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Line.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Line.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Line.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Point.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Point.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Point.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Point.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Size.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Size.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Size.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Size.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.BoundingBox.CoordinateSystem.Line.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.BoundingBox.CoordinateSystem.Line.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.BoundingBox.CoordinateSystem.Point.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.BoundingBox.CoordinateSystem.Point.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.BoundingBox.CoordinateSystem.Size.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.BoundingBox.CoordinateSystem.Size.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Line.CoordinateSystem.BoundingBox.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Line.CoordinateSystem.BoundingBox.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Line.CoordinateSystem.Point.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Line.CoordinateSystem.Point.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Line.CoordinateSystem.Size.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Line.CoordinateSystem.Size.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Point.CoordinateSystem.BoundingBox.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Point.CoordinateSystem.BoundingBox.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Point.CoordinateSystem.Line.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Point.CoordinateSystem.Line.CoordinateSystem.Size.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Point.CoordinateSystem.Size.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Point.CoordinateSystem.Size.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Size.CoordinateSystem.BoundingBox.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Size.CoordinateSystem.BoundingBox.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Size.CoordinateSystem.Line.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox, τ_0_0.Size.CoordinateSystem.Line.CoordinateSystem.Point.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox == τ_0_0.Size.CoordinateSystem.Point.CoordinateSystem.Line.CoordinateSystem.BoundingBox.CoordinateSystem.BoundingBox>

Note that the assertion is coming from InferredGenericSignatureRequestGSB which doesn't run when the corresponding flag is set to 'on'. The underlying bug exists in the 5.6 toolchain as well, it's just that Xcode builds swiftc with assertions disabled so it's not caught. You can see that the GSB's minimized generic signature looks ridiculous, with lots of redundant same-type requirements, which is what triggers the assert.

I’m using unsafeFlags in the package description.

I only used -Xfrontend -requirement-machine-inferred-signatures=on, I’ll try the the two others as well and tell you.

Are you saying some of my constraints are redundant or that it’s a minimization issue?

It’s a compiler bug in the old code.

1 Like

@Slava_Pestov I tried the flags and I got the compiler to show errors in my code. You didn't have them because they are in the Turf target. I didn't have time to finish fixing them, but hopefully everything will be compiling soon :crossed_fingers:t2: