[PD] different float accuracy betw. Pd-0.52-1-msw-i386 and Pd-0.52-1-msw-amd64

Miller Puckette msp at ucsd.edu
Fri Feb 11 23:55:19 CET 2022


Just to ad tothe confusion ... I'm running tests ("reality check") to see
of Pd runs musical pieces the same way on diffrent machines.  I found that
AMD64 Pd on linux and on MacOS (both 64-bit Intel CPUs) gave slightly
different results, off by less thatn a part in a million (10^-6 error).
But.. the MacOS test gave the identical same result as a Raspberry Pi, which
is in 32 bits and has an ARM processor.

I _think_ linux and MACOS are setting different rounding modes in the
processor, but haven't takent the time to try to figure it out.

cheers
Miller

On Fri, Feb 11, 2022 at 11:25:26PM +0100, Christof Ressi wrote:
> > However, what worries me is that if I run a Pd vanilla patch on
> > different Pd versions (i386 or amd64) with the same floating point
> > precision, I expect the same results.
> Generally, you can't really expect that. Even without -ffast-math, different
> CPU architectures or instruction sets will give slightly different results
> (unless you jump through various hoops).
> 
> Here's an interesting article by a game developer: https://urldefense.proofpoint.com/v2/url?u=https-3A__gafferongames.com_post_floating-5Fpoint-5Fdeterminism_&d=DwICAg&c=-35OiAkTchMrZOngvJPOeA&r=XprZV3Fxus2L1LCw80hE4Q&m=APlmOH6-SnFCR7Jvr5B5Sup5Bjb4le7rctP34Mrr9Y-4wQA2jiIang6E8-_797z3&s=uDkC4rfduQLn3ViZe_SQnSi3i6yQHuLVgwGP64klfN4&e=
> 
> Usually, these errors are very small, but with (suboptimal) recursive
> algorithms they can get amplified significantly. Your patch is a very
> striking demonstration of the problems with the direct 2 form of the biquad
> filter :-)
> 
> Christof
> 
> On 11.02.2022 23:11, musil at iem.at wrote:
> > 
> > Zitat von Christof Ressi <info at christofressi.com>:
> > 
> > > That's only half the story. Generally, one shouldn't expect floating
> > > point computations to yield the exact same result with different
> > > compilers/machines. The rounding errors themselves are very small,
> > > but they can accumulate over long periods of time or get amplified
> > > by recursive algorithms.
> > > I've made an alternative implementation [biquad2~] that uses direct
> > > form 1. It shows significantly less noise than the [biquad~]
> > > examples. See attachments.
> > 
> > That's right what you wrote.
> > However, what worries me is that if I run a Pd vanilla patch on
> > different Pd versions (i386 or amd64) with the same floating point
> > precision, I expect the same results.
> > 
> > e.g. the test patch running on Pd-0.52-1-xxx-i386 produces -60dB low
> > frequency spikes, the identical patch running on Pd-0.52-1-xxx-amd64
> > produces -34dB high frequency bursts. And that's a realistic simple
> > situation, a microphone signal feeds a 3rd order high pass filter.
> > 
> > Thomas Musil
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Pd-list at lists.iem.at mailing list
> > UNSUBSCRIBE and account-management -> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.puredata.info_listinfo_pd-2Dlist&d=DwICAg&c=-35OiAkTchMrZOngvJPOeA&r=XprZV3Fxus2L1LCw80hE4Q&m=APlmOH6-SnFCR7Jvr5B5Sup5Bjb4le7rctP34Mrr9Y-4wQA2jiIang6E8-_797z3&s=vRvKjb8aoxutgyCOdjzRXK3d2PruXTybxAlF26kcRO0&e=
> 
> 
> 
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.puredata.info_listinfo_pd-2Dlist&d=DwICAg&c=-35OiAkTchMrZOngvJPOeA&r=XprZV3Fxus2L1LCw80hE4Q&m=APlmOH6-SnFCR7Jvr5B5Sup5Bjb4le7rctP34Mrr9Y-4wQA2jiIang6E8-_797z3&s=vRvKjb8aoxutgyCOdjzRXK3d2PruXTybxAlF26kcRO0&e=





More information about the Pd-list mailing list