Skip to content

feat(minifier): implement variadic Math methods in known methods #8783

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

Conversation

7086cmd
Copy link
Contributor

@7086cmd 7086cmd commented Jan 30, 2025

No description provided.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Jan 30, 2025
Copy link
Contributor Author

7086cmd commented Jan 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@7086cmd 7086cmd requested review from Boshen and sapphi-red January 30, 2025 06:45
@7086cmd 7086cmd force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from 21a9c05 to ef16e27 Compare January 30, 2025 06:46
@7086cmd 7086cmd marked this pull request as ready for review January 30, 2025 06:46
Copy link

codspeed-hq bot commented Jan 30, 2025

CodSpeed Performance Report

Merging #8783 will not alter performance

Comparing 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods (48fb1e0) with main (4f30a17)

Summary

✅ 33 untouched benchmarks

@7086cmd 7086cmd force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from ef16e27 to abc84d1 Compare January 30, 2025 08:23
@7086cmd 7086cmd requested a review from sapphi-red January 30, 2025 08:25
@7086cmd
Copy link
Contributor Author

7086cmd commented Jan 30, 2025

It is intriguing that the application passes on my Mac but fails in Ubuntu. What happens?

@sapphi-red
Copy link
Member

Maybe this issue is related: rust-lang/rust#83984

@7086cmd
Copy link
Contributor Author

7086cmd commented Jan 30, 2025

Maybe this issue is related: rust-lang/rust#83984

So we may skip minifying this at present when -0 exists, or throw a warning here? It seems to be tricky.

@sapphi-red
Copy link
Member

Maybe this issue is related: rust-lang/rust#83984

So we may skip minifying this at present when -0 exists, or throw a warning here? It seems to be tricky.

Can we solve this by changing the result to be -0 if and only if the input includes -0 and the result was 0? If not, I think we can skip minifying for now. FYI to match -0, the comparision needs to be value == 0.0 && value.is_negative() IIRC.

@7086cmd 7086cmd force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from abc84d1 to 42f7235 Compare January 30, 2025 08:59
@7086cmd
Copy link
Contributor Author

7086cmd commented Jan 30, 2025

Can we solve this by changing the result to be -0 if and only if the input includes -0 and the result was 0? If not, I think we can skip minifying for now. FYI to match -0, the comparision needs to be value == 0.0 && value.is_negative() IIRC.

It seems that the inelegant approach that manually comparing instead of using min or max methods works.

@Boshen Boshen changed the base branch from 01-30-feat_minifier_implement_unary_math_functions_in_known_methods to graphite-base/8783 January 30, 2025 15:07
@Boshen Boshen force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from 42f7235 to aa5f9da Compare January 30, 2025 15:14
@Boshen Boshen force-pushed the graphite-base/8783 branch from 6893b32 to 6c627df Compare January 30, 2025 15:14
@Boshen Boshen changed the base branch from graphite-base/8783 to main January 30, 2025 15:15
@Boshen Boshen force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from aa5f9da to fb675a3 Compare January 30, 2025 15:15
@7086cmd
Copy link
Contributor Author

7086cmd commented Jan 31, 2025

rust-lang/rust#91079

The std is implementing a API apart from min or max that is designed for distinguishing -0.0 and 0.0, but at present, the manually approach may be mandatory.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jan 31, 2025
Copy link
Member

Boshen commented Jan 31, 2025

Merge activity

  • Jan 30, 10:51 PM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 30, 10:51 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 31, 4:40 AM UTC: The Graphite merge queue couldn't merge this PR because it timed out.

@graphite-app graphite-app bot force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from fb675a3 to bd67e6b Compare January 31, 2025 04:20
@graphite-app graphite-app bot force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from bd67e6b to 5be671d Compare January 31, 2025 04:25
@graphite-app graphite-app bot force-pushed the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch from 5be671d to 48fb1e0 Compare January 31, 2025 04:32
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 31, 2025
@Boshen Boshen merged commit 249895f into main Jan 31, 2025
27 checks passed
@Boshen Boshen deleted the 01-30-feat_minifier_implement_variadic_math_methods_in_known_methods branch January 31, 2025 04:46
@oxc-bot oxc-bot mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-minifier Area - Minifier C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants