#1 2024-05-25 09:56:16

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

different query results under windows risc

I found something really crazy running windows (risc version) in VMware in Mac. Let me explain:

I have a windows 32bit executable using last github mormot2 compiled with Delphi 11.3 that runs the following query in a TRestServerDB object (memory type based on TOrmVirtualTableBinary):

memserver.Orm.RetrievelistJson(TOrmApiIC11, 'RowID in (select distinct (f.value->"$.ic11") as ic from apicols p, json_each(p.ic11s) f where p.RowID='+toutf8(_pr)+') ORDER BY code', '(code || " " || title) as title');

The above works ok in a windows machine.

Now in a Mac, I install the free VmWare Fusion personal edition and then I installed windows 11 Risc edition. The same windows executable does not gives the same results in this enviroment.

I tried to test the following queries and the returned results are OK:

memserver.Orm.executeJson([TOrmApiCols], 'select distinct (f.value->"$.ic11") as ic from apicols p, json_each(p.ic11s) f where p.RowID='+toutf8(_pr)+') ORDER BY code');
memserver.Orm.RetrievelistJson(TOrmApiIC11, 'RowID in (1930,1931) ORDER BY code', '(code || " " || title) as title');

Same results I am having also using Parallels

I am thinking that this should be sqlite's problem and not Mormot. Am I right?
Thank you in advance

Last edited by dcoun (2024-05-25 10:00:12)

Offline

#2 2024-05-25 18:14:20

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: different query results under windows risc

I can confirm that the same happens using an external database with virtual tables and TrestserverDB, so it should not be mormot's problem
I downloaded the SQLITE version 3.44.2 tools and from the command line tool, the query executes ok in the win11 Arm cmd prompt

I am not sure if it is a problem of win11 emulation or a bug in the code of sqlite. Anyway, I broke the query to two queries and it work ok now. I will follow it in the future updates.

Offline

#3 2024-05-26 16:59:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: different query results under windows risc

What is "Windows RISC" ?

Offline

#4 2024-05-26 17:00:35

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: different query results under windows risc

ab wrote:

What is "Windows RISC" ?

Apologies... my mistake. Windows 11 Arm version

I can run a VM with windows 11 native arm version for Apple's risc processor
All x86-x64 applications can run inside it with "transparent" emulation. The OS is native, but the application can be translated/emulated

Last edited by dcoun (2024-05-26 17:04:19)

Offline

#5 2024-05-26 17:05:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: different query results under windows risc

We don't have any test on Win64 binaries on Mac M1.
But we test, and validate native aarch64 binaries on Mac M1.
https://luti.tranquil.it/history/tis-test-mormot2

Did you compile under Delphi as Win32 or Win64?

Did you download the Win32, Win64 or Mac-M1 version of SQLite3 command line tool?

Offline

#6 2024-05-26 17:30:47

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: different query results under windows risc

I compiled as usual a w32 app using delphi 11.3 that has last snapshot from mormot2 in Github and I run it in a Mac mini inside a VM with win 11 arm edition.
I downloaded the SQLite3 command tool for windows x64 and I tested with it.
To be honest I am curious to run the mormot2 tests inside this VM. I will do it

Offline

#7 2024-05-26 18:12:25

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: different query results under windows risc

Nothing unexpected....
I compiled mormot2 tests using Delphi 12 and FPC 3.2.3  both for w32 & w64 targets
w64 targets finished without errors

w32 targets finished with errors that are available to this gist: https://gist.github.com/dkounal/1887a0e … 8001bf9f27

Offline

#8 2024-05-27 06:46:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: different query results under windows risc

The first error "ECryptCert {Message:"TCryptCertX509.Generate: GeneratePrivateKey failed error"}" is likely to be a timeout issue when generating a RSA keypai.
Is the Win32 emulation somewhat slow for the computing demanding tasks (like RSA prime search)?

The other issues seem to be related to floating-point issues.
My guess is that Win32 has poor floating point emulation.

Offline

#9 2024-05-27 07:08:44

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: different query results under windows risc

ab wrote:

The first error "ECryptCert {Message:"TCryptCertX509.Generate: GeneratePrivateKey failed error"}" is likely to be a timeout issue when generating a RSA keypai.
Is the Win32 emulation somewhat slow for the computing demanding tasks (like RSA prime search)?

No, I could say that it is more fast than I expected. As it is the iPhone emulator in the Mac.

ab wrote:

The other issues seem to be related to floating-point issues.
My guess is that Win32 has poor floating point emulation.

As I understood I have to move to 64bit to have it to work ok

Offline

Board footer

Powered by FluxBB