Skip to content

Implement coercion of numeric types for ascription and arithmetic (off by default)#6175

Merged
nrc merged 1 commit intomainfrom
nrc-uom-coerce
Apr 7, 2025
Merged

Implement coercion of numeric types for ascription and arithmetic (off by default)#6175
nrc merged 1 commit intomainfrom
nrc-uom-coerce

Conversation

@nrc
Copy link
Contributor

@nrc nrc commented Apr 6, 2025

Another step towards better UoM. This also removes the deserialize bounds on a few things, notably operations. The changes to polar are a temporary step backwards and will be addressed in another PR

@nrc nrc requested a review from jtran April 6, 2025 20:36
@qa-wolf
Copy link

qa-wolf bot commented Apr 6, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@vercel
Copy link

vercel bot commented Apr 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Apr 7, 2025 3:24am

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 6, 2025

CodSpeed Walltime Performance Report

Merging #6175 will degrade performances by 16.14%

Comparing nrc-uom-coerce (1beccac) with main (38446b5)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

⚡ 2 improvements
❌ 12 regressions
✅ 78 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
execute_bracket 2.6 s 2.3 s +10.15%
execute_cycloidal-gear 1.4 s 1.2 s +10.04%
parse_food-service-spatula 11 ms 12.2 ms -10.27%
parse_gear-rack 2.1 ms 2.3 ms -11.13%
parse_gear 7.8 ms 8.9 ms -12.25%
parse_gridfinity-baseplate-magnets 13.6 ms 15.4 ms -11.5%
parse_hex-nut 987.3 µs 1,172.6 µs -15.8%
parse_lego 2.7 ms 3.1 ms -12.54%
parse_makeup-mirror 4.2 ms 4.8 ms -12.69%
parse_mounting-plate 2.8 ms 3.3 ms -16.14%
parse_poopy-shoe 7.6 ms 8.8 ms -13.81%
parse_router-template-cross-bar 5.2 ms 5.8 ms -10.88%
parse_socket-head-cap-screw 1.4 ms 1.6 ms -11.8%
parse_washer 505.7 µs 563.4 µs -10.26%

…f by default)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
@codecov
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 66.50485% with 207 lines in your changes missing coverage. Please review.

Project coverage is 85.04%. Comparing base (ce7a967) to head (1beccac).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
rust/kcl-lib/src/execution/types.rs 65.36% 160 Missing ⚠️
rust/kcl-lib/src/std/args.rs 42.85% 24 Missing ⚠️
rust/kcl-lib/src/execution/exec_ast.rs 76.76% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6175      +/-   ##
==========================================
- Coverage   85.34%   85.04%   -0.31%     
==========================================
  Files         110      110              
  Lines       44248    44609     +361     
==========================================
+ Hits        37765    37938     +173     
- Misses       6483     6671     +188     
Flag Coverage Δ
rust 85.04% <66.50%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nrc nrc merged commit e7b23e1 into main Apr 7, 2025
57 of 59 checks passed
@nrc nrc deleted the nrc-uom-coerce branch April 7, 2025 04:13
modeling-app-github-app bot pushed a commit that referenced this pull request Apr 7, 2025
…hmetic (off by default) (#6175)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
jessfraz added a commit that referenced this pull request Apr 7, 2025
* origin/main:
  Quick app rename typo fix in settings.md (#6198)
  Add point-and-click Insert from local project files (#6129)
  Install and start Vector on macOS CI runners (#6147)
  Implement polar std function in KCL (#6180)
  Bump typescript from 5.8.2 to 5.8.3 in /packages/codemirror-lsp-client in the patch group (#6188)
  Bump @types/node from 22.13.13 to 22.14.0 in /packages/codemirror-lsp-client in the minor group (#6189)
  Bump the major group in /packages/codemirror-lang-kcl with 2 updates (#6194)
  Bump taiki-e/install-action from 2.49.30 to 2.49.45 in the patch group (#6185)
  Bump the patch group with 6 updates (#6186)
  Bump the patch group in /rust/kcl-language-server with 3 updates (#6183)
  Bump the patch group in /packages/codemirror-lang-kcl with 2 updates (#6193)
  Remove unnecessary timeouts waiting for command bar (#6199)
  Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312)
  More propagation of numeric types (#6177)
  Apply type-directed coercions to arguments in calls of user functions (#6179)
  Erase comment start positions from snapshot tests (#6178)
  Implement coercion of numeric types for ascription and arithmetic (off by default) (#6175)
  Reduce the number of reps in the add_lots test (#6174)
  take things off the batch in a more safe way (#6171)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants