1
0
Fork 0
Commit Graph

397 Commits

Author SHA1 Message Date
Rémi Verschelde 0d4d70d5a6 Merge pull request #102587 from bruvzg/s_pa_tst
[Tests] Add `Packed*Array` `to_byte_array` variant call tests.
2025-02-11 10:54:14 +01:00
Pablo Andres Fuente d1338528f9 Fix file loggin log rotation
Fixes #97066

`RBSet` were used on `RotatedFileLogger` because it guarantees that
iterating it is done via `operator<`. This is important because
`RotatedFileLogger` depends on this behavior to delete the oldest log file.
On #61194 `HashSet` was added and all `RBSet` uses were replaced by
`HashSet`.
When that happened, the iteration in order is guaranteed to be the insertion
order, wich made that `RotatedFileLogger` delete the newest log file.
As a bonus, I added unit test for `RotatedFileLogger` and `CompositeLogger`.
2025-02-10 21:57:07 +01:00
Pāvels Nadtočajevs 7f7f12dad3 [Tests] Add Packed*Array to_byte_array variant call tests. 2025-02-08 17:40:50 +02:00
Thaddeus Crews f0f5319b0b
Merge pull request #100107 from Faless/fix/net_tests
[Net] Fix TCP/UDP server network tests
2025-02-05 18:50:44 -06:00
Pāvels Nadtočajevs b50d9742c2 Fix `is_valid_float`, `Variant` parser, `Expression` parser, script highlighter, and `TextServer` not handing capital E in scientific notation. 2025-02-05 18:39:40 +02:00
bruvzg 3be46a69c4 Fix uppercase B and X parsing in the integer literals. 2025-02-05 16:02:06 +02:00
Adam d56cbd374b Fix `Basis::get_euler` incorrectly simplifying rotations in some cases. 2025-01-29 16:13:29 -06:00
Silc Lizard (Tokage) Renew 27e23280c5 Fix Quaternion arc constructor to check dot & Add test for same vec3s 2025-01-20 18:16:53 +09:00
Rémi Verschelde 35080c6df3 Merge pull request #100970 from anknetau/ank/godot-add-test-cases-for-uid-strings
Add some tests for `uid://` encoding and decoding
2025-01-10 23:05:59 +01:00
Rémi Verschelde ad74e337b9 Merge pull request #100954 from Bromeon/bugfix/nodepath-slice
Fix `NodePath::slice()` incorrect behavior for subname indexing
2025-01-10 23:05:56 +01:00
Andres Kievsky 2b5dd99d72 Add some tests for uid:// encoding and decoding 2025-01-10 23:41:12 +11:00
Aarni Koskela f134769506 Fix various typos
* Add TODO notes for typos that should be fixed for 5.0

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-08 14:47:42 +02:00
Yufeng Ying 34d8255947 Force build editor with regex module, remove checking code.
Fix include.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-07 19:43:23 +08:00
Rémi Verschelde 653f5a9613
Merge pull request #100976 from AThousandShips/uid_fixes
[Core] Fix UID encoding
2025-01-06 22:48:13 +01:00
Rémi Verschelde 1aaf20b1f1
Merge pull request #98488 from RandomShaper/lockless_rid_fetch_pro
Fix `RID_Owner` synchronization
2025-01-06 08:38:14 +01:00
Pedro J. Estébanez de7e4efef8 Fix RID_Owner synchronization 2025-01-03 17:05:36 +01:00
Rémi Verschelde d47fef15b8
Merge pull request #100991 from TokageItLab/180deg-arc
Fix looking at with 180 degree arc
2025-01-03 00:49:59 +01:00
Rémi Verschelde dd7d36e803
Merge pull request #100770 from hpvb/command-queue-mt
Core: Refactor CommandQueueMT to use vararg templates for performance and maintainability
2025-01-03 00:49:02 +01:00
HP van Braam cccd2432c3 Refactor CommandQueueMT to use vararg templates
In order to make CommandQueueMT more maintainable this PR changes the
previous macro hell with variadic templates instead. This makes the
class far more explicit and will allow us to more easily change the way
the class functions in the future.

Furthermore this refactoring has allowed for some optimizations. In
particular by using std::forward to delay the decision of decaying the
type to as late as possible we are able to move the data from the
callsite into our Command buffer and later move it to the call.

In practice what this means is that compared to the old version instead
of copying values 3 times, we can now get away with 1 copy, and 1 move
for lvalues, and just 2 moves for rvalues. This saves quite a few
operations in a hot codepath.

We also now test to make sure that the amount of copies and moves are
what we expect. This way we can spot performance regressions in this
code easily.

Somewhat unscientifically, running TPS-demo by pressing enter and not
touching the controls average mspf, repeatable across many runs:

before: 6.467
after : 6.202
2025-01-02 15:35:08 +01:00
Silc Lizard (Tokage) Renew d0c421976c Fix looking at with 180 degree arc
Co-authored-by: Fruitsalad <949631+fruitsalad@users.noreply.github.com>
2025-01-02 15:47:01 +09:00
AThousandShips 25ecf5ec83
[Core] Fix UID encoding
Fixes edge case where `0` encoded as `uid://` instead of `uid://a`, and
fixes the size of the temporary buffer storing encoded UID strings.
2024-12-31 15:20:09 +01:00
Jan Haller df66ea74d7 Fix `NodePath::slice()` incorrect behavior for subname indexing
Adjust slice boundaries in `NodePath` logic to correctly handle subnames.
Update test cases to reflect these changes.
2024-12-30 21:22:26 +01:00
A Thousand Ships a1846b27ea
Improve use of `Ref.is_null/valid`
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
Thaddeus Crews 08d4dd7fd8
Merge pull request #100694 from Ivorforce/cowdata-destruct-graciously
Destruct `CowData` more graciously by avoiding accidentally exposing a half-destructed buffer.
2024-12-23 11:15:18 -06:00
Lukas Tenbrink 25cd923ea1 Destruct `CowData` more graciously by avoiding accidentally exposing a half-destructed buffer. This can avoid problems if any of the destructed objects tries to access the data while it's being destructed. 2024-12-21 20:01:03 +01:00
Rémi Verschelde dac0b67c4d
Merge pull request #100659 from clayjohn/color-srgb-precision
Increase precision in `linear_to_srgb()` and `srgb_to_linear()`
2024-12-20 23:57:35 +01:00
clayjohn 46ce499b6f Increase precision in linear_to_srgb and srgb_to_linear
This avoids the situation where white stops being white after conversion. While maintaining as much floating point ops as possible
2024-12-20 10:49:43 -07:00
Thaddeus Crews 361e3b4fe8
Core: Expand `std::initializer_list` support 2024-12-18 18:46:59 -06:00
HP van Braam 240f510fa7 Core ubsan fixes
This fixes UBSAN errors reported by running our testsuite, importing the
TPS demo, and running the TPS demo. I have tried, wherever possible, to
fix issues related to reported issues but not directly reported by UBSAN
because thse code paths just happened to not have been exercised in
these cases.

These fixes apply only to errors reported, and caused by, core/

The following things have been changed:

* Make sure there are no implicit sign changing casts in core.
* Explicitly type enums that are part of a public API such that users of
  the API cannot pass in wrongly-sized values leading to potential stack
  corruption.
* Ensure that memcpy is never called with invalid or null pointers as
  this is undefined behavior, and when the engine is built with
  optimizations turned on leads to memory corruption and hard to debug
  crashes.
* Replace enum values only used as static values with constexpr static
  const values instead. This has no runtime overhead. This makes it so
  that the size of the enums is explicit.
* Make sure that nan and inf is handled consistently in String.
* Implement a _to_int template to ensure that all of the paths use the
  same algorhithm, and correct the negative integer case.
* Changed the way the json serializer precision work, and added tests to
  verify the new behavior. The behavior doesn't quite match master in
  particulary for negative doubles as the original code tried to cast -inf
  to an int. This then led to negative doubles losing all but one of
  their decimal points when serializing. Behavior in GDScript remains
  unchanged.
2024-12-18 14:31:12 +01:00
Thaddeus Crews 8f16f864a6
Merge pull request #99765 from dalexeev/core-fix-json-from-to-native
Core: Fix `JSON.{from,to}_native()` issues
2024-12-10 14:15:53 -06:00
Thaddeus Crews 4b1a51d3e3
Merge pull request #100075 from demolke/simplify
Fix handling of leading `..` in simplify_path
2024-12-09 14:33:34 -06:00
Fabio Alessandrelli e5807b2adf [Net] Fix TCP/UDP server network tests
Some tests have been removed since there's no way to guarantee they will
pass.

Other tests have been refactored to ensure proper waiting, and taking
into account potential out-of-order delivery (which is unlikely in test
scenarios but expecting a specific order on a UDP socket is wrong and
OSes makes no promises of ordered delivery on localhost).
2024-12-06 18:00:49 +01:00
demolke 964e2b3a9e Fix handling of leading `..` in simplify_path
Prior to this `..\..\texture.png` was incorrectly simplified to `texture.png`
2024-12-06 07:53:55 +01:00
Pablo Andres Fuente df2c2ca3c3 Fix TCPServer "Should disconnect client" test
"Should disconnect client" test was failing randomly on Mac CI tests, so
this PR is making it more reliable reading on the closed client instead of
writing to it
2024-12-03 09:46:37 -03:00
Rémi Verschelde 9048776457
Merge pull request #99751 from bruvzg/dir_init
Add `std::initializer_list` constructor for Dictionary.
2024-11-29 22:51:17 +01:00
Rémi Verschelde bcb5f8377f
Merge pull request #99125 from Flarkk/projection_tests
Add tests for `Projection`
2024-11-29 22:01:59 +01:00
Pāvels Nadtočajevs 54945c4d28 Add std::initializer_list constructor for Dictionary. 2024-11-29 14:12:40 +02:00
Pablo Andres Fuente 0c03db09f8 Add unit tests for TCPServer
This PR aims to help "fix" #43440
2024-11-29 12:55:49 +01:00
Danil Alexeev bd1a35ce9e
Core: Fix `JSON.{from,to}_native()` issues 2024-11-29 12:43:06 +03:00
Florent Guiocheau f1f47c3a53 Add tests for `Projection` 2024-11-27 11:09:10 +01:00
Pablo Andres Fuente 2c9de1d9d2 Add unit tests for UDPServer
This PR aims to help "fix" #43440
2024-11-22 23:08:05 -03:00
Thaddeus Crews ea3154a0d4 Merge pull request #99424 from dalexeev/core-fix-builtin-enum-const-binds
Core: Fix built-in enum constant bindings
2024-11-22 14:54:31 -06:00
Thaddeus Crews c35e4c41d2 Merge pull request #97716 from pafuent/add_half_precision_floating_point_to_stream_peer
Add half precision floating point support to `StreamPeer` and `FileAccess`
2024-11-22 14:54:19 -06:00
Danil Alexeev 03b05cf9ac
Core: Fix built-in enum constant bindings 2024-11-22 14:03:21 +03:00
Thaddeus Crews f952bfe998
Merge pull request #98972 from dbnicholson/standardize-add-defaults
Expose `TranslationServer::standardize_locale` `add_default` param publicly
2024-11-21 17:57:01 -06:00
Dan Nicholson 6f4fadf65d Expose standardize_locale add_default param publicly
Comparing locales can have surprising outcomes since it standardizes
locales with defaults. For example, zh and zh_CN result in an exact
match since the defaults change them both to zh_Hans_CN. Expose the
add_default parameter publicly with a default of false so the fully
standardized locale can be inspected.
2024-11-21 16:50:31 -07:00
Rémi Verschelde 23fc8e22a3
Merge pull request #95303 from EIREXE/inverted_composer
Fix `Projection::invert` for orthographic projection
2024-11-20 17:03:03 +01:00
Álex Román 02b2efc668 Fix Projection::invert on orthogonal projections and others.
Fixes #68878, specially when using orthographic projection.

Also adds some tests.
2024-11-18 16:13:04 +01:00
Thaddeus Crews cc6ee3e956
Merge pull request #98713 from dalexeev/core-fix-callable-get-bound-arguments
Core: Fix `Callable.get_bound_arguments{,_count}()` return incorrect data
2024-11-12 12:13:04 -06:00
Thaddeus Crews 8fd672cd87
Merge pull request #98120 from dalexeev/core-typed-dicts-bin-serialization
Core: Add typed dictionary support for binary serialization
2024-11-12 09:28:00 -06:00