Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2023-05-29 00:00:00Z and 2023-05-30 00:00:00Z
Avatar
扬州一手高防服务器 有需要的可以加 2885230098
07:42
江苏扬州一手高防服务器 有需要的加qq2885230098
Avatar
number of chinese ppl that read this: 0 xd
Avatar
wut
07:45
we got aliens in the chat rn
Avatar
ChillerDragon BOT 2023-05-29 07:46:11Z
uhm sos xd
07:46
i may have run chown -R root:admin / on my production vps :justatest: and now ssh just hangs what could i have broken? xd i still have a open ssh connection but if i loose that the server has to be nuked
Avatar
why root:admin
07:48
did u create that group? xd
Avatar
用我家的服务器啊 高速稳定
Avatar
ws-client BOT 2023-05-29 07:49:14Z
<ChillerDragon> yes xd
Avatar
i guess as a start make it root:root again? xd
Avatar
ws-client BOT 2023-05-29 07:49:40Z
<ChillerDragon> doubt thatll fix it
Avatar
rip
Avatar
ws-client BOT 2023-05-29 07:49:50Z
<ChillerDragon> i assume i wiped some stuff that was owned by the ssh user or something like that
07:50
<ChillerDragon> in the hindsight it was a reckless move xd
Avatar
did u try to reinstall all packages
Avatar
ChillerDragon BOT 2023-05-29 08:00:02Z
i am not sure if i want to reinstall ssh if thats the only thing keeping me alive
Avatar
no risk no fun
Avatar
ChillerDragon BOT 2023-05-29 08:03:15Z
oh boi
08:03
i tried to backup my data but everything went to shit xd
08:03
dns is dead
08:03
ping cant even access the socket etc xd
08:03
feels like rm -rf
Avatar
rip to your vps
Avatar
ChillerDragon BOT 2023-05-29 08:04:24Z
and its data as it seems
Avatar
but hard to do a diagnosis
Avatar
ChillerDragon BOT 2023-05-29 08:04:37Z
i just need to restore all default debian permissions
08:04
"just"
Avatar
chmod 777 -R / 😂 😂 😂
Avatar
ChillerDragon BOT 2023-05-29 08:05:35Z
e
08:05
bro
Avatar
yeah yeah jk, u r fckd
Avatar
ChillerDragon BOT 2023-05-29 08:07:16Z
ok seems like i learn a bit more about the linux file system today :)
08:07
i gotta repair at least until i can ssh again and backup my data
Avatar
compress everything in your working shell, then type the binary compressed data by hand
Avatar
ChillerDragon BOT 2023-05-29 08:07:56Z
ez
08:08
i can also ctrl+c the base64 encoded binary data
Avatar
do u have no network access at all?
Avatar
ChillerDragon BOT 2023-05-29 08:08:23Z
yes
08:08
i mean kinda
08:08
my ssh is fully functional but onbly the one that is open
08:08
my tw server is running fine i think
Avatar
and that has internet access?
Avatar
ChillerDragon BOT 2023-05-29 08:08:49Z
idk actually
08:08
i cant ping or do git push
08:09
fun CTF
08:09
if it wouldnt be my vps at risk xd
08:09
i can see my unstable internet dieing any moment and then im out
08:10
i need a backdoor xd
Avatar
the question is if internet doesnt work at all
Avatar
ChillerDragon BOT 2023-05-29 08:10:18Z
idk
Avatar
wget
Avatar
ChillerDragon BOT 2023-05-29 08:10:29Z
i dont have dns i think
Avatar
do by IP directly
Avatar
ChillerDragon BOT 2023-05-29 08:10:46Z
works
08:11
maybe i can scp to my other vps
Avatar
well then u can probably at least upload all data somewhere
Avatar
ChillerDragon BOT 2023-05-29 08:11:12Z
i wanna git push -,-
08:11
fakin scp
08:11
gimme sec i linux pro ima fix all perms
Avatar
Avatar
Jupstar ✪
githubs cross linking is still the must stupid thing (edited)
I like it when I see what other project's issues are related to my project's issues. what do you not like about it?
Avatar
Avatar
heinrich5991
I like it when I see what other project's issues are related to my project's issues. what do you not like about it?
i think it should be one sided only. but we already had this discussion. Why should an unrelated project be able to annoy my project
08:19
see e.g. how chillerdragon abused it
08:21
50% of the issue is not related to the project
08:22
if they want it, they could at least make it more decent
Avatar
Avatar
deen
I do get annoyed about Rust being relatively immature still. Lots of necessary features are still in discussion, so a bit annoying to build some important software on top of it
it doesn't really seem that way to me, haven't encountered a necessary but not existent feature in quite some time, I think
Avatar
heinrich wheres ur map archive, i keep forgetting the site
Avatar
Avatar
Jupstar ✪
number of chinese ppl that read this: 0 xd
server seller
Avatar
ChillerDragon BOT 2023-05-29 08:29:46Z
heirncihde maps
Avatar
ChillerDragon BOT 2023-05-29 08:30:30Z
trol
Avatar
Avatar
TsFreddie
server seller
and did he convince you? xd
Avatar
It's interesting that the guy didn't spam the irc channel
Avatar
as the only chinese here
Avatar
Server resellers usually gets a lot more annoying
08:31
He didn't say anything other than he has some lmao (edited)
Avatar
lmao it broke my phone browser
Avatar
yeah use firefox with that site
08:33
its usually a bit faster, tho chrome seems to have fixed it on desktop
Avatar
They did say they have ddos protection which is exactly what we are trying to avoid
Avatar
i remember like 2 years ago it was unuseable 😄
Avatar
So no, he didn't convince me at all
Avatar
Avatar
Jupstar ✪
yeah use firefox with that site
firefox on phone?
Avatar
Avatar
cyberFighter
firefox on phone?
yeah
08:40
if u got iphone u screwed tho xd
08:40
it only allows safari backend
Avatar
ChillerDragon BOT 2023-05-29 08:50:08Z
pog pog i fixed git
Avatar
Avatar
Jupstar ✪
if u got iphone u screwed tho xd
bro an iphone has better performance than my laptop
08:57
i absolutely dont have one
Avatar
Avatar
cyberFighter
bro an iphone has better performance than my laptop
that's not my point ^^
Avatar
apple disallows browers to have their own backends
08:57
they all use safari
Avatar
apple sux
Avatar
if u use chrome, u use safari xD
Avatar
ws-client BOT 2023-05-29 08:58:38Z
<ChillerDragon> Can someone leak the :feelsbadman: texture?
Avatar
oops
08:59
well firefox works good
09:00
rip my mobile data though lmfao
Avatar
you probably need to scale it down
Avatar
does anyone remember ctf_epic
Avatar
Avatar
heinrich5991
it doesn't really seem that way to me, haven't encountered a necessary but not existent feature in quite some time, I think
I wanted to build Rust dependencies as shared libs and not rebuild them each time. For unit tests wanted a test harness that is implicitly run before each test
Avatar
Avatar
cyberFighter
does anyone remember ctf_epic
09:02
this?
Avatar
yeah
Avatar
i'm unsure but maybe i have seen it before
Avatar
i remember seeing ctf maps like that in those weird ctf with levels mods
Avatar
Avatar
deen
I wanted to build Rust dependencies as shared libs and not rebuild them each time. For unit tests wanted a test harness that is implicitly run before each test
the shared lib thing is actually not there, yea :/
Avatar
Avatar
deen
I wanted to build Rust dependencies as shared libs and not rebuild them each time. For unit tests wanted a test harness that is implicitly run before each test
the other thing is possible, you can define your own #[test] attribute that does what you want
Avatar
static linking is master race
Avatar
useful feature?
Avatar
Avatar
Robyt3
useful feature?
no, but still epic
09:06
xdd
Avatar
Avatar
heinrich5991
the other thing is possible, you can define your own #[test] attribute that does what you want
A crate providing a replacement #[[macro@test]] attribute that initializes logging and/or tracing infrastructure before running tests.
Avatar
Avatar
Robyt3
useful feature?
if u pr it make sure it has a high move tollerance before moving. i often move while clicking and hate apps that are too sensitive when dragging ^^
Avatar
it starts moving after dragging for more than 5 pixels (2d distance)
09:09
behaves similar to Windows I'd say
Avatar
ws-client BOT 2023-05-29 09:12:09Z
<chilerdr> thanks @Mr.Gh0s7
Avatar
btw I have yet to upload my dotfiles :/
09:13
I came across a strange error and can't push to the dwm repo >:(
09:17
(to my dwm repo xD)
Avatar
Avatar
heinrich5991
Still requires touching every one of the thousands of files containing a test though, right?
Avatar
Avatar
deen
Still requires touching every one of the thousands of files containing a test though, right?
yes, once
Avatar
Avatar
Jupstar ✪
static linking is master race
true, this made me remember seeing a gentoo staff calling static linking a bug
Avatar
Avatar
Robyt3
useful feature?
yeah, if something interesting happens bottom left
Avatar
today im older
🎂 3
10:22
justatest
10:23
Avatar
happy birthday 🎂
10:24
technically, you're getting older every day though 🙂
Avatar
ws-client BOT 2023-05-29 10:26:10Z
<ChillerDragon> e wot i reinstalled my vps and dns is still working am i losing it?
Avatar
ChillerDragon BOT 2023-05-29 10:32:30Z
!help
Avatar
chillerbot1 BOT 2023-05-29 10:32:30Z
https://github.com/ChillerDragon/ddnet-bot-irc eth0=172.17.0.2 commands: !mods, !ping, !p (hex traffixc), !sh (bash)
irc bot for ddnet#developer. Contribute to ChillerDragon/ddnet-ircbot development by creating an account on GitHub.
Avatar
ChillerDragon BOT 2023-05-29 10:32:32Z
!ip
10:32
!ipaddr
10:32
fk
10:32
a there it is xd
10:33
omg its wrong xd
Avatar
Basically tiles that move around. Example on KoG: https://youtu.be/T7vi2BsjcuY?t=276 CC #6228
10:46
Same as for the envelope editor. Extract RenderExtraEditorDragBar function to reduce duplicate code. Fix height being changed by repeated clicking on the draggable element by also resetting s_Operation when Clicked is true.

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
-...
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
happy bday happy
Avatar
Allow dragging the demo player controls anywhere on the screen. The controls can't be moved outside of the screen. Round corners are automatically disabled when the controls are on the edge of the screen. https://github.com/ddnet/ddnet/assets/23437060/72510c1f-4fd2-426b-a631-3a78db5f7b8b

Checklist

  • [X] Tested the change ingame
  • [X] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (e...
11:24
a634044 Fix ordering of unfinished/unconnected tees - Learath2 6c7f6a4 Merge #6665 - bors[bot]
Avatar
guys, why i cant watch demo while im playing on server?
12:20
its bad, need to fix
Avatar
the whole client is simply not build for it just open a second client
12:22
this isnt really an easy fix
Avatar
sad
Avatar
Avatar
Smetanolub
guys, why i cant watch demo while im playing on server?
are you playing an a server or watching a demo?
Avatar
im playing on server, and i want to watch demo without disconnect
Avatar
just open a second client
Avatar
it's a crutch
12:52
i didnt ask how, i asked for new feature
yungsballswow 4
Avatar
it is a feature: simply open a second client troll
santatrollet 2
Avatar
Avatar
Robyt3
useful feature?
Just when I want my custom button's position to move with the mouse's velocity, you do this afterwards and it makes me both happy and mad kek
Avatar
Avatar
MilkeeyCat
happy bday happy
thanks
13:41
brownbear
Avatar
happy ddbirthday
Avatar
i think it's regular birthday
14:08
ddbirthday is on 02/01/2015
Avatar
may kids are the best
Avatar
at least, you never have to worry about your age
14:10
born on 2000
Avatar
but he'll never be able to have lived in 3 centuries
14:10
except he gets 200 years old xD
Avatar
cant wait to be an old sack
Avatar
ez
Avatar
Avatar
Chairn
born on 2000
i know
14:11
2023 = 23
14:12
@Jupstar ✪ there is big drama in rust rn
Avatar
i love drama
14:12
here
Avatar
Avatar
Jupstar ✪
but he'll never be able to have lived in 3 centuries
technically, he was born on 20th century 🙂
Avatar
Unfortunately we have witnessed another example of how the folks involved in the Rust project allow a culture of “back channels” and “out groups”. The people involved in the highest level of leadership do not self-police in a productive fashion.
>
Why are people associated with The Rust Project’s leadership always so opaque about who is responsible? Why are we always hearing about one “individual” acting without the permission of “leadership”?
>
In order to have actual accountability of people’s actions, which JT suggests is the root of the sickness we are witnessing in the leadership teams you need to have courage to stand up to others. We need to condemn the actions of those who act outside their station. You need to have the courage to name and shame when required. In this case, the individual who messaged @rabidferret claiming to represent the consensus of the project should be ejected from their position of power. That is what accountability entails - consequences. I urge those still involved to stand up for what Rust is supposed to be about: openness, inclusivity, and respect.
Avatar
Avatar
Ryozuki
Unfortunately we have witnessed another example of how the folks involved in the Rust project allow a culture of “back channels” and “out groups”. The people involved in the highest level of leadership do not self-police in a productive fashion.
>
Why are people associated with The Rust Project’s leadership always so opaque about who is responsible? Why are we always hearing about one “individual” acting without the permission of “leadership”?
>
In order to have actual accountability of people’s actions, which JT suggests is the root of the sickness we are witnessing in the leadership teams you need to have courage to stand up to others. We need to condemn the actions of those who act outside their station. You need to have the courage to name and shame when required. In this case, the individual who messaged @rabidferret claiming to represent the consensus of the project should be ejected from their position of power. That is what accountability entails - consequences. I urge those still involved to stand up for what Rust is supposed to be about: openness, inclusivity, and respect.
is there a summary somewhere
14:15
i dont understand this 😄
Avatar
Avatar
Jupstar ✪
i dont understand this 😄
no
14:17
but its mainly "back channels" on leadership
14:18
@Jupstar ✪ read the links in order i sent them
Avatar
well what is back channels in this context 😄
14:18
i read it, but its confusing af
Avatar
also the talk itself is interesting
14:20
compile time reflection
Avatar
i wait for a video 😂
14:21
someones heart got broken
14:21
bcs of some leadership
14:21
thats all i understand
Avatar
Avatar
Jupstar ✪
i wait for a video 😂
wait for the tik toks
Avatar
1. council invites P as keynote speaker for RustConf
14:31
2. some council member A ask RustConf admin B to decline P 3. admin B accepts to decline P 4. P doesn't understand and feels like he was mistreated (which is the case from what i've read). He makes a blog post about it 5. A realizes he's been duped and leaves Rust council 6. Drama ensures
Avatar
But why in first place decline. do they hate each others xd
Avatar
Fixes #6644 by sending switch state for team 0 on sv_solo_server 1 to match the team of the clients own character, and by not predicting other characters/entities when in solo.

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 boun...
Avatar
where can i programm a bot for ddnet?(not for hacking) (edited)
banhammer 5
Avatar
Avatar
Jupstar ✪
But why in first place decline. do they hate each others xd
feels like, the invited guy was from the C comitee
Avatar
lmao
Avatar
Avatar
Adil
where can i programm a bot for ddnet?(not for hacking) (edited)
for educational purposes?
Avatar
for educating the pros kek
Avatar
Avatar
MilkeeyCat
for educational purposes?
yes
14:43
my friend wanted to know
Avatar
Avatar
Adil
yes
in ddnet jail
Avatar
is sth like that not allowed?
Avatar
obviously not
Avatar
Avatar
Adil
is sth like that not allowed?
what do you think of when you imagine a bot and not for hacking (edited)
Avatar
Hey guys, do you know if I can bind vote to a key somehow?
Avatar
wait maybe we misunderstood. Is it a bot that plays the game or or like a discord bot for ddnet?
Avatar
Avatar
MilkeeyCat
what do you think of when you imagine a bot and not for hacking (edited)
like a bot that when someone moves me from a spot then it moves back there alone
Avatar
bind "<key>" "vote <yes|no>"
Avatar
Avatar
Kondensator
Hey guys, do you know if I can bind vote to a key somehow?
bind <key> callvote option <name of vote>
14:46
2023-05-29 17:45:54 I chatresp: Invalid arguments... Usage: vote r['yes'|'no'] 2023-05-29 17:46:20 I chatresp: Invalid arguments... Usage: callvote s['kick'|'spectate'|'option'] s[id|option text] ?r[reason]
Avatar
thanks, will see if that works
14:48
huh, this must have been added recently (I mean the usage help)
Avatar
Avatar
gerdoe
2023-05-29 17:45:54 I chatresp: Invalid arguments... Usage: vote r['yes'|'no'] 2023-05-29 17:46:20 I chatresp: Invalid arguments... Usage: callvote s['kick'|'spectate'|'option'] s[id|option text] ?r[reason]
works on my machine. (eg bind f3 vote yes)
Avatar
the question is, how do I get vote option text if it uses some weird characters
Avatar
Avatar
Kondensator
huh, this must have been added recently (I mean the usage help)
hm, no(?)
Avatar
Avatar
Kondensator
the question is, how do I get vote option text if it uses some weird characters
call it and copy from f1
14:50
2023-05-29 17:50:33 I chat: *** '<~{Barsik}~>' called vote to change server option 'Scorelimit 100' (No reason given)
Avatar
alright, thanks
14:54
Well, the vote I want to call with a bind does not print out anything in the console :/
Avatar
Avatar
Kondensator
Well, the vote I want to call with a bind does not print out anything in the console :/
You're trying to bind a vote so that it calls that vote on a buttonpress? What's the vote that you're trying to call?
15:31
Actually it doesn't even say critical, what could one write in a blogpost about reflection that is controversial even?
Avatar
@Learath2 when is const_cast used?
Avatar
Preferably never, it's just a patch for a lack of language features
Avatar
Block *make_Block(const OpBuilder &builder, Region *region) { return const_cast<OpBuilder &>(builder).createBlock(region); } i cant call createBlock without it here
Avatar
Can't you take a non-const reference to it to begin with?
Avatar
i wonder
15:38
i use this with cxx
15:38
well i jsut started toying with it
15:39
a bridge with rust
Avatar
Because if you cast away const and it is actually const it's UB
Avatar
(the c api lacks features)
Avatar
const_cast is only for non-const correct apis to be able to be called
Avatar
Avatar
Learath2
Because if you cast away const and it is actually const it's UB
"and the function you call actually modifies the value" is more correct I guess
15:41
(when you know an object isn't const is also fine, but that's not the case I was trying to illustrate)
Avatar
what if the type is behind a unique ptr
15:43
i tried to make it non const but i think it fails
Avatar
Oh I remember a good example, strchr(). It takes and returns a char * but you can safely use it on a const char * instead
Avatar
Avatar
Ryozuki
i tried to make it non const but i think it fails
Hm, is this generated code or sth?
15:45
e.g. what calls make_Block? Why can't it pass a non-const reference?
Avatar
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-arch" "arm64" "-I" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/include" "-I" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/crate" "-Wall" "-Wextra" "-std=c++17" "-I/opt/homebrew/opt/llvm@16/include" "-Wno-unused-parameter" "-o" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/a900a5298c52b4bf-bridge.rs.o" "-c" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/sources/mlircpp/src/bridge.rs.cc" cargo:warning=/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/sources/mlircpp/src/bridge.rs.cc:483:36: error: cannot initialize a variable of type '::std::unique_ptr< ::OpBuilder> (*)(const ::MLIRContext &)' (aka 'unique_ptr<mlir::OpBuilder> (*)(const mlir::MLIRContext &)') with an lvalue of type 'std::unique_ptr<OpBuilder> (mlir::MLIRContext &)': type mismatch at 1st parameter ('const ::MLIRContext &' (aka 'const mlir::MLIRContext &') vs 'mlir::MLIRContext &') cargo:warning= ::std::unique_ptr<::OpBuilder> (*make_OpBuilder$)(::MLIRContext const &) = ::make_OpBuilder; cargo:warning= ^ ~~~~~~~~~~~~~~~~ cargo:warning=1 error generated. exit status: 1 source: std::unique_ptr<MLIRContext> make_MLIRContext(); std::unique_ptr<OpBuilder> make_OpBuilder(MLIRContext &); std::unique_ptr<MLIRContext> make_MLIRContext() { mlir::DialectRegistry registry; mlir::registerAllDialects(registry); return std::make_unique<MLIRContext>(registry); } std::unique_ptr<OpBuilder> make_OpBuilder(MLIRContext &context) { return std::make_unique<OpBuilder>(&context); }
15:46
it works if context is const
15:46
std::unique_ptr<OpBuilder> make_OpBuilder(const MLIRContext &context) { return std::make_unique<OpBuilder>(const_cast<MLIRContext *>(&context)); }`
15:46
@Learath2
15:47
#[test] fn myfunc() { let c = make_MLIRContext(); let op = make_OpBuilder(&c); }
15:47
xd
Avatar
Ah so it is generated
15:47
i can define how it is generated
15:47
i can remove the const
15:47
but idk i get a error xd
15:48
oh wait
Avatar
Okay, I think the context needs to be passed non-const too
Avatar
maybe i did smth bad
Avatar
idk why it's getting the const, or where it's getting the const
Avatar
error: cannot initialize a variable of type '::std::unique_ptr< ::OpBuilder> (*)(const ::MLIRContext &)' (aka 'unique_ptr<mlir::OpBuilder> (*)(const mlir::MLIRContext &)') with an lvalue of type 'std::unique_ptr<OpBuilder> (mlir::MLIRContext &)': type mismatch at 1st parameter ('const ::MLIRContext &' (aka 'const mlir::MLIRContext &') vs 'mlir::MLIRContext &')
15:50
i removed all consts i found lol
15:50
maybe llvm constructor of opbuilder requires a const ref to context?
Avatar
Well let me take a look
Avatar
/// Create a builder with the given context. explicit OpBuilder(MLIRContext *ctx, Listener *listener = nullptr) : Builder(ctx), listener(listener) {}`
15:50
doesnt see so
15:51
does make_unique require const
15:51
xd
Avatar
idk how the translation layer handle these but why isn't your make_OpBuilder taking a std::unique_ptr?
Avatar
because i didnt make it so
15:52
i can make it so
15:52
let me see
Avatar
Ohh, I see what's going on here
15:53
You can't get a non-const ptr out of a unique_ptr
Avatar
chillerdragon:
Avatar
Otherwise you could destroy the object, but unique_ptr is supposed to be managing it
Avatar
@Learath2
Avatar
so the const thing is good?
Avatar
This is how you get it out
Avatar
my coworker made this before
15:54
xd
Avatar
I think in this case I would have OpBuilder take the context and release it before passing it to llbm
15:55
llvm*
15:55
So move out of c I guess?
15:55
Idk how rust maps to c++
Avatar
we need to keep context
15:55
we own it
Avatar
Avatar
Learath2
Idk how rust maps to c++
im using the cxx crate
Avatar
If you need to access it later I guess a shared_ptr/Arc is called for
Avatar
what we use in ddnet
15:56
but say
15:56
i have a unique ptr of context
15:56
cant i just pass a ref of context to a function
15:56
why do i need to pass the unique ptr itself
Avatar
Hm, actually now that I re-read this section I think you should be able to get a normal pointer too
16:01
Yeah, idk, is it maybe the &c in the rust code generating this? I don't understand why it's trying to generate a ::std::unique_ptr< ::OpBuilder> (*)(const ::MLIRContext &)
Avatar
pub fn make_MLIRContext() -> ::cxx::UniquePtr<MLIRContext>
16:02
on rust i have to define the function too
16:02
i have it like
16:02
fn make_OpBuilder(context: &MLIRContext) -> UniquePtr<OpBuilder>;
Avatar
Can you check the generated code btw?
Avatar
Avatar
Ryozuki
error: cannot initialize a variable of type '::std::unique_ptr< ::OpBuilder> (*)(const ::MLIRContext &)' (aka 'unique_ptr<mlir::OpBuilder> (*)(const mlir::MLIRContext &)') with an lvalue of type 'std::unique_ptr<OpBuilder> (mlir::MLIRContext &)': type mismatch at 1st parameter ('const ::MLIRContext &' (aka 'const mlir::MLIRContext &') vs 'mlir::MLIRContext &')
it'd be interesting to see around this error
Avatar
::OpBuilder *cxxbridge1$make_OpBuilder(::MLIRContext const &context) noexcept { ::std::unique_ptr<::OpBuilder> (*make_OpBuilder$)(::MLIRContext const &) = ::make_OpBuilder; return make_OpBuilder$(context).release(); }`
16:03
lol
16:04
::MLIRContext *cxxbridge1$make_MLIRContext() noexcept { ::std::unique_ptr<::MLIRContext> (*make_MLIRContext$)() = ::make_MLIRContext; return make_MLIRContext$().release(); }
Avatar
Avatar
Ryozuki
::OpBuilder *cxxbridge1$make_OpBuilder(::MLIRContext const &context) noexcept { ::std::unique_ptr<::OpBuilder> (*make_OpBuilder$)(::MLIRContext const &) = ::make_OpBuilder; return make_OpBuilder$(context).release(); }`
bizarre bizarre bizarre, that const there is obviously the reason for your issue, Opbuilder wants a non-const reference as per LLVM docs
16:05
Also this generated code does look a little insane, why is it creating a unique_ptr only to destroy it the next line?
Avatar
it does it on all
16:06
hmm
16:06
must be some c++ quirk with rust?
16:06
im sure dtolnay knows his shit xd
Avatar
Avatar
Ryozuki
im sure dtolnay knows his shit xd
Yeah, I'd think I'm holding it wrong before I question cxx
Avatar
let me see what we do i nddnet
Avatar
Avatar
Ryozuki
::MLIRContext *cxxbridge1$make_MLIRContext() noexcept { ::std::unique_ptr<::MLIRContext> (*make_MLIRContext$)() = ::make_MLIRContext; return make_MLIRContext$().release(); }
Ah I think I get it. It calls your function, then destroys the unique_ptr immediately because now Rust took ownership
Avatar
Now when you borrow from the context that seems to generate a const. Idk why that is the case
Avatar
maybe because a rust & ref is const?
Avatar
its immutable
Avatar
well maybe const_cast isnt as bad here?
16:13
xd
Avatar
Do you have type MLIRContext somewhere?
16:14
I mean the const cast is technically safe here, since you know for a fact that the underlying object wasnt declared const. But why is it happening in the first place? Is that not the more curious thing?
16:15
type MLIRContext;
Avatar
Avatar
Learath2
I mean the const cast is technically safe here, since you know for a fact that the underlying object wasnt declared const. But why is it happening in the first place? Is that not the more curious thing?
i wonder
Avatar
Now that I think about it. I think this type of relationship just isn't a thing Rust really has
16:16
OH maybe try a mutable borrow?
16:17
It is technically wrong, since I have a feeling OpBuilder keeps a reference to Context, but there might not be a better way to map this
Avatar
error[cxxbridge]: needs a cxx::ExternType impl in order to be used as a non-pinned mutable reference in signature of `make_OpBuilder` ┌─ src/bridge.rs:12:9 │ 12 │ type MLIRContext; │ ^^^^^^^^^^^^^^^^ needs a cxx::ExternType impl in order to be used as a non-pinned mutable reference in signature of `make_OpBuilder` error[cxxbridge]: mutable reference to C++ type requires a pin -- use Pin<&mut MLIRContext> ┌─ src/bridge.rs:24:36 │ 24 │ fn make_OpBuilder(context: &mut MLIRContext) -> UniquePtr<OpBuilder>; │ ^^^^^^^^^^^^^^^^ mutable reference to C++ type requires a pin -- use Pin<&mut MLIRContext>
Avatar
this is more complicated than expected
16:19
xd
Avatar
I guess you just impl ExternType and it should work? Idk I never used the cxx bridge
Avatar
didnt follow, but why not pass a pointer?
16:22
u want a unique ptr out of a reference?
16:22
or do u want it to be copied?
Avatar
it seems like cxx always adds const
16:23
it also does for a *const
Avatar
Avatar
Jupstar ✪
didnt follow, but why not pass a pointer?
Issue is constness, the c++ api requires a non-const pointer. The bridge generates const pointers
Avatar
the externtype manual impl is if u use bindgen iirc
Avatar
what's so bad about const pointers
16:24
pointers are just ints 😂
Avatar
its not that
16:24
it requires to use const_cast
16:24
everywhere
Avatar
It can't possibly add a const if you are passing a mutable borrow
Avatar
Avatar
Ryozuki
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-arch" "arm64" "-I" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/include" "-I" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/crate" "-Wall" "-Wextra" "-std=c++17" "-I/opt/homebrew/opt/llvm@16/include" "-Wno-unused-parameter" "-o" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/a900a5298c52b4bf-bridge.rs.o" "-c" "/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/sources/mlircpp/src/bridge.rs.cc" cargo:warning=/Users/edgar/Documents/mlircpp/target/debug/build/mlircpp-7a862e997e3d30d5/out/cxxbridge/sources/mlircpp/src/bridge.rs.cc:483:36: error: cannot initialize a variable of type '::std::unique_ptr< ::OpBuilder> (*)(const ::MLIRContext &)' (aka 'unique_ptr<mlir::OpBuilder> (*)(const mlir::MLIRContext &)') with an lvalue of type 'std::unique_ptr<OpBuilder> (mlir::MLIRContext &)': type mismatch at 1st parameter ('const ::MLIRContext &' (aka 'const mlir::MLIRContext &') vs 'mlir::MLIRContext &') cargo:warning= ::std::unique_ptr<::OpBuilder> (*make_OpBuilder$)(::MLIRContext const &) = ::make_OpBuilder; cargo:warning= ^ ~~~~~~~~~~~~~~~~ cargo:warning=1 error generated. exit status: 1 source: std::unique_ptr<MLIRContext> make_MLIRContext(); std::unique_ptr<OpBuilder> make_OpBuilder(MLIRContext &); std::unique_ptr<MLIRContext> make_MLIRContext() { mlir::DialectRegistry registry; mlir::registerAllDialects(registry); return std::make_unique<MLIRContext>(registry); } std::unique_ptr<OpBuilder> make_OpBuilder(MLIRContext &context) { return std::make_unique<OpBuilder>(&context); }
the source: is the source u want to use?
Avatar
u build a unique ptr out of a reference
Avatar
but u do it
Avatar
it calls opbuilder constructor
Avatar
Idk maybe pin it just to see if it generates properly?
Avatar
so does opbuild have nothing to do with the context directly?
Avatar
ok ill see the pin
Avatar
it's only there to be called
Avatar
opbuilder uses context in the constructor
Avatar
i mean in the sense of rust, Pin probably makes sense here
16:27
references in cpp are not reassignable
Avatar
works with pin
Avatar
Technically. I think since OpBuilder probably keeps that pointer, to do it properly you need lifetimes too
16:28
I doubt OpBuilder outliving it's context is sane
Avatar
doesnt cxx require unsafe anyway
Avatar
UniquePtr even has a pin_mut method
Avatar
But anyway, so it was indeed the immutable borrow that's the issue. I wonder why the pin is needed
Avatar
#[test] fn myfunc() { let mut c = make_MLIRContext(); let op = make_OpBuilder(c.pin_mut()); }
16:29
works
16:29
no const anymore
Avatar
Does the generated code look sane?
Avatar
Avatar
Learath2
I doubt OpBuilder outliving it's context is sane
yeah thats true
16:30
its smth i gotta express in rust
16:30
opbuilder is "owned" by the context
16:30
::OpBuilder *cxxbridge1$make_OpBuilder(::MLIRContext &context) noexcept { ::std::unique_ptr<::OpBuilder> (*make_OpBuilder$)(::MLIRContext &) = ::make_OpBuilder; return make_OpBuilder$(context).release(); }
16:30
looks like this
16:31
so ye
Avatar
do u need this for work?
Avatar
Avatar
Ryozuki
its smth i gotta express in rust
That link I sent had an example of lifetimes
16:34
I guess the idea is that you give a lifetime to that mut borrow. But there is a potential issue there. There can't exist more than one borrow if there is a hanging mut borrow
16:35
So is the context even usable until you destroy the opbuilder than?
16:36
Maybe an Arc/SharedPtr is the better abstraction for MLIRContext
16:38
Rc, I guess, A part may not be necessary here
Avatar
every rc and arc means a refcell, mutex etc.
16:39
except its read only
16:39
@Ryozuki what are the goals of your work? do u need a high performance compiler?
16:40
or just get things done? xd
Avatar
They model shared ownership is my point
Avatar
yeah, but that also means more "randomness"
16:40
in a sense that u cannot control it cleanly anymore
Avatar
Yeah, if you don't care about correctness and just want it done I guess this current model is good enough as long as you make sure you don't ever drop context before the opbuilder
Avatar
a shared object might suddenly outlife something u didnt expect or wanted
Avatar
tbh idk
16:41
but we need to make the compiler with mlir
16:41
and we use the c api which is simple
16:41
but it lacks features
16:41
for example we cannot get the data layout for a given type
Avatar
because the c api doesnt have it
16:41
so we are going to cpp now
Avatar
ryo just does smth random
Avatar
Btw, didn't anyone else already wrap the C++ api for llvm?
Avatar
@Jupstar ✪ i do what i do to get paid lel
16:42
@Learath2 no
16:42
thats insane
16:42
inkwell wraps the c api
16:42
of llvm
16:42
but the c api of llvm is better
16:42
mlir is quite new, so they focus on c++
Avatar
@Ryozuki u have freetime.... waste it for wrapping llvm
Avatar
the c api is behind
Avatar
:^)
Avatar
Well good luck. I need to take a shower and do some chores
Avatar
yeah its fine dw
Avatar
Look into making MLIRContext a shared_ptr. I think that is the correct model here
Avatar
i was mostly curious
Avatar
Avatar
Jupstar ✪
@Ryozuki u have freetime.... waste it for wrapping llvm
It's a New Kind of Wrapper for Exposing LLVM (Safely) - GitHub - TheDan64/inkwell: It's a New Kind of Wrapper for Exposing LLVM (Safely)
Avatar
anyway this convo was interesting
16:49
mixing 2 langs gives light to interesting things
16:50
@Jupstar ✪ why make a binding, we just need to rewrite llvm in rust
16:50
BASEDDEPT
16:50
PES2_BasedGe
Avatar
tru story
Avatar
Avatar
Learath2
Look into making MLIRContext a shared_ptr. I think that is the correct model here
well idk, because this mlircontext will be wrapped in a context struct, that can be the single owner
17:02
and then with lifetimes we can model the opbuilder lifetime
17:02
opbuilder needn't have the pointer itself
17:02
needn't, such pro english
Avatar
Avatar
Ryozuki
and then with lifetimes we can model the opbuilder lifetime
idk how the opbuilder is used, so I can't comment very much on this, but when you create the opbuilder and return from it you have your MLIRContext back, but on the C++ side a non-const reference to it is kept, now when you borrow mut or non-mut from the context, aren't you breaking rust assumptions?
17:10
Specifically that there can exist no mut borrows along with immut ones and no more than one mut borrow?
Avatar
the context has no methods itself
17:10
the underlying principle of the context is that it is used to provide an isolated environment (or “context”, hence the name), in which your entire IR is living. This includes types, attributes, location, dialect, identifiers, and every operation that references these.
17:11
ok it has methods
17:11
but
17:11
honestly i wonder
17:11
xd
Avatar
I don't see how methods are relevant, but the more I think about it the less I think there is a sane way to wrap context in Rust
Avatar
Create a builder with the given context.
Avatar
multiple mut borrows isn't a thing Rust can do
Avatar
i wonder how other safe wrappers are done
Avatar
Avatar
Learath2
idk how the opbuilder is used, so I can't comment very much on this, but when you create the opbuilder and return from it you have your MLIRContext back, but on the C++ side a non-const reference to it is kept, now when you borrow mut or non-mut from the context, aren't you breaking rust assumptions?
it is possible
17:14
in rust u would do that with interior mutability
17:14
aka runtime checks
17:14
rc refcell
17:15
If you have a reference &T, then normally in Rust the compiler performs optimizations based on the knowledge that &T points to immutable data. Mutating that data, for example through an alias or by transmuting an &T into an &mut T, is considered undefined behavior. UnsafeCell<T> opts-out of the immutability guarantee for &T: a shared reference &UnsafeCell<T> may point to data that is being mutated. This is called “interior mutability”.
Avatar
Ah, that's cool
Avatar
but well, u dont rly own the context on the rust side, just a unique ptr
17:16
no?
Avatar
You do own it, I think that's what the wrapper implies. It immediately destroys the unique_ptr
17:17
It seems to imply that the ownership moved from the std::unique_ptr on the cxx side to the UniquePtr on the rust side
Avatar
don't explode pls
Avatar
i think i only need to care about opbuilder outliving the context tbh
17:24
idk head exploding
Avatar
I would love to be of more help but I possess limited knowledge of both the cxx crate and LLVM 😄
17:26
but this is a common pattern in the c/c++ world
17:26
holding a context
17:26
sdl does this, but it has a single global context
17:26
sdl init exit
Avatar
Yeah maybe check out another wrapper where there is context involved? Curl has lots of mutable contexts passing around
17:27
Though curl I think does it in a controlled manner, as in they don't stack them inside eachother 😄
17:28
Oh, curl_multi might be a good place to check if anyone wrapped that one
Avatar
i mean llvm only has 1 context u pass around
Avatar
A curl_multi handle keeps non-const pointers to curl_easy handles, and you can still use the handles so you also have non-const ones
Avatar
Rust bindings to libcurl. Contribute to alexcrichton/curl-rust development by creating an account on GitHub.
17:29
its c tho
Avatar
Here is the interesting part I guess
17:37
Okay, it just cheats to avoid the problem by using a *mut CURL
17:38
dereferencing that requires an unsafe so if you break anything it's your own fault I presume 😄
17:40
ye thats how i guessed
Avatar
Minimum SDL version 2.0.16 is required for SDL_FlashWindow. The SDL version schema changes after version 2.0.22 to 2.24.0 etc. (minor version is used instead of patchlevel) which was causing the condition that checks for minimum version 2.0.16 to not work correctly with newer SDL versions. Closes #6687.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Writ...
Avatar
Avatar
Ryozuki
ye thats how i guessed
So I guess you should probably wrap the Opbuilder in a struct and shove a PhantomData<MLIRContext> next to it?
17:51
thats what we do in the c api binding too
17:51
and its how its done generally imo
17:52
pub struct Operation<'c> { raw: MlirOperation, _context: PhantomData<&'c Context>, } the c api
Avatar
Sounds sane, I guess you just have to make sure you treat the type opaquely on the rust side and there'll be no issues
Avatar
d0333f1 Fix flashing window not working with newer SDL versions - Robyt3 b8b4eef Merge #6688 - bors[bot]
Avatar
This sounds quite fun to work with, maybe I should wrap a couple c++ libraries for people
18:18
Maybe I can also have stars on my repos
Avatar
Avatar
Mr.Gh0s7
ah yes that was the procudure i did take but I was writting off memoery in the above msg. sry if any confusion
I finally managed to push it :). I runned git config http.version HTTP/1.1 and now it worked! Could this have any side effects though?
Avatar
Avatar
ws-client
<ChillerDragon> or riot
ChillerDragon https://github.com/Inateblig/dotfiles it only took a second justatest
Avatar
Avatar
Mr.Gh0s7
I finally managed to push it :). I runned git config http.version HTTP/1.1 and now it worked! Could this have any side effects though?
Huh, why was that needed? Bizarre
Avatar
I don't know either I hope it doesn't break anything though. I just tried stuff with care and the start and then starting expirementing with other stuff here's the stackoverflow link btw https://stackoverflow.com/questions/59282476/error-rpc-failed-curl-92-http-2-stream-0-was-not-closed-cleanly-protocol-erro
Avatar
installed the game over steam and this happend lol
Avatar
new dance feature
Avatar
hehe and whats the fix
Avatar
Avatar
five
hehe and whats the fix
update drivers
19:38
or click the other start option
19:38
if that start option is finally fixed
Avatar
@heinrich5991 Teeskins website is down and I have no idea if NeXus will come back to re-open it, so I'll already do preparations for Teeworlds Data. So might as well change the forum links for Teeskins to "unavailable currently" or something.
19:52
I also have no idea if the API works, if it pulls the repo's Assets or not, so that might also need a check.
Avatar
what happened to him :/
Avatar
I have no idea. I cannot contact him and he is not up since the beginning of this year
Avatar
rip
Avatar
Indeed
Avatar
Avatar
Jupstar ✪
or click the other start option
where
Avatar
Avatar
five
where
does it show u when u start it from steam?
19:58
what OS are u even on
Avatar
chillerdragon BOT 2023-05-29 20:59:25Z
Thanks (@Mr.Gh0s7)
ChillerDragon https://github.com/Inateblig/dotfiles it only took a second [:justatest: https://mau.lu/hkjgy- ] (<@749222324980416602_ws-client>)
21:08
db6b050 Add missing change to version 16.8 changelog - Robyt3 b66c60f Merge pull request #259 from Robyt3/Changelog-Missing-Change - def-
Avatar
anyone know clang-tidy well enough to tell me if i can use it to add the parent enum's name as a prefix to the enum constants
21:13
enum TEST { ONE, TWO }; turns into enum TEST { // automatically put test in front of constant names TEST_ONE, TEST_TWO }; (edited)
21:13
etc
Avatar
i don't know for clang-tidy, but it's easy with a macro
21:23
okay, not that easy actually
21:23
but still possible
Avatar
a090ba8 Don't predict other players in solo - trml ed89ba5 Send team 0 for switchers as well on solo server - trml eb63cb3 Merge #6686 - bors[bot]
Avatar
hey when are moving tiles coming to ddnet? is there a reason to not do it?
Avatar
it would be hard to do right
Avatar
but it would be accepted?
Avatar
atm the way kog does it is not on the game layer so it doesn’t work in entities
22:00
ppl would really hate that in ddrace
Avatar
Avatar
Ewan
atm the way kog does it is not on the game layer so it doesn’t work in entities
ye ik thats why it would be cool to have the ddnet client support moving tiles on game layers
22:00
its pretty annoying since its only serverside on kog
Avatar
that's not how that works
22:01
it's just not predicted by the client
Avatar
it's still rendered fine
22:02
thats what i said
Avatar
its not that easy to add both server side and client side i suppose
22:02
not that one-day task
Avatar
cant wait for a troll level with moving blocks
Avatar
there will perhaps be some questions about how to implement it. will it be possible to switch them on/off? will the tile move the player around when standing on it? and what if the player get stuck between a moving and a solid tile (or two moving tiles), should the player remain stuck or glitch out of it somehow?
Avatar
Avatar
Voxel
cant wait for a troll level with moving blocks
single-pixel onetilers justatest
Avatar
it means entities will use envelopes too kekw
Avatar
Avatar
Teero
single-pixel onetilers justatest
getting squished into the cieling:
Avatar
Avatar
Voxel
getting squished into the cieling:
instant death
Avatar
i dont think thats even coded in lol
Avatar
let mapper choose lol
22:06
imagine being able to teleport tee body if its stuck
Avatar
>teleports it to finish
Avatar
hey jao
22:06
chillerdragon:
Avatar
you scared him off!!
22:09
as for the squshing ig
Avatar
imagine every skin squashed
Avatar
Avatar
gerdoe
imagine every skin squashed
xD that would be fun!
Avatar
Avatar
Teero
Click to see attachment 🖼️
hydraulic press
Avatar
Avatar
Teero
hey when are moving tiles coming to ddnet? is there a reason to not do it?
No reason not to, we were offered to be shown the code KoG has, but I don't think they intend to go open source anytime soon, so they'll either have to extract the moving tiles part or show someone they trust that has time to implement it the code. Overall a lot of moving parts that just haven't aligned yet, that's all
Avatar
Ah ok cool
Avatar
Kog has a server download you can use to test it. In theory it would not be hard to test all possible interactions from that
Exported 560 message(s)