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-05-23 00:00:00Z and 2024-05-24 00:00:00Z
Avatar
ws-client BOT 2024-05-23 00:18:23Z
<ChillerDragon> the translations are a bit cursed tho :D
00:18
<ChillerDragon> but ye its super simple and light weight to self host
Avatar
ws-client BOT 2024-05-23 00:29:22Z
<ChillerDragon> @heinrich5991 i mean every feature I wanted is working now. But i still dont like the developer expirience. Now I have to annotate every function defintion and call with a #ifdef thingy
00:32
<ChillerDragon> I mean big ass functions with 10k lines are fun and then you only have to do that thing once. But I started to enjoy using more functions these days and then this would be unusabily bad to type.
00:33
<ChillerDragon> there has to be a way to find a function in an shared object that is also already defined in the main executable
01:00
<ChillerDragon> so this works ....
01:00
<ChillerDragon> but even i am scared of those macros
01:02
<ChillerDragon> I could replace function names in the final binary using some hexediting step at the end of the cmake pipeline xd
01:03
<ChillerDragon> that should work too. And then writing the code feels super smooht. No macros.
Avatar
What are you even making?
Avatar
Avatar
ws-client
<ChillerDragon> there has to be a way to find a function in an shared object that is also already defined in the main executable
With ifuncs anything is possible
Avatar
ws-client BOT 2024-05-23 02:30:55Z
<ChillerDragon> watafak is ifuncs
02:31
<ChillerDragon> i tried messing with linker scripts to rename my functions but that was no fun :(
02:32
<ChillerDragon> What i am working on is my developer expirience. I want to control tees on the server side. Like let them walk left or right. And those controls should be written in C. And i want them to get applied on compile without server reload.
02:32
<ChillerDragon> it all works now but only if i have all function names twice. because fakin dlsym does not look in my shared object if they are also statically linked into the server executable already
Avatar
ws-client BOT 2024-05-23 03:59:15Z
<ChillerDragon> Hmm interesting i managed to get dlsym work as i wanted it to. But outside of ddnet https://github.com/ChillerDragon/CompileTests/tree/6cb5015eeb0df128510c8c186491f6629816b800 but this one has all the features i want. Not sure how the ddnet code base is different from that. I mean ddnets cmakelists is huge who knowns which flags break rdynamic
Contribute to ChillerDragon/CompileTests development by creating an account on GitHub.
Avatar
@Bota Thank you!
Avatar
2eba913 Add 100 € donation by Bota - def-
❤️ 3
Avatar
Avatar
deen
@Bota Thank you!
🙃
Avatar
morning
Avatar
Avatar
Ryozuki
morning
🚂
Avatar
c755844 Use shfmt as formatter for shell scripts - ChillerDragon 60fb406 Merge pull request #8310 from ChillerDragon/pr_shfmt - heinrich5991
06:49

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssan...
Avatar
morning
Avatar
Avatar
Ryozuki
morning
Morning Windows enjoyers and others
Avatar
Im a Windown Addict monkalaugh
Avatar
@Ryozuki its my Birthday, am i now officially older than you? I forgot
❤️ 3
Avatar
Avatar
meloƞ
@Ryozuki its my Birthday, am i now officially older than you? I forgot
Happy Birthday! 🎂🎉🎁🎈🎊
Avatar
ws-client BOT 2024-05-23 08:20:14Z
<JStar> morning may kids and others
08:20
<JStar> @melon happy birthday. may kids are best, i also got older this month sadness
08:20
<JStar> i am sadly much older than you
Avatar
Overview I would like to propose a patchset that allows LLVM to be built for WebAssembly/WASI (this includes WASIp1 and WASIp2). I am interested in this functionality for the YoWASP project, and it will be immediately useful for the Amaranth HDL as well as Spade HDL communities, with obvious other applications for projects such as Compiler Explo...
Avatar
Avatar
meloƞ
@Ryozuki its my Birthday, am i now officially older than you? I forgot
mine is on 29th
Avatar
ws-client BOT 2024-05-23 08:46:32Z
<JStar> @Ryozuki +rep
Avatar
why u chat on irc now
08:47
btw llvm on wasm can be pog
08:47
better godbolt, rust wasm compiler, etc
Avatar
ws-client BOT 2024-05-23 08:47:38Z
<JStar> i always forget to refresh my login on mobile xd
08:48
<JStar> i cant access the pw from my mobile lmao
Avatar
and u can compile wasm on wasm host
Avatar
ws-client BOT 2024-05-23 08:48:16Z
<JStar> yeah would be funny
08:48
<JStar> wasm-ception
Avatar
Good morning, does anyone know, if the ddnet client has true command line arguments? I want to start the client in the editor directly with a map, something like ddnet-client --map something.map
Avatar
ws-client BOT 2024-05-23 08:56:46Z
<JStar> ./DDNet "mymap.map" should work or not?
Avatar
does it? If so thank you 👍
Avatar
Avatar
meloƞ
@Ryozuki its my Birthday, am i now officially older than you? I forgot
HBD Melon senpai 🎉
Avatar
My favourite type of website. Just error_generic and not_valid doesn't say what the generic error is nor what is not valid on the form
13:07
Submitting the form again with no change immediately worked
13:10
Which actually didn't work, but added my tax code to the db so now I can't try again as it shows me as registered but I didn't even finish registering
Avatar
thanks software
Avatar
but atleast the website looks cool with react and implemented using a flux pattern for state consistency
13:13
turns out if you don't think out your logic properly, no amount of fancy patterns will save you
Avatar
Avatar
heinrich5991
(ask about the community status for the fokkonaut server)
thanks a lot
Avatar
I'm really enjoying the builtin testing framework in golang. It's just so easy to use, no thinking about what to use, how to configure it
13:49
Just put tests in a file with suffix _test.go and name the functions with prefix Test, it even has builtin coverage, so you can just add -cover and it'll calculate coverage too while testing
13:50
Also builtin support for benchmarks, and not the stupid kind, it modifies the iteration count until the result is statistically significant like hyperfine
13:51
Parallel testing is also something you don't have to think about at all, if the test can run in parallel to others you just call t.Parallel()
Avatar
rust also has this kind of test support 🙂
Avatar
Avatar
Learath2
My favourite type of website. Just error_generic and not_valid doesn't say what the generic error is nor what is not valid on the form
Is this Esperanto?
Avatar
no built-in test coverage though
Avatar
ws-client BOT 2024-05-23 13:52:52Z
<ChillerDragon> @AssassinTee ye the editor can open demo files and map names when you provide it as argument. It looks at the file extension. But breaks on spaces because it could also be a console command xd
Avatar
Rust was also quite enjoyable after C++ tbf 😄
Avatar
ws-client BOT 2024-05-23 13:53:14Z
<ChillerDragon> ./DDNet "my map.map" runs the console command "my" and passes "map.map" as argument.
13:53
c++ tuples
13:53
xdd
13:53
they cant add syntax sugar right
13:54
its so ugly
Avatar
Mh, tuples are the least offensive part of modern C++ to me
Avatar
ws-client BOT 2024-05-23 13:55:17Z
<ChillerDragon> @Jupstar ✪ having an insecure password for chat.zillyhuhn.com is so pog! makes it such an accessible chat platform.
Avatar
Especially not tie. Look at how they interact with std::get though
Avatar
sum types are annoying in C++
13:57
and go, I assume
Avatar
Yeah not the most enjoyable things, in go for sum types you have to forgo type safety
14:00
well mostly, sometimes you can get away with an interface that atleast keeps some information
14:03
rust sum types are its power
14:03
ADT
Avatar
Your best bet in C++ would be a tagged union or a std::variant, both have huge downsides as you know
Avatar
ws-client BOT 2024-05-23 14:11:09Z
<JStar> @ChillerDragon true xDDD, i mean it's super secure, ngl
Avatar
How to reset the running time in the server code?
14:44
Von Neumann's First Computer Program
14:45
A third precaution: The notation used in this paper differs considerably from that used by von Neumann, so that modern readers can more easily understand what he did. Where he would write, for instance, 15) c -}- (m' -- 1)(p ~- 1) ~-~ 14 [ p ~- 2, we will use an equivalent assembly-like language form, MOVEIN PIK p~- 1, BUFFER, [YPTR].
14:45
xd
Avatar
Avatar
TheNofis
How to reset the running time in the server code?
ƤØŢĀŤ0Co 2024-05-23 14:47:48Z
Isn't it in sql db?
Avatar
Avatar
Ryozuki
_invoke_trampoline: # rdi <- fn_ptr: extern "C" fn() # rsi <- args_ptr: *const u64 # rdx <- args_len: usize # rcx <- ret_ptr: &mut [u64; 2] push rbp # Push rbp (callee-saved). push rcx # Push rcx (ret_ptr). mov rbp, rsp # Store the current stack pointer. sub rsp, 8 # Align the stack. mov r10, rdi # We'll need rdi. mov r11, rsi # We'll need rsi. cmp rdx, 6 # Check if there are more than 6 arguments. jbe 2f # If there are less than 6, skip to register arguments. # # Process stack arguments. # # Add padding to support an odd number of stack parameters. mov rax, rdx and rax, 1 lea rsp, [rsp + 8 * rax] 1: dec rdx # Decrement length. mov rax, [r11 + 8 * rdx] # Load the value. push rax # Push it into the stack. cmp rdx, 6 # Check if there are more than 6 arguments. ja 1b # If there still are, loop back and repeat. 2: # # Process registers. # shl rdx, 2 # Multiply remaining length by 4. lea rax, [rip + 3f] # Load the PC-relative address of `3f`. sub rax, rdx # Subtract 4 * remaining_len (rdx). jmp rax # Jump to the resulting address. mov r9, [r11 + 0x28] # Load argument #6. mov r8, [r11 + 0x20] # Load argument #5. mov rcx, [r11 + 0x18] # Load argument #4. mov rdx, [r11 + 0x10] # Load argument #3. mov rsi, [r11 + 0x08] # Load argument #2. nop # Note: The previous 5 `mov` instructions use 4 bytes each, but # the last one only takes 3. This `nop` (1 byte) is used to # align them all at 4 bytes so that the last jump instruction # works correctly. mov rdi, [r11] # Load argument #1. 3: # Call the function. call r10 mov rsp, rbp pop rcx pop rbp # Store return registers. mov [rcx], rax mov [rcx + 8], rdx ret this is like our trampoline method to call a function with X amount of arguments
I have question, do you have a limitation on what can be passed to C? You don't seem to handle any of the complexity that comes from passing mixed class parameters
Avatar
can you give a example of mixed class parameters
Avatar
e.g. argument 1 is MEMORY class and argument 2 is INTEGER class
Avatar
Avatar
ws-client
<ChillerDragon> ./DDNet "my map.map" runs the console command "my" and passes "map.map" as argument.
Works for me on Windows, e.g. with DDNet "data/maps/Sunny Side Up.map"
Avatar
argument 1 should end up on stack, argument 2 should end up in rdi
Avatar
interesting. so if 1 is a large struct, then the first integer parameter will be in rdi?
Avatar
Avatar
heinrich5991
interesting. so if 1 is a large struct, then the first integer parameter will be in rdi?
Yes, larger than 8 eightbytes to be exact for amd64 sysv
14:55
Floats also break this btw, those need to go to xmm0 thru xmm7
Avatar
we have no floats
14:55
i guess yeah we have a limitation
Avatar
class SSE to be more exact
Avatar
some stuff is passed by allocating it on the heap
14:58
i think thats a way to avoid the complexity xd
Avatar
This way of passing basically only works as long as everything belongs to class integer
Avatar
yeah you could say the arguments that would be memory class are passed as a pointer
Avatar
So only pointers to aggregates
Avatar
Also be very careful with ints with bitsize larger than 64
Avatar
pub fn push_aligned(&mut self, align: usize, mut values: &[u64]) { assert!(align.is_power_of_two()); assert!(align <= 16); #[cfg(target_arch = "x86_64")] const NUM_REGISTER_ARGS: usize = 6; #[cfg(target_arch = "aarch64")] const NUM_REGISTER_ARGS: usize = 8; if align == 16 { // This works because on both aarch64 and x86_64 the stack is already aligned to // 16 bytes when the trampoline starts pushing values. // Whenever a value spans across multiple registers, if it's in a position where it would be split between // registers and the stack it must be padded so that the entire value is stored within the stack. if self.invoke_data.len() >= NUM_REGISTER_ARGS { if self.invoke_data.len() & 1 != 0 { self.invoke_data.push(0); } } else if self.invoke_data.len() + 1 >= NUM_REGISTER_ARGS { self.invoke_data.push(0); } else { let new_len = self.invoke_data.len() + values.len(); if new_len >= NUM_REGISTER_ARGS && new_len % 2 != 0 { let chunk; (chunk, values) = if values.len() >= 4 { values.split_at(4) } else { (values, [].as_slice()) }; self.invoke_data.extend(chunk); self.invoke_data.push(0); } } } self.invoke_data.extend(values); }
Avatar
Avatar
TheNofis
How to reset the running time in the server code?
you can access the time with m_Score on the player class. It's an std::optional so you can reset it with .reset() method. That may be wrong but at least it's what I did :p. It wont delete the time in the db though. You could also just delete the times directly in the db if you don't want them ig.
Avatar
Avatar
Ryozuki
pub fn push_aligned(&mut self, align: usize, mut values: &[u64]) { assert!(align.is_power_of_two()); assert!(align <= 16); #[cfg(target_arch = "x86_64")] const NUM_REGISTER_ARGS: usize = 6; #[cfg(target_arch = "aarch64")] const NUM_REGISTER_ARGS: usize = 8; if align == 16 { // This works because on both aarch64 and x86_64 the stack is already aligned to // 16 bytes when the trampoline starts pushing values. // Whenever a value spans across multiple registers, if it's in a position where it would be split between // registers and the stack it must be padded so that the entire value is stored within the stack. if self.invoke_data.len() >= NUM_REGISTER_ARGS { if self.invoke_data.len() & 1 != 0 { self.invoke_data.push(0); } } else if self.invoke_data.len() + 1 >= NUM_REGISTER_ARGS { self.invoke_data.push(0); } else { let new_len = self.invoke_data.len() + values.len(); if new_len >= NUM_REGISTER_ARGS && new_len % 2 != 0 { let chunk; (chunk, values) = if values.len() >= 4 { values.split_at(4) } else { (values, [].as_slice()) }; self.invoke_data.extend(chunk); self.invoke_data.push(0); } } } self.invoke_data.extend(values); }
I would honestly just ban anything larger than a register and only special case i128 if you need those
Avatar
thats what we do tbh
15:01
the align 16 if branch is for u128 mainly
Avatar
Avatar
Learath2
Yes, larger than 8 eightbytes to be exact for amd64 sysv
a 64-byte struct is passed via registers?
15:02
do you mean larger than 2 eightbytes?
Avatar
Avatar
heinrich5991
a 64-byte struct is passed via registers?
Unless I'm forgetting something, it should end up in registers
15:04
Let me check again
Avatar
Avatar
Devinci
you can access the time with m_Score on the player class. It's an std::optional so you can reset it with .reset() method. That may be wrong but at least it's what I did :p. It wont delete the time in the db though. You could also just delete the times directly in the db if you don't want them ig.
Is there any way to get the time of the race?
Avatar
Avatar
heinrich5991
do you mean larger than 2 eightbytes?
Oh yeah, I forgot about the cleanup step, yes it's 2
Avatar
Avatar
ws-client
<ChillerDragon> ./DDNet "my map.map" runs the console command "my" and passes "map.map" as argument.
Thank you for the explanation! I have never seen it anywhere. I plan to integrate a button in the software I am currently creating, where you can start the ddnet client as check method
Avatar
Avatar
AssassinTee
Thank you for the explanation! I have never seen it anywhere. I plan to integrate a button in the software I am currently creating, where you can start the ddnet client as check method
Depends on your shell/OS I guess, it works on Windows with paths containing spaces. This is basically what happens when you double-click a .map file in the windows explorer. (edited)
Avatar
oh, the map suffix has other meanings, this doesn't work on my windows machine xD
Avatar
Avatar
AssassinTee
oh, the map suffix has other meanings, this doesn't work on my windows machine xD
DDNet client should change the default editor though, unless you changed it back ^^
Avatar
tested this, it asks me now which software I want to use
18:05
ddnet ist the first choice
Avatar
Avatar
AssassinTee
tested this, it asks me now which software I want to use
yeah, that's Windows default behavior since 10, the user always needs to confirm the choice
Avatar
this has some nice implications, if you work on a map and want to start the editor quick, just link the map
Avatar
hello everyone! I wanted to clarify why it says "the server has not responded yet" on most of my servers
Avatar
bcs u are from ukraine and want to connect to russian servers (edited)
troll 1
Avatar
thank you!
Avatar
yo jupjopjapstar
Avatar
yo
Avatar
jopjapjupstar
Avatar
clever
Avatar
chillerdragon is chillentano
Avatar
Avatar
Jupstar ✪
bcs u are from ukraine and want to connect to russian servers (edited)
Oooooooh I'm Russian
Avatar
Avatar
данёк
Oooooooh I'm Russian
ok then russia seems to block traffic to outside of russia now
Avatar
my English is bad
Avatar
at least for your ISP
Avatar
Avatar
данёк
Oooooooh I'm Russian
which servers are inaccessible
18:14
ips or names
18:14
how are you jupstar
Avatar
Avatar
zhn
which servers are inaccessible
all servers are from ddnet
Avatar
Avatar
zhn
how are you jupstar
i'm fine, how are you zohan the best moderator that is 100% still moderator?
Avatar
Avatar
данёк
all servers are from ddnet
are you sure?
Avatar
Avatar
данёк
all servers are from ddnet
even RUS servers?
Avatar
Avatar
Jupstar ✪
i'm fine, how are you zohan the best moderator that is 100% still moderator?
justatest
18:15
i have an access to all ddnet servers fifo but sshhh
Avatar
Avatar
Jupstar ✪
even RUS servers?
Yes
Avatar
Avatar
данёк
Yes
mhh, u can try to restart your router
18:16
has it ever worked for you?
18:16
or are you a new player?
Avatar
Avatar
Jupstar ✪
mhh, u can try to restart your router
I've already done it
Avatar
you can try a vpn
18:16
then you know if it's related to this issue
Avatar
Avatar
AssassinTee
you can try a vpn
I do not know how to download vpn on pc😅
Avatar
I don't know of you'll get "sanctioned" if you try to do that
Avatar
because of the VPN?
Avatar
Avatar
данёк
I do not know how to download vpn on pc😅
can you try to ping any server from your pc?
Avatar
Avatar
zhn
can you try to ping any server from your pc?
And how is it?
Avatar
Avatar
данёк
And how is it?
press win+R and write cmd.exe
18:20
press enter and write "ping <ip_of_any_ddnet_server_here>" in console
18:20
and press enter one more time
Avatar
shouldn't also the domain work? master1.ddnet.org?
18:20
or something like that
Avatar
i mean he sees the servers, so server list works
18:21
maybe UDP is blocked
Avatar
Avatar
zhn
press enter and write "ping <ip_of_any_ddnet_server_here>" in console
issues
Avatar
Avatar
Jupstar ✪
bcs u are from ukraine and want to connect to russian servers (edited)
jupsti was right
Avatar
@Learath2 do u think its possible to do the assembly i gave u in C without inline asm?
Avatar
Avatar
Ryozuki
@Learath2 do u think its possible to do the assembly i gave u in C without inline asm?
The trampoline thing? Surely it should be possible
19:19
(With the restrictions we talked about)
19:25
Actually no, what I was thinking of doesn't quite work
Avatar
remember it has a arbitrary num of args
19:27
i would like to see it in pure c or rust
Avatar
I was thinking __builtin_apply but it's just too weak
Avatar
Btw something like libffi already has this stuff properly implemented if you’d like to take a look there
Avatar
(in assembly ofc, that’s the only proper way to do it, I was thinking of a way to trick the compiler into generating the assembly for you, which didn’t quite pan out)
Avatar
do the arguments are all the same size or can they be of different types ?
Avatar
Avatar
Chairn
do the arguments are all the same size or can they be of different types ?
He constrained it to the situation where we only have to handle amd64 sysv abi with only INTEGER class arguments
19:59
Well aarch64 too but I think if you can get C or Rust code to generate correct assembly for one the other should also be free anyway
Avatar
then just a function with first parameter as int, then varargs should work
Avatar
Oh, you also start with just a pointer to the function, a pointer to an array of the args and the amount of args
20:04
the trampoline builds the call
Avatar
There is a very jank way to do it, a switch statement over the arg count, and each branch has a call with 0 thru MAX_ARGCOUNT arguments 😄
20:10
It won’t optimize properly at all I bet
Avatar
See commit messages. Follow-up for #8334. SDK 19 is the lowest API level support by SDL2 because it is the lowest API level supported by the latest NDK toolchain. According to https://www.composables.com/tools/distribution-chart this should cover virtually all Android devices.

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 b...
Exported 193 message(s)