27 Commits

Author SHA1 Message Date
Jeroen van Rijn
eff32e18a7 Also test a big int with a large number of zeroes. 2025-11-27 16:32:27 +01:00
Jeroen van Rijn
1ea5990be2 Speed up big.itoa
Extract 18 (64-bit) or 8 (32-bit) digits per big division.
This gives a 2.5x speedup for a 1024-bit bigint.
2025-11-27 15:35:05 +01:00
gingerBill
0b4884ada4 Update test generator 2025-11-27 09:21:54 +00:00
Jeroen van Rijn
56aab55d82 Fix #5931
Fix #5931 and add test case for it.
2025-11-18 15:37:57 +01:00
gingerBill
842cfee0f3 Change Odin's LICENSE to zlib from BSD 3-clause
This change was made in order to allow things produced with Odin and using Odin's core library, to not require the LICENSE to also be distributed alongside the binary form.
2025-10-28 14:38:25 +00:00
Jeroen van Rijn
9dafd77bc0 Turn core:math/bìg tests into regular core:testing tests.
`core:math/big` has been verified against Python's big integer implementation long enough.
Turn it into a regular regression test using the `core:testing` framework, testing against
a generated corpus of test vectors.
2025-06-11 00:40:52 +02:00
Jeroen van Rijn
4e50b9d331 Fix path 2025-06-10 16:55:03 +02:00
Jeroen van Rijn
4f4839ecc5 Add initial tests for big rationals 2025-06-10 16:46:12 +02:00
gingerBill
23351ca8be Merge pull request #3137 from laytan/show-defineable
Add flags to show/export defineable values and warn if a -define is unused in the project
2024-06-20 11:45:52 +01:00
Feoramund
fe5c278fca Add test for core:math/big permutation & combination procs 2024-06-09 20:42:09 -04:00
Feoramund
f0d65112b8 Rename math/big test package
This is in line with the other tests, and it does not seem to affect
building the library.
2024-06-09 20:42:07 -04:00
Laytan Laats
f2be35f1f0 remove caught unused define 2024-06-07 15:22:14 +02:00
Feoramund
890fe07c6e Disable FANCY_OUTPUT in Odin test scripts
This should tidy up the CI output logs a bit.
2024-06-02 14:54:32 -04:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
Jeroen van Rijn
07cd6cd670 Change large math/big test literals to hex.
In September 2022, the Python team addressed a possible DoS issue converting big integers to and from base 10 strings: https://github.com/python/cpython/issues/95778

Converting to/from base 10 is a quadratic operation, so they limited it to 4300 digits: https://discuss.python.org/t/int-str-conversions-broken-in-latest-python-bugfix-releases/18889/83

Github CI still uses an old Python version which parsed our test suite just fine. This patch converts them to hex literals to ensure our test doesn't break when Github does update to a non-vulnerable Python version released after September 2022.
2023-09-30 11:16:36 +02:00
gingerBill
f7211408fc Merge pull request #1544 from FancyKillerPanda/build_ignore
Changed `//+ignore` to `//+build ignore` and emit a warning for unknown tags
2022-11-03 12:58:26 +00:00
Jeroen van Rijn
40f0f5ad8d Update CI for math library. 2022-04-26 15:01:09 +02:00
Jeroen van Rijn
63331ef731 Revert "Merge pull request #1702 from Kelimion/filename_generation"
This reverts commit a40a53b104, reversing
changes made to 5422a3b17e.
2022-04-24 19:53:36 +02:00
Jeroen van Rijn
3cab2592c3 Compiler: Add early error for output path being a directory.
- Introduce new `Path` type and an array of build paths on the build context.
- Resolve input and output paths/files early (before parsing).
- Error early if inputs are missing or outputs are directories.
- Plumb new file path generation into linker stage instead of its adhoc method.

TODO:
- Remove more adhoc file path generation in parser and linker stage.
- Make intermediate object file generation use new path system.
- Round out and robustify Path helper functions.
2022-04-24 13:37:26 +02:00
Jeroen van Rijn
581d53b96b [math/big] Tell Python test runner how many nails we use.
`_DIGIT_NAILS` is defined as 4, meaning that we use 60 out of every 64 bits.
We can use as few as 1 nail, using 63 bits out of every 64, and all tests will still pass.

However, it needs more testing to see if that's a worthwhile change to make.

For the tests to work properly when changing the nails, Python needs to know about it as well.

In addition, compile the big math code with `-o:speed` going forward.
2022-04-01 16:24:27 +02:00
FancyKillerPanda
e139d1cbe4 Removed //+build ignore from tests/core/math/big/test.odin. 2022-02-24 12:45:03 +11:00
FancyKillerPanda
62ff8daa78 Changed //+ignore to //+build ignore. 2022-02-24 12:23:54 +11:00
Jeroen van Rijn
938744b276 [math/big] Rename internal_int_shl_digit to _private_int_shl_leg.
Same for the SHR variant. These are pure implementation details to shift by a leg/word at a time.
Prevent accidental usage.
2021-12-11 15:22:24 +01:00
Jeroen van Rijn
c94098c2ab [math/big] Fix int_set and int_get. 2021-12-09 16:14:04 +01:00
Jeroen van Rijn
f978e74773 LLVM 12 big math test workaround. 2021-09-11 20:36:09 +02:00
Jeroen van Rijn
ce2f926ff7 Separate math/big test. 2021-09-07 20:24:02 +02:00
Jeroen van Rijn
f7601a759b Move math/big tests under tests/. 2021-09-07 19:51:56 +02:00