00:19 < bridge> @miguilim: maybe worth to mention next to your snap crc pseudocode is that C++ has integer overflows. So it’s just adding values to some integer if the snap is too big that might overflow. If you take the same code to other languages it might not overflow in the same way. But I’m not super sure here. It’s just something someone mentioned in the \#developer channel once iirc. I do not know if snaps can even be big enough for that. Maybe 00:21 < bridge> lol, again some people still don't use common time & date libraries ? 00:21 < bridge> ? 00:23 < bridge> Epic meme. I would love to know how he scrapes everything without even a phone number. Many websites require phone numbers just for accessing their content. 00:26 < bridge> This is a solved problem. Jxsl built a Econ vpn banner in go. And I did build one in python. Just search ddnet econ or teeworlds Econ on GitHub. 00:27 < bridge> What’s wrong with Econ? It’s the most portable and works across hosts. FIFO only works for ddnet and if you are on the same server. 00:35 < bridge> chillerdragon: u online on wire ? 00:50 < bridge> problem with econ is that the output is interleaved, so spotting the output to your commands is rather annoying 01:19 < bridge> Yes that’s true. So what do you suggest? FIFO doesn’t solve it does it? 01:19 < bridge> Later maybe I gtg now 01:26 < bridge> Yes you 01:27 < bridge> Yes you're correct. C++ crc int is int32, when it reaches 0x7FFFFFFF it will change the number to negative. This "issue" can easily be achieved by packing the client info snap 01:27 < bridge> I will add a comment there 01:31 < bridge> Thanks for the hint 01:43 < bridge> what about an actual rcon-cli ? i can see this beeing a thing for 0.7 aswell 01:45 < bridge> Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) 01:45 < bridge> Better to cast the numbers to unsigned and do the calculation like that if it matters 01:45 < bridge> Or use something like __builtin_*_overflow 01:45 < bridge> Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) 01:45 < bridge> Better to cast the numbers to unsigned and do the calculation like that if it matters, then cast back 01:45 < bridge> Or use something like __builtin_*_overflow 01:45 < bridge> Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) 01:45 < bridge> Better to cast the numbers to unsigned and do the calculation like that if it matters, then cast back 01:45 < bridge> Or use something like _\_builtin_\*_overflow 01:45 < bridge> Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) 01:45 < bridge> Better to cast the numbers to unsigned and do the calculation like that if it matters, then cast back 01:45 < bridge> Or use something like \_\_builtin_\*\_overflow 01:46 < bridge> Nope, however the new interface I'm trying to build does solve it if I ever figure it out :CelebratoryToast_fae: 01:46 < bridge> Nope, however the new interface I'm trying to build does solve it if I ever figure it out 01:51 < bridge> Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) 01:51 < bridge> Better to cast the numbers to unsigned and do the calculation like that if it matters, then cast back 01:51 < bridge> Or use something like \_\_builtin_\*\_overflow 01:51 < bridge> Unless I don't understand because 7FFFFFFF is INT_MAX 08:17 < bridge> Nice 08:19 < bridge> But that doesn’t exist. He was asking for the most portable way which does not require reimplementing it for every server. That is Econ and not fifo. And it’s also not rolling your own. 09:23 < bridge> econ output differs from version to version, and it requires reimplementing for each kind 11:16 < bridge> im tired 11:17 < bridge> hi tired, im chillerdragon 11:53 < bridge> Today on ffr 11:54 < bridge> I read this 11:54 < bridge> https://graydon2.dreamwidth.org/307291.html 11:54 < bridge> It's kinda funny to say it, but probably it was good for rusts success that the original author lost influence on it 11:55 < bridge> Tho some stuff sounds interesting 12:27 < bridge> correct, you need to do a wrapping addition for the snap "crc" 12:30 < bridge> seems like we're doing it with an unsigned integer already: https://github.com/ddnet/ddnet/blob/16feff41de1f46cb8a3f0d852035c51e27403521/src/engine/shared/snapshot.cpp#L103 12:32 < bridge> does c++ have saturated add? 12:35 < bridge> doubt it has it in the standard library 12:35 < bridge> but you can write the three lines of code for it yourself, I guess 12:36 < bridge> https://en.cppreference.com/w/cpp/numeric/add_sat 12:36 < bridge> "since c++26" 😄 12:37 < bridge> ```c++ 12:37 < bridge> constexpr unsigned char c = std::add_sat(UCHAR_MAX, 4); // not saturated, T = int 12:37 < bridge> // add_sat(int, int) returns int tmp == 259, 12:37 < bridge> // then assignment truncates 259 % 256 == 3 12:38 < bridge> static_assert(c == 3); 12:38 < bridge> ``` 12:38 < bridge> amazing 12:44 < bridge> what 12:52 < bridge> adding casts soon to edlang 12:52 < bridge> and then it will be somewhat useful 12:52 < bridge> structs + extern fns 12:52 < bridge> so u can use libc 12:52 < bridge> nice 🙂 12:53 < bridge> then i think ill add some basic generics 12:53 < bridge> so i can make a allocator api 12:53 < bridge> alloc() 12:53 < bridge> and hide malloc 12:53 < bridge> generics are hard ^^ 12:54 < bridge> yeah thats why i said basic 12:54 < bridge> i guess it will be like only sized and no trait bounds for now 12:54 < bridge> there are no traits yet anyway xd 12:55 < bridge> will it be like C++ templates or more like rust generics? 12:55 < bridge> i.e. will you decide at declaration time that a template type-checks or at instantiation time? 12:58 < bridge> Make a multi layer compilation. So that proc macros have additional information like the data type of symbols etc. 12:58 < bridge> 12:58 < bridge> If u do that cleanly your respect increases 12:59 < bridge> Make object safe dyn with compile constant values :lol: 13:00 < bridge> That would be insanely cool. But I've no idea if that would be even possible 13:00 < bridge> Maybe if initialization is transparent to the compiler somehow 13:01 < bridge> Also dyn without box pls 13:01 < bridge> While u at the impossible stuff 13:01 < bridge> rust 13:01 < bridge> i like a lot rust traits 13:02 < bridge> what i wanna try is some new borrow checker techniques 13:02 < bridge> when i have a solid language 13:02 < bridge> Do u also like dyn? 13:02 < bridge> https://verdagon.dev/blog/zero-cost-borrowing-regions-overview 13:02 < bridge> Tbh I try as good as possible not to use it without making generics explode over the whole code base 13:03 < bridge> yes i like being able to do dynamic dispatch too 13:03 < bridge> u can do the technique i explained several times 13:03 < bridge> make the generic function small and a call to a non generic one 13:03 < bridge> like std does a lot 13:04 < bridge> ```rust 13:04 < bridge> fn a(x: T) { 13:04 < bridge> b(x.into()) 13:04 < bridge> } 13:04 < bridge> 13:04 < bridge> fn b(x: PathBuf) { big here } 13:04 < bridge> ``` 13:04 < bridge> pseudocode 13:04 < bridge> But I don't mean generic functions 13:04 < bridge> I mean data types 13:04 < bridge> ah 13:05 < bridge> But their impl ofc is generic too 13:05 < bridge> I also don't have a problem with generics 13:05 < bridge> It's just that it's much more code to write often 13:05 < bridge> So very rarely I use dynamic dispatch. 13:05 < bridge> But I try to minimize that 13:06 < bridge> Dyn is basically polymorphism 😬 13:06 < bridge> Hate me for that 13:08 < bridge> dyn is fat pointer 13:17 < bridge> in rust. in C++, the vtable poiner is part of the object itself 13:17 < bridge> in rust. in C++, the vtable pointer is part of the object itself 13:18 < bridge> Yeah that's a clever design choice by rust 13:18 < bridge> But when ryo always says he doesn't like polymorphism, then I doubt it is because of this argument xd 13:21 < bridge> @jupeyy_keks why u should report ur rust analyzer crashes: https://github.com/rust-lang/rust-analyzer/issues/16656#event-11960074836 13:21 < bridge> i reported this one and they fixed it 13:22 < bridge> i was using nightly idk why but im using stable 13:22 < bridge> the nightly crashed xd 13:22 < bridge> I reported some stuff there already. They only fix it if it's a regression 13:22 < bridge> Design flaws are carried on for ever xd 13:22 < bridge> Understandable, but annoying 13:23 < bridge> xd 13:24 < bridge> But I blame Intel and amd. They should give me 64 cores clocked at 10ghz 13:25 < bridge> yes 13:25 < bridge> when blazingly fast speed 13:25 < bridge> On my desktop rust analyzer is usable. But on my second PC it's horrible xd 13:25 < bridge> xd 13:25 < bridge> i thnk vscode makes rust-analyzer slower tbh 13:25 < bridge> i think its faster on nvim or zed 13:25 < bridge> or lapce 13:25 < bridge> I think so too 13:26 < bridge> Lapce works somehow better. But then again it's too unstable xd 13:26 < bridge> qt creator 13:26 < bridge> I really don't want to say vscodr is good perf wise. But anything else just works better xD 13:27 < bridge> I tried so many in my CPP times already. At creator, eclipse, clion, visual studio 13:27 < bridge> All used for at least one month 13:27 < bridge> Vs felt best coding wise, but windows is slow 13:28 < bridge> Vscode second plus faster thanks to Linux😏 13:28 < bridge> Eclipse was always buggy xdd 13:28 < bridge> I used it for 2 years actually 13:29 < bridge> jetbrains IDEs always seemed better than eclipse to me 13:30 < bridge> Is android studio based on intellij? 13:30 < bridge> yes 13:31 < bridge> Then I don't like it. But at least android studio is stable 13:31 < bridge> But only wrote Java in it 13:31 < bridge> So I'm already biased against it xdd 13:32 < bridge> I think android studio was heavier than the other IDEs 13:32 < bridge> it's not by jetbrains directly, I think, but google(?) 13:35 < bridge> So did u try rustrover already? Xd 13:35 < bridge> yes, I'm actually using it to navigate big rust codebases 13:35 < bridge> I like it 13:35 < bridge> I guess it costs money? 13:37 < bridge> They video looks almost like vscode xd 13:37 < bridge> it's closed source. it currently does not cost money, and you personally will probably be able to use it for free after it'll cost something because you're a contributor to ddnet 13:38 < bridge> Epyc 13:41 < bridge> google paid jetbrains to make it and it uses their framework 13:41 < bridge> same for me? 13:41 < bridge> probably 13:41 < bridge> you also have edlang 😉 13:42 < bridge> morning :monkaCoffee: 13:42 < bridge> did jetbrains develop android studio on top of intellij or did jetbrains develop android studio on top of intellij? 13:42 < bridge> I thought it was the first one 13:42 < bridge> :PES3_SadCoffee: 13:42 < bridge> jetbrains has like their framework in which they make all their ides 13:42 < bridge> thats why they all look same 13:42 < bridge> yes 13:43 < bridge> but its probs heavily based on intellij 13:43 < bridge> i like android studio btw 13:43 < bridge> I know that this is the case 13:43 < bridge> why u sad :saddybear: 13:43 < bridge> but I was wondering who developed android studio on top of that framework or on top of intellij 13:43 < bridge> used it with flutter 13:43 < bridge> was it google or jetbrains? 13:43 < bridge> > Android Studio is the official integrated development environment (IDE) for Android application development. It is based on IntelliJ IDEA, a Java integrated development environment for software, and incorporates its code editing and developer tools. 13:43 < bridge> https://developer.android.com/studio/intro 13:43 < bridge> > Android Studio is the official Integrated Development Environment (IDE) for Android app development. Based on the powerful code editor and developer tools from IntelliJ IDEA , Android Studio offers even more features that enhance your productivity when building Android apps, such as: 13:43 < bridge> > 13:43 < bridge> > A flexible Gradle-based build system 13:44 < bridge> > A fast and feature-rich emulator 13:44 < bridge> > A unified environment where you can develop for all Android devices 13:44 < bridge> > Live Edit to update composables in emulators and physical devices in real time 13:44 < bridge> > Code templates and GitHub integration to help you build common app features and import sample code 13:44 < bridge> > Extensive testing tools and frameworks 13:44 < bridge> > Lint tools to catch performance, usability, version compatibility, and other problems 13:44 < bridge> > C++ and NDK support 13:44 < bridge> > Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine 13:44 < bridge> not sure if you're trying to answer my question, but you're not 13:44 < bridge> google also pushes for kotlin 13:44 < bridge> if you are, it feels like talking to a language model 13:44 < bridge> because java issues with licensing or smth 13:44 < bridge> @heinrich5991 xd 13:44 < bridge> this is the new 2024 insult or smth? kek 13:44 < bridge> but answering ur question: idk 13:45 < bridge> ok, you're not trying, then it's fine ^^ 13:45 < bridge> I was trying to describe my experience. I was asking a question and you kept posting large quotes that are vaguely related to the terms I used, but not at all to the question I asked 13:45 < bridge> my bet is jetbrains 13:45 < bridge> doubt it's that 13:46 < bridge> i dont think jetbrains would give their code for google to use 13:46 < bridge> to make android studio 13:46 < bridge> why not? if they're paid, as you say 13:46 < bridge> I think they are pushing kotlin because it has a better developer experience 13:47 < bridge> in unrelated news: https://cloudinary.com/blog/jpeg-xl-and-the-pareto-front 13:47 < bridge> jpeg xl seems like a really nice format 13:47 < bridge> I hope there will be unbiased benchmarks 13:47 < bridge> I only found like 2 blogs back then 13:48 < bridge> Back when chrome removed it :lol: 13:48 < bridge> the blog post looks sane to me 13:49 < bridge> i need a good name for my cargo for edlang 13:49 < bridge> or maybe just make it all edlang 13:49 < bridge> pkg.ed-lang.org 13:49 < bridge> docs.ed-lang.org 13:52 < bridge> Almost looks to good to be true. But tbf it's hard for me to understand the relevance of these graphs. But if it's so much better in both lossless and lossy, wtf have formats done in the past to be so bad xdd 13:53 < bridge> it's kinda like zstd, it's also much better than the rest 13:54 < bridge> ok, not mch better than the rest: https://gregoryszorc.com/blog/2017/03/07/better-compression-with-zstandard/ 13:55 < bridge> but strictly better than gzip 13:55 < bridge> yet a lot of stuff still uses gzip 13:59 < bridge> btw @ryozuki: https://www.jetbrains.com/community/opensource/#support 14:01 < bridge> i go by https://www.gnu.org/philosophy/free-sw.en.html 14:01 < bridge> :PES_NotCool: 14:02 < bridge> @heinrich5991 14:02 < bridge> > 14:02 < bridge> > 9. License Must Not Restrict Other Software 14:02 < bridge> > 14:02 < bridge> > The license must not place restrictions on other software that is distributed along with the licensed software. For example, the license must not insist that all other programs distributed on the same medium must be open source software. 14:02 < bridge> does this clash with agpl? 14:03 < bridge> ok probs not 14:03 < bridge> that seems unrelated again ^^ 14:03 < bridge> i know but i wanted to post it 14:03 < bridge> cuz i saw the word open source 14:03 < bridge> do better? ^^ 14:03 < bridge> what does that mean xD 14:04 < bridge> be more interesting. a person that consistently posts a certain link on a certain phrase is not interesting 14:05 < bridge> what would you do 14:05 < bridge> try to follow the conversation, post the link if it's currently interesting 14:07 < bridge> added the agpl logo to the edlang web 14:07 < bridge> :brownbear: 14:07 < bridge> https://ed-lang.org/ 14:07 < bridge> maybe put a code sample in there 14:07 < bridge> so people can see what it looks like 🙂 14:09 < bridge> i havent fixed on my syntax yet so i didnt know whether to do that 14:10 < bridge> added one xd 14:11 < bridge> @heinrich5991 do u know how to make a link to the latest release artifact on github? 14:11 < bridge> https://github.com/edg-l/edlang/releases/download/v0.0.1-alpha.11/edlang 14:11 < bridge> this but for latest always 14:11 < bridge> just linking to /releases should work, no? 14:11 < bridge> ah 14:11 < bridge> the download 14:12 < ws-client> jopsti would you call your coding style benchmark driven development? 14:12 < ws-client> benchmark first then write code 14:12 < bridge> thanks for the code sample @ryozuki 🙂 14:16 < bridge> so no, don't have a solution 14:26 < bridge> For me brotli won, but I didn't use a custom directory 14:27 < bridge> But it also won by quite some margin. And even for binary files 14:28 < bridge> Chillerdragon: no, but for me stuff like compressions are easily to replace 14:28 < bridge> do you have some documentation on the numbers that you found? what kind of data did you compress? 14:28 < bridge> So I try to Bench such stuff 14:28 < bridge> that makes a lot of sense IMO 14:28 < bridge> Let me go on PC, but I shared them here 14:29 < bridge> here 🙂 14:30 < bridge> It was for a bincode encoded map file 14:30 < bridge> Tw map, but not like vanilla map files 14:30 < bridge> So it also contained lot of zeros 14:34 < bridge> @heinrich5991 do u know if u can have ssh over cloudflare? 14:34 < bridge> so i can enable ssh on forgejo 14:35 < bridge> https://git.edgarluque.com/ 14:35 < bridge> soon tm 14:35 < bridge> why do you want to have that? 14:35 < bridge> https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ 14:35 < bridge> you can simply™ connect directly to the server IP address 14:36 < bridge> i dont want users using my forgejo to know my ip 14:36 < bridge> aah 14:36 < bridge> not sure if that's possible 14:36 < bridge> @heinrich5991 14:36 < bridge> https://pastebin.com/2NY0hg7E 14:36 < bridge> you seem to have read more than I did already 14:36 < bridge> Discord broken on PC dunno 14:37 < bridge> nice, thanks 14:37 < bridge> can you edit your message to include "brotli" so we can finid it in the future? ^^ 14:42 < bridge> Pastebins are deleted afyrer time anyway aren't they? 14:42 < bridge> pastila.nl 14:42 < bridge> ryo u can run a relay server 14:43 < bridge> in between the user and your server 14:43 < bridge> and expose that to cloudflare 14:43 < bridge> it communicates between the two independently 14:44 < bridge> don't think so 14:45 < bridge> @heinrich5991 14:46 < bridge> https://pastebin.com/2NY0hg7E 14:46 < bridge> @heinrich5991 14:46 < bridge> https://pastebin.com/2NY0hg7E brotli 14:48 < bridge> https://git.edgarluque.com/edg-l/edlang 14:48 < bridge> epyc 15:04 < bridge> apparently there is a cloudflare feature 15:04 < bridge> 15:04 < bridge> ill look into it later 15:05 < bridge> cool 15:08 < bridge> ill add later oauth with github 15:09 < bridge> is that actually proxied? 15:09 < bridge> or is it more like wireguard where you still connect to the target IP directly 15:10 < bridge> I couldn't tell from the page 15:25 < bridge> i think proxied 15:25 < bridge> with warp 15:27 < bridge> meh 15:27 < bridge> but this needs software on user side 15:27 < bridge> so its a no 15:31 < bridge> when crates io 15:34 < bridge> https://forgejo.org/2023-01-10-answering-forgejo-federation-questions/ 15:34 < bridge> forgejo has federation! 15:34 < bridge> https://forgefed.org/ 15:37 < bridge> @ryozuki when do we team up to create a rust-like language for GPUs 15:40 < bridge> after i do edlang 15:40 < bridge> btw forgejo allows creating a cargo repository 15:40 < bridge> pog 15:42 < bridge> @jupeyy_keks https://git.edgarluque.com/user/sign_up 15:42 < bridge> can u signup 15:42 < bridge> with ur github if u want 15:43 < bridge> xd 15:45 < bridge> xd 15:45 < bridge> whats funny xd 15:46 < bridge> it's not written in rust 😬 15:46 < bridge> 15:46 < bridge> ok no, i currently have no project to host there 15:47 < bridge> sadge 15:47 < bridge> do you feel alone on your selfhosted git instance? 15:47 < bridge> yes 15:47 < bridge> @jupeyy_keks but apparently its federated 15:48 < bridge> so u can create issues among forgejo instances 15:48 < bridge> e.g i have my account in my instance 15:48 < bridge> ah cool 15:48 < bridge> i can make a issue on another instance 15:48 < bridge> idk how it works 15:52 < bridge> https://git.edgarluque.com/edg-l/ddnet 15:52 < bridge> pog 15:54 < bridge> the only thing i'd highly be interested in is better stats than gitlab 15:54 < bridge> contributor stats etc 15:55 < bridge> my interest is not relying on microsoft github xd 15:55 < bridge> yeah understandable, but sadly also no very realistic if u want your project to have visibility 15:55 < bridge> except it's a really game changing project xd 15:56 < bridge> yeah 15:56 < bridge> im using this as mirror for now 15:57 < bridge> @jupeyy_keks it has action runner support too 15:57 < bridge> https://forgejo.org/docs/next/admin/actions/ 16:10 < bridge> @robyt3 #8036 what do i need to do, does it always increase memory or any specific condition? 16:10 < bridge> 16:10 < bridge> just open f1 console and it starts? 16:10 < bridge> 16:10 < bridge> does chat msg also work? 16:10 < bridge> https://github.com/ddnet/ddnet/issues/8036 16:10 < bridge> yes, just open console or active chat and it should start (with Vulkan) 16:10 < bridge> Somehow increases faster if there is less text in the console, so maybe linked to frame rate 16:12 < bridge> VRAM or RAM? 16:13 < bridge> RAM I assume, it's the normal value in task manager 16:14 < bridge> how long do i need to wait xd 16:14 < bridge> for me it doesnt increase by 1 byte xD 16:14 < bridge> It should start immediately 16:15 < bridge> Maybe it's Windows only again, or are you already on Windows? 16:15 < bridge> i have chat + console open 16:15 < bridge> nah 16:16 < bridge> It also behaves different in release and debug mode, but memory keeps increasing in both 16:16 < bridge> im in debug rn 16:16 < bridge> In release mode I get large lag spikes when the memory is freed, in debug I don't get the spikes for some reason 16:16 < bridge> and as soon as you close it, the RAM drops? 16:17 < bridge> yeah, it goes back to the normal value again, so everything is properly freed 16:17 < bridge> but it keeps allocating something 16:17 < bridge> sounds more like a IME thing 16:17 < bridge> xd 16:17 < bridge> how did u find out it's ONE TIME SUBMIT? 16:17 < bridge> If you remove `TextEx` calls it works 16:17 < bridge> If you only remove the flag it also works 16:17 < bridge> But then the memory usage keeps fluctuating 16:18 < bridge> But it does not increase over time 16:18 < bridge> maybe it's the shared pointer in the text containers? 16:18 < bridge> std::shared_ptr m_UseCount = 16:18 < bridge> std::make_shared(STextContainerUsages()); 16:18 < bridge> this one 16:18 < bridge> but weird that i dont get the bug at all 16:19 < bridge> do u also use a different compiler? 16:19 < bridge> MSVC? 16:19 < bridge> yeah, I did debug with GCC and RelWithDebug with MSVC 16:19 < bridge> mh 16:19 < bridge> I used MSVC profiler to find out that these allocations/frees are on the hot path 16:20 < bridge> that would probably also speak for the shared ptr 16:20 < bridge> but on the other hand side u said only on vk 16:21 < bridge> i'm just surprised that it's not visible, does windows task manager by chance also track VRAM xD 16:22 < bridge> ok 16:22 < bridge> yeah, but not per process I think, I'll test 16:24 < bridge> VRAM stays unchanged 16:24 < bridge> Simply removing the shared ptr did not fix it 16:25 < bridge> but u are 100% certain it only happens with vk? 16:25 < bridge> can u press CTRL shift D and see if the memory usage spikes in the top 16:25 < bridge> esp the "streamed" one 16:26 < bridge> all stays unchanged while the console is open 16:27 < bridge> what confuses me most is that the memory does not leak 16:27 < bridge> yeah, with OpenGL memory usage does not increase 16:27 < bridge> pog actions on my ryzen server 16:28 < bridge> <.< 16:28 < bridge> that's why there should be NO globals 16:28 < bridge> not even global allocators 16:29 < bridge> would be ez to debug with local ones 16:29 < bridge> 😏 16:30 < bridge> @robyt3 i dunno how to debug, since i dont have it xd 16:30 < bridge> my ram decreased a bit since we started talking xD 16:32 < bridge> Really weird how this only affects line inputs which are active 16:32 < bridge> Seems almost like IME playes a role somehow 16:32 < bridge> Seems almost like IME plays a role somehow 16:32 < bridge> you talking about drop fps when chat is active ? 16:32 < bridge> when u close it 16:32 < bridge> but yes 16:32 < bridge> in debug mode on windows it's happened with chat or open console 16:33 < bridge> yeah 16:33 < bridge> on release build it's fine 16:33 < bridge> mh ok 16:33 < bridge> Hmmm, that's the opposite of my experience 16:33 < bridge> then it's weird 16:33 < bridge> lmao 16:33 < bridge> win 11 64 bit what about you ? 16:34 < bridge> i'm win 11 64 bit what about you ? 16:34 < bridge> win 10 64 bit 16:34 < bridge> NVIDIA 16:34 < bridge> same 16:34 < bridge> Does the memory usage keep going up for you in the task manager while the console is open and DDNet is active? 16:35 < bridge> I noticed about it when I tried to add chat emoji that drop my fps to 60 or 50 then I had to remove it and couldn't fix it 16:35 < bridge> let me check with latest ddnet source 16:37 < bridge> https://github.com/ddnet/ddnet/blob/16feff41de1f46cb8a3f0d852035c51e27403521/src/engine/client/graphics_threaded.cpp#L129C2-L129C21 where the hell is this value gets set on window resize 16:38 < bridge> `GetViewportSize` 16:39 < bridge> omg i was expecting to see &m_ScreenWidth somewhere and wasnt checking other methods 16:39 < bridge> yes, that's an annoying feature of references 😦 16:40 < bridge> you don't see where stuff is passed by reference and where by value 16:41 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213149090607534150/image.png?ex=65f46c22&is=65e1f722&hm=e2c55290e390f56aa12261af07303efdf8004793ec038466f059ca7913987d58& 16:41 < bridge> for me it at least shows as phantom code 16:41 < bridge> but yeah seraching doesnt help here 16:41 < bridge> but yeah searching doesnt help here 16:42 < bridge> can u just disable IME to check 16:42 < bridge> before we look everywhere else 16:43 < bridge> code should also be somewhat readable without an IDE: we do it when reviewing PRs, for example 16:43 < bridge> I tried commenting out the IME code in lineinput but that didn't make any difference 16:44 < bridge> well every language has it's hiddenness tho 16:44 < bridge> in rust u most often dont type out types either 16:44 < bridge> yes. some more and some less 16:44 < bridge> isnt't why there's these `m_vpAll` prefixes and stuff 16:44 < bridge> so others can write code in notepad 16:44 < bridge> @robyt3 on menu cpu using 2-9% with open console it's goes 30+% 16:44 < bridge> it also wouldnt hurt if github adds inlay hints 16:44 < bridge> 😄 16:44 < bridge> yep 16:45 < bridge> but for the common case, you see that stuff is modified, you explicitly pass `&mut` 16:45 < bridge> I mean the memory usage. If you are in the menu it should stay the same, if you have the console open it seems to keep increasing for me (with Vulkan) 16:45 < bridge> true, but often i create the &mut before 16:45 < bridge> I kinda prefer pointers over references for mutable stuff, for this reason 16:45 < bridge> in C++ 16:45 < bridge> depends on the situation i guess 16:45 < bridge> oh I checked cpu let me see 16:45 < bridge> in python, it's the worst 16:45 < bridge> any object can be modified anywhere 16:46 < bridge> it's a feature 😏 16:46 < bridge> yeah we had that discussion, i guess i'm 60:40 for refs 16:46 < bridge> 16:46 < bridge> the passing is an argument, but pointers loose context etc. 16:46 < bridge> checking for null also kinda sucks 16:46 < bridge> or expecting to checking it 16:46 < bridge> If you start the memory usage might change a bit, but in the menu is should stay constant after maybe 30 seconds at most 16:46 < bridge> loose context? 16:46 < bridge> nope memory is 321mb and doesn't change 16:46 < bridge> And you use Vulkan? 16:47 < bridge> refs have a lifetime & are less prone to const removness 16:47 < bridge> and now increasing wtf 16:47 < bridge> yea, I'd treat every pointer that is not documented to be nullable as non-null 16:47 < bridge> yeah on Vulkan 16:47 < bridge> but checking docs also sucks xD 16:47 < bridge> In remote console it should increase faster than in local console 16:48 < bridge> maybe one could create a `Nullable<>` template. any pointer not in a `Nullable` must be non-null 16:48 < bridge> mh that sucks ofc 16:48 < bridge> I don't see much different between them both increase with same speed 16:49 < bridge> so how about you create a template and call it ref, but pass a pointer 😏 16:49 < bridge> 16:49 < bridge> but anyway, in cpp there is no diff between mut and const anyway in the call, also not for pointers 16:50 < bridge> i wouldn't hurt my head too much for this 16:50 < bridge> also not for references. but it documents stuff ^^ 16:51 < bridge> I guess 16:53 < bridge> @robyt3 i dunno i also cant find any related allocation if i set a breakpoint in the paths where vk allocations happen (or pushing to the buffer objects) 16:53 < bridge> if u remove the ONE TIME SUBMIT flag it will simply create "normal" buffer objects 16:53 < bridge> so the code path for a leak is pretty small 16:53 < bridge> bcs they share the same code 16:53 < bridge> except a few `if` statements 16:54 < bridge> https://gist.github.com/jokertarot/7583938 16:54 < bridge> is it possible to have on DDNet ? 16:54 < bridge> i think we already tried emojis once and they were disliked 16:54 < bridge> better invest into more SHIFT emojis 16:55 < bridge> Somehow these code paths are only triggered for active line inputs though, even though the `TextEx` function is also called in other places like the scoreboard, which does not cause this issue 16:55 < bridge> xd that just makes IME so likely 16:55 < bridge> weird that it isnt the cause (probably) 16:56 < bridge> @robyt3 r u on fullscreen 16:56 < bridge> or windowed 16:56 < bridge> with fullscreen i mean real one 16:56 < bridge> :troll: 16:56 < bridge> Windowed 16:56 < bridge> I tried to use that emoji system that use png but got huge drop fps on latest DDNet 17.1+ 16:56 < bridge> why that 16:57 < bridge> what about it should cause huge fps drops.. are the emojis 4k? XD 16:57 < bridge> Also happens with other fullscreen modes 16:57 < bridge> i expected it to happen only with fullscreen :lol: 16:57 < bridge> so nvm 16:57 < bridge> maybe I ruined somewhere don't know 😄 16:57 < bridge> I tested fullscreen and still increase memory and cpu usage 16:58 < bridge> ok 16:58 < bridge> what can we try... older SDL? 16:58 < bridge> it doesnt happen in OpenGL for you too @diariesvexar ? 16:58 < bridge> let me test it 17:00 < bridge> Also happens with SDL 2.0.16, which was used with DDNet 16.9 that still worked 17:00 < bridge> with opengl it's seem to be fine 17:01 < bridge> Will not be fixed by updating to SDL 2.28.5 either 17:02 < bridge> I noticed another thing though, the memory usage increases significantly faster when you've selected all lines of the local console 17:02 < bridge> yep it's stable with OpenGL3.3 + borderless window with 200mb ram usage 17:04 < bridge> ok i'll try that 17:04 < bridge> It's definitely caused by cursor/selection rendering 17:04 < bridge> Yes mine too 17:05 < bridge> Disabling text selection and cursor rendering fixes it 17:06 < bridge> Yeah it's stop increasing memory usage when disabling text selection 17:07 < bridge> so it's specifically about that nice 17:07 < bridge> I guess the selection quads are leaking? 17:08 < bridge> but also freed at some point right? 17:08 < bridge> yeah, when the console is closed 17:08 < bridge> so only partially leaking 17:08 < bridge> but it keeps allocating more and storing them somewhere 17:08 < bridge> ok 17:08 < bridge> if(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex == -1) 17:08 < bridge> TextContainer.m_StringInfo.m_SelectionQuadContainerIndex = Graphics()->CreateQuadContainer(false); 17:08 < bridge> this looks sus 17:08 < bridge> it only creates it if not created 17:08 < bridge> so maybe it appends it forever? 17:09 < bridge> is that even the code path we talk about? 17:09 < bridge> I'm not sure which kind of allocations `QuadContainerAddQuads` causes 17:10 < bridge> it adds the stuff to a vec and uploads everythign (even previous quads added) 17:10 < bridge> Seems like it leads to the code paths where BufferObjects are created 17:10 < bridge> I added breakpoint for `TextContainer.m_StringInfo.m_SelectionQuadContainerIndex = Graphics()->CreateQuadContainer(false);` and it's happening even that I just opened console is it fine ? 17:11 < bridge> but that still doesnt explain the unrelated ONE TIME SUBMIT flag xD 17:11 < bridge> yeah, it renders the blinking cursor 17:11 < bridge> oh right 17:17 < bridge> but why can i not reprod xd 17:17 < bridge> sometimes memory increases but then it stops forever 17:18 < bridge> I don't know how to explain it but without that gray highlight of selection still memory increasment happening 17:20 < bridge> @robyt3 where exactly did u disable selection? 17:20 < bridge> 17:20 < bridge> in text.cpp? 17:20 < bridge> lineinput.cpp, lines 450-484 17:21 < bridge> comment out all `Cursor.m_* = *` lines 17:22 < bridge> commenting out usage of `m_SelectionQuadContainerIndex` in `text.cpp` also fixes it 17:25 < bridge> commenting out only the two `QuadContainerAddQuads` calls is enough 17:28 < bridge> is linux reporting memory changes only once per hour or what am i doing wrong 17:28 < bridge> `Container.m_QuadBufferObjectIndex = CreateBufferObject(UploadDataSize, Container.m_vQuads.data(), 0);` 17:28 < bridge> i do 17:28 < bridge> 17:28 < bridge> ``` 17:28 < bridge> watch -n 0.1 'sudo pmap -x 78543 | grep "gesamt"' 17:28 < bridge> ``` 17:28 < bridge> 17:28 < bridge> where 78543 is my pid of DDNet 17:28 < bridge> the ram doesnt change even a single byte xD 17:29 < bridge> Do you reach the two lines `m_Elements.erase(...)` in `backend_vulkan.cpp`? 17:29 < bridge> yes 17:29 < bridge> Does it work without grep? 17:30 < bridge> yes but it's very verbose 17:30 < bridge> i also have a "normal" taskmanager open 17:30 < bridge> I mean does grep update or does it only read the output once? 17:30 < bridge> where i also dont see any change in ram xd 17:30 < bridge> oh i dunno 17:30 < bridge> i thought watch -n simply execs the whole command 17:31 < bridge> it does 17:32 < bridge> I'd recommend putting the sudo to the outside though, so it won't need to be re-executed 17:32 < bridge> ok when i move the ddnet window it instantly changes RAM 17:32 < bridge> `sudo watch -n 0.1 'pmap -x 78543 | grep "gesamt"'` 17:33 < bridge> but selection changes nothing at all 17:34 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213162334160420928/testdc.mp4?ex=65f47877&is=65e20377&hm=755efc55465c41507a2945907f8e30f24122140bb4e5df51beae3717343c4ea7& 17:34 < bridge> well anyway, i have to go now, hope u find the fix or cause xd 17:49 < bridge> @learath2 next try 17:49 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213166235219529748/PXL_20240301_164906809.MP.jpg?ex=65f47c1a&is=65e2071a&hm=75aa8f79eff9d85dc3eb860c515de0ddd52731c3107913051f18fbf406413b41& 17:50 < bridge> bro's gonna buy every dac he sees to test if it works with linux powered pc (it will not) 17:51 < bridge> anyway share the results :P 17:53 < bridge> i hope this works cuz im not gonna try more xd 17:54 < bridge> i have a k3 and it works 17:54 < bridge> size diference 17:54 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213167412791214090/PXL_20240301_165351382.jpg?ex=65f47d32&is=65e20832&hm=d103b93d450e874d892c6b203e5542f6db41a00e0cd3fc537164bfae371085d9& 18:05 < bridge> it seems to work 18:05 < bridge> like the others if i replug it will not until a reboot 18:05 < bridge> which is probs a bug in the driver 18:06 < bridge> but oh well 18:23 < bridge> epic 18:23 < bridge> it has bluetooth too 18:48 < bridge> https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html 18:48 < bridge> Is this the right way to draw a rectangle with a texture? ```cpp 18:48 < bridge> char aBuf[128]; 18:48 < bridge> CImageInfo Info; 18:48 < bridge> str_format(aBuf, sizeof(aBuf), "/path/to/file.png"); 18:48 < bridge> Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ABSOLUTE); 18:48 < bridge> auto Handle = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, 0); 18:48 < bridge> Graphics()->TextureSet(Handle); 18:48 < bridge> 18:48 < bridge> Graphics()->QuadsBegin(); 18:48 < bridge> Graphics()->DrawRectExt(100, 100, 100, 100, 0, 0); 18:48 < bridge> Graphics()->QuadsEnd(); 18:48 < bridge> ``` 18:49 < bridge> time for catalan 19:38 < bridge> I personally wouldn't call `LoadPNG` every frame, but you do you! :D 19:58 < bridge> owned 19:58 < bridge> rekt 19:58 < bridge> https://www.youtube.com/watch?v=e3uOMCfopR8 20:07 < bridge> this is bizarre though 20:07 < bridge> this one seems to work better now 20:07 < bridge> even after changing input modes 20:07 < bridge> i like it has rca in and out 20:07 < bridge> Have you tried restarting pipewire and seeing if it's maybe an issue in pipewire? 20:07 < bridge> so i can connect my mixer table permanently 20:08 < bridge> i doubt because dmesg shows the things i told u 20:08 < bridge> but not when you plug it in the first time? 20:08 < bridge> but well so far it works 20:08 < bridge> hmm idk 20:08 < bridge> im not gonna try it now 20:08 < bridge> cuz its working 20:08 < bridge> and i like it working 20:08 < bridge> :SmileWink: 20:08 < bridge> yeah just something to check before your next shutdown 20:08 < bridge> true 20:09 < bridge> ill probs forget 20:09 < bridge> cuz some friends coming over and drinks and such 20:09 < bridge> kek 20:09 < bridge> @learath2 btw when u coming to barcelona 20:09 < bridge> `std::string_view` is such a meh abstraction over strings, not guaranteeing null termination was such a bad idea, it's basically completely useless for interoperability with any already existing code 20:10 < bridge> Depends on when I get a reason to come over 😄 20:10 < bridge> xd 20:10 < bridge> u said u would come in the next 2 months 20:10 < bridge> or were u drunk 20:10 < bridge> I was planning on going to the nier concert, but I caught the one in berlin instead 20:11 < bridge> lemme see if there is anything interesting in barcelona 20:13 < bridge> I guess I could always just hop over for food 20:13 < bridge> true 20:13 < bridge> where's a place in C/C++ where you need null termination? 20:14 < bridge> not guaranteeing null termination is pretty essential, otherwise you can't have substrings without mutable access 20:14 < bridge> Interacting with all legacy code requires null termination, can't even compare string views safely 20:14 < bridge> can you give an example? 20:15 < bridge> `a.len() == b.len() || memcmp(a.data(), b.data(), a.len()) == 0` 20:15 < bridge> `a.len() == b.len() && memcmp(a.data(), b.data(), a.len()) == 0` 20:17 < bridge> Opening a file (the open syscall requires it null terminated) 20:17 < bridge> I agree null termination is total trash and your life gets much better if you can drop it 20:17 < bridge> I guess that's the correct way to do it, but you still can't use it in conjunction with old stuff, like the constructors of `ifstream` 20:17 < bridge> No copy substrings are a big deal 20:17 < bridge> And most data is not null terminated 20:17 < bridge> 🤝 20:18 < bridge> Null termination is eternal, trying to avoid it without replacing the entire OS is just extra overhead everywhere 20:18 < bridge> no 20:18 < bridge> You need to embrace null termination and make it nice to work with instead 20:18 < bridge> I'd like to see you pass your fancy rust string to `open(2)` 20:19 < bridge> just wait till ryOS 20:19 < bridge> I bet doing null termination only at the OS boundary is more performant than not having read-only substrings in programs 20:19 < bridge> For C I also drop them 20:19 < bridge> I prefer a type like this: 20:19 < bridge> 20:19 < bridge> ```c 20:19 < bridge> typedef struct 20:19 < bridge> { 20:19 < bridge> ptrdiff_t len; 20:19 < bridge> unsigned char* str; 20:19 < bridge> } s8; 20:19 < bridge> #define s8(s) (s8) { ((ptrdiff_t) sizeof(s)-1), (unsigned char*)s } 20:19 < bridge> ``` 20:19 < bridge> It absolutely is 20:19 < bridge> strlen is O(n) 20:19 < bridge> Calling it often is really, really bad 20:19 < bridge> ye 20:19 < bridge> rust str len is o1 20:20 < bridge> and comparision at best case can be o1 too if len doesnt match 20:20 < bridge> I love the random speculation. Ok let me make one too, my programs don't substring filenames except at the end, thus your strings perform much worse for my usecase 20:20 < bridge> rust allocates it on the stack for short strings, and on the heap for long ones IIRC 20:20 < bridge> rust stack strings look funny iirc they are all concatenated in a single place in memory 20:20 < bridge> Mine even has the benefit of being a 100% correct for my own use even though it's not generic 20:21 < bridge> Imagine the use case of "take a filename and return the extension" 20:21 < bridge> With a null terminated string you have to copy it, it's an allocation that can fail, and you have to free 20:21 < bridge> If you store the length it's absolutely trivial 20:21 < bridge> You can do things like reading tokens straight out of memory mapped files as well 20:21 < bridge> bad example. substrings at the end work with null termination 20:21 < bridge> Actually, returning the extension requires no allocation 20:21 < bridge> i bet most subprograms substring at start 20:21 < bridge> tokenization 20:21 < bridge> filenames 20:21 < bridge> etc 20:21 < bridge> Ah okay yeah my bad 20:22 < bridge> Mine doesn't so your strings objectively perform worse for me 20:22 < bridge> :owo: 20:22 < bridge> But returning the filename without the extension would 20:22 < bridge> It's almost as if there isn't one perfect solution, I wonder why 20:22 < bridge> There's a good reason nothing other than C chooses it 20:22 < bridge> nothing other than c and interfaces to c* 20:22 < bridge> The perfect solution is only concerning yourself with the null terminated BS when it matters 20:22 < bridge> C is not a language anymore 20:23 < bridge> its a protocol 20:23 < bridge> that we are forced to use 20:23 < bridge> If you have a mutable string at hand, it's only a matter of replacing the dot with a null character 20:23 < bridge> Well yeah... that's an allocation + copy 20:23 < bridge> I disagree, the perfect solution is only concerning with length-prefixed strings when it matters 20:23 < bridge> Do you see the issue with this line of argumentation? I can do the exact same thing 20:24 < bridge> No, because length is more generally useful 20:24 < bridge> And which council decides what is "more generally useful" 20:25 < bridge> See gta online json parser as an example where null termination goes wrong 20:25 < bridge> let's try to come up with ideas on how to quantitively determine which option is better 20:25 < bridge> whats the substring method for C? 20:25 < bridge> Null termination is also how you end up with extremely stupid APIs like strtok 20:25 < bridge> lets grep 20:26 < bridge> the ddnet dev council 20:26 < bridge> Not my fault some programmers are inept. You can write bad code in any language with any performance characteristic you desire. You can have `O(n)` strlen in Rust too 20:26 < bridge> :NekoDrink: 20:26 < bridge> but its opt in in rust 20:26 < bridge> You need the length every time you want to iterate the string 20:26 < bridge> Surely that's a general thing to do? 20:27 < bridge> Nope, you don't unless you have to iterate backwards 20:27 < bridge> You still need the length to know where the end is 20:27 < bridge> Not for null terminated strings 20:27 < bridge> but u cant slice nicely 20:27 < bridge> The end is where the null terminator is 20:28 < bridge> Okay, well you need to do an O(n) operation to know that info then 20:28 < bridge> aaaaaaab 20:28 < bridge> aaaaaaabb 20:28 < bridge> 20:28 < bridge> o1 in rust 20:28 < bridge> o(n) in c 20:28 < bridge> right? 20:28 < bridge> Yes, that is the main difference. strlen is `O(n)` for one type of string and `O(1)` for the other. If you don't need strlen for your "operation" it's not a cost you pay 20:28 < bridge> comparision 20:29 < bridge> What does that mean? 20:29 < bridge> comparing those 2 strings 20:29 < bridge> And you need it, practically every time you want to manipulate one 20:29 < bridge> Yeah if you store the length you can just compare the two and reject immediately 20:30 < bridge> That's one advantage I didn't think, thanks for mentioning it 20:30 < bridge> Yes 20:30 < bridge> If the lengths were the same, both are O(n) though 20:31 < bridge> what if u do a comparision in rust comparing first and last 20:31 < bridge> going inwards 20:31 < bridge> ? 20:31 < bridge> u cant do that efficiently in c 20:31 < bridge> like in rust when knowing len 20:32 < bridge> Not really, if your algorithm will be iterating forwards through a string (many are including the strtok you don't like), you don't need to know the length a priori 20:32 < bridge> Strtok has to write into your string to work 20:32 < bridge> That's what's so bad about it 20:32 < bridge> Also it doesn't return the length of the token (why???) 20:33 < bridge> You can't do that efficiently barring space-computers, any modern architecture with any amount of cache relies on prefetch to have efficient strlen 20:33 < bridge> Yet more loops just to figure out info the function already had to calculate 20:33 < bridge> llvm has its own string 20:33 < bridge> with length 20:33 < bridge> surely they had a reason 20:34 < bridge> So? It's still the same O(1) in space that any other tokenization algorithm you would like 20:34 < bridge> https://llvm.org/doxygen/classllvm_1_1StringRef.html 20:34 < bridge> I don't like appeals to authority, but there is indeed value to having length-prefixed strings. I'd only use them when I need those benefits, like when tokenizing 20:34 < bridge> ```cpp 20:34 < bridge> class LLVM_GSL_POINTER StringRef { 20:34 < bridge> public: 20:34 < bridge> static constexpr size_t npos = ~size_t(0); 20:34 < bridge> 20:35 < bridge> using iterator = const char *; 20:35 < bridge> using const_iterator = const char *; 20:35 < bridge> using size_type = size_t; 20:35 < bridge> 20:35 < bridge> private: 20:35 < bridge> /// The start of the string, in an external buffer. 20:35 < bridge> const char *Data = nullptr; 20:35 < bridge> 20:35 < bridge> /// The length of the string. 20:35 < bridge> size_t Length = 0; 20:35 < bridge> 20:35 < bridge> // Workaround memcmp issue with null pointers (undefined behavior) 20:35 < bridge> // by providing a specialized version 20:35 < bridge> static int compareMemory(const char *Lhs, const char *Rhs, size_t Length) { 20:35 < bridge> if (Length == 0) { return 0; } 20:35 < bridge> return ::memcmp(Lhs,Rhs,Length); 20:35 < bridge> } 20:35 < bridge> ``` 20:35 < bridge> The function doesn't tell you how long the token is so you're stuck calling strlen *again* 20:35 < bridge> When the function "knew" before it returned 20:35 < bridge> I'd guess if we look into the ddnet codebase, we'd see a lot of places that would be improved if naively replaced by strings that carry their lengths 20:35 < bridge> Well designed languages that don't enjoy butting heads with the nature of legacy code have either both types of string available or do both 20:36 < bridge> rust has both (?) 20:36 < bridge> CStr 20:36 < bridge> I'm not saying "don't have both available"... just "don't use null terminated unless you need to interact with legacy" 20:36 < bridge> I'd guess if we look at API boundries of the ddnet codebase, we'd see a lot of places that would be degraded if naively replaced by strings that carry their lengths 20:36 < bridge> this 20:36 < bridge> lets do this 20:36 < bridge> a rework 20:36 < bridge> and then we compare 20:36 < bridge> I'd bet if we count how often these are executed, we'd see more of my kind 20:37 < bridge> I doubt that very much, I can probably count on one hand the amount of substringing there is in the ddnet codebase 20:38 < bridge> substringing is just not a common operation for a game, nowhere near as common as it is in other problem spaces 20:38 < bridge> it's also string concatenation 20:39 < bridge> I default to zero terminated strings and use lenght-prefixed ones where needed 20:39 < bridge> every use of strcat and similar are a lot faster with strings whose length you know 20:39 < bridge> strcat is another huge mistake 20:39 < bridge> You can often find quadratic code using it 20:40 < bridge> guys just use assembly 20:41 < bridge> Why strcat doesn't just return a pointer to the end of the concatenated string is beyond me 20:41 < bridge> It's nothing but a performance W 20:41 < bridge> https://www.zarl.dev/articles/enums 20:41 < bridge> xd 20:41 < bridge> https://community.intel.com/t5/Blogs/Tech-Innovation/Tools/Why-do-we-need-a-Undefined-Behavior-Annex-for-the-C-standard/post/1574397 20:42 < bridge> I'm sure it's better to just copy some amount of bytes at once rather than having to iterate by byte and check for a null terminator each time 20:42 < bridge> strcpy is useless and no one should be calling it 20:45 < bridge> Thankfully modern cpus are very good at doing this operation in a vectorized manner, instead of pretending the 7 decades of legacy computing didn't exist 20:45 < bridge> @heinrich5991 the mail bro with a offer sent another mail 20:45 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213210442575384666/image.png?ex=65f4a545&is=65e23045&hm=c40e04ea308d25be164b598dbb4cd2c5aae5a984448e5c24c890c80399e7da62& 20:45 < bridge> do u still think its automated? 20:45 < bridge> I think the first thing was automated, yes 20:45 < bridge> maybe you're talking to a human now 20:46 < bridge> How are you supposed to vectorize strcpy? Doesn't sound very amenable to it 20:46 < bridge> probably is vectorized in glibc, I'd guess 20:46 < bridge> Same way you "vectorize" strlen, you do it in blocks 20:46 < bridge> still would guess memcpy performs better 20:47 < bridge> I'm pretty sure you'd have to read one byte at a time and can't read past the string 20:47 < bridge> vectorized strlen reads past 20:47 < bridge> not sure how to do strcpy though, writing past is bad 20:47 < bridge> That's allowed? Huh 20:47 < bridge> Does someone know why the SnapIDPool has a timeout system? 20:47 < bridge> "allowed" 20:48 < bridge> Just because I can't think how to do it doesn't mean it's not possible, obviously 20:49 < bridge> Well you can just calculate `strlen` vectorized, and after that it's equivalent to whatever you'd do with length prefixed strings 20:49 < bridge> that soudns super bad for performance 20:49 < bridge> I doubt strcpy does that 20:49 < bridge> in glibc 20:49 < bridge> I would be surprised if it doesn't do that, because as you said, writing past is bad 20:51 < bridge> It's much better than going char by char for any string longer than some N atleast 20:51 < bridge> it abuses the fact that reading past end isn't bad 20:51 < bridge> wanna bet? ^^ haven't looked yet 😄 20:52 < bridge> as long as you stay within the same page 20:52 < bridge> That going char by char is worse for most n > N? I don't know how we check 20:52 < bridge> no, glibc strcpy not precalculating the strlen 20:52 < bridge> Oh, I'm fairly confident it would as I don't see a way to avoid the write past end either 20:53 < bridge> Wazzup, @robyt3 found anything? 20:54 < bridge> precalculate the strlen for hte entire string before starting to write? 20:54 < bridge> @jupeyy_keks i have a video for u 20:54 < bridge> Yep 20:54 < bridge> ok, I bet against 20:54 < bridge> Send in 1h 20:54 < bridge> let's figure it out, default impl for x86_64 20:54 < bridge> Then I'm 20:54 < bridge> home 20:54 < bridge> let us check 20:54 < bridge> https://www.youtube.com/watch?v=wE1ZoMGIZHM 20:55 < bridge> its about gpus 20:56 < bridge> I think I heard about that too 20:57 < bridge> But dunno in which context 20:57 < bridge> > George Francis Hotz, alias geohot, is an American security hacker, entrepreneur, and software engineer. He is known for developing iOS jailbreaks, reverse engineering the PlayStation 3, and for the subsequent lawsuit brought against him by Sony. 20:57 < bridge> @heinrich5991 you win I guess 😄 20:57 < bridge> But it did some mix of SIMD and normal processing 20:59 < bridge> Is it interesting? That podcast always sounds like some manager talks 20:59 < bridge> Usually trash 20:59 < bridge> Unless I'm misreading the assembly it doesn't calculate the len first 20:59 < bridge> ye because mostly george talks xd 20:59 < bridge> haven't figured it out yet 20:59 < bridge> which assembly impl do you look at? 20:59 < bridge> avx? 20:59 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213214084237885521/image.png?ex=65f4a8aa&is=65e233aa&hm=f9f6b5bc140222da8e61d6db11b14902afff1a7d3321e168934e5d22ebc02ac6& 20:59 < bridge> 95' 21:00 < bridge> Epyc 21:00 < bridge> https://mcyoung.xyz/2023/08/01/llvm-ir/ 21:01 < bridge> @ryozuki when do u give me a job at Intel or amd. Now that you are a famous compiler dev 21:04 < bridge> True 21:04 < bridge> dont set too high bar for writing 21:04 < bridge> because even if u think its trivial others may find it rly interesting 21:05 < bridge> I could write a blog about synchronization between render passes xd 21:05 < bridge> do it 21:05 < bridge> Ez 21:05 < bridge> i'll read anything you would write 21:05 < bridge> just share the link kekw 21:05 < bridge> also do one about how rust helped u 21:05 < bridge> I start on mobile 21:05 < bridge> (and expect a blank check from rust-lang kek) 21:05 < bridge> im joking 21:05 < bridge> Xd 21:05 < bridge> Xd 21:07 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213216080978251897/GHm0Cy8XYAEL328.png?ex=65f4aa86&is=65e23586&hm=a10393f94b2bf08a9a172f16ce440d5c146b7535587d66f022a103451a40b47e& 21:07 < bridge> game news lmao 21:08 < bridge> can someone pls help me with this? 21:17 < bridge> In vulkan it's a bug to ignore memory alignment requirements, even if you don't allocate (aka split your existing allocation into sub allocations) 21:17 < bridge> 21:17 < bridge> You have to dynamically fetch the alignment requirements for every memory you will use. I guess the compiler can guarantee Smth similar for aligned allocations and for unaligned falls back to a different method. 21:17 < bridge> 21:17 < bridge> For strncpy it knows the size and can do a similar method 21:19 < bridge> Also it can provably recover overwritten values if it keeps it in the registers 21:30 < bridge> @learath2 21:30 < bridge> https://freebsdfoundation.org/blog/a-sneak-peek-simd-enhanced-string-functions-for-amd64/ 21:30 < bridge> This is interesting for you 21:30 < bridge> I clearly have nothing better to so right now xdd 21:32 < bridge> I wonder if their approach is really the fastest 21:32 < bridge> Dynamically checking for nul as part of the SIMD process sounds slow 21:34 < bridge> I should write the fastest strcpy using vk and make a blog post 21:45 < bridge> @learath2 if we assume using a alignment of 128 for every single allocation u ever do would lead to 20% faster str operations. would you say the wasted RAM is worth it? 21:57 < bridge> how would it affect whole-program performance? 21:59 < bridge> i dunno, if u dont allocate too much, probably quite few 22:01 < bridge> i guess the allocation size isn't significant enough, ofc considering it's not the limiting factor 22:01 < bridge> 22:01 < bridge> but would be a funny experiment 22:01 < bridge> but now that learath is a vulkan pro, he'll need to accept that wasting memory gets into a completely new class :lol: 22:02 < bridge> the memory alignment requirements for some allocations are absurd 22:04 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213230303875964940/image.png?ex=65f4b7c5&is=65e242c5&hm=babff6bde04ccb10d860a7204e86d28b4e7148cd627376fd088742305644a05e& 22:04 < bridge> one example 22:07 < bridge> aw man sad i really wanted that 22:08 < bridge> oh wow 😮 22:16 < bridge> ah yeah, gpu programming is simpler but also harder bcs it's easier to not make it epicly fast 22:16 < bridge> 22:16 < bridge> it's indeed interesting how CPUs compare to GPUs 22:17 < bridge> i should really learn vulkan compute 22:20 < bridge> ah lol now that makes sense 22:20 < bridge> but tbh 22:20 < bridge> 22:20 < bridge> RISC vs CISC is an endless debate 22:20 < bridge> RISC processors than get extensions like SIMD opcodes to be faster 22:20 < bridge> and some day they are so bloated with extensions that they are just CISC xd 22:20 < bridge> the story of ARM 22:20 < bridge> xdddd 22:24 < bridge> @chairn btw read the convo, you an expert on this stuff, teach us 22:25 < bridge> @peter44h who are u btw? renamed or new? 22:25 < bridge> 22:25 < bridge> i've only seen u recently 22:25 < bridge> Can you make vulkan write directly to `/dev/fb0`? @jupeyy_keks 22:25 < bridge> i've no idea xdd 22:25 < bridge> probably not 22:26 < bridge> just thinking running ddnet in tty 22:26 < bridge> idk 22:26 < bridge> VLIW! 22:26 < bridge> i mean u could copy stuff around 22:26 < bridge> but natively forcing vk... u'd probably need to write your own vulkan surface extension 22:26 < bridge> then _maybe_ 22:28 < bridge> is there really a distinction now? that there are the "micro ops" that all the instructions turned to 22:28 < bridge> new 22:30 < bridge> tbh i dunno. maybe u could say GPUs are still "real" RISC 22:30 < bridge> dafuq my rpi says it has no kernel but everything works fine? 22:30 < bridge> what? 22:31 < bridge> kernels are so 21th century 22:31 < bridge> welcome to 22 22:31 < bridge> yea 22:31 < bridge> who needs those anyways 22:32 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213237507744075776/IMG_20240301_223153890.jpg?ex=65f4be7a&is=65e2497a&hm=8143f10982f44b7f93aebe2f3a7bcb31d7ac1afa364d7e9dd2cb77b429492f2c& 22:32 < bridge> It boots just fine 22:33 < bridge> fk. how do i exit vim on an american layout??? 22:33 < bridge> wheres the double colon 22:34 < bridge> okay i got it 22:34 < bridge> Is it rasp 4? 22:34 < bridge> zero w 22:35 < bridge> little boi 22:35 < bridge> Does it have vk driver or does it suck 22:35 < bridge> i have no idea 22:35 < bridge> Zero sounds so powerless 22:36 < bridge> I'd not buy a washing machine without vk support again 22:36 < bridge> you say its powerless but you can't even divide by it 22:36 < bridge> Ngl 22:36 < bridge> still haven't got compute shaders to work :justatest: 22:36 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213238543950942329/image.png?ex=65f4bf71&is=65e24a71&hm=2d5ce8951f3191e33d5f705baa4974180e4455dae2438106a29252f71cb6ec1d& 22:36 < bridge> exactly 22:37 < bridge> 0/0 = infinity 22:37 < bridge> nvm 0/0 is not a number 22:37 < bridge> 1/0 is inf 22:37 < bridge> Xddd 22:37 < bridge> i thought it would throw an error 22:37 < bridge> 🤷‍♂️ 22:37 < bridge> Problem is 22:37 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213238827355865098/image.png?ex=65f4bfb5&is=65e24ab5&hm=33c53223ed0314242e6cc3bf1e030ebc32defff3e545c1b578637b76d1a5282d& 22:38 < bridge> Math != computer science in this case 22:38 < bridge> 0 doesn't really exist, so they assume an infinite small number 22:38 < bridge> based pyson 22:38 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213238976387883088/image.png?ex=65f4bfd8&is=65e24ad8&hm=a7f91f6fd5bf287b1f0b33dea1f0517fe522e4feafecce4d1972186ca493beda& 22:38 < bridge> And then it goes against inf 22:39 < bridge> okay i have a little LCD screen connected to the gpio pins. can i somehow use it as a primary display? prbly need drivers but there isn't even a company name on the screen xd 22:39 < bridge> gotta setup ssh first 22:39 < bridge> brb 22:45 < bridge> wait do i need a user? 22:45 < bridge> try 1.0/0.0 22:45 < bridge> integer is different 22:45 < bridge> ZeroDivisionError: float division by zero 22:45 < bridge> pyson doesnt think so 22:45 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1213240780076875826/image.png?ex=65f4c186&is=65e24c86&hm=520a0aea05a9a612677ca2d7298a235472f96f2cebcf2702698567f9e0dc409c& 22:45 < bridge> kek 22:45 < bridge> sudo apt purge python 22:45 < bridge> yes 22:46 < bridge> do you really want to uninstall your whole system? 22:46 < bridge> ah shit, here we go again 22:46 < bridge> well at least the root i guess? xd 22:47 < bridge> root is there but i can't login to root over ssh it seems 22:47 < bridge> i created a user and it works 22:48 < bridge> ``` 22:48 < bridge> >>> 1.0/0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 22:48 < bridge> Traceback (most recent call last): 22:48 < bridge> File "", line 1, in 22:48 < bridge> ZeroDivisionError: float division by zero 22:48 < bridge> ``` 22:48 < bridge> 22:48 < bridge> not really bro, not really 22:48 < bridge> 😬 22:48 < bridge> who could have guessed xd 22:48 < bridge> just use brüche 22:49 < bridge> ``` 22:49 < bridge> >>> 22:49 < bridge> KeyboardInterrupt 22:49 < bridge> >>> 22:49 < bridge> KeyboardInterrupt 22:49 < bridge> >>> 22:49 < bridge> KeyboardInterrupt 22:49 < bridge> >>> 22:49 < bridge> KeyboardInterrupt 22:49 < bridge> >>> quit 22:49 < bridge> Use quit() or Ctrl-D (i.e. EOF) to exit 22:49 < bridge> ``` 22:49 < bridge> 22:49 < bridge> LMAO 22:49 < bridge> python elite 22:51 < bridge> if user_arg == "quit" print message how to quit 22:51 < bridge> nice special casing 22:51 < bridge> nice special case`ing 23:02 < bridge> ah i forgot to edit the config. there is an option to enable root 23:09 < bridge> wait does ddnet even run on arm? 23:09 < bridge> should be cuz of android version right? 23:14 < bridge> I think it does, just no builds are provided 23:14 < bridge> it does, but compile with -fsigned-char 23:14 < bridge> thx 23:14 < bridge> we should add that to our cmake xd 23:14 < bridge> now that arm is more common 23:14 < bridge> xDDDD 23:14 < bridge> yea everyone plays ddnet on an rpi nowadays 23:17 < bridge> I meant arm cloud/vps 23:17 < bridge> But RPI is better than the PC of some ppl here 23:37 < bridge> xDDD 23:37 < bridge> might well be for me (after I bricked my motherboard with a BIOS update) 23:37 < bridge> sadge 23:37 < bridge> still angry about that 23:38 < bridge> haven't had the willpower to fix it 23:38 < bridge> i bought the parts for my little project more than half a year ago. i hope it works and i don't have to buy new things 23:39 < bridge> just putting an rpi zero w into my school calculator 23:39 < bridge> imagine gpt on calculator xdd 23:40 < bridge> my current laptop is "indefinitely borrowed" from a school 23:40 < bridge> xDD 23:40 < bridge> nice 23:41 < bridge> well, not nice but.... 23:41 < bridge> well actually not nice but.... 23:41 < bridge> apparently it wasn't getting used so it's nice 23:59 < bridge> Let me give you one last reason to use zero-terminated strings. They don't have a length limit