Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2024-03-01 00:00:00Z and 2024-03-02 00:00:00Z
Avatar
chillerdragon BOT 2024-03-01 00:18:59Z
Yes that’s true. So what do you suggest? FIFO doesn’t solve it does it?
Replying to @Learath2 problem with econ is that the output is interleaved, so spotting the out…
00:19
Later maybe I gtg now
Replying to @fokkonaut chillerdragon: u online on wire ?
Avatar
Avatar
chillerdragon
@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 it’s worth it to test the crc code with the same high values in C vs python, JavaScript and rust etc
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
00:27
I will add a comment there
00:31
Thanks for the hint
Avatar
Avatar
chillerdragon
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.
what about an actual rcon-cli ? i can see this beeing a thing for 0.7 aswell
Avatar
Avatar
Miguilim
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
Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) Better to cast the numbers to unsigned and do the calculation like that if it matters, then cast back Or use something like __builtin_*_overflow Unless I don't understand because 7FFFFFFF is INT_MAX (edited)
Avatar
Avatar
chillerdragon
Yes that’s true. So what do you suggest? FIFO doesn’t solve it does it?
Nope, however the new interface I'm trying to build does solve it if I ever figure it out celebrate (edited)
Avatar
https://github.com/teeworlds/teeworlds/commit/e6b8518b49c353963af35efad8465d9066fb819e this sounds cool teeworlds master: https://github.com/teeworlds/teeworlds/blob/a1911c8f7d8458fb4076ef8e7651e8ef5e91ab3e/src/engine/shared/snapshot.cpp#L25-L37 ```C++ int CSnapshot::GetItemIndex(int Key) const { plain_range_sorted Keys(SortedKeys(), SortedKeys() + m_NumItems); plain_range_sorted r = ::find_binary(Keys, Key); if(r.empty()) return -1; int Index = &r.front() - Sorte...
Avatar
chillerdragon BOT 2024-03-01 07:17:32Z
Nice
Replying to @Learath2 Nope, however the new interface I'm trying to build does solve it if I e…
07:19
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.
Replying to @meloƞ what about an actual rcon-cli ? i can see this beeing a thing for 0.7 as…
Avatar
econ output differs from version to version, and it requires reimplementing for each kind
Avatar
I have started working on a desert_main remake, about 1/3 done.
Avatar
im tired
10:17
hi tired, im chillerdragon
Avatar
Today on ffr
10:54
It's kinda funny to say it, but probably it was good for rusts success that the original author lost influence on it
10:55
Tho some stuff sounds interesting
Avatar
Avatar
chillerdragon
@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 it’s worth it to test the crc code with the same high values in C vs python, JavaScript and rust etc
correct, you need to do a wrapping addition for the snap "crc"
Avatar
Avatar
Peter0x44
Actually, it's straight UB and that isn't assured (without asking the compiler to, like with -fwrapv) Better to cast the numbers to unsigned and do the calculation like that if it matters, then cast back Or use something like __builtin_*_overflow Unless I don't understand because 7FFFFFFF is INT_MAX (edited)
Avatar
does c++ have saturated add?
Avatar
doubt it has it in the standard library
11:35
but you can write the three lines of code for it yourself, I guess
11:36
"since c++26" 😄
11:37
c++ constexpr unsigned char c = std::add_sat(UCHAR_MAX, 4); // not saturated, T = int // add_sat(int, int) returns int tmp == 259, // then assignment truncates 259 % 256 == 3 static_assert(c == 3);
11:37
amazing
Avatar
adding casts soon to edlang
11:52
and then it will be somewhat useful
11:52
structs + extern fns
11:52
so u can use libc
Avatar
nice 🙂
Avatar
then i think ill add some basic generics
11:53
so i can make a allocator api
11:53
alloc<T>()
11:53
and hide malloc
Avatar
generics are hard ^^
Avatar
yeah thats why i said basic
11:54
i guess it will be like only sized and no trait bounds for now
11:54
there are no traits yet anyway xd
Avatar
will it be like C++ templates or more like rust generics?
11:55
i.e. will you decide at declaration time that a template type-checks or at instantiation time?
Avatar
Make a multi layer compilation. So that proc macros have additional information like the data type of symbols etc. If u do that cleanly your respect increases
11:59
Make object safe dyn with compile constant values lol
12:00
That would be insanely cool. But I've no idea if that would be even possible
12:00
Maybe if initialization is transparent to the compiler somehow
12:01
Also dyn without box pls
12:01
While u at the impossible stuff
Avatar
Avatar
heinrich5991
will it be like C++ templates or more like rust generics?
rust
12:01
i like a lot rust traits
12:02
what i wanna try is some new borrow checker techniques
12:02
when i have a solid language
Avatar
Avatar
Ryozuki
i like a lot rust traits
Do u also like dyn?
Avatar
Tbh I try as good as possible not to use it without making generics explode over the whole code base
Avatar
Avatar
Jupstar ✪
Do u also like dyn?
yes i like being able to do dynamic dispatch too
Avatar
Avatar
Jupstar ✪
Tbh I try as good as possible not to use it without making generics explode over the whole code base
u can do the technique i explained several times
12:03
make the generic function small and a call to a non generic one
12:03
like std does a lot
12:04
fn a<T: Into<PathBuf>(x: T) { b(x.into()) } fn b(x: PathBuf) { big here }
12:04
pseudocode
Avatar
Avatar
Ryozuki
make the generic function small and a call to a non generic one
But I don't mean generic functions
12:04
I mean data types
Avatar
But their impl ofc is generic too
12:05
I also don't have a problem with generics
12:05
It's just that it's much more code to write often
12:05
So very rarely I use dynamic dispatch.
12:05
But I try to minimize that
12:06
Dyn is basically polymorphism 😬
12:06
Hate me for that
Avatar
dyn is fat pointer
Avatar
in rust. in C++, the vtable pointer is part of the object itself (edited)
Avatar
Yeah that's a clever design choice by rust
12:18
But when ryo always says he doesn't like polymorphism, then I doubt it is because of this argument xd
Avatar
@Jupstar ✪ why u should report ur rust analyzer crashes: https://github.com/rust-lang/rust-analyzer/issues/16656#event-11960074836
rust-analyzer version: Tried show RA version but doesnt work, on vscode extension manager it shows v0.4.1857 rustc version: rustc 1.76.0 (07dca489a 2024-02-04) relevant settings: (eg. client settin...
12:21
i reported this one and they fixed it
12:22
i was using nightly idk why but im using stable
12:22
the nightly crashed xd
Avatar
I reported some stuff there already. They only fix it if it's a regression
12:22
Design flaws are carried on for ever xd
12:22
Understandable, but annoying
Avatar
But I blame Intel and amd. They should give me 64 cores clocked at 10ghz
12:25
when blazingly fast speed
Avatar
On my desktop rust analyzer is usable. But on my second PC it's horrible xd
12:25
i thnk vscode makes rust-analyzer slower tbh
12:25
i think its faster on nvim or zed
12:25
or lapce
Avatar
I think so too
12:26
Lapce works somehow better. But then again it's too unstable xd
Avatar
qt creator
Avatar
I really don't want to say vscodr is good perf wise. But anything else just works better xD
12:27
I tried so many in my CPP times already. At creator, eclipse, clion, visual studio
12:27
All used for at least one month
12:27
Vs felt best coding wise, but windows is slow
12:28
Vscode second plus faster thanks to Linux😏
12:28
Eclipse was always buggy xdd
12:28
I used it for 2 years actually
Avatar
jetbrains IDEs always seemed better than eclipse to me
Avatar
Is android studio based on intellij?
Avatar
Then I don't like it. But at least android studio is stable
12:31
But only wrote Java in it
12:31
So I'm already biased against it xdd
Avatar
I think android studio was heavier than the other IDEs
12:32
it's not by jetbrains directly, I think, but google(?)
Avatar
Avatar
heinrich5991
jetbrains IDEs always seemed better than eclipse to me
So did u try rustrover already? Xd
Avatar
yes, I'm actually using it to navigate big rust codebases
12:35
I like it
Avatar
I guess it costs money?
12:37
They video looks almost like vscode xd
Avatar
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
Avatar
Epyc
Avatar
Avatar
heinrich5991
it's not by jetbrains directly, I think, but google(?)
google paid jetbrains to make it and it uses their framework
Avatar
Avatar
heinrich5991
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
same for me?
Avatar
probably
12:41
you also have edlang 😉
Avatar
morning monkaCoffee
Avatar
did jetbrains develop android studio on top of intellij or did jetbrains develop android studio on top of intellij?
12:42
I thought it was the first one
Avatar
Avatar
Nouaa
morning monkaCoffee
PES3_SadCoffee
Avatar
Avatar
heinrich5991
did jetbrains develop android studio on top of intellij or did jetbrains develop android studio on top of intellij?
jetbrains has like their framework in which they make all their ides
12:42
thats why they all look same
Avatar
yes
Avatar
but its probs heavily based on intellij
12:43
i like android studio btw
Avatar
I know that this is the case
Avatar
Avatar
Ryozuki
PES3_SadCoffee
why u sad saddybear
Avatar
but I was wondering who developed android studio on top of that framework or on top of intellij
Avatar
used it with flutter
Avatar
was it google or jetbrains?
Avatar
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.
12:43
Android Studio is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA.
12:43
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: A flexible Gradle-based build system A fast and feature-rich emulator A unified environment where you can develop for all Android devices Live Edit to update composables in emulators and physical devices in real time Code templates and GitHub integration to help you build common app features and import sample code Extensive testing tools and frameworks Lint tools to catch performance, usability, version compatibility, and other problems C++ and NDK support Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine
Avatar
not sure if you're trying to answer my question, but you're not
Avatar
google also pushes for kotlin
Avatar
if you are, it feels like talking to a language model
Avatar
because java issues with licensing or smth
12:44
@heinrich5991 xd
12:44
this is the new 2024 insult or smth? kek
12:44
but answering ur question: idk
Avatar
ok, you're not trying, then it's fine ^^
12:45
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
Avatar
my bet is jetbrains
Avatar
Avatar
Ryozuki
because java issues with licensing or smth
doubt it's that
Avatar
i dont think jetbrains would give their code for google to use
12:46
to make android studio
Avatar
why not? if they're paid, as you say
Avatar
Avatar
Ryozuki
because java issues with licensing or smth
I think they are pushing kotlin because it has a better developer experience
12:47
Version 0.10 of libjxl, the reference implementation for JPEG XL, has just been released. The main improvement this version brings, is that the so-called
12:47
jpeg xl seems like a really nice format
Avatar
I hope there will be unbiased benchmarks
12:47
I only found like 2 blogs back then
12:48
Back when chrome removed it lol
Avatar
the blog post looks sane to me
✅ 1
Avatar
i need a good name for my cargo for edlang
12:49
or maybe just make it all edlang
12:49
pkg.ed-lang.org docs.ed-lang.org
Avatar
Avatar
heinrich5991
the blog post looks sane to me
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
Avatar
it's kinda like zstd, it's also much better than the rest
12:55
but strictly better than gzip
12:55
yet a lot of stuff still uses gzip
12:59
JetBrains supports development of non-commercial open-source projects by providing core project contributors with a set of best-in-class developer tools.
Avatar
Since 1983, developing the free Unix style operating system GNU, so that computer users can have the freedom to share and improve the software they use.
13:01
PES_NotCool
13:02
@heinrich5991
9. License Must Not Restrict Other Software 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.
13:02
does this clash with agpl?
13:03
ok probs not
Avatar
that seems unrelated again ^^
Avatar
Avatar
heinrich5991
that seems unrelated again ^^
i know but i wanted to post it
13:03
cuz i saw the word open source
Avatar
do better? ^^
Avatar
what does that mean xD
Avatar
be more interesting. a person that consistently posts a certain link on a certain phrase is not interesting
Avatar
what would you do
Avatar
try to follow the conversation, post the link if it's currently interesting
Avatar
added the agpl logo to the edlang web
13:07
brownbear
Avatar
Experimental statically-typed compiled programming language made with LLVM and Rust
13:07
maybe put a code sample in there
13:07
so people can see what it looks like 🙂
Avatar
i havent fixed on my syntax yet so i didnt know whether to do that
13:10
added one xd
13:11
@heinrich5991 do u know how to make a link to the latest release artifact on github?
13:11
this but for latest always
Avatar
just linking to /releases should work, no?
13:11
ah
13:11
the download
Avatar
ws-client BOT 2024-03-01 13:12:35Z
<ChillerDragon> jopsti would you call your coding style benchmark driven development?
13:12
<ChillerDragon> benchmark first then write code
Avatar
thanks for the code sample @Ryozuki 🙂
Avatar
Avatar
heinrich5991
it's kinda like zstd, it's also much better than the rest
For me brotli won, but I didn't use a custom directory
13:27
But it also won by quite some margin. And even for binary files
13:28
Chillerdragon: no, but for me stuff like compressions are easily to replace
Avatar
do you have some documentation on the numbers that you found? what kind of data did you compress?
Avatar
So I try to Bench such stuff
Avatar
that makes a lot of sense IMO
Avatar
Avatar
heinrich5991
do you have some documentation on the numbers that you found? what kind of data did you compress?
Let me go on PC, but I shared them here
Avatar
Avatar
Jupstar ✪
deflate: 415078 - 415013, gz: 415096 - 415031, zlib: 415084 - 415031, lz4: 1124876, brotli: 165840, zstd: 228700 - 191730, lzma: 179541 - 178466 it even wins against lzma lmao, i didnt expect that
here 🙂
Avatar
It was for a bincode encoded map file
13:30
Tw map, but not like vanilla map files
13:30
So it also contained lot of zeros
Avatar
@heinrich5991 do u know if u can have ssh over cloudflare?
13:34
so i can enable ssh on forgejo
13:35
Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job.
13:35
soon tm
Avatar
Avatar
Ryozuki
@heinrich5991 do u know if u can have ssh over cloudflare?
why do you want to have that?
Avatar
The Secure Shell Protocol (SSH) enables users to remotely access devices through the command line. With Cloudflare Zero Trust, you can make your SSH …
Avatar
you can simply™ connect directly to the server IP address
Avatar
Avatar
heinrich5991
you can simply™ connect directly to the server IP address
i dont want users using my forgejo to know my ip
Avatar
aah
13:36
not sure if that's possible
Avatar
@heinrich5991 https://pastebin.com/2NY0hg7E brotli (edited)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Avatar
you seem to have read more than I did already
Avatar
Discord broken on PC dunno
Avatar
nice, thanks
Avatar
Avatar
Jupstar ✪
@heinrich5991 https://pastebin.com/2NY0hg7E brotli (edited)
can you edit your message to include "brotli" so we can finid it in the future? ^^
Avatar
Pastebins are deleted afyrer time anyway aren't they?
Avatar
pastila.nl
Avatar
ryo u can run a relay server
13:43
in between the user and your server
13:43
and expose that to cloudflare
13:43
it communicates between the two independently
Avatar
Avatar
Jupstar ✪
Pastebins are deleted afyrer time anyway aren't they?
don't think so
Avatar
Experimental statically-typed compiled programming language made with LLVM and Rust.
13:48
epyc
Avatar
Avatar
Ewan
ryo u can run a relay server
apparently there is a cloudflare feature
14:04
ill look into it later
Avatar
ill add later oauth with github
14:09
or is it more like wireguard where you still connect to the target IP directly
14:10
I couldn't tell from the page
Avatar
Avatar
heinrich5991
is that actually proxied?
i think proxied
14:25
with warp
14:27
meh
14:27
but this needs software on user side
14:27
so its a no
14:34
forgejo has federation!
Avatar
@Ryozuki when do we team up to create a rust-like language for GPUs
Avatar
Avatar
Jupstar ✪
@Ryozuki when do we team up to create a rust-like language for GPUs
after i do edlang
14:40
btw forgejo allows creating a cargo repository
14:40
pog
14:42
This is a Forgejo instance hosted by Edgar
14:42
can u signup
14:42
with ur github if u want
Avatar
xd
14:45
whats funny xd
Avatar
Avatar
Ryozuki
whats funny xd
it's not written in rust 😬 ok no, i currently have no project to host there
Avatar
Avatar
Ryozuki
sadge
do you feel alone on your selfhosted git instance?
14:47
@Jupstar ✪ but apparently its federated
14:48
so u can create issues among forgejo instances
14:48
e.g i have my account in my instance
Avatar
ah cool
Avatar
i can make a issue on another instance
14:48
idk how it works
14:52
DDraceNetwork, a free cooperative platformer game
14:52
pog
Avatar
the only thing i'd highly be interested in is better stats than gitlab
14:54
contributor stats etc
Avatar
my interest is not relying on microsoft github xd
Avatar
yeah understandable, but sadly also no very realistic if u want your project to have visibility
14:55
except it's a really game changing project xd
14:56
im using this as mirror for now
14:57
@Jupstar ✪ it has action runner support too
Avatar
@Robyt3 #8036 what do i need to do, does it always increase memory or any specific condition? just open f1 console and it starts? does chat msg also work?
Avatar
While a line input is rendered (e.g. when the console/chat is open) (i.e. when the CLineInput::Render function is called), the memory usage shown in Windows' task manager keeps increasing. It g...
Avatar
Avatar
Jupstar ✪
@Robyt3 #8036 what do i need to do, does it always increase memory or any specific condition? just open f1 console and it starts? does chat msg also work?
yes, just open console or active chat and it should start (with Vulkan)
15:10
Somehow increases faster if there is less text in the console, so maybe linked to frame rate
Avatar
Avatar
Robyt3
yes, just open console or active chat and it should start (with Vulkan)
VRAM or RAM?
Avatar
Avatar
Jupstar ✪
VRAM or RAM?
RAM I assume, it's the normal value in task manager
Avatar
Avatar
Robyt3
RAM I assume, it's the normal value in task manager
how long do i need to wait xd
15:14
for me it doesnt increase by 1 byte xD
Avatar
It should start immediately
15:15
Maybe it's Windows only again, or are you already on Windows?
Avatar
i have chat + console open
Avatar
Avatar
Robyt3
Maybe it's Windows only again, or are you already on Windows?
nah
Avatar
It also behaves different in release and debug mode, but memory keeps increasing in both
Avatar
im in debug rn
Avatar
In release mode I get large lag spikes when the memory is freed, in debug I don't get the spikes for some reason
Avatar
and as soon as you close it, the RAM drops?
Avatar
Avatar
Jupstar ✪
and as soon as you close it, the RAM drops?
yeah, it goes back to the normal value again, so everything is properly freed
15:17
but it keeps allocating something
Avatar
sounds more like a IME thing
15:17
xd
15:17
how did u find out it's ONE TIME SUBMIT?
Avatar
If you remove TextEx calls it works
15:17
If you only remove the flag it also works
15:17
But then the memory usage keeps fluctuating
15:18
But it does not increase over time
Avatar
maybe it's the shared pointer in the text containers?
15:18
std::shared_ptr<STextContainerUsages> m_UseCount = std::make_shared<STextContainerUsages>(STextContainerUsages());
15:18
this one
15:18
but weird that i dont get the bug at all
15:19
do u also use a different compiler?
15:19
MSVC?
Avatar
yeah, I did debug with GCC and RelWithDebug with MSVC
Avatar
mh
Avatar
I used MSVC profiler to find out that these allocations/frees are on the hot path
Avatar
that would probably also speak for the shared ptr
15:20
but on the other hand side u said only on vk
15:21
i'm just surprised that it's not visible, does windows task manager by chance also track VRAM xD
Avatar
Avatar
Jupstar ✪
i'm just surprised that it's not visible, does windows task manager by chance also track VRAM xD
yeah, but not per process I think, I'll test
Avatar
Avatar
Jupstar ✪
i'm just surprised that it's not visible, does windows task manager by chance also track VRAM xD
VRAM stays unchanged
Avatar
Avatar
Jupstar ✪
that would probably also speak for the shared ptr
Simply removing the shared ptr did not fix it
Avatar
Avatar
Robyt3
Simply removing the shared ptr did not fix it
but u are 100% certain it only happens with vk?
15:25
can u press CTRL shift D and see if the memory usage spikes in the top
15:25
esp the "streamed" one
Avatar
Avatar
Jupstar ✪
can u press CTRL shift D and see if the memory usage spikes in the top
all stays unchanged while the console is open
Avatar
what confuses me most is that the memory does not leak
Avatar
Avatar
Jupstar ✪
but u are 100% certain it only happens with vk?
yeah, with OpenGL memory usage does not increase
Avatar
that's why there should be NO globals
15:28
not even global allocators
15:29
would be ez to debug with local ones
15:29
😏
15:30
@Robyt3 i dunno how to debug, since i dont have it xd
15:30
my ram decreased a bit since we started talking xD
Avatar
Really weird how this only affects line inputs which are active
15:32
Seems almost like IME plays a role somehow (edited)
Avatar
you talking about drop fps when chat is active ?
Avatar
Avatar
Peakies
you talking about drop fps when chat is active ?
when u close it
15:32
but yes
Avatar
in debug mode on windows it's happened with chat or open console
Avatar
yeah
Avatar
on release build it's fine
Avatar
mh ok
Avatar
Hmmm, that's the opposite of my experience
Avatar
then it's weird
Avatar
lmao
Avatar
i'm win 11 64 bit what about you ? (edited)
Avatar
win 10 64 bit
15:34
NVIDIA
Avatar
Does the memory usage keep going up for you in the task manager while the console is open and DDNet is active?
Avatar
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
Avatar
Avatar
Robyt3
Does the memory usage keep going up for you in the task manager while the console is open and DDNet is active?
let me check with latest ddnet source
Avatar
omg i was expecting to see &m_ScreenWidth somewhere and wasnt checking other methods
Avatar
yes, that's an annoying feature of references 😦
15:40
you don't see where stuff is passed by reference and where by value
15:41
for me it at least shows as phantom code
15:41
but yeah searching doesnt help here (edited)
Avatar
Avatar
Robyt3
Seems almost like IME plays a role somehow (edited)
can u just disable IME to check
15:42
before we look everywhere else
Avatar
code should also be somewhat readable without an IDE: we do it when reviewing PRs, for example
Avatar
I tried commenting out the IME code in lineinput but that didn't make any difference
Avatar
Avatar
heinrich5991
code should also be somewhat readable without an IDE: we do it when reviewing PRs, for example
well every language has it's hiddenness tho
15:44
in rust u most often dont type out types either
Avatar
Avatar
Jupstar ✪
well every language has it's hiddenness tho
yes. some more and some less
Avatar
Avatar
heinrich5991
code should also be somewhat readable without an IDE: we do it when reviewing PRs, for example
isnt't why there's these m_vpAll prefixes and stuff
15:44
so others can write code in notepad
Avatar
@Robyt3 on menu cpu using 2-9% with open console it's goes 30+%
Avatar
Avatar
heinrich5991
code should also be somewhat readable without an IDE: we do it when reviewing PRs, for example
it also wouldnt hurt if github adds inlay hints
15:44
😄
Avatar
yep
Avatar
Avatar
heinrich5991
yes. some more and some less
but for the common case, you see that stuff is modified, you explicitly pass &mut
Avatar
Avatar
Peakies
@Robyt3 on menu cpu using 2-9% with open console it's goes 30+%
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)
Avatar
Avatar
heinrich5991
but for the common case, you see that stuff is modified, you explicitly pass &mut
true, but often i create the &mut before
Avatar
I kinda prefer pointers over references for mutable stuff, for this reason
15:45
in C++
Avatar
depends on the situation i guess
Avatar
oh I checked cpu let me see
Avatar
in python, it's the worst
15:45
any object can be modified anywhere
Avatar
it's a feature 😏
Avatar
Avatar
heinrich5991
I kinda prefer pointers over references for mutable stuff, for this reason
yeah we had that discussion, i guess i'm 60:40 for refs the passing is an argument, but pointers loose context etc.
15:46
checking for null also kinda sucks
15:46
or expecting to checking it
Avatar
Avatar
Peakies
oh I checked cpu let me see
If you start the memory usage might change a bit, but in the menu is should stay constant after maybe 30 seconds at most
Avatar
Avatar
Jupstar ✪
yeah we had that discussion, i guess i'm 60:40 for refs the passing is an argument, but pointers loose context etc.
loose context?
Avatar
nope memory is 321mb and doesn't change
Avatar
And you use Vulkan?
Avatar
Avatar
zhn
loose context?
refs have a lifetime & are less prone to const removness
Avatar
and now increasing wtf
Avatar
Avatar
Jupstar ✪
checking for null also kinda sucks
yea, I'd treat every pointer that is not documented to be nullable as non-null
Avatar
Avatar
Robyt3
And you use Vulkan?
yeah on Vulkan
Avatar
Avatar
heinrich5991
yea, I'd treat every pointer that is not documented to be nullable as non-null
but checking docs also sucks xD
Avatar
Avatar
Peakies
yeah on Vulkan
In remote console it should increase faster than in local console
Avatar
maybe one could create a Nullable<> template. any pointer not in a Nullable must be non-null
Avatar
Avatar
Robyt3
I tried commenting out the IME code in lineinput but that didn't make any difference
mh that sucks ofc
Avatar
Avatar
Robyt3
In remote console it should increase faster than in local console
I don't see much different between them both increase with same speed
Avatar
Avatar
heinrich5991
maybe one could create a Nullable<> template. any pointer not in a Nullable must be non-null
so how about you create a template and call it ref, but pass a pointer 😏 but anyway, in cpp there is no diff between mut and const anyway in the call, also not for pointers
Avatar
dd09834 Always build switch entities layers - Robyt3 011299d Merge pull request #8035 from Robyt3/Entities-Switch-Fix - Jupeyy
Avatar
i wouldn't hurt my head too much for this
Avatar
Avatar
Jupstar ✪
so how about you create a template and call it ref, but pass a pointer 😏 but anyway, in cpp there is no diff between mut and const anyway in the call, also not for pointers
also not for references. but it documents stuff ^^
Avatar
Avatar
Jupstar ✪
i wouldn't hurt my head too much for this
I guess
Avatar
@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)
15:53
if u remove the ONE TIME SUBMIT flag it will simply create "normal" buffer objects
15:53
so the code path for a leak is pretty small
15:53
bcs they share the same code
15:53
except a few if statements
Avatar
https://gist.github.com/jokertarot/7583938 is it possible to have on DDNet ?
How to render color emoji font with FreeType 2.5. GitHub Gist: instantly share code, notes, and snippets.
Avatar
Avatar
Peakies
https://gist.github.com/jokertarot/7583938 is it possible to have on DDNet ?
i think we already tried emojis once and they were disliked
15:54
better invest into more SHIFT emojis
Avatar
Avatar
Jupstar ✪
except a few if statements
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
Avatar
Avatar
Robyt3
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
xd that just makes IME so likely
15:55
weird that it isnt the cause (probably)
15:56
@Robyt3 r u on fullscreen
15:56
or windowed
15:56
with fullscreen i mean real one
Avatar
Avatar
Jupstar ✪
i think we already tried emojis once and they were disliked
troll
Avatar
Avatar
Jupstar ✪
with fullscreen i mean real one
Windowed
Avatar
Avatar
Jupstar ✪
i think we already tried emojis once and they were disliked
I tried to use that emoji system that use png but got huge drop fps on latest DDNet 17.1+
Avatar
Avatar
Peakies
I tried to use that emoji system that use png but got huge drop fps on latest DDNet 17.1+
why that
15:57
what about it should cause huge fps drops.. are the emojis 4k? XD
Avatar
Avatar
Jupstar ✪
with fullscreen i mean real one
Also happens with other fullscreen modes
Avatar
Avatar
Robyt3
Also happens with other fullscreen modes
i expected it to happen only with fullscreen lol
15:57
so nvm
Avatar
Avatar
Jupstar ✪
what about it should cause huge fps drops.. are the emojis 4k? XD
maybe I ruined somewhere don't know 😄
15:57
I tested fullscreen and still increase memory and cpu usage
Avatar
ok
15:58
what can we try... older SDL?
15:58
it doesnt happen in OpenGL for you too @Peakies ?
Avatar
let me test it
Avatar
Avatar
Jupstar ✪
what can we try... older SDL?
Also happens with SDL 2.0.16, which was used with DDNet 16.9 that still worked
Avatar
with opengl it's seem to be fine
Avatar
Will not be fixed by updating to SDL 2.28.5 either
16:02
I noticed another thing though, the memory usage increases significantly faster when you've selected all lines of the local console
Avatar
yep it's stable with OpenGL3.3 + borderless window with 200mb ram usage
Avatar
Avatar
Robyt3
I noticed another thing though, the memory usage increases significantly faster when you've selected all lines of the local console
ok i'll try that
Avatar
It's definitely caused by cursor/selection rendering
Avatar
Yes mine too
Avatar
Disabling text selection and cursor rendering fixes it
Avatar
Yeah it's stop increasing memory usage when disabling text selection
Avatar
Avatar
Robyt3
Disabling text selection and cursor rendering fixes it
so it's specifically about that nice
Avatar
I guess the selection quads are leaking?
Avatar
Avatar
Robyt3
I guess the selection quads are leaking?
but also freed at some point right?
Avatar
yeah, when the console is closed
Avatar
so only partially leaking
Avatar
but it keeps allocating more and storing them somewhere
Avatar
ok
16:08
if(TextContainer.m_StringInfo.m_SelectionQuadContainerIndex == -1) TextContainer.m_StringInfo.m_SelectionQuadContainerIndex = Graphics()->CreateQuadContainer(false);
16:08
this looks sus
16:08
it only creates it if not created
16:08
so maybe it appends it forever?
16:09
is that even the code path we talk about?
Avatar
I'm not sure which kind of allocations QuadContainerAddQuads causes
Avatar
Avatar
Robyt3
I'm not sure which kind of allocations QuadContainerAddQuads causes
it adds the stuff to a vec and uploads everythign (even previous quads added)
Avatar
Seems like it leads to the code paths where BufferObjects are created
Avatar
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 ?
Avatar
Avatar
Robyt3
Seems like it leads to the code paths where BufferObjects are created
but that still doesnt explain the unrelated ONE TIME SUBMIT flag xD
Avatar
Avatar
Peakies
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 ?
yeah, it renders the blinking cursor
Avatar
oh right
Avatar
but why can i not reprod xd
16:17
sometimes memory increases but then it stops forever
Avatar
I don't know how to explain it but without that gray highlight of selection still memory increasment happening
Avatar
@Robyt3 where exactly did u disable selection? in text.cpp?
Avatar
lineinput.cpp, lines 450-484
16:21
comment out all Cursor.m_* = * lines
16:22
commenting out usage of m_SelectionQuadContainerIndex in text.cpp also fixes it
16:25
commenting out only the two QuadContainerAddQuads calls is enough
Avatar
is linux reporting memory changes only once per hour or what am i doing wrong
Avatar
Container.m_QuadBufferObjectIndex = CreateBufferObject(UploadDataSize, Container.m_vQuads.data(), 0);
Avatar
i do watch -n 0.1 'sudo pmap -x 78543 | grep "gesamt"' where 78543 is my pid of DDNet
16:28
the ram doesnt change even a single byte xD
Avatar
Avatar
Jupstar ✪
is linux reporting memory changes only once per hour or what am i doing wrong
Do you reach the two lines m_Elements.erase(...) in backend_vulkan.cpp?
Avatar
Avatar
Robyt3
Do you reach the two lines m_Elements.erase(...) in backend_vulkan.cpp?
yes
Avatar
Avatar
Jupstar ✪
i do watch -n 0.1 'sudo pmap -x 78543 | grep "gesamt"' where 78543 is my pid of DDNet
Does it work without grep?
Avatar
yes but it's very verbose
16:30
i also have a "normal" taskmanager open
Avatar
I mean does grep update or does it only read the output once?
Avatar
where i also dont see any change in ram xd
Avatar
Avatar
Robyt3
I mean does grep update or does it only read the output once?
oh i dunno
16:30
i thought watch -n simply execs the whole command
Avatar
it does
16:32
I'd recommend putting the sudo to the outside though, so it won't need to be re-executed
Avatar
ok when i move the ddnet window it instantly changes RAM
Avatar
sudo watch -n 0.1 'pmap -x 78543 | grep "gesamt"'
Avatar
but selection changes nothing at all
16:34
16:34
well anyway, i have to go now, hope u find the fix or cause xd
Avatar
@Learath2 next try
Avatar
bro's gonna buy every dac he sees to test if it works with linux powered pc (it will not)
16:51
anyway share the results :P
Avatar
i hope this works cuz im not gonna try more xd
16:54
i have a k3 and it works
16:54
size diference
💀 1
Avatar
it seems to work
17:05
like the others if i replug it will not until a reboot
17:05
which is probs a bug in the driver
17:06
but oh well
17:23
it has bluetooth too
Avatar
Is this the right way to draw a rectangle with a texture? char aBuf[128]; CImageInfo Info; str_format(aBuf, sizeof(aBuf), "/path/to/file.png"); Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ABSOLUTE); auto Handle = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, 0); Graphics()->TextureSet(Handle); Graphics()->QuadsBegin(); Graphics()->DrawRectExt(100, 100, 100, 100, 0, 0); Graphics()->QuadsEnd();
Avatar
  • Rename parameter s to State.
  • Only print debug message if new state is different from old state.
  • Reduce indentation.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affe...
Avatar
Avatar
MilkeeyCat
Is this the right way to draw a rectangle with a texture? char aBuf[128]; CImageInfo Info; str_format(aBuf, sizeof(aBuf), "/path/to/file.png"); Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ABSOLUTE); auto Handle = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, 0); Graphics()->TextureSet(Handle); Graphics()->QuadsBegin(); Graphics()->DrawRectExt(100, 100, 100, 100, 0, 0); Graphics()->QuadsEnd();
I personally wouldn't call LoadPNG every frame, but you do you! :D
🔥 2
18:58
rekt
19:05
52da715 Minor refactoring of CClient::SetState - Robyt3 4be92b2 Merge pull request #8038 from Robyt3/Client-SetState-Refactoring - def-
Avatar
Avatar
Ryozuki
like the others if i replug it will not until a reboot
this is bizarre though
Avatar
Avatar
Learath2
this is bizarre though
this one seems to work better now
19:07
even after changing input modes
19:07
i like it has rca in and out
Avatar
Have you tried restarting pipewire and seeing if it's maybe an issue in pipewire?
Avatar
so i can connect my mixer table permanently
Avatar
Avatar
Learath2
Have you tried restarting pipewire and seeing if it's maybe an issue in pipewire?
i doubt because dmesg shows the things i told u
Avatar
but not when you plug it in the first time?
Avatar
but well so far it works
19:08
hmm idk
19:08
im not gonna try it now
19:08
cuz its working
19:08
and i like it working
19:08
SmileWink
Avatar
yeah just something to check before your next shutdown
19:09
ill probs forget
19:09
cuz some friends coming over and drinks and such
19:09
kek
19:09
@Learath2 btw when u coming to barcelona
Avatar
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
Avatar
Avatar
Ryozuki
@Learath2 btw when u coming to barcelona
Depends on when I get a reason to come over 😄
19:10
u said u would come in the next 2 months
19:10
or were u drunk
Avatar
Avatar
Ryozuki
u said u would come in the next 2 months
I was planning on going to the nier concert, but I caught the one in berlin instead
19:11
lemme see if there is anything interesting in barcelona
19:13
I guess I could always just hop over for food
Avatar
Avatar
Learath2
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
where's a place in C/C++ where you need null termination?
Avatar
Avatar
Learath2
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
not guaranteeing null termination is pretty essential, otherwise you can't have substrings without mutable access
Avatar
Avatar
heinrich5991
where's a place in C/C++ where you need null termination?
Interacting with all legacy code requires null termination, can't even compare string views safely
Avatar
can you give an example?
19:15
a.len() == b.len() && memcmp(a.data(), b.data(), a.len()) == 0 (edited)
Avatar
Avatar
heinrich5991
where's a place in C/C++ where you need null termination?
Opening a file (the open syscall requires it null terminated)
19:17
I agree null termination is total trash and your life gets much better if you can drop it
Avatar
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
Avatar
No copy substrings are a big deal
19:17
And most data is not null terminated
Avatar
Avatar
Peter0x44
I agree null termination is total trash and your life gets much better if you can drop it
🤝
Avatar
Null termination is eternal, trying to avoid it without replacing the entire OS is just extra overhead everywhere
Avatar
You need to embrace null termination and make it nice to work with instead
Avatar
Avatar
Ryozuki
no
I'd like to see you pass your fancy rust string to open(2)
Avatar
Avatar
Learath2
I'd like to see you pass your fancy rust string to open(2)
just wait till ryOS
Avatar
I bet doing null termination only at the OS boundary is more performant than not having read-only substrings in programs
Avatar
For C I also drop them I prefer a type like this: typedef struct { ptrdiff_t len; unsigned char* str; } s8; #define s8(s) (s8) { ((ptrdiff_t) sizeof(s)-1), (unsigned char*)s }
Avatar
Avatar
heinrich5991
I bet doing null termination only at the OS boundary is more performant than not having read-only substrings in programs
It absolutely is
19:19
strlen is O(n)
19:19
Calling it often is really, really bad
19:19
rust str len is o1
19:20
and comparision at best case can be o1 too if len doesnt match
Avatar
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
Avatar
Avatar
Learath2
I'd like to see you pass your fancy rust string to open(2)
rust allocates it on the stack for short strings, and on the heap for long ones IIRC
Avatar
Avatar
heinrich5991
rust allocates it on the stack for short strings, and on the heap for long ones IIRC
rust stack strings look funny iirc they are all concatenated in a single place in memory
Avatar
Avatar
Learath2
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
Mine even has the benefit of being a 100% correct for my own use even though it's not generic
Avatar
Avatar
Learath2
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
Imagine the use case of "take a filename and return the extension" With a null terminated string you have to copy it, it's an allocation that can fail, and you have to free If you store the length it's absolutely trivial
19:21
You can do things like reading tokens straight out of memory mapped files as well
Avatar
Avatar
Peter0x44
Imagine the use case of "take a filename and return the extension" With a null terminated string you have to copy it, it's an allocation that can fail, and you have to free If you store the length it's absolutely trivial
bad example. substrings at the end work with null termination
Avatar
Avatar
Peter0x44
Imagine the use case of "take a filename and return the extension" With a null terminated string you have to copy it, it's an allocation that can fail, and you have to free If you store the length it's absolutely trivial
Actually, returning the extension requires no allocation
Avatar
Avatar
Learath2
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
i bet most subprograms substring at start
19:21
tokenization
19:21
filenames
19:21
etc
Avatar
Ah okay yeah my bad
Avatar
Avatar
Ryozuki
i bet most subprograms substring at start
Mine doesn't so your strings objectively perform worse for me
Avatar
But returning the filename without the extension would
Avatar
It's almost as if there isn't one perfect solution, I wonder why
Avatar
There's a good reason nothing other than C chooses it
Avatar
nothing other than c and interfaces to c*
Avatar
Avatar
Learath2
It's almost as if there isn't one perfect solution, I wonder why
The perfect solution is only concerning yourself with the null terminated BS when it matters
Avatar
C is not a language anymore
19:23
its a protocol
19:23
that we are forced to use
Avatar
Avatar
Peter0x44
But returning the filename without the extension would
If you have a mutable string at hand, it's only a matter of replacing the dot with a null character
Avatar
Well yeah... that's an allocation + copy
Avatar
Avatar
Peter0x44
The perfect solution is only concerning yourself with the null terminated BS when it matters
I disagree, the perfect solution is only concerning with length-prefixed strings when it matters
19:23
Do you see the issue with this line of argumentation? I can do the exact same thing
Avatar
No, because length is more generally useful
Avatar
And which council decides what is "more generally useful"
Avatar
See gta online json parser as an example where null termination goes wrong
Avatar
let's try to come up with ideas on how to quantitively determine which option is better
Avatar
whats the substring method for C?
Avatar
Null termination is also how you end up with extremely stupid APIs like strtok
Avatar
lets grep
Avatar
Avatar
Learath2
And which council decides what is "more generally useful"
the ddnet dev council
Avatar
Avatar
Peter0x44
See gta online json parser as an example where null termination goes wrong
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
Avatar
Avatar
Learath2
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
but its opt in in rust
Avatar
Avatar
Learath2
And which council decides what is "more generally useful"
You need the length every time you want to iterate the string Surely that's a general thing to do?
Avatar
Avatar
Peter0x44
You need the length every time you want to iterate the string Surely that's a general thing to do?
Nope, you don't unless you have to iterate backwards
Avatar
You still need the length to know where the end is
Avatar
Not for null terminated strings
Avatar
but u cant slice nicely
Avatar
The end is where the null terminator is
Avatar
Okay, well you need to do an O(n) operation to know that info then
Avatar
aaaaaaab aaaaaaabb o1 in rust o(n) in c right?
Avatar
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
Avatar
comparision
Avatar
Avatar
Ryozuki
aaaaaaab aaaaaaabb o1 in rust o(n) in c right?
What does that mean?
Avatar
comparing those 2 strings
Avatar
Avatar
Learath2
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
And you need it, practically every time you want to manipulate one
Avatar
Avatar
Ryozuki
aaaaaaab aaaaaaabb o1 in rust o(n) in c right?
Yeah if you store the length you can just compare the two and reject immediately
19:30
That's one advantage I didn't think, thanks for mentioning it
Avatar
Avatar
Ryozuki
comparision
Yes
19:30
If the lengths were the same, both are O(n) though
Avatar
Avatar
Learath2
If the lengths were the same, both are O(n) though
what if u do a comparision in rust comparing first and last
19:31
going inwards
19:31
?
19:31
u cant do that efficiently in c
19:31
like in rust when knowing len
Avatar
Avatar
Peter0x44
And you need it, practically every time you want to manipulate one
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
Avatar
Strtok has to write into your string to work
19:32
That's what's so bad about it Also it doesn't return the length of the token (why???)
Avatar
Avatar
Ryozuki
u cant do that efficiently in c
You can't do that efficiently barring space-computers, any modern architecture with any amount of cache relies on prefetch to have efficient strlen
Avatar
Yet more loops just to figure out info the function already had to calculate
Avatar
llvm has its own string
19:33
with length
19:33
surely they had a reason
Avatar
Avatar
Peter0x44
Strtok has to write into your string to work
So? It's still the same O(1) in space that any other tokenization algorithm you would like
Avatar
Avatar
Ryozuki
surely they had a reason
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
Avatar
class LLVM_GSL_POINTER StringRef { public: static constexpr size_t npos = ~size_t(0); using iterator = const char *; using const_iterator = const char *; using size_type = size_t; private: /// The start of the string, in an external buffer. const char *Data = nullptr; /// The length of the string. size_t Length = 0; // Workaround memcmp issue with null pointers (undefined behavior) // by providing a specialized version static int compareMemory(const char *Lhs, const char *Rhs, size_t Length) { if (Length == 0) { return 0; } return ::memcmp(Lhs,Rhs,Length); }
Avatar
Avatar
Learath2
So? It's still the same O(1) in space that any other tokenization algorithm you would like
The function doesn't tell you how long the token is so you're stuck calling strlen again
19:35
When the function "knew" before it returned
Avatar
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
👍 1
Avatar
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
Avatar
rust has both (?)
19:36
CStr
Avatar
I'm not saying "don't have both available"... just "don't use null terminated unless you need to interact with legacy"
Avatar
Avatar
heinrich5991
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
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
Avatar
Avatar
Peter0x44
I'm not saying "don't have both available"... just "don't use null terminated unless you need to interact with legacy"
this
Avatar
Avatar
Learath2
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
lets do this
19:36
a rework
19:36
and then we compare
Avatar
Avatar
Learath2
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
I'd bet if we count how often these are executed, we'd see more of my kind
Avatar
I doubt that very much, I can probably count on one hand the amount of substringing there is in the ddnet codebase
19:38
substringing is just not a common operation for a game, nowhere near as common as it is in other problem spaces
Avatar
it's also string concatenation
Avatar
Avatar
Peter0x44
I'm not saying "don't have both available"... just "don't use null terminated unless you need to interact with legacy"
I default to zero terminated strings and use lenght-prefixed ones where needed
Avatar
every use of strcat and similar are a lot faster with strings whose length you know
👍 1
Avatar
strcat is another huge mistake
19:39
You can often find quadratic code using it
Avatar
guys just use assembly
Avatar
Why strcat doesn't just return a pointer to the end of the concatenated string is beyond me
19:41
It's nothing but a performance W
19:41
xd
19:41
Intel's developer software engineers are not only working on the latest optimizations and improvements in the Intel® oneAPI DPC++/C++ Compiler. We actively contribute to the advancements of Khronos Group's SYCL, the LLVM Project, and the latest C and C++ language standards . We would like to share...
Avatar
Avatar
heinrich5991
every use of strcat and similar are a lot faster with strings whose length you know
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
19:42
strcpy is useless and no one should be calling it
Avatar
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
Avatar
@heinrich5991 the mail bro with a offer sent another mail
19:45
do u still think its automated?
Avatar
I think the first thing was automated, yes
19:45
maybe you're talking to a human now
Avatar
Avatar
Learath2
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
How are you supposed to vectorize strcpy? Doesn't sound very amenable to it
Avatar
probably is vectorized in glibc, I'd guess
Avatar
Same way you "vectorize" strlen, you do it in blocks
Avatar
still would guess memcpy performs better
Avatar
I'm pretty sure you'd have to read one byte at a time and can't read past the string
Avatar
vectorized strlen reads past
19:47
not sure how to do strcpy though, writing past is bad
Avatar
That's allowed? Huh
Avatar
Does someone know why the SnapIDPool has a timeout system?
Avatar
Avatar
Peter0x44
That's allowed? Huh
"allowed"
Avatar
Just because I can't think how to do it doesn't mean it's not possible, obviously
Avatar
Avatar
heinrich5991
not sure how to do strcpy though, writing past is bad
Well you can just calculate strlen vectorized, and after that it's equivalent to whatever you'd do with length prefixed strings
Avatar
Avatar
Learath2
Well you can just calculate strlen vectorized, and after that it's equivalent to whatever you'd do with length prefixed strings
that soudns super bad for performance
19:49
I doubt strcpy does that
19:49
in glibc
Avatar
I would be surprised if it doesn't do that, because as you said, writing past is bad
Avatar
Avatar
heinrich5991
that soudns super bad for performance
It's much better than going char by char for any string longer than some N atleast
Avatar
Avatar
Peter0x44
Just because I can't think how to do it doesn't mean it's not possible, obviously
it abuses the fact that reading past end isn't bad
Avatar
Avatar
Learath2
It's much better than going char by char for any string longer than some N atleast
wanna bet? ^^ haven't looked yet 😄
Avatar
Avatar
heinrich5991
it abuses the fact that reading past end isn't bad
as long as you stay within the same page
Avatar
Avatar
heinrich5991
wanna bet? ^^ haven't looked yet 😄
That going char by char is worse for most n > N? I don't know how we check
Avatar
Avatar
Learath2
That going char by char is worse for most n > N? I don't know how we check
no, glibc strcpy not precalculating the strlen
Avatar
Oh, I'm fairly confident it would as I don't see a way to avoid the write past end either
Avatar
Wazzup, @Robyt3 found anything?
Avatar
Avatar
Learath2
Oh, I'm fairly confident it would as I don't see a way to avoid the write past end either
precalculate the strlen for hte entire string before starting to write?
Avatar
@Jupstar ✪ i have a video for u
Avatar
Avatar
heinrich5991
precalculate the strlen for hte entire string before starting to write?
Yep
Avatar
ok, I bet against
Avatar
Avatar
Ryozuki
@Jupstar ✪ i have a video for u
Send in 1h
Avatar
let's figure it out, default impl for x86_64
Avatar
Then I'm
19:54
home
Avatar
Avatar
heinrich5991
ok, I bet against
let us check
19:55
its about gpus
Avatar
Avatar
Learath2
Yep
I think I heard about that too
19:57
But dunno in which context
Avatar
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.
Avatar
@heinrich5991 you win I guess 😄
Avatar
But it did some mix of SIMD and normal processing
Avatar
Is it interesting? That podcast always sounds like some manager talks
19:58
Usually trash
Avatar
Unless I'm misreading the assembly it doesn't calculate the len first
Avatar
Avatar
Jupstar ✪
Is it interesting? That podcast always sounds like some manager talks
ye because mostly george talks xd
Avatar
haven't figured it out yet
19:59
which assembly impl do you look at?
19:59
avx?
19:59
95'
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
Epyc
Avatar
@Ryozuki when do u give me a job at Intel or amd. Now that you are a famous compiler dev
Avatar
im not famous yet
20:02
but gimme 5 years
Avatar
Until then I am famous.. For ....... U know
Avatar
vulkan
20:03
@Jupstar ✪ become more pro at vulkan
20:03
write lot of blog posts
20:03
u rly should write bro
20:03
idk why ur not doing it yet
Avatar
True
Avatar
dont set too high bar for writing
20:04
because even if u think its trivial others may find it rly interesting
Avatar
I could write a blog about synchronization between render passes xd
Avatar
Ez
Avatar
Avatar
Jupstar ✪
I could write a blog about synchronization between render passes xd
i'll read anything you would write
20:05
just share the link kekw
Avatar
also do one about how rust helped u
Avatar
I start on mobile
Avatar
(and expect a blank check from rust-lang kek)
20:05
im joking
Avatar
Xd
20:07
justatest 1
20:07
game news lmao
Avatar
Avatar
Miguilim
Does someone know why the SnapIDPool has a timeout system?
can someone pls help me with this?
Avatar
Avatar
Learath2
Oh, I'm fairly confident it would as I don't see a way to avoid the write past end either
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) 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. For strncpy it knows the size and can do a similar method
20:19
Also it can provably recover overwritten values if it keeps it in the registers
Avatar
String processing is a common part of almost all programs found on FreeBSD. Even if strings are not at the core of an application, many ancillary tasks such as parsing options, dealing with configuration files, and generating log files involve string operations. String operations have a reputation for performing rather poorly. Instead of having an
20:30
This is interesting for you
20:30
I clearly have nothing better to so right now xdd
20:32
I wonder if their approach is really the fastest
20:32
Dynamically checking for nul as part of the SIMD process sounds slow
20:34
I should write the fastest strcpy using vk and make a blog post
Avatar
@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?
Avatar
how would it affect whole-program performance?
Avatar
Avatar
heinrich5991
how would it affect whole-program performance?
i dunno, if u dont allocate too much, probably quite few
21:01
i guess the allocation size isn't significant enough, ofc considering it's not the limiting factor but would be a funny experiment
21:01
but now that learath is a vulkan pro, he'll need to accept that wasting memory gets into a completely new class lol
21:02
the memory alignment requirements for some allocations are absurd
21:04
21:04
one example
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
aw man sad i really wanted that
Avatar
Avatar
Jupstar ✪
Click to see attachment 🖼️
oh wow 😮
Avatar
Avatar
Ryozuki
its about gpus
ah yeah, gpu programming is simpler but also harder bcs it's easier to not make it epicly fast it's indeed interesting how CPUs compare to GPUs
21:17
i should really learn vulkan compute
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
ah lol now that makes sense
21:20
but tbh RISC vs CISC is an endless debate
21:20
RISC processors than get extensions like SIMD opcodes to be faster
21:20
and some day they are so bloated with extensions that they are just CISC xd
21:20
the story of ARM
21:20
xdddd
21:24
@Chairn btw read the convo, you an expert on this stuff, teach us
21:25
@Peter0x44 who are u btw? renamed or new? i've only seen u recently
Avatar
Can you make vulkan write directly to /dev/fb0? @Jupstar ✪
Avatar
Avatar
Teero
Can you make vulkan write directly to /dev/fb0? @Jupstar ✪
i've no idea xdd
21:25
probably not
Avatar
just thinking running ddnet in tty
21:26
idk
Avatar
Avatar
Jupstar ✪
but tbh RISC vs CISC is an endless debate
VLIW!
Avatar
i mean u could copy stuff around
21:26
but natively forcing vk... u'd probably need to write your own vulkan surface extension
21:26
then maybe
Avatar
Avatar
Jupstar ✪
but tbh RISC vs CISC is an endless debate
is there really a distinction now? that there are the "micro ops" that all the instructions turned to
Avatar
Avatar
Jupstar ✪
@Peter0x44 who are u btw? renamed or new? i've only seen u recently
new
Avatar
Avatar
Peter0x44
is there really a distinction now? that there are the "micro ops" that all the instructions turned to
tbh i dunno. maybe u could say GPUs are still "real" RISC
Avatar
dafuq my rpi says it has no kernel but everything works fine?
21:30
what?
Avatar
kernels are so 21th century
21:31
welcome to 22
21:31
who needs those anyways
21:32
21:32
It boots just fine
21:33
fk. how do i exit vim on an american layout???
21:33
wheres the double colon
21:34
okay i got it
Avatar
Is it rasp 4?
21:35
little boi
Avatar
Does it have vk driver or does it suck
Avatar
i have no idea
Avatar
Zero sounds so powerless
21:36
I'd not buy a washing machine without vk support again
Avatar
you say its powerless but you can't even divide by it
Avatar
Ngl
Avatar
still haven't got compute shaders to work justatest
Avatar
Avatar
Teero
you say its powerless but you can't even divide by it
21:37
0/0 = infinity
21:37
nvm 0/0 is not a number
21:37
1/0 is inf
Avatar
Xddd
Avatar
i thought it would throw an error
21:37
🤷‍♂️
Avatar
Avatar
MilkeeyCat
i thought it would throw an error
Problem is
Avatar
Math != computer science in this case
21:38
0 doesn't really exist, so they assume an infinite small number
Avatar
based pyson
Avatar
And then it goes against inf
Avatar
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
21:39
gotta setup ssh first
21:39
brb
21:45
wait do i need a user?
Avatar
Avatar
MilkeeyCat
based pyson
try 1.0/0.0
21:45
integer is different
21:45
ZeroDivisionError: float division by zero
Avatar
pyson doesnt think so
Avatar
kek
21:45
sudo apt purge python
21:45
yes
21:46
do you really want to uninstall your whole system?
21:46
ah shit, here we go again
Avatar
Avatar
Teero
wait do i need a user?
well at least the root i guess? xd
Avatar
root is there but i can't login to root over ssh it seems
21:47
i created a user and it works
Avatar
Avatar
MilkeeyCat
pyson doesnt think so
>>> 1.0/0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: float division by zero not really bro, not really
21:48
😬
Avatar
who could have guessed xd
21:48
just use brüche
Avatar
>>> KeyboardInterrupt >>> KeyboardInterrupt >>> KeyboardInterrupt >>> KeyboardInterrupt >>> quit Use quit() or Ctrl-D (i.e. EOF) to exit LMAO
21:49
python elite
21:51
if user_arg == "quit" print message how to quit
21:51
nice special case`ing (edited)
Avatar
Avatar
Jupstar ✪
well at least the root i guess? xd
ah i forgot to edit the config. there is an option to enable root
22:09
wait does ddnet even run on arm?
22:09
should be cuz of android version right?
Avatar
Avatar
Teero
wait does ddnet even run on arm?
I think it does, just no builds are provided
Avatar
it does, but compile with -fsigned-char
Avatar
we should add that to our cmake xd
22:14
now that arm is more common
22:14
yea everyone plays ddnet on an rpi nowadays
Avatar
I meant arm cloud/vps
✅ 1
22:17
But RPI is better than the PC of some ppl here
Avatar
might well be for me (after I bricked my motherboard with a BIOS update)
Avatar
still angry about that
22:38
haven't had the willpower to fix it
Avatar
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
22:39
just putting an rpi zero w into my school calculator
22:39
imagine gpt on calculator xdd
Avatar
my current laptop is "indefinitely borrowed" from a school
22:40
nice
22:41
well actually not nice but.... (edited)
Avatar
apparently it wasn't getting used so it's nice
Avatar
Let me give you one last reason to use zero-terminated strings. They don't have a length limit
Avatar
Avatar
Learath2
Let me give you one last reason to use zero-terminated strings. They don't have a length limit
i was already convinced when you started typing
Avatar
Avatar
heinrich5991
avx?
./sysdeps/x86_64/multiarch/strcpy-sse2.S I looked at the sse2 one
Avatar
Avatar
Teero
i was already convinced when you started typing
Finally someone that takes me for my word
Avatar
Avatar
Learath2
Finally someone that takes me for my word
all plagiarized from the dictionary
Avatar
Avatar
Learath2
./sysdeps/x86_64/multiarch/strcpy-sse2.S I looked at the sse2 one
fwiw I only looked to spot the presence of 2 loops and I couldn't spot 2 loops
Avatar
Avatar
Learath2
Let me give you one last reason to use zero-terminated strings. They don't have a length limit
I think in practice the compilers do have an object size limitation of PTRDIFF_MAX
23:03
and I guess if you used a 64 bit unsigned for the length the max length would be your whole address space anyway (not that it would work)
23:04
though probably a joke
Avatar
Avatar
Peter0x44
I think in practice the compilers do have an object size limitation of PTRDIFF_MAX
ackshully, since zero terminated strings are just a single pointer, their object size is just the size of a pointer
Avatar
the memory backing the string is an object, I wasn't talking about the pointer itself
Avatar
does ddnet have a function to rotate text?
Avatar
Avatar
Peter0x44
the memory backing the string is an object, I wasn't talking about the pointer itself
For a C string literal under clang and gcc it maybe matters, but any portion of memory that ends in a \0 is technically free game. e.g. strlens implementation knows nothing about the object size limits
Avatar
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91397 I've had gcc give me a related bogus warning with wording: exceeds maximum object size 9223372036854775807 (which is PTRDIFF_MAX)
23:10
but if anyone has the 9 million TB of memory please give me some
Avatar
Avatar
Jupstar ✪
@Chairn btw read the convo, you an expert on this stuff, teach us
uh, this seems to be too long for the time i have 😢
Avatar
waiting 20mins already for xorg to finish installing.......
23:31
15€ rpi do be slow
Avatar
hmm
23:52
color picker is kind of jank
23:53
Exported 895 message(s)