Pale Moon x86-64 SSE2/AVX2

For contributed third party builds not necessarily configured like the main product.
e.g. AVX builds, SSE builds, Pandora builds.
User avatar
back2themoon
Knows the dark side
Knows the dark side
Posts: 3281
Joined: 2012-08-19, 20:32

Re: Pale Moon x86-64 SSE2/AVX2

Post by back2themoon » 2026-06-02, 19:04

Great, thank you both. :thumbup:

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1010
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Pale Moon x86-64 SSE2/AVX2

Post by UCyborg » 2026-06-03, 11:48

How does Firefox handle it?

It has media.av1.use-dav1d pref.

Not that I think AV1 is a good idea with 20 years old PC.
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 350
Joined: 2020-03-02, 16:04

Re: Pale Moon x86-64 SSE2/AVX2

Post by Nuck-TH » 2026-06-03, 13:23

A few pages ago there was some discussion about AVX and mention that some relatively recent Intel CPUs lack it.

User avatar
Drugwash
Lunatic
Lunatic
Posts: 467
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: Pale Moon x86-64 SSE2/AVX2

Post by Drugwash » 2026-06-03, 14:32

UCyborg wrote:
2026-06-03, 11:48
How does Firefox handle it?

It has media.av1.use-dav1d pref.
No idea but maybe it falls back to safer code if it has the ability to detect the running CPU's capabilities at runtime. Although that would mean to build and provide two different versions of the dav1d decoder. Or simply disable dav1d/AV1 capability altogether if CPU can't handle AVX and the dav1d decoder was built with AVX capability. Or maybe they have another method.

I also see there is a vaapitest executable in its folder for the videocard.

I would've expected for Pale Moon's build script(s) to detect CPU configuration in .mozconfig and automatically enable the --enable-libaom fallback if --enable-av1 was enabled in a SSE2 configuration, but that is not the case. On the other hand the script did throw an error when --enable-libaom was active and --enable-av1 was disabled. Hm.
Because of this I'll have to rebuild 34.3.0, and I've not yet decided whether to enable the libaom fallback or just disable AV1 completely - seeing I don't playback videos in the browser anyway.

User avatar
Moonchild
Project founder
Project founder
Posts: 39467
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Pale Moon x86-64 SSE2/AVX2

Post by Moonchild » 2026-06-03, 14:53

Drugwash wrote:
2026-06-03, 14:32
I would've expected for Pale Moon's build script(s) to detect CPU configuration in .mozconfig and automatically enable the --enable-libaom fallback if --enable-av1 was enabled in a SSE2 configuration, but that is not the case.
That would be assuming you're always building binaries on the machine you're going to use them on. And that's just not the case. Build machine CPU capabilities should have no bearing on the configuration. The builder determines the target configuration, not the hardware.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Drugwash
Lunatic
Lunatic
Posts: 467
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: Pale Moon x86-64 SSE2/AVX2

Post by Drugwash » 2026-06-03, 15:50

Maybe I got this wrong but wouldn't an option like ac_add_options --enable-optimize="-O2 -msse2 -mfpmath=sse -w" imply the binaries are built for usage on SSE2 machines, that is without any AVX/AVX2 capability? :? Otherwise there would be no point in having separate AVX and SSE2 builds (official or not).
I mean logically, if the binary is built without AVX capabilities why would any of its dependent libraries have AVX dependency?

And if that's the case, couldn't the building script(s) detect that option and if necessary correct any (minor) user errors automatically, such as in this case? With warnings - for user's learning - in order to minimize any such issues in the future.

This kinda ties into one of our previous discussions regarding improvement of the building environment in order to avoid errors and oversights.

My apologies if I somehow didn't understand the situation correctly.

Now, just for clarification: while I built PM using the SSE option as above, and enabled AV1 without also enabling libaom, what would happen if I tried to view/play an AV1 video file in this browser, on my SSE2-only machine? Would it just refuse to play, would it throw a player error, or would it crash the whole browser? If it wouldn't crash then I'd rather avoid sitting idle around my notebook for another 2+ hours.
Not that I'm usually playing videos in browser - as previously mentioned - but one doesn't know what they may stumble upon on some random page.

User avatar
Moonchild
Project founder
Project founder
Posts: 39467
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Pale Moon x86-64 SSE2/AVX2

Post by Moonchild » 2026-06-03, 16:37

Drugwash wrote:
2026-06-03, 15:50
And if that's the case, couldn't the building script(s) detect that option and if necessary correct
Theoretically, yes, but then you're asking the build system to be aware of and respond to every compiler option a user might be passing in the optimization flags. For every compiler supported, on every OS supported. That would be neither simple nor very maintainable.
Asking the person building to pass the correct/logical configuration parameters in their mozconfig is simply the most common sense solution.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Drugwash
Lunatic
Lunatic
Posts: 467
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: Pale Moon x86-64 SSE2/AVX2

Post by Drugwash » 2026-06-03, 17:10

Moonchild wrote:
2026-06-03, 16:37
Theoretically, yes
Well then, I wasn't so far off. :)
Moonchild wrote:
2026-06-03, 16:37
For every compiler supported, on every OS supported. That would be neither simple nor very maintainable.
That may be true, unfortunately. Too many compilers, too many operating system versions. Ironically, none even remotely close to perfection otherwise there wouldn't be so many to begin with.
Moonchild wrote:
2026-06-03, 16:37
Asking the person building to pass the correct/logical configuration parameters in their mozconfig is simply the most common sense solution.
Also true... if the person knew all configuration intricacies of the said project (be it Pale Moon or anything else). If there wasn't the tiny mention of libaom on the Release Notes page I and maybe others would've scratched our heads looking for a fix - or just banged those heads against the wall in desperation. (I do have a flair for the dramatic :) )

So... should I rebuild or would it just be a minor hitch? I could let it do its job over night.

User avatar
back2themoon
Knows the dark side
Knows the dark side
Posts: 3281
Joined: 2012-08-19, 20:32

Re: Pale Moon x86-64 SSE2/AVX2

Post by back2themoon » 2026-06-03, 17:21

Drugwash wrote:
2026-06-03, 15:50
... would it throw a player error, or would it crash the whole browser? If it wouldn't crash then I'd rather avoid sitting idle around my notebook for another 2+ hours.
Isn't there a risk for system crashes (and quite the ugly ones) with CPU instruction mismatches?

User avatar
Drugwash
Lunatic
Lunatic
Posts: 467
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: Pale Moon x86-64 SSE2/AVX2

Post by Drugwash » 2026-06-03, 18:02

back2themoon wrote:
2026-06-03, 17:21
Isn't there a risk for system crashes (and quite the ugly ones) with CPU instruction mismatches?
Dunno, so far I haven't had such ugly crashes - knock on wood. :shh:

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 350
Joined: 2020-03-02, 16:04

Re: Pale Moon x86-64 SSE2/AVX2

Post by Nuck-TH » 2026-06-03, 18:05

Drugwash wrote:
2026-06-03, 15:50
Maybe I got this wrong but wouldn't an option like ac_add_options --enable-optimize="-O2 -msse2 -mfpmath=sse -w" imply the binaries are built for usage on SSE2 machines, that is without any AVX/AVX2 capability? :? Otherwise there would be no point in having separate AVX and SSE2 builds (official or not).
It does, but there can be overrides for some compiler options for certain source files/their parts.

And there is matter of inline assembly, which is common in codecs where hand optimizations are done. Ideally they are guarded by #ifs, but in case of dav1d this apparently isn't the case. Making and maintaining patches that will do just that isn't viable, and tbh isn't even very useful.
Drugwash wrote:
2026-06-03, 15:50
Now, just for clarification: while I built PM using the SSE option as above, and enabled AV1 without also enabling libaom, what would happen if I tried to view/play an AV1 video file in this browser, on my SSE2-only machine? Would it just refuse to play, would it throw a player error, or would it crash the whole browser? If it wouldn't crash then I'd rather avoid sitting idle around my notebook for another 2+ hours.
Not that I'm usually playing videos in browser - as previously mentioned - but one doesn't know what they may stumble upon on some random page.
Due to above it will crash with illegal instruction error, but since that code is confined to av1 decoder, it will happen only when av1 playback is attempted.
back2themoon wrote:
2026-06-03, 17:21
Drugwash wrote:
2026-06-03, 15:50
... would it throw a player error, or would it crash the whole browser? If it wouldn't crash then I'd rather avoid sitting idle around my notebook for another 2+ hours.
Isn't there a risk for system crashes (and quite the ugly ones) with CPU instruction mismatches?
Cpus aren't that stupid. For ages there are ways to catch attempt of executing unknown instructions.
On non-AVX cpu it will crash with illegal instruction error.
If it built into 32bit binary and run on AVX capable cpu it will either produce some incorrect results or outright crash because AVX instructions are made with assumption that they are used from 64bit mode. Why they aren't trapped as illegal in legacy(32bit) mode is anyone's guess...

User avatar
Drugwash
Lunatic
Lunatic
Posts: 467
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: Pale Moon x86-64 SSE2/AVX2

Post by Drugwash » 2026-06-03, 19:11

Nuck-TH wrote:
2026-06-03, 18:05
there can be overrides for some compiler options for certain source files/their parts.
Granted, but here we're talking about the main setting for the whole of the project, and I believe this is what would have to be considered if it were to tweak other settings on this base. The individual options for parts of the project shouldn't have any say in this unless they pertain to the very settings that would be tweaked on this occasion.
Nuck-TH wrote:
2026-06-03, 18:05
there is matter of inline assembly, [...] guarded by #ifs, but in case of dav1d this apparently isn't the case.
This is quite bad. [Deleted by moderator.]
Nuck-TH wrote:
2026-06-03, 18:05
Due to above it will crash with illegal instruction error, but [...] only when av1 playback is attempted.
This is obvious, but my question was whether it would crash the whole browser or just the player in its respective tab where the video was attempted open. A system crash would be very unlikely in my humble opinion but we never know. In my case Cinnamon is quite flaky itself, and used to crash pretty often in the past before I tweaked a few system files and installed some backports. By the way, mine is a 64bit system not 32bit, so it's one least thing to worry about.

Anyway, all things seem to indicate a rebuild would be indicated, and most likely with AV1 disabled completely. Will fire it up before I go to bed tonight.
Thank you all, and sorry for the slight hijacking.

User avatar
back2themoon
Knows the dark side
Knows the dark side
Posts: 3281
Joined: 2012-08-19, 20:32

Re: Pale Moon x86-64 SSE2/AVX2

Post by back2themoon » 2026-06-03, 21:25

Yes, perhaps the "ugly" crashes in such occasions are only related to deeper-level stuff e.g. system drivers.

Don't know really, but Nvidia has messed up on something like this. And yes, I got that treatment. System backups are good things.

User avatar
Moonchild
Project founder
Project founder
Posts: 39467
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Pale Moon x86-64 SSE2/AVX2

Post by Moonchild » 2026-06-04, 05:06

Drugwash wrote:
2026-06-03, 19:11
but my question was whether it would crash the whole browser or just the player in its respective tab where the video was attempted open.
The application would crash (on any reasonable OS anyway). If a CPU encounters an illegal instruction for its hardware then there is no sensible way to continue execution in that process, and the only option is to exit with an error. Unless video playback would be handled entirely externally (e.g. using an out-of-process plugin) and in a fault-tolerant manner, there's no way the browser can recover and continue execution.
"Praise from a narcissistic person is always a poison dart. They don't share the stage, so discernment matters." - Dr. Ramani
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1010
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Pale Moon x86-64 SSE2/AVX2

Post by UCyborg » 2026-06-04, 16:42

Firefox seems to have less hiccups with AV1 than Pale Moon, though there doesn't seem be any practical difference with media.av1.use-dav1d. Maybe it's decided at runtime whether to use it or not dependnig on CPU?
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.

User avatar
UCyborg
Board Warrior
Board Warrior
Posts: 1010
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Pale Moon x86-64 SSE2/AVX2

Post by UCyborg » 2026-06-04, 19:42

And PotPlayer mentions using libdav1d on my AVXless CPU.
PotPlayer-libdav1d.png
No crashes, though 1920x1080 video loads the CPU fully.
You do not have the required permissions to view the files attached to this post.
The Merovingian wrote:Choice is an illusion, created between those with power, and those without.