p.s.: if you become aware of such an issue with any toolchain, it
would be nice to file a bug report *with the corresponding toolchain
package in Debian* to make its maintainer (me in this case) aware as
well. we could have had 2-3 months head start on tackling this issue
if you had done so..
Quoting Chris Hofstaedtler (2024-11-23 04:16:29)
* Jonas Smedegaard <[email protected]> [241122 18:01]:
All release architectures support Rust. We should not accept
release architectures without Rust support.
A minor set of ports architectures does not have Rust support
yet.
Rust is unsupported on i386 and patched to silently assume i686
i686 is not a problem, as that's the arch baseline for our i386
arch since bookworm.
- see
DEP-3 references in this patch for discussions about that, and the patch >> > itself for a way to more loudly make reverse dependencies aware that
code using SSE2 *must* be compiled without optimizations on i386:
https://salsa.debian.org/debian/rust-wide/-/blob/debian/latest/debian/patches/2001_fail_non-sse2-x86.patch
Beware that Rust team build routines run tests without optimizations,
regardless of DEB_BUILD_OPTIONS=noopt, so for libraries maintained by
them the issue may go unnoticed until reverse dependencies run into the
issue *and* test for it, otherwise it might go unnoticed until users
report it.
So maybe it's time to raise the baseline to i686+sse2.
As I understand the situation with Rust, it is *not* that compiled code
fails to run on old non-SSE2 hardware. Instead, the problem is that the
Rust compiler produces code that is *ALWAYS* broken regardless if target hardware supports SSE2 or not.
Yes, your final remark is a "solution" regardless, I just wanted to
emphasize that the problem affects the whole architecture, not only
outdated parts of it.
...unless I have misunderstand the situation, obciously.
A) move i386 rustc to Rust's i586 target (which doesn't have SSE out of the box), instead of the i686-with-SSE2-disabled it currently uses
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
On Sat, Nov 23, 2024, at 1:09 PM, Jonas Smedegaard wrote:
Quoting Chris Hofstaedtler (2024-11-23 04:16:29)
* Jonas Smedegaard <[email protected]> [241122 18:01]:
All release architectures support Rust. We should not accept
release architectures without Rust support.
A minor set of ports architectures does not have Rust support
yet.
Rust is unsupported on i386 and patched to silently assume i686
i686 is not a problem, as that's the arch baseline for our i386
arch since bookworm.
yeah, this is not related to that particular change, but to this:
https://wiki.debian.org/ArchitectureSpecificsMemo#i386
in combination with a bad interaction between rustc and LLVM..
- see
DEP-3 references in this patch for discussions about that, and the patch >>> > itself for a way to more loudly make reverse dependencies aware that
code using SSE2 *must* be compiled without optimizations on i386:
https://salsa.debian.org/debian/rust-wide/-/blob/debian/latest/debian/patches/2001_fail_non-sse2-x86.patch
Beware that Rust team build routines run tests without optimizations,
regardless of DEB_BUILD_OPTIONS=noopt, so for libraries maintained by
them the issue may go unnoticed until reverse dependencies run into the >>> > issue *and* test for it, otherwise it might go unnoticed until users
report it.
So maybe it's time to raise the baseline to i686+sse2.
As I understand the situation with Rust, it is *not* that compiled code
fails to run on old non-SSE2 hardware. Instead, the problem is that the
Rust compiler produces code that is *ALWAYS* broken regardless if target
hardware supports SSE2 or not.
Yes, your final remark is a "solution" regardless, I just wanted to
emphasize that the problem affects the whole architecture, not only
outdated parts of it.
...unless I have misunderstand the situation, obciously.
AFAICT, this seems to be true. I was (so far) under the impression so
far that this only affects FP arithmetics (i.e., the usual issue one
runs into this is test code that does FP operations and then checks
that the result is as expected). given that it's not limited to that
(see
https://github.com/rust-lang/rust/issues/114479#issuecomment-2072052116
and https://github.com/rust-lang/compiler-team/issues/808), the
situation is a lot worse!
so yeah, I guess we should either
A) move i386 rustc to Rust's i586 target (which doesn't have SSE out of
the box), instead of the i686-with-SSE2-disabled it currently uses
B) bump the i386 baseline in Debian to require SSE2, and stop disabling
SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an
option I think, just here for completeness sake)
The unsoundness is not just theoretical; the LLVM IR Rust compiles f32 and f64 operations to has the desired Rust semantics, whereas the LLVM non-SSE x86 backend compiles that IR to machine code that violates the semantics of the IR. This means e.g.LLVM optimisations that (correctly) operate presuming the LLVM IR semantics with regards to evaluation precision can cause the LLVM non-SSE x86 backend introduce out-of-bounds reads/writes in safe code (see this earlier comment for a code example). The
Because this is a miscompilation at the LLVM IR -> machine code stage, as opposed to the Rust -> LLVM IR stage, miscompilations can occur in other programming languages that use LLVM as a codegen backend. For example, llvm/llvm-project#89885 containsan example of a miscompilation from C. Ultimately what matters are the semantics of the LLVM IR; not everything that is permitted by the IEEE 754 specification is permitted by LLVM IR (and vice versa).
The return value ABI issue is tracked separately in #115567, and affects all 32-bit x86 targets, not just those with SSE/SSE2 disabled. It is possible to manually load/store a f32/f64 signalling NaN to/from an x87 register without quietening it (see e.g. the code in #115567 (comment)), but currently neither LLVM nor Rust do so. The "Rust" ABI (which doesn't have any stability guarantees) is being changed to avoid x87 registers completely in #123351.
GH user RalfJung at https://github.com/rust-lang/rust/issues/114479#issuecomment-2208193457 wrote:referenced demonstrate that there is no reliable way to program against this hardware in any compiler that uses LLVM as its backend. (At least not if the compiler uses the standard LLVM float types and operations.)
As @beetrees explained, it's not just that the underlying hardware works differently and that bleeds into language semantics. It's that Rust's primary backend, LLVM, assumes the underlying hardware to work the standard way -- the examples @beetrees
To my knowledge, nobody on the LLVM side really cares about this. So until that changes it is unlikely that we'll be able to improve things in Rust here. Telling programmers "on this hardware your program may randomly explode for no fault of your own"is not very useful. (I mean, it is a useful errata of course, but it doesn't make sense to make this the spec.)
* Fabian Grünbichler <[email protected]> [241123 15:31]:
A) move i386 rustc to Rust's i586 target (which doesn't have SSE out of the box), instead of the i686-with-SSE2-disabled it currently uses
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
D) follow the other teams and stop building Rust on i386.
On Sat, Nov 23, 2024 at 03:14:42PM +0100, Fabian Grünbichler wrote:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
As suggested by Chris, and a popular opinion/request in general.
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
Le samedi 23 novembre 2024, 18:29:04 UTC Andrey Rakhmatullin a écrit :
On Sat, Nov 23, 2024 at 03:14:42PM +0100, Fabian Grünbichler wrote:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
It will break I suppose imagemagick on i386 and scientific software testsuite
i386 means FPU so excess precision.
SSE is good and even better but excess precision is worked arround thus FTBFS
On Sat, Nov 23, 2024 at 1:57 PM Bastien Roucariès <[email protected]> wrote: >>
Le samedi 23 novembre 2024, 18:29:04 UTC Andrey Rakhmatullin a écrit :
On Sat, Nov 23, 2024 at 03:14:42PM +0100, Fabian Grünbichler wrote:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
It will break I suppose imagemagick on i386 and scientific software testsuite
i386 means FPU so excess precision.
SSE is good and even better but excess precision is worked arround thus FTBFS
Debian's i386 already has excess precision: >https://wiki.debian.org/ArchitectureSpecificsMemo#i386
If you mean something else, could you be… more precise?
On Sat, Nov 23, 2024 at 1:57 PM Bastien Roucariès <[email protected]> wrote:
Le samedi 23 novembre 2024, 18:29:04 UTC Andrey Rakhmatullin a écrit :
On Sat, Nov 23, 2024 at 03:14:42PM +0100, Fabian Grünbichler wrote:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
It will break I suppose imagemagick on i386 and scientific software testsuite
i386 means FPU so excess precision.
SSE is good and even better but excess precision is worked arround thus FTBFS
Debian's i386 already has excess precision: https://wiki.debian.org/ArchitectureSpecificsMemo#i386
If you mean something else, could you be… more precise?
Thank you,
Jeremy Bícha
On November 23, 2024 9:03:26 PM GMT+01:00, "Jeremy Bícha" <[email protected]> wrote:
On Sat, Nov 23, 2024 at 1:57 PM Bastien Roucariès <[email protected]> wrote:
Le samedi 23 novembre 2024, 18:29:04 UTC Andrey Rakhmatullin a écrit :
On Sat, Nov 23, 2024 at 03:14:42PM +0100, Fabian Grünbichler wrote:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
It will break I suppose imagemagick on i386 and scientific software testsuite
i386 means FPU so excess precision.
SSE is good and even better but excess precision is worked arround thus FTBFS
Debian's i386 already has excess precision: >https://wiki.debian.org/ArchitectureSpecificsMemo#i386
If you mean something else, could you be… more precise?
Its very much possible that things relying on x87 floats on i386 will need to adapt if some underlying implementation switches to SSE, just like the inverse happens now (like testsuites expecting SSE behaviour/results that need to be adapted to x87).
I don't think that is a problem per se. And you can still use x87 floats if those work for your package, even if we go down that road.
Well not with rust, but given that those are apparently broken already anyway...
A) move i386 rustc to Rust's i586 target (which doesn't have SSE out of the box), instead of the i686-with-SSE2-disabled it currently uses
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
It will break I suppose imagemagick on i386 and scientific software testsuite
i386 means FPU so excess precision.
SSE is good and even better but excess precision is worked arround thus FTBFS
Debian's i386 already has excess precision: https://wiki.debian.org/ArchitectureSpecificsMemo#i386
If you mean something else, could you be… more precise?
if SSE2 is enables gcc will not use i387 thus i386 will loss excess precision and have double like amd64
i387 => excess precision
SSE2 no excess precision
* Fabian Grünbichler <[email protected]> [241123 15:31]:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
D) follow the other teams and stop building Rust on i386.
On Sat, Nov 23, 2024 at 10:30 PM Fabian Grünbichler <[email protected]> wrote:
A) move i386 rustc to Rust's i586 target (which doesn't have SSE out of the box), instead of the i686-with-SSE2-disabled it currently uses
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
For reference, golang had a similar problem 3 years ago[1]. We decided
to downgrade the baseline for golang on i386.
[1] https://lists.debian.org/debian-devel/2021/04/msg00165.html
On Sun, Nov 24, 2024, at 8:01 AM, Shengjing Zhu wrote:
On Sat, Nov 23, 2024 at 10:30 PM Fabian Grünbichler <[email protected]> wrote:
A) move i386 rustc to Rust's i586 target (which doesn't have SSE out of the box), instead of the i686-with-SSE2-disabled it currently uses
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
For reference, golang had a similar problem 3 years ago[1]. We decided
to downgrade the baseline for golang on i386.
[1] https://lists.debian.org/debian-devel/2021/04/msg00165.html
downgrading the baseline for Rust is what got us into this mess ;) there is no 32-bit x86 softfloat target upstream. there is a 64-bit one for kernel/.. usage: https://doc.rust-lang.org/beta/rustc/platform-support/x86_64-unknown-none.html
On Sat, Nov 23, 2024, at 5:50 PM, Chris Hofstaedtler wrote:
* Fabian Grünbichler <[email protected]> [241123 15:31]:I am not personally invested in i386 at all, but that is still not a call that I'd want to make as toolchain maintainer. If the release team prefers it over B) and over risking running into the miscompilation issues in practice, then I won't object.
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustcD) follow the other teams and stop building Rust on i386.
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
FWIW, my (personal!) current preference would be B), followed by either documenting the issue and accepting it or D). Given the far-reaching implications of both B and D, I don't think this is a decision that either I or the Rust team can make alone.
On Sat, Nov 23, 2024, at 5:50 PM, Chris Hofstaedtler wrote:
* Fabian Grünbichler <[email protected]> [241123 15:31]:
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
D) follow the other teams and stop building Rust on i386.
I am not personally invested in i386 at all, but that is still not a call that I'd want to make as toolchain maintainer. If the release team prefers it over B) and over risking running into the miscompilation issues in practice, then I won't object.
FWIW, my (personal!) current preference would be B), followed by either documenting the issue and accepting it or D). Given the far-reaching implications of both B and D, I don't think this is a decision that either I or the Rust team can make alone.
Are there viable/realistic platforms today that are i386 for real, and
don't support SSE2? In other words, if Debian as a whole does B) (not
only for rust), what is the practical impact on any non-toy hardware?
B) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc
C) disable all optimizations for Rust code on i386 (not really an option I think, just here for completeness sake)
D) follow the other teams and stop building Rust on i386.
I am not personally invested in i386 at all, but that is still not a call that I'd want to make as toolchain maintainer. If the release team prefers it over B) and over risking running into the miscompilation issues in practice, then I won't object.
FWIW, my (personal!) current preference would be B), followed by either documenting the issue and accepting it or D). Given the far-reaching implications of both B and D, I don't think this is a decision that either I or the Rust team can make alone.
I've been watching this thread from the sideline so far, but after
thinking some more, I don't understand why B) is simply not the chosen
path forward.
On Sat, Nov 23, 2024 at 08:31:15PM +0000, Bastien Roucariès wrote:
It will break I suppose imagemagick on i386 and scientific software testsuiteB) bump the i386 baseline in Debian to require SSE2, and stop disabling SSE2 there in rustc> > >
i386 means FPU so excess precision.
SSE is good and even better but excess precision is worked arroundDebian's i386 already has excess precision: https://wiki.debian.org/ArchitectureSpecificsMemo#i386
thus FTBFS> >
If you mean something else, could you be… more precise?
if SSE2 is enables gcc will not use i387 thus i386 will loss excess precision and have double like amd64
i387 => excess precision
SSE2 no excess precision
Which is a good thing normally.
Just remove the workarounds you mentioned.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 13:27:06 |
| Calls: | 12,100 |
| Files: | 15,004 |
| Messages: | 6,518,008 |