Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] Simplify how the list of points are structured #18163

Merged
merged 1 commit into from
May 30, 2024

Conversation

calixteman
Copy link
Contributor

Instead of sending to the main thread an array of Objects for a list of points (or quadpoints), we'll send just a basic float buffer.
It should slightly improve performances (especially when cloning the data) and use slightly less memory.

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/10e5dd63bf23fe4/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/3b67265eba93c9e/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/3b67265eba93c9e/output.txt

Total script time: 2.90 mins

  • Unit tests: FAILED
  • Integration Tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.193.163.58:8877/3b67265eba93c9e/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio-windows test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/384ec49f12783b3/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/10e5dd63bf23fe4/output.txt

Total script time: 27.78 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 34
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/10e5dd63bf23fe4/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/384ec49f12783b3/output.txt

Total script time: 13.06 mins

  • Unit tests: FAILED
  • Integration Tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.193.163.58:8877/384ec49f12783b3/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9854630ec7de34d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/78252ef7bea0fa7/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/9854630ec7de34d/output.txt

Total script time: 27.78 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 31
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/9854630ec7de34d/reftest-analyzer.html#web=eq.log

@mozilla mozilla deleted a comment from moz-tools-bot May 24, 2024
@calixteman
Copy link
Contributor Author

/botio-windows test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/63baf1d26558a4f/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/63baf1d26558a4f/output.txt

Total script time: 12.97 mins

  • Unit tests: FAILED
  • Integration Tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.193.163.58:8877/63baf1d26558a4f/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

Two questions:

  • Are the ref-test "failures" actually expected?
  • If so, what's the explanation for the changes?

@calixteman
Copy link
Contributor Author

Two questions:

* Are the ref-test "failures" actually expected?

* If so, what's the explanation for the changes?

I didn't expect the changes and their are due to the fact I chose to set the data in some Float32Array which makes the check failing:

if (
rectTrX === trX &&
rectTrY === trY &&
rectBlX === blX &&
rectBlY === blY

So in last version of the patch I changed for Float64Array.
I think we don't need to have 64-bits precision here and 32-bits is enough but it can be done in a follow-up.
And it'll require to make few other changes especially when we test the equality of two numbers with different precisions or we could just try to pass every floating data into Float32Array (which could make sense for data.rect).

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 1

Live output at: http://54.241.84.105:8877/d183f9007b0e2bf/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/6bfc227e0be2cc2/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/d183f9007b0e2bf/output.txt

Total script time: 27.74 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 18
  different first/second rendering: 4

Image differences available at: http://54.241.84.105:8877/d183f9007b0e2bf/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/6bfc227e0be2cc2/output.txt

Total script time: 60.00 mins

@calixteman
Copy link
Contributor Author

/botio-windows test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/5e113b023186972/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/5e113b023186972/output.txt

Total script time: 43.35 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 4

Image differences available at: http://54.193.163.58:8877/5e113b023186972/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

I didn't expect the changes and their are due to the fact I chose to set the data in some Float32Array which makes the check failing:

Interesting, thank you!
This leads me to a, potentially stupid, question: Could we use Float32Array and utilize Math.fround(...) in that check?

@calixteman
Copy link
Contributor Author

I didn't expect the changes and their are due to the fact I chose to set the data in some Float32Array which makes the check failing:

Interesting, thank you! This leads me to a, potentially stupid, question: Could we use Float32Array and utilize Math.fround(...) in that check?

Yes (thx for the tip: I didn't know fround) or just use a Float32Array for the data.rect, but as said I think it's worth doing that in follow-up, or do you prefer we switch to 32-bits precision in this patch ?

@Snuffleupagus
Copy link
Collaborator

[...] or just use a Float32Array for the data.rect,

Off the top of my head I cannot tell how much else that'd affect, so perhaps we shouldn't do that here.

My untested idea was that we'd use Float32Array as originally in this patch, and simply change

const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect;
into

const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect.map(e => Math.fround(e));

Instead of sending to the main thread an array of Objects for a list of points (or quadpoints),
we'll send just a basic float buffer.
It should slightly improve performances (especially when cloning the data) and use slightly less memory.
@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/f69f32419ae001b/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/8eada7f5d96d4af/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/f69f32419ae001b/output.txt

Total script time: 27.96 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 18
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/f69f32419ae001b/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/8eada7f5d96d4af/output.txt

Total script time: 41.07 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 6

Image differences available at: http://54.193.163.58:8877/8eada7f5d96d4af/reftest-analyzer.html#web=eq.log

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, thank you!

@calixteman calixteman merged commit fdb3617 into mozilla:master May 30, 2024
9 checks passed
@calixteman calixteman deleted the simplify_list_points branch May 30, 2024 16:25
@timvandermeij
Copy link
Contributor

Given that this is the first [api-minor] patch for the new release, could you create a patch to bump the library version to 4.4 with a reference to the merge commit of this patch, similar to 3ff93ed? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants