05:45 <+bridge> [ddnet] hmm 05:46 <+bridge> [ddnet] china is planning on requiring platforms to show ip geolocation alongside with usernames. 05:46 <+bridge> [ddnet] :monkaS: 06:14 <+bridge> [ddnet] I noticed a weird crash too in prediction code, i made a design changer and when the new map gets loaded there seems to be a crash sometimes, some index too high for the m_pTiley array from collision, idk why 06:15 <+bridge> [ddnet] yes 06:33 <+bridge> [ddnet] is it bad to revert a pull request? 06:35 <+bridge> [ddnet] is it bad to revert a pull request that has already been merged? 06:40 <+bridge> [ddnet] I think the best option is to make a PR that reverts that PR. 06:43 <+bridge> [ddnet] If you do that then the github PR might catch that it's been reverted, but I haven't ever tried 06:43 <+bridge> [ddnet] If you do that then the github PR might catch that it's been reverted & re-open, but I haven't ever tried 06:44 <+bridge> [ddnet] yes, I mean this button creates the new PR but I don't know if it'll fuck up something xd 06:45 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903142278695096330/unknown.png 06:46 <+bridge> [ddnet] it won't fuck anything up, it creates a PR with the git revert commit. DDNet maintainers can deny your PR. But you probably want to make an issue if you haven't yet explaining why you are reverting the commit 06:46 <+bridge> [ddnet] it won't fuck anything up, it creates a PR with the git revert commit. DDNet maintainers can deny your PR. But you probably want to make an issue if you haven't yet explaining why you are reverting the pr 06:48 <+bridge> [ddnet] The git history will still be in-tact, so you don't have to worry about fucking up someone else's history like you would with rebase. The revert would be put at HEAD and anyone rebasing/merging would have to deal with that revert 06:48 <+bridge> [ddnet] it's just a .txt tho 06:49 <+bridge> [ddnet] doesn't really matter what kind of file it is, even binary, all git does is maintain a history of diffs. 06:49 <+bridge> [ddnet] if you created a .txt file then the revert would just remove it 06:51 <+bridge> [ddnet] so if I edited the .txt and then revert it, it'll go back to how it was before? 06:51 <+bridge> [ddnet] yeah hold on i can just demonstrate this 06:54 <+bridge> [ddnet] ``` 06:54 <+bridge> [ddnet] [I] /home/toad/repo/test > git log 06:54 <+bridge> [ddnet] commit 5722bd316a408006fe39042c14b131d0e42da4f3 (HEAD -> master) 06:54 <+bridge> [ddnet] Author: aodq <0@aodq.net> 06:54 <+bridge> [ddnet] Date: Wed Oct 27 17:53:08 2021 -0700 06:54 <+bridge> [ddnet] 06:54 <+bridge> [ddnet] Revert "changes bob to joe" 06:54 <+bridge> [ddnet] 06:54 <+bridge> [ddnet] This reverts commit d78d20190b2edfa25909a8f91f7a0a83ab7ed047. 06:54 <+bridge> [ddnet] 06:54 <+bridge> [ddnet] commit d78d20190b2edfa25909a8f91f7a0a83ab7ed047 06:54 <+bridge> [ddnet] Author: aodq <0@aodq.net> 06:54 <+bridge> [ddnet] Date: Wed Oct 27 17:52:56 2021 -0700 06:54 <+bridge> [ddnet] 06:54 <+bridge> [ddnet] changes bob to joe 06:54 <+bridge> [ddnet] 06:54 <+bridge> [ddnet] commit e0397f9787a068274c03b629c4d2ca461cf54e81 06:55 <+bridge> [ddnet] Author: aodq <0@aodq.net> 06:55 <+bridge> [ddnet] Date: Wed Oct 27 17:52:37 2021 -0700 06:55 <+bridge> [ddnet] 06:55 <+bridge> [ddnet] adds initial test 06:55 <+bridge> [ddnet] 06:55 <+bridge> [ddnet] [I] /home/toad/repo/test > git diff HEAD~ 06:55 <+bridge> [ddnet] diff --git a/test.txt b/test.txt 06:55 <+bridge> [ddnet] index 0870381..724b0fd 100644 06:55 <+bridge> [ddnet] --- a/test.txt 06:55 <+bridge> [ddnet] +++ b/test.txt 06:55 <+bridge> [ddnet] @@ -1 +1 @@ 06:55 <+bridge> [ddnet] -hello there, my name is Joe. 06:55 <+bridge> [ddnet] +hello there, my name is Bob. 06:55 <+bridge> [ddnet] 06:55 <+bridge> [ddnet] the last `git diff HEAD~2` doesn't print anything because there is no difference from the initial and last commit, bc the second commit was reverted 07:00 <+bridge> [ddnet] ah, ok 07:01 <+bridge> [ddnet] so it's better to make a new pr of the merged one 07:01 <+bridge> [ddnet] for what i want to do 07:01 <+bridge> [ddnet] Yeah I think that revert button will do what you want 07:02 <+bridge> [ddnet] if not, like if you wanted to extra work on top, you could just revert it from git commandline then make whatever other commits you need before you do a PR 07:03 <+bridge> [ddnet] `git revert ` 07:09 <+bridge> [ddnet] ty very much 11:28 <+bridge> [ddnet] If ubsan throws a error it is the line the error was first catched right? So not neccessarly the line the issue was caused in hm? I currently get "runtime error\: -nan is outside the range of representable values of type 'int'" 14:29 <+bridge> [ddnet] Any ideas on how to avoid conflicting defintions of keys.h and ncurses without editing keys.h? I try to include ncurses in ddnet and it yells at me that for example KEY\_BACKSPACE is defined already. Any chance we can rename all key constants in ddnet? 14:45 <+bridge> [ddnet] don't include both from the same cpp file? 14:46 <+bridge> [ddnet] hmm i mean sooner or later both are included 14:46 <+bridge> [ddnet] make the KEY_* enum an enum class KEY 14:46 <+bridge> [ddnet] then they are different 14:46 <+bridge> [ddnet] ? 14:46 <+bridge> [ddnet] enum class is better anyway 14:46 <+bridge> [ddnet] whats that 14:46 <+bridge> [ddnet] so you mean editing the keys.h? 14:46 <+bridge> [ddnet] https://en.cppreference.com/w/cpp/language/enum 14:47 <+bridge> [ddnet] well, editing the datasrc file that generates keys.h 14:47 <+bridge> [ddnet] ye ofc 14:47 <+bridge> [ddnet] and then in the source code use KEY::FIRST instead of KEY_FIRST 14:47 <+bridge> [ddnet] but then i diff with upstream 14:47 <+bridge> [ddnet] can we get that in ddnet? 14:47 <+bridge> [ddnet] I'd be ok with it, maybe wait for some other opinions 14:47 <+bridge> [ddnet] another alternative would be namespaces 14:48 <+bridge> [ddnet] would also fix the windows conflict 14:48 <+bridge> [ddnet] i did rename all keys from KEY\_BACKSPACE to TW\_KEY\_BACKSPACE once 14:48 <+bridge> [ddnet] thats maybe less typing 14:49 <+bridge> [ddnet] namespaces might be the coolest so in binds.cpp and so on we can do using namespace 14:59 <+bridge> [ddnet] image.png 14:59 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903266643994619944/image.png 14:59 <+bridge> [ddnet] meh thats a bit ugly i can not do 1 = 30 15:00 <+bridge> [ddnet] 🥴 15:03 <+bridge> [ddnet] 1 = 30 🤪 15:03 <+bridge> [ddnet] \:D 15:21 <+bridge> [ddnet] image.png 15:21 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903272144044183612/image.png 15:21 <+bridge> [ddnet] front end is hard 15:25 <+bridge> [ddnet] image.png 15:25 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903273371133943838/image.png 15:26 <+bridge> [ddnet] guess u didnt rebase or smth? 15:30 <+bridge> [ddnet] chilledragon maybe try KB_1 KB_2 instead 15:30 <+bridge> [ddnet] yaya i saw and fixed it 15:31 <+bridge> [ddnet] KB as in KEYBOARD? 15:31 <+bridge> [ddnet] ye 15:31 <+bridge> [ddnet] i think it makes sense 15:31 <+bridge> [ddnet] would also be inconsistent then 15:31 <+bridge> [ddnet] there is already KP as in keypad 15:31 <+bridge> [ddnet] its consistent 15:31 <+bridge> [ddnet] KEY\:\:A does not have a KB prefix 15:31 <+bridge> [ddnet] _1 looks horrendous 15:31 <+bridge> [ddnet] it does 15:32 <+bridge> [ddnet] ONE\_1, then you can find it by name and by number \:D 15:32 <+bridge> [ddnet] lol 15:32 <+bridge> [ddnet] or just ONE ? 15:32 <+bridge> [ddnet] TWO_2 15:32 <+bridge> [ddnet] THREE_3 15:32 <+bridge> [ddnet] lmao 15:32 <+bridge> [ddnet] KEY\:\:ONE 15:32 <+bridge> [ddnet] KAY ONE 15:32 <+bridge> [ddnet] aaxaxaxaxax 15:32 <+bridge> [ddnet] ur german not russian 15:32 <+bridge> [ddnet] TEEWORLDS\_KEYBOARD\_KEY\_WITH\_NUMBER\_ONE\_OR\_NUMERICAL\_1 15:32 <+bridge> [ddnet] stop culture apropiation 15:32 <+bridge> [ddnet] laugh like a deutsch 15:33 <+bridge> [ddnet] \:D 15:33 <+bridge> [ddnet] i am rus 15:33 <+bridge> [ddnet] HöhöHöhöHöhöHöhöHöhö 15:33 <+bridge> [ddnet] this 15:33 <+bridge> [ddnet] lol 15:33 <+bridge> [ddnet] I honestly like KEY\:\:ONE 15:33 <+bridge> [ddnet] any opinions? 15:33 <+bridge> [ddnet] just use SDL keycodes xD 15:34 <+bridge> [ddnet] looking at those tsan prs 15:34 <+bridge> [ddnet] reminds me of rust 15:34 <+bridge> [ddnet] so remove keys.h u mean? 15:34 <+bridge> [ddnet] and the fact it wouldnt have ever happened 15:34 <+bridge> [ddnet] :greenthing: 15:34 <+bridge> [ddnet] i guess that wouldnt hurt 15:34 <+bridge> [ddnet] adventerous 15:34 <+bridge> [ddnet] its always a trade @Ryozuki 15:34 <+bridge> [ddnet] therefore less control over it 15:34 <+bridge> [ddnet] what 15:35 <+bridge> [ddnet] atleast if you want to stay in safe rust ofc 15:35 <+bridge> [ddnet] there is no trade here 15:35 <+bridge> [ddnet] rust is safe outright 15:35 <+bridge> [ddnet] but what happens under the hood? locking, memory barrier? 15:36 <+bridge> [ddnet] in rust u still use mutex condvars arcs etc 15:36 <+bridge> [ddnet] its just that u cant miss them 15:36 <+bridge> [ddnet] due to how Send + Sync trait works 15:36 <+bridge> [ddnet] u should learn rust to know what i mean 15:39 <+bridge> [ddnet] https://doc.rust-lang.org/book/ch16-00-concurrency.html 15:39 <+bridge> [ddnet] I suggest you don't get into this with ryozuki, he will shoot you 15:39 <+bridge> [ddnet] :monkaS: 15:39 <+bridge> [ddnet] did we find out why that crash happens? 15:40 <+bridge> [ddnet] I'm still looking at the coredump blankly 15:40 <+bridge> [ddnet] the state the gameserver ended up in makes absolutely no sense to me 15:40 <+bridge> [ddnet] sucks its delaying the release 15:40 <+bridge> [ddnet] :feelsbadman: 15:40 <+bridge> [ddnet] i see, but then it probs catches too much in some cases? 15:40 <+bridge> [ddnet] 15:40 <+bridge> [ddnet] what would happen if one thread reads a var, but writes to it later inside a mutex, and reads from a different thread with the mutex 15:40 <+bridge> [ddnet] We somehow end up with a zero'd out CCharacter inside the entity linked list 15:40 <+bridge> [ddnet] @Ryozuki\: when start rewtring parts of ddnet code base in rust? 15:41 <+bridge> [ddnet] probs never 15:41 <+bridge> [ddnet] why not 15:42 <+bridge> [ddnet] rewriting is too much effort 15:42 <+bridge> [ddnet] even only parts? 15:42 <+bridge> [ddnet] that would lose the point of using rust 15:42 <+bridge> [ddnet] since u will have c code 15:42 <+bridge> [ddnet] if rust gets new syntax xD 15:42 <+bridge> [ddnet] bcs that still sucks 15:42 <+bridge> [ddnet] lol 15:42 <+bridge> [ddnet] i like rust syntax 15:42 <+bridge> [ddnet] no syntax is worse than modern c++ 15:43 <+bridge> [ddnet] ye i dislike modern c++ 15:43 <+bridge> [ddnet] modern c++ is fine to me 15:43 <+bridge> [ddnet] its cuz they cant make it first class features 15:43 <+bridge> [ddnet] so they make some weird stuff 15:43 <+bridge> [ddnet] u just have to understand templates 15:43 <+bridge> [ddnet] Jupstar: A regular variable wouldn't be Send or Sync, so can't really happen iirc 15:43 <+bridge> [ddnet] magick 15:43 <+bridge> [ddnet] but how is it protected then? 15:43 <+bridge> [ddnet] (@Learath2) 15:43 <+bridge> [ddnet] over the borrow system? 15:44 <+bridge> [ddnet] ```C 15:44 <+bridge> [ddnet] std::thread([after, task]() { 15:44 <+bridge> [ddnet] std::this_thread::sleep_for(std::chrono::milliseconds(after)); 15:44 <+bridge> [ddnet] task(); 15:44 <+bridge> [ddnet] }).detach(); 15:44 <+bridge> [ddnet] ``` 15:44 <+bridge> [ddnet] the compiler automatically marks variables with Send and Sync 15:44 <+bridge> [ddnet] so is it protected or not xd 15:44 <+bridge> [ddnet] u cant have data races in rust 15:44 <+bridge> [ddnet] i think its even mathematically proved 15:45 <+bridge> [ddnet] see 15:45 <+bridge> [ddnet] and thats why i ask 15:45 <+bridge> [ddnet] you can still have 15:45 <+bridge> [ddnet] deadlocks tho 15:45 <+bridge> [ddnet] so you dont know what happens 15:45 <+bridge> [ddnet] the compiler does it automatically 15:45 <+bridge> [ddnet] If the compiler thinks it's safe it'll mark things with Send and Sync. You also have wrapping types which themselves are send/sync 15:45 <+bridge> [ddnet] ?? 15:46 <+bridge> [ddnet] atomic variables for exampel are marked Send 15:46 <+bridge> [ddnet] i understand, but lets not use atomics 15:46 <+bridge> [ddnet] i want a variables used in 2 threads like in my example 15:47 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903278707609858088/unknown.png 15:47 <+bridge> [ddnet] the write is always protected, and the read from the other thread too 15:48 <+bridge> [ddnet] ok i write the c++ example, you do the same in rust ok? \:D 15:48 <+bridge> [ddnet] ok i try 15:48 <+bridge> [ddnet] xd 15:49 <+bridge> [ddnet] I have a feeling your example is going to be UB though since what you seem to be describing is a data race 15:49 <+bridge> [ddnet] hehe 15:50 <+bridge> [ddnet] you have to know, a Mutex alone doesnt allow you to share variables over threads in rust 15:50 <+bridge> [ddnet] you need a Arc too 15:50 <+bridge> [ddnet] (or I misunderstood, that is also possible) 15:53 <+bridge> [ddnet] :monkaS: 15:53 <+bridge> [ddnet] he is crafting c++ wizardry 15:53 <+bridge> [ddnet] ```c 15:53 <+bridge> [ddnet] #include 15:53 <+bridge> [ddnet] #include 15:53 <+bridge> [ddnet] #include 15:53 <+bridge> [ddnet] 15:53 <+bridge> [ddnet] int ProtectMe = 0; 15:54 <+bridge> [ddnet] std::mutex m; 15:54 <+bridge> [ddnet] 15:54 <+bridge> [ddnet] static void f() { 15:54 <+bridge> [ddnet] bool breakloop = false; 15:54 <+bridge> [ddnet] while(breakloop) { 15:54 <+bridge> [ddnet] m.lock(); 15:54 <+bridge> [ddnet] printf("test %d", ProtectMe); 15:54 <+bridge> [ddnet] if(ProtectMe >= 1000) { 15:54 <+bridge> [ddnet] breakloop = true; 15:54 <+bridge> [ddnet] } 15:54 <+bridge> [ddnet] m.unlock(); 15:54 <+bridge> [ddnet] } 15:54 <+bridge> [ddnet] } 15:54 <+bridge> [ddnet] 15:54 <+bridge> [ddnet] 15:54 <+bridge> [ddnet] int main() { 15:54 <+bridge> [ddnet] std::thread t(f); 15:54 <+bridge> [ddnet] while(ProtectMe < 1000) { 15:54 <+bridge> [ddnet] m.lock(); 15:54 <+bridge> [ddnet] ProtectMe++; 15:54 <+bridge> [ddnet] m.unlock(); 15:54 <+bridge> [ddnet] } 15:54 <+bridge> [ddnet] t.join(); 15:54 <+bridge> [ddnet] } 15:54 <+bridge> [ddnet] 15:55 <+bridge> [ddnet] ojh 15:55 <+bridge> [ddnet] while (!breakloop) 15:55 <+bridge> [ddnet] [Edit](https://discord.com/channels/252358080522747904/293493549758939136/903280411843641415): ```c 15:55 <+bridge> [ddnet] #include 15:55 <+bridge> [ddnet] #include 15:55 <+bridge> [ddnet] #include 15:55 <+bridge> [ddnet] 15:55 <+bridge> [ddnet] int ProtectMe = 0; 15:55 <+bridge> [ddnet] std::mutex m; 15:55 <+bridge> [ddnet] 15:55 <+bridge> [ddnet] static void f() { 15:55 <+bridge> [ddnet] bool breakloop = false; 15:55 <+bridge> [ddnet] while(!breakloop) { 15:55 <+bridge> [ddnet] m.lock(); 15:55 <+bridge> [ddnet] printf("test %d", ProtectMe); 15:55 <+bridge> [ddnet] if(ProtectMe >= 1000) { 15:56 <+bridge> [ddnet] breakloop = true; 15:56 <+bridge> [ddnet] } 15:56 <+bridge> [ddnet] m.unlock(); 15:56 <+bridge> [ddnet] } 15:56 <+bridge> [ddnet] } 15:56 <+bridge> [ddnet] 15:56 <+bridge> [ddnet] 15:56 <+bridge> [ddnet] int main() { 15:56 <+bridge> [ddnet] std::thread t(f); 15:56 <+bridge> [ddnet] while(ProtectMe < 1000) { 15:56 <+bridge> [ddnet] m.lock(); 15:56 <+bridge> [ddnet] ProtectMe++; 15:56 <+bridge> [ddnet] m.unlock(); 15:56 <+bridge> [ddnet] } 15:56 <+bridge> [ddnet] t.join(); 15:56 <+bridge> [ddnet] } 15:56 <+bridge> [ddnet] 15:56 <+bridge> [ddnet] dood 15:56 <+bridge> [ddnet] just come to discord 15:56 <+bridge> [ddnet] this bot sucks xd 15:56 <+bridge> [ddnet] soon 15:56 <+bridge> [ddnet] soon\:tm\: 15:56 <+bridge> [ddnet] https://godbolt.org/z/f3G98b38c 15:57 <+bridge> [ddnet] ok, this doesn't look like a data-race 15:58 <+bridge> [ddnet] Oh actually I think it is 15:58 <+bridge> [ddnet] thread2 never writes to it, so should be fine 15:58 <+bridge> [ddnet] all changes are visible to all threads 15:59 <+bridge> [ddnet] i can do this with a RwLock 16:00 <+bridge> [ddnet] if its possible then fine, but ofc no unsafe code \:D 16:01 <+bridge> [ddnet] its certainly not impossible for the compiler to see read only stuff, i just wonder if rust does it 16:01 <+bridge> [ddnet] or better\: if you know if it does it 16:01 <+bridge> [ddnet] or if it happens under the hood 16:02 <+bridge> [ddnet] ```rust 16:02 <+bridge> [ddnet] use std::sync::{Arc, RwLock}; 16:02 <+bridge> [ddnet] 16:02 <+bridge> [ddnet] fn main() { 16:02 <+bridge> [ddnet] let protect_me = Arc::new(RwLock::new(0)); 16:02 <+bridge> [ddnet] 16:02 <+bridge> [ddnet] let protect_me_thread = Arc::clone(&protect_me); 16:02 <+bridge> [ddnet] let handle = std:🧵:spawn(move || loop { 16:02 <+bridge> [ddnet] let protect_me_thread = protect_me_thread.read().unwrap(); 16:02 <+bridge> [ddnet] if *protect_me_thread >= 1000 { 16:02 <+bridge> [ddnet] println!("reached target"); 16:02 <+bridge> [ddnet] break; 16:02 <+bridge> [ddnet] } 16:02 <+bridge> [ddnet] }); 16:02 <+bridge> [ddnet] 16:02 <+bridge> [ddnet] while *protect_me.read().unwrap() < 1000 { 16:02 <+bridge> [ddnet] println!("adding one"); 16:02 <+bridge> [ddnet] *protect_me.write().unwrap() += 1; 16:02 <+bridge> [ddnet] } 16:02 <+bridge> [ddnet] handle.join().ok(); 16:02 <+bridge> [ddnet] } 16:02 <+bridge> [ddnet] ``` 16:02 <+bridge> [ddnet] ez 16:02 <+bridge> [ddnet] > Okay, this is indeed safe and I don't think you can easily get the same assembly in rust 16:02 <+bridge> [ddnet] i dunno what exactly a RWLock is, is it read write lock, like a guard? 16:03 <+bridge> [ddnet] You needed an Arc, that's extra overhead, and you are reading the value under the lock unlike in jupstars example 16:03 <+bridge> [ddnet] RWLock is sort of like a mutex but it allows multiple readers and a single writer 16:05 <+bridge> [ddnet] Your example is only safe because the only write happens on the thread where the "unsafe" read happens btw 16:05 <+bridge> [ddnet] i mean to be fair i really like the concept of rust for other reasons @Ryozuki , bcs it basically prooves memory safety, which could be abused to build "less safe" processor designs in regard to the kernel/os, e.g. remove the ringsbut nobody can tell me that the above syntax is soo much better than c++ XDD 16:06 <+bridge> [ddnet] if there wouldnt be some trade, it wouldnt be considered high level ofc 16:07 <+bridge> [ddnet] yeah \:D 16:07 <+bridge> [ddnet] (@Learath2) 16:07 <+bridge> [ddnet] To be fair though, I think you'd just use an atomic here, should give you roughly the same performance on x86 16:07 <+bridge> [ddnet] i like more rust syntax tho 16:07 <+bridge> [ddnet] probably yes \:D 16:08 <+bridge> [ddnet] but u will never convince me 16:08 <+bridge> [ddnet] its subjective 16:08 <+bridge> [ddnet] yeah its ok 16:08 <+bridge> [ddnet] there are also ppl liking pythons syntax 16:08 <+bridge> [ddnet] have you found urself in a situation of the code u sent in a real project? 16:08 <+bridge> [ddnet] so i have to acept thats its subjective anyway xD 16:09 <+bridge> [ddnet] it happens in ddnet for example \:D 16:09 <+bridge> [ddnet] and ddnet segfaults a lot 16:09 <+bridge> [ddnet] :monkalaugh: 16:09 <+bridge> [ddnet] I actually don't see how to get it to work in rust. @heinrich5991 could know, he is more of a rust wizard 16:09 <+bridge> [ddnet] ye he knows more 16:09 <+bridge> [ddnet] idk 16:09 <+bridge> [ddnet] maybe what jupstar is doing is ub? 16:09 <+bridge> [ddnet] but ddnet segfaults bcs of memory overflow or deletes 16:10 <+bridge> [ddnet] i doubt its UB 16:10 <+bridge> [ddnet] its just living at the limits 16:10 <+bridge> [ddnet] i doubt u get much more realistic perf with that than a Read write lock 16:11 <+bridge> [ddnet] non relaxed atomics for example, are pretty powerful, they are almost like a mutex just without threads waiting on it, but the constraits allow you to garantuee visisbility across threads even for non atomics 16:11 <+bridge> [ddnet] I don't think so, I took a look at the standard, seems fine since the only possible write that could conflict with the "unsafe" read is sequenced after the said read. No conflicting action = no data race atleast 16:11 <+bridge> [ddnet] thats also the reason lock free queues etc exists 16:11 <+bridge> [ddnet] probably not, not with modern hardware atleast 16:11 <+bridge> [ddnet] (@Ryozuki) 16:12 <+bridge> [ddnet] i litterally added a mutex to alot of sound calls, and made no real difference 16:12 <+bridge> [ddnet] (that werent there before) 16:13 <+bridge> [ddnet] i mean most stuff programmed today isnt designed for ultimate performance anyway \:D 16:13 <+bridge> [ddnet] Sometimes I wish there was a way to do extremely unsafe stuff without invoking UB. Like sometimes I really don't care about a data-race 16:13 <+bridge> [ddnet] i am still for a rethink of all software, the whole concept of theads suck, we need a design like GPUs do it, eheheheh 16:13 <+bridge> [ddnet] I'm okay with the reader getting incomplete/broken data 16:13 <+bridge> [ddnet] https://docs.rs/crossbeam/0.8.1/crossbeam/sync/struct.ShardedLock.html 16:13 <+bridge> [ddnet] 👀 16:13 <+bridge> [ddnet] no write /read in one pipeline call 16:14 <+bridge> [ddnet] Like massively parralelized stuff? Not all tasks parallelize that well tho :/ 16:14 <+bridge> [ddnet] i know 16:14 <+bridge> [ddnet] i just like the idea alot 16:14 <+bridge> [ddnet] thinking about it is very hard 16:14 <+bridge> [ddnet] even trying todo it 16:15 <+bridge> [ddnet] most ppl probs just write singlethreaded stuff, or "semi" threaded stuff 16:15 <+bridge> [ddnet] https://blog.pimaker.at/texts/rvc1/ 16:17 <+bridge> [ddnet] I was wondering the feasibility of doing npc AI on a gpu. It's like the perfect task to parallelize 16:17 <+bridge> [ddnet] Could do like thousands of ai agents in a city like that 16:17 <+bridge> [ddnet] :monkaS: 16:18 <+bridge> [ddnet] I couldn't justify looking further into it since I worry just ferrying the data between the gpu and the cpu would be too slow for it to be worth until I get many thousands of ai agents 16:19 <+bridge> [ddnet] But with architectures like the M1 where you get compute cores very closely linked to the cpu it might just become feasible to do 16:20 <+bridge> [ddnet] yeah, very interesting indeed 16:20 <+bridge> [ddnet] i dislike m1 16:20 <+bridge> [ddnet] cuz 16:20 <+bridge> [ddnet] its made by apple 16:20 <+bridge> [ddnet] apple 16:20 <+bridge> [ddnet] imho it would be real progress is they made it open for everyone 16:20 <+bridge> [ddnet] a real strength of m1, i wonder if they can scale it to a desktop component, or if the heat is too much there 16:21 <+bridge> [ddnet] but i will never consider looking into a m1 or things to do with it 16:21 <+bridge> [ddnet] cuz its locked into apple 16:21 <+bridge> [ddnet] yeah ofc, i wouldnt buy it with macos xD, thats like a big downgrade 16:21 <+bridge> [ddnet] Did you see alder lake? Seems atleast we are getting big-core little-core 16:21 <+bridge> [ddnet] i didnt 16:22 <+bridge> [ddnet] I doubt we'll get compute cores this closely linked to the cpu outside of M1 anytime soon though and going thru pci there is always a real latency concern 16:22 <+bridge> [ddnet] its mostly the memory in m1 that makes it so fast i guess 16:22 <+bridge> [ddnet] and i wonder what kinds of hidden instructions or stuff apple processors have 16:22 <+bridge> [ddnet] this reminded me of a rly good vid i saw 16:23 <+bridge> [ddnet] about the mastermind that made a compiler with only movs 16:23 <+bridge> [ddnet] cant remember now 16:23 <+bridge> [ddnet] amd's 3rd gen is basically only increase cache size and get 20% more perf 16:23 <+bridge> [ddnet] https://www.youtube.com/watch?v=KrksBdWcZgQ 16:23 <+bridge> [ddnet] > A processor is not a trusted black box for running code; on the contrary, modern x86 chips are packed full of secret instructions and hardware bugs. In this talk, we'll demonstrate how page fault analysis and some creative processor fuzzing can be used to exhaustively search the x86 instruction set and uncover the secrets buried in your chipset. 16:23 <+bridge> [ddnet] this video is insane 16:23 <+bridge> [ddnet] i have to rewatch it 16:24 <+bridge> [ddnet] apple uses arm arch now 16:24 <+bridge> [ddnet] x86 is also sooooo old, i really wish a modern CISC would exists, designed with instructions that make sense in 2021 16:24 <+bridge> [ddnet] Well it's the fact that m1 has unified memory that makes it so efficient. Consoles also use this to get amazing performance. 16:24 <+bridge> [ddnet] i also would like that 16:24 <+bridge> [ddnet] im sure shitload of stuff changed 16:24 <+bridge> [ddnet] Why would you want a modern CISC? RISC >>>> CISC 😛 16:25 <+bridge> [ddnet] arm is also not really RISC 16:25 <+bridge> [ddnet] anymore 16:25 <+bridge> [ddnet] isnt making a modern instruction set would also remove the need to conditionally enable simd stuff and so on 16:25 <+bridge> [ddnet] I wish RISC-V would get some more attention 16:25 <+bridge> [ddnet] wow my english sucks at that sentence 16:26 <+bridge> [ddnet] the good thing about RISC is that you can program in asm realistically right? 16:26 <+bridge> [ddnet] xd 16:26 <+bridge> [ddnet] but i feel that 16:26 <+bridge> [ddnet] i think NEON didnt exist before v7 16:28 <+bridge> [ddnet] With a RISC fixed-length ISA you could feasibly read bytecode even. It'd make disassemblers so much easier to implement. It'd also simplify the decode step immensely 16:29 <+bridge> [ddnet] yeah thats true 16:29 <+bridge> [ddnet] i wonder how much diff the 5nm makes, i really wonder how close apple is to x86 desktop chips 16:29 <+bridge> [ddnet] but they need all the same circumstances to compare, and more software, not only video editors 16:30 <+bridge> [ddnet] Apparently the nm thing is a bit deceptive. I wonder if we should start talking in terms of transistor density instead or sth 16:30 <+bridge> [ddnet] and ofc, i wonder how they arch would scale to a desktop chip, so 100-200 watt TDP 16:30 <+bridge> [ddnet] is alder lake 10nm? 16:30 <+bridge> [ddnet] ye 16:30 <+bridge> [ddnet] yeah thats true, but i mean like if they all makes their chips at the same company 16:30 <+bridge> [ddnet] (@Learath2) 16:30 <+bridge> [ddnet] im still a amd fan tho 16:31 <+bridge> [ddnet] im happy with my 5600x 16:31 <+bridge> [ddnet] Seems intels 10nm process lead to a similar transistor size to tsmcs 7nm process 16:32 <+bridge> [ddnet] intel seems to be good in also making other stuff smaller, e.g. the memory controler 16:32 <+bridge> [ddnet] i read somewhere a year ago or smth, that these are still often in 30nm+ 16:32 <+bridge> [ddnet] I'm a huge fan of big-core little-core btw. It's something I wished existed for years 16:32 <+bridge> [ddnet] Hope AMD comes out with a hybrid offering soon too 16:33 <+bridge> [ddnet] but only for laptops? 16:33 <+bridge> [ddnet] https://wccftech.com/amd-big-little-processor-cores-show-up-in-latest-patent-coming-to-next-gen-ryzen-cpus-apus/ 16:33 <+bridge> [ddnet] Alder Lake is a desktop cpu, so not anymore 😛 16:33 <+bridge> [ddnet] for desktop it seems like the motherboard is more powerhungry in idle 16:35 <+bridge> [ddnet] Power savings are not the only concern. With the OS Scheduler cooperating with the cpu, and the fact that you can fit multiple small cores instead of one big core, we might finally get a more responsive system 16:36 <+bridge> [ddnet] oh ok, possible yeah, i am not that much into what causes most latency bottlenecks \:D 17:04 <+bridge> [ddnet] @Learath2\: have you tried to build the server in a clean environment? maybe even with LTO to make sure its not data curroption, i also had data curroption after the bug in detect.h 17:04 <+bridge> [ddnet] for the server bug 17:05 <+bridge> [ddnet] (data curroption in the build process bcs of ODR) 17:06 <+bridge> [ddnet] i really cant find anything broken else \:/ 17:11 <+bridge> [ddnet] The fact that it happens randomly makes it so hard to check 17:12 <+bridge> [ddnet] ye sucks 17:12 <+bridge> [ddnet] did u try it with jupstar new patch 17:12 <+bridge> [ddnet] that fixes the data race? 17:12 <+bridge> [ddnet] maybe it changed when i removed those volatiles 17:12 <+bridge> [ddnet] i doubt tho 17:12 <+bridge> [ddnet] xd 17:13 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903300390378962964/unknown.png 17:13 <+bridge> [ddnet] :monkaS: 17:13 <+bridge> [ddnet] its only client \:D 17:13 <+bridge> [ddnet] (@Ryozuki) 17:13 <+bridge> [ddnet] ah xd 17:14 <+bridge> [ddnet] yeah but i'd really suggest trying it, as said i also had ODR errors when i rebased without clearing the build dir 17:14 <+bridge> [ddnet] (@Learath2) 17:14 <+bridge> [ddnet] https://github.com/ddnet/ddnet/pull/4217/files 17:14 <+bridge> [ddnet] maybe 17:14 <+bridge> [ddnet] after the detect.h defect 17:14 <+bridge> [ddnet] the reentry guard 17:14 <+bridge> [ddnet] guards* 17:14 <+bridge> [ddnet] need to be atomic? 17:14 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903300806676197476/unknown.png 17:14 <+bridge> [ddnet] heinrich told me they didnt 17:14 <+bridge> [ddnet] i dont think so as i dont see another thread using it 17:15 <+bridge> [ddnet] https://github.com/ddnet/ddnet/commit/66947b70b773ef3e8184425e5a55ccf5de72e48b 17:15 <+bridge> [ddnet] 12 days ago 17:15 <+bridge> [ddnet] when did the crashes first happen? 17:15 <+bridge> [ddnet] atleast 5 days ago 17:16 <+bridge> [ddnet] https://github.com/ddnet/ddnet/commit/3b1c0748423a4a493ae6eb7536d16507499de9bc#diff-86d59021cb4561b3911602552aed980edc3ddf8b4846d5e59f09b3e863fff8e5 17:16 <+bridge> [ddnet] the bug was added 13. september 17:18 <+bridge> [ddnet] i'd just add smth like -DCMAKE\_CXX\_FLAGS="-flto" -DCMAKE\_C\_FLAGS="-flto" -DCMAKE\_EXE\_LINKER\_FLAGS="-flto" and see what the build says 17:18 <+bridge> [ddnet] and then remove it again if nothing is shown 17:18 <+bridge> [ddnet] (on the old build dir= 17:18 <+bridge> [ddnet] (on the old build dir) 17:19 <+bridge> [ddnet] are servers built with o3 or o2 17:19 <+bridge> [ddnet] maybe its a miscompilation xd 17:20 <+bridge> [ddnet] i guess normal release flags so o2 17:20 <+bridge> [ddnet] server isnt really hungry 17:21 <+bridge> [ddnet] or revert some changes and see when it happened, it seems like they happen every day 17:25 <+bridge> [ddnet] @Learath2\: are the servers always cleanly built? or are the old build dirs reused? 17:31 <+bridge> [ddnet] Jupstar: clean build 17:31 <+bridge> [ddnet] mhh too bad 17:31 <+bridge> [ddnet] ``` 17:31 <+bridge> [ddnet] rm -rf ../master-build 17:31 <+bridge> [ddnet] mkdir ../master-build 17:31 <+bridge> [ddnet] cd ../master-build 17:31 <+bridge> [ddnet] cmake ../master -DANTIBOT=ON -DWEBSOCKETS=OFF -DMYSQL=ON -DCLIENT=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo 17:31 <+bridge> [ddnet] make DDNet-Server map_convert_07 map_optimize 17:31 <+bridge> [ddnet] ``` 17:32 <+bridge> [ddnet] alright, from the latest UBSan report it looks like it gets mem\_zero'd somehow 17:32 <+bridge> [ddnet] vptr is 0 17:32 <+bridge> [ddnet] thats not really common 17:34 <+bridge> [ddnet] @deen\: so whats the plan, revert some commits and see what happens?, i guess it must be somwhere from the anti startline skips until master 17:34 <+bridge> [ddnet] I have no plan 17:35 <+bridge> [ddnet] I could check dmesg on the servers to see when regular crashes started, but I wouldn't 100% be sure that it's those 17:36 <+bridge> [ddnet] I'm so lost, the entity we seem to be ticking on has no reference in the entire memory space of the process 17:36 <+bridge> [ddnet] where are we getting this weird entity even? 17:37 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903306611920076800/unknown.png 17:38 <+bridge> [ddnet] Actually this address isn't even mapped?? 17:40 <+bridge> [ddnet] the fact that all sanitizers cant catch it really speaks for either uninitialized, data race or logic error 17:41 <+bridge> [ddnet] but that should be ez to find in the commits 17:41 <+bridge> [ddnet] since its no overflow 17:42 <+bridge> [ddnet] AHA I think I have an idea 17:42 <+bridge> [ddnet] ok tw also uses memory pools, so i dunno how the sanitizers react to it \:D 17:44 <+bridge> [ddnet] Hm this member variable `m_pNextTraverseEntity` is so sus 17:44 <+bridge> [ddnet] Why is it a member variable? 17:46 <+bridge> [ddnet] yeah looks like it makes no sense 17:46 <+bridge> [ddnet] but also doesnt see any problem with it 17:47 <+bridge> [ddnet] but maybe its used recursivly somewhere 17:47 <+bridge> [ddnet] RemoveEntity for example, so i guess it can make sense 17:53 <+bridge> [ddnet] The problem is this insane value out of nowhere, I don't see this memory address referenced on any of the linked lists 17:54 <+bridge> [ddnet] There seems to be no alive characters, and `m_apFirstEntityTypes[ENTTYPE_CHARACTER]` is indeed 0x0 17:59 <+bridge> [ddnet] I think you are on to something there 17:59 <+bridge> [ddnet] that code looks very very sus 18:07 <+bridge> [ddnet] sus 18:07 <+bridge> [ddnet] christmas is soon 18:07 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903314099155386398/icyafwgzm5w71.png 18:07 <+bridge> [ddnet] Hm, the member thing seems to be to ensure that if within Tick an entity gets removed the traversal doesn't break 18:08 <+bridge> [ddnet] Neither draggers nor pickups kill you, right? 18:09 <+bridge> [ddnet] i mean deen is right, that its sus that it always happens if a player leaves 18:10 <+bridge> [ddnet] it somehow has to happen before the tick starts, but besides the antibot i dont see anything 18:10 <+bridge> [ddnet] It seems to always happen when a player leaves than another kills 18:10 <+bridge> [ddnet] yeah true 18:10 <+bridge> [ddnet] wouldnt that be awesome to create tests with the headless server we can now have 18:10 <+bridge> [ddnet] maybe we could reproduce tick perfect bugs 18:11 <+bridge> [ddnet] headless client 18:11 <+bridge> [ddnet] idk what im talking 18:13 <+bridge> [ddnet] ``` 18:13 <+bridge> [ddnet] [2021-10-27 10:21:06][server]: client dropped. cid=9 addr=<{X}> reason='' 18:13 <+bridge> [ddnet] [2021-10-27 10:21:06][game]: kill killer='9:Maybe.' victim='9:Maybe.' weapon=-3 special=0 18:13 <+bridge> [ddnet] [2021-10-27 10:21:06][chat]: *** 'Maybe.' has left the game 18:13 <+bridge> [ddnet] [2021-10-27 10:21:06][game]: leave player='9:Maybe.' 18:13 <+bridge> [ddnet] [2021-10-27 10:21:06][game]: kill killer='10:[D] Maybe.' victim='10:[D] Maybe.' weapon=-1 special=0 18:13 <+bridge> [ddnet] [2021-10-27 10:21:06][game]: kill killer='10:[D] Maybe.' victim='10:[D] Maybe.' weapon=-2 special=0 18:13 <+bridge> [ddnet] ```He leaves and his dummy dies in spikes and self kills afterwards ? XD 18:13 <+bridge> [ddnet] that alone is sus 18:14 <+bridge> [ddnet] maybe u just have to kill while the world kills you or smth, but why the player leave? maybe a bug in the dummy code that does it for some reason? 18:15 <+bridge> [ddnet] Hm maybe the dummy also left but it crashed before that leave went through? 18:15 <+bridge> [ddnet] possible yeah 18:16 <+bridge> [ddnet] i wonder if that was on dummy maps 18:16 <+bridge> [ddnet] where e.g. startline kills you 18:38 <+bridge> [ddnet] mhh the startline skip kills you when someone leaves the team after you hit the start line, and thats the only commit that changed kill behavior lately 18:38 <+bridge> [ddnet] I found some stack addresses where the insane entity pointer is found, not sure how best to figure out what was stored in these stack variables 18:42 <+bridge> [ddnet] from the flow it would fit 18:42 <+bridge> [ddnet] it kills the char in the world tick, then self kills in team start line skip tick 18:43 <+bridge> [ddnet] (it uses WEAPON\_SELF) 18:50 <+bridge> [ddnet] too bad that we dont log the server tick 18:51 <+bridge> [ddnet] only self kill that happens after the tick is this i think, the rest are console commands 19:01 <+bridge> [ddnet] What's the difference between these? 19:01 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903327562497917019/unknown.png 19:06 <+bridge> [ddnet] fullscreen minimizes the other doesnt 19:06 <+bridge> [ddnet] fullscreen might disable stuff like the windows compositor so its exclusive 19:06 <+bridge> [ddnet] also you can only change fullscreen resolution with fullscreen 19:08 <+bridge> [ddnet] so Desktop fullscreen uses like the native resolution? 19:08 <+bridge> [ddnet] so Desktop fullscreen uses like the native resolution only? 19:08 <+bridge> [ddnet] it uses your desktops resolution 19:08 <+bridge> [ddnet] ah ok 19:08 <+bridge> [ddnet] ty 19:29 <+bridge> [ddnet] Woah uh oh hmm 19:29 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/903334770547769404/Screenshot_2021-10-28-20-29-31-154_com.valvesoftware.android.steam.community.jpg 19:30 <+bridge> [ddnet] :thonk: 19:35 <+bridge> [ddnet] https://media.discordapp.net/attachments/737521938045599745/884617389726113802/Fa5C2k8GB1c.gif 19:36 <+bridge> [ddnet] @Learath2\: just remove all these pool hacks and let asan detect the issue then we know xd, cant be that hard 20:53 <+bridge> [ddnet] The last two kills in a row seems like what you get when the team is locked and someone dies from kill tiles 21:31 <+bridge> [ddnet] i guess the starting date of the crashes could already help