Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2023-12-04 00:00:00Z and 2023-12-05 00:00:00Z
Avatar
Error out on invalid UTF-16 in locale name

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](ht...
Avatar
CC #7575

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#usin...
Avatar
chillerdragon BOT 2023-12-04 07:47:22Z
Heinrich pr be like 0/7 checklist items done hehe
Avatar
done today
09:14
488ms
Avatar
a0d8c6c Reintroduce m_HaveGlobalTcpAddr - heinrich5991 dc6893e Make dbg_assert take a boolean - heinrich5991 a9ccc69 Make error message about invalid UTF-16 more precise - heinrich5991 9e3d7c4 Merge pull request #7586 from heinrich5991/pr_ddnet_invalid_utf16_error - Robyt3 f910ac6 Merge pull request #7587 from heinrich5991/pr_ddnet_fix_7575 - Robyt3
Avatar
ChillerDragon BOT 2023-12-04 09:34:51Z
@ryouzki ❤️
09:34
best "rust" "coder" eveR!!!!!!
Avatar
This does not fix any issues in ddnet as far as I know. Because ddnet code removed all round based code. Currently the per tee demos are only stopped when a character dies. But the Reset() method in the gameworld destroys characters without killing them. This allows to do world resets without calling gamecontext shutdown while sv_player_demo_record is active. Which is nice for round based game modes. ```C++ void CGameWorld::Reset() { // reset all entities for(auto *pEnt : m...
Avatar
@Learath2 are u using gentoo
Avatar
Avatar
Ryozuki
@Learath2 are u using gentoo
Ofc, I am gentoo
Avatar
@Learath2 https://discord.com/channels/252358080522747904/293493549758939136/1176801129363931196 Not that access is always access by value since it's important that the data type stays small. So index for vec is obv not possible
14:20
Ofc every structure has advantages and disadvantages (edited)
14:20
And i also don't want to exclude slightly more cache misses
Avatar
heinrich is a classic CS enjoyer. They hate linked lists and gotos
Avatar
linked lists are bad 98% of times
14:21
@Learath2 u kinda agree right
14:21
i mean
14:21
xd
14:21
they only famous cuz they are used to teach
Avatar
I disagree ofc
Avatar
Avatar
Ryozuki
linked lists are bad 98% of times
That's also just your opinion because of rust
Avatar
Avatar
Jupstar ✪
That's also just your opinion because of rust
not rly, overall
14:22
Just so we're totally 100% clear: I hate linked lists. With a passion. Linked lists are terrible data structures. Now of course there's several great use cases for a linked list: You want to do a lot of splitting or merging of big lists. A lot. You're doing some awesome lock-free concurrent thing. You're writing a kernel/embedded thing and want to use an intrusive list. You're using a pure functional language and the limited semantics and absence of mutation makes linked lists easier to work with. ... and more! But all of these cases are super rare for anyone writing a Rust program. 99% of the time you should just use a Vec (array stack), and 99% of the other 1% of the time you should be using a VecDeque (array deque). These are blatantly superior data structures for most workloads due to less frequent allocation, lower memory overhead, true random access, and cache locality. Linked lists are as niche and vague of a data structure as a trie. Few would balk at me claiming a trie is a niche structure that your average programmer could happily never learn in an entire productive career -- and yet linked lists have some bizarre celebrity status. We teach every undergrad how to write a linked list. It's the only niche collection I couldn't kill from std::collections. It's the list in C++! We should all as a community say no to linked lists as a "standard" data structure. It's a fine data structure with several great use cases, but those use cases are exceptional, not common. Several people apparently read the first paragraph of this PSA and then stop reading. Like, literally they'll try to rebut my argument by listing one of the things in my list of great use cases. The thing right after the first paragraph!
Avatar
Linked lists are ideal when you need O(1) deletion and don't need indexing. And as Jupman said, if you put them in a contiguous block cache misses aren't an issue anymore
14:23
Fwiw I was about to write and @Ryozuki hates them because he read a blogpost where a classical CS guy said they are bad and it looked reasonable 😄
Avatar
no read it and it makes sense in my head
14:23
i read*
14:23
there are facts
14:24
i never said u should never ever use it
14:24
they have their niche use case
Avatar
It makes sense for traditional linked lists maybe
Avatar
common use case is more suited for a vec
14:24
less frequent allocation, lower memory overhead, true random access, and cache locality
14:24
a trie is nice for making merkle trees for example
14:24
hashing in bittorrent
Avatar
It's nice to push items to the back, still keep order and have old stuff in front
14:25
There are many use cases
Avatar
vecdeque
14:25
growable ring buffer
Avatar
Avatar
Jupstar ✪
It's nice to push items to the back, still keep order and have old stuff in front
Vecdeques can do that too
Avatar
No i mean an existing item
14:26
It's basically on fly sorting, if your sorting parameters changes
Avatar
Learath how is it O(1) deletion? If you ahve multiple nodes you still need to delete them 1 by 1 no? or am I missing something
Avatar
With a call you do xd
Avatar
Avatar
Devinci
Learath how is it O(1) deletion? If you ahve multiple nodes you still need to delete them 1 by 1 no? or am I missing something
no
Avatar
Avatar
Learath2
Vecdeques can do that too
But iirc they are secretly linked lists. They are implemented as a linked list of vecs so you dont have to resize all the time
Avatar
u point prev ptr to next ptr
Avatar
oh yeah
Avatar
its o1
Avatar
whoops
Avatar
a vecdeque is nice for deleting too
14:27
it leaves holes in the ring buffer
14:27
tho
14:28
Rearranges the internal storage of this deque so it is one contiguous slice, which is then returned. This method does not allocate and does not change the order of the inserted elements. As it returns a mutable slice, this can be used to sort a deque. Once the internal storage is contiguous, the as_slices and as_mut_slices methods will return the entire contents of the deque in a single slice.
Avatar
Every data structure has it's place. Including linked lists
Avatar
Anyway. I wouldn't directly blame the idea of linked lists. But yeah a linked list like you learn in school is probably rarely a good idea
Avatar
Avatar
Learath2
Every data structure has it's place. Including linked lists
yeah, its just linked lists are more niche than tries
14:28
but they are mentioned more
14:29
because they used for teaching
Avatar
Actually in C I would argue you should always start with a linked list or an array
Avatar
yeah its mostly C to blame
14:29
i agree xd
14:29
They have O(1) split-append-insert-remove if you have a pointer there Yep! Although as Bjarne Stroustrup notes this doesn't actually matter if the time it takes to get that pointer completely dwarfs the time it would take to just copy over all the elements in an array (which is really quite fast). Unless you have a workload that is heavily dominated by splitting and merging costs, the penalty every other operation takes due to caching effects and code complexity will eliminate any theoretical gains. But yes, if you're profiling your application to spend a lot of time in splitting and merging, you may have gains in a linked list.
Avatar
Just give it a go, benchmark, if it doesnt meet your performance requirements go on and implement a cool space age datastructure
Avatar
Linked lists waste less space Well, this is complicated. A "standard" array resizing strategy is to grow or shrink so that at most half the array is empty. This is indeed a lot of wasted space. Especially in Rust, we don't automatically shrink collections (it's a waste if you're just going to fill it back up again), so the wastage can approach infinity! But this is a worst-case scenario. In the best-case, an array stack only has three pointers of overhead for the entire array. Basically no overhead. Linked lists on the other hand unconditionally waste space per element. A singly-linked list wastes one pointer while a doubly-linked list wastes two. Unlike an array, the relative wasteage is proportional to the size of the element. If you have huge elements this approaches 0 waste. If you have tiny elements (say, bytes), then this can be as much as 16x memory overhead (8x on 32-bit)! Actually, it's more like 23x (11x on 32-bit) because padding will be added to the byte to align the whole node's size to a pointer. This is also assuming the best-case for your allocator: that allocating and deallocating nodes is being done densely and you're not losing memory to fragmentation. But yes, if you have huge elements, can't predict your load, and have a decent allocator, there are memory savings to be had!
Avatar
Avatar
Learath2
Just give it a go, benchmark, if it doesnt meet your performance requirements go on and implement a cool space age datastructure
no need to impl, just use vec
Avatar
Avatar
Ryozuki
They have O(1) split-append-insert-remove if you have a pointer there Yep! Although as Bjarne Stroustrup notes this doesn't actually matter if the time it takes to get that pointer completely dwarfs the time it would take to just copy over all the elements in an array (which is really quite fast). Unless you have a workload that is heavily dominated by splitting and merging costs, the penalty every other operation takes due to caching effects and code complexity will eliminate any theoretical gains. But yes, if you're profiling your application to spend a lot of time in splitting and merging, you may have gains in a linked list.
Bjarne also invented C++. I would take his opinion with a grain of salt
Avatar
vec should be the universal default data structure
14:32
and then u go to niches
14:32
unless u need a obvious map
Avatar
i love linked lists and functional programming
Avatar
Avatar
Learath2
Bjarne also invented C++. I would take his opinion with a grain of salt
i dont look at names i look at facts
Avatar
Avatar
louis
i love linked lists and functional programming
did u try elixir
Avatar
not outside of clash of clans
Avatar
Avatar
louis
i love linked lists and functional programming
I use linked lists all the time in <functional language> Great! Linked lists are super elegant to use in functional languages because you can manipulate them without any mutation, can describe them recursively, and also work with infinite lists due to the magic of laziness. Specifically, linked lists are nice because they represent an iteration without the need for any mutable state. The next step is just visiting the next sublist. Rust mostly does this kind of thing with iterators. They can be infinite and you can map, filter, reverse, and concatenate them just like a functional list, and it will all be done just as lazily! Rust also lets you easily talk about sub-arrays with slices. Your usual head/tail split in a functional language is just slice.split_at_mut(1). For a long time, Rust had an experimental system for pattern matching on slices which was super cool, but the feature was simplified when it was stabilized. Still, basic slice patterns are neat! And of course, slices can be turned into iterators! But yes, if you're limited to immutable semantics, linked lists can be very nice. Note that I'm not saying that functional programming is necessarily weak or bad. However it is fundamentally semantically limited: you're largely only allowed to talk about how things are, and not how they should be done. This is actually a feature, because it enables the compiler to do tons of exotic transformations and potentially figure out the best way to do things without you having to worry about it. However this comes at the cost of being able to worry about it. There are usually escape hatches, but at some limit you're just writing procedural code again. Even in functional languages, you should endeavour to use the appropriate data structure for the job when you actually need a data structure. Yes, singly-linked lists are your primary tool for control flow, but they're a really poor way to actually store a bunch of data and query it.
Avatar
Avatar
Ryozuki
They have O(1) split-append-insert-remove if you have a pointer there Yep! Although as Bjarne Stroustrup notes this doesn't actually matter if the time it takes to get that pointer completely dwarfs the time it would take to just copy over all the elements in an array (which is really quite fast). Unless you have a workload that is heavily dominated by splitting and merging costs, the penalty every other operation takes due to caching effects and code complexity will eliminate any theoretical gains. But yes, if you're profiling your application to spend a lot of time in splitting and merging, you may have gains in a linked list.
You need to have absolutely tiny elements and a small array for the shift of all the data to be fast. And you need to have no way to get a pointer to what you want to delete without iterating which is rarely the case
Avatar
we should use doubly linked lists with bubble sort
14:35
and add a gc just to make sure
14:35
we dont leak anything
14:35
gigachad
Avatar
Avatar
Ryozuki
Linked lists waste less space Well, this is complicated. A "standard" array resizing strategy is to grow or shrink so that at most half the array is empty. This is indeed a lot of wasted space. Especially in Rust, we don't automatically shrink collections (it's a waste if you're just going to fill it back up again), so the wastage can approach infinity! But this is a worst-case scenario. In the best-case, an array stack only has three pointers of overhead for the entire array. Basically no overhead. Linked lists on the other hand unconditionally waste space per element. A singly-linked list wastes one pointer while a doubly-linked list wastes two. Unlike an array, the relative wasteage is proportional to the size of the element. If you have huge elements this approaches 0 waste. If you have tiny elements (say, bytes), then this can be as much as 16x memory overhead (8x on 32-bit)! Actually, it's more like 23x (11x on 32-bit) because padding will be added to the byte to align the whole node's size to a pointer. This is also assuming the best-case for your allocator: that allocating and deallocating nodes is being done densely and you're not losing memory to fragmentation. But yes, if you have huge elements, can't predict your load, and have a decent allocator, there are memory savings to be had!
Only a brain damaged individual would use a linked list for small elements. Assume the worst case for linked lists assume the best case for arrays and yeah arrays handily beat linked lists
14:37
Did you know arrays have O(1) deletion aswell, you just have to only remove from the very end
Avatar
Avatar
Learath2
Only a brain damaged individual would use a linked list for small elements. Assume the worst case for linked lists assume the best case for arrays and yeah arrays handily beat linked lists
xd actually the snippets are from a FAQ he put answering the questions he got asked
Avatar
Avatar
Learath2
Did you know arrays have O(1) deletion aswell, you just have to only remove from the very end
yeah, common use case
14:37
lifo best
14:38
anyway im not rly disagreeing xd
Avatar
And linked lists have O(1) find as long as the node you are looking for is at the very start
Avatar
And linked hashmaps always have O(1)
14:39
Best data structure
Avatar
It's almost as if it's not as simple as "linked list bad"
14:40
Best data structure is no data structure
14:40
I just put everything in ram and use memcmp to find it when I need it
Avatar
I'm huge raii abuser
Avatar
Avatar
Learath2
It's almost as if it's not as simple as "linked list bad"
true, its as simple as: "linked lists are usually bad"
Avatar
I hate languages that don't have it
14:41
Especially pyson
14:42
And i hate that rust has no partial borrowing
14:43
I often catch myself using indices to not fight with borrow checker
Avatar
What is a partial borrow?
14:43
Oh I see
14:43
Yeah I needed that a couple times too
Avatar
You can probably always design it differently. But sometimes it feels overkill xd
Avatar
chillerdragon BOT 2023-12-04 14:44:45Z
jopsti or patiga can you already turn this .demo link in a web viewable clip? i cba to download a demo file https://uploadnow.io/f/4XCWyHC
A file is available for download and streaming via UploadNow by following this link
Avatar
Whenever the borrow checker argues with me I just tell myself I need to change the way I think about it because thousands of people use rust daily with no issue
Avatar
good mentality
Avatar
Avatar
Jupstar ✪
And i hate that rust has no partial borrowing
it has limited partial borrowing
14:45
but ye
14:45
u can help develop polonius
14:45
and make it come faster
Avatar
I'd have nothing against it being more intelligent. But maybe that drastically increases compile time
14:45
So i have no strong opinion
Avatar
Avatar
Ryozuki
u can help develop polonius
Ez
Avatar
Avatar
Learath2
Whenever the borrow checker argues with me I just tell myself I need to change the way I think about it because thousands of people use rust daily with no issue
Then I reminisce over the good old days of C where my compiler wasn't such a drama queen
Avatar
chillerdragon BOT 2023-12-04 14:46:40Z
@JSaurusRex: still got matrix? :D
Avatar
Avatar
chillerdragon
jopsti or patiga can you already turn this .demo link in a web viewable clip? i cba to download a demo file https://uploadnow.io/f/4XCWyHC
Per link no. Bcs don't want to fight with cors
Avatar
Avatar
chillerdragon
@JSaurusRex: still got matrix? :D
yes
Avatar
But u can upload it in my demo viewer, which is just ddnet xdd
Avatar
Issue from here: https://github.com/ZillyInsta/ddnet-insta/pull/63 But this bug also exists upstream so issue here. https://github.com/ddnet/ddnet/assets/50572621/f860cb3d-2e4a-42c7-b315-9232ea0edbaa On first bounce it hits the player clientside but not serverside !image second bounce it doesn't !image
Avatar
does anybody know if tuning is saved in demos?
16:30
i think its on the map
Avatar
The tunings are stored in demos but the correct tuning is currently not used when the demos are played back (#6138)
👀 1
Avatar
Most notably in minigames like Xpanic, which have unique tunes for grenade or shotgun bullet speeds, if you were to replay the video in editor, the objects would fire "normally", causing ...
Avatar
ChillerDragon
18:59
for some reason the crypto market is rly bullish lately
18:59
this graph is bitcoin
Avatar
its gonna crash
Avatar
i just bought more land in the metaverse
Avatar
ChillerDragon BOT 2023-12-04 21:17:55Z
@Ryozuki yeye its cycle again and halfing and institutional money flooding in due to spot ETFs being a thing now
21:18
i planned to invest more coin into btc during the bear market but im broke af wat can i do
Avatar
The popup menu render function can open/close other popups, which may resize the vector of popup menus and thus invalidate the current popup menu variable before the popup is closed. We therefore store the popup UI element ID in a separate variable to avoid the access to the potentially invalidated popup menu variable after the popup menu is rendered. Also prevent invalidated popup menu from being rendered for one frame after it is closed by clicking outside. Closes #7565. ## Checkli...
21:27
The invalid sound index is -1 but the check in the editor for the sound preview assumed it was 0. We should use a type-safe wrapper to avoid this in the future, like for texture handles.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and o...
Avatar
ChillerDragon BOT 2023-12-04 21:38:29Z
halving*
Avatar
ah nice chiller has his max fps set to 666
Avatar
ChillerDragon BOT 2023-12-04 21:38:59Z
ye fuck god
Avatar
pls dont fuck me
Avatar
ChillerDragon BOT 2023-12-04 21:39:09Z
satan poggies
21:39
complex jopsti
Avatar
+ hello everybody, i just wanna say ty for playing this
Avatar
Any javascript experts? <body> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <script> document.addEventListener('DOMContentLoaded', () => { const addr = new URLSearchParams(window.location.search).get('addr'); if (addr) { confirmDialog("Would you like to join via Steam or standalone?", (choice) => { if (choice) { window.location.href = `steam://${addr}`; } else { window.location.href = `ddnet://${addr}`; } setTimeout(() => { window.close(); }, 10000); }); } }); I'm trying to close the window once the user selects one of the options. Without the timeout, the code never reaches the stage of actually opening the app. Any idea how to do this in a more elegant manner? (edited)
Exported 151 message(s)