#programming
1 messages ยท Page 196 of 1
there
can we calc while the other side makes their move or no
ok there's still a problem
for will refer to the original for after macro expansion

tho other macros wont be able to use it anymore
๐
it was such a good idea
would allow nested macro loops
without shadowing vars
nope
you need thi
#define concat_inner(a, b) a##b
#define concat(...) concat_inner(__VA_ARGS__)
#define for_(l) for_v(concat(i, __COUNTER__), l)
i dont know why it needs a second degree of separation
macro machinery
single threaded
wow
any parallel processing banned
i will be abusing simd then!!

shhhh
for_(10)
expand to
for(int i0=0;i0<10;i0++)
but expand to
for(int i__COUNTER__=0;i__COUNTER__<10;i__COUNTER__++)
if i use concat_inner instead of concat
do we keep things we calculated in the past?
you can, yes
incredible
you do have a ram limit
what is the mem limit
tentatively like 4GB
if you crash every game you're in, you will probably lose the tournament
lets put it that way
specific languages allowed but under the right conditions im willing to officialize supplied bindings to the chess api
currently C (C++ probably too?) and python supported
there's people working on or planning to work on C# and rust support tho
incredible
credit to them
i don't even know if i will be able to l1 optimize this with so few tokens
yea my code is barely under the limit with 189 lines
idea
the piece constants are currently 1 through 6
so I think I can just
int value = 0;
for (int j = 1; j < 7; j++) {
value |= chess_get_bitboard(color, j);
if (value & moveto) break;
}
because
by pure coincidence
the piece constants are roughly sorted by value
alr
are you plugging all these answers into an LLM or something
oh I see you're coding already

unfortunately not
also i think gpt is kinda too stupid to be of use in a token limited context
because it probably doesn't understand that you can make everything jank to save space
you were just going silent for a bit between questions so I wondered if you were actually just shuttling messages between myself and an LLM
๐
anyways
back to the mines of vscode
neuro neuro you can call me neuro

--> 
<--
wow instead of writing ts from the ground up, i am going to cut things from an existing bot until i can make it fit
then i will add more heuristics
Hmmm
ideally this goes without saying but
using anything outside the stdlib is also not allowed
aside from the provided chess api

gdb
its probably a concurrency issue
nah i found it
stupid bug
i set some variables = 0 outside of a loop instead of inside
this is so frustrating
my bot is just allergic to capturing pieces somehow
why
everyday i thank god im not majoring in cs
nor am i
Shiro is soo intelligent

i am so confused
my bot keeps losing to the random one
how is this possible
like it just refuses to capture
re-fuses
why
Bugs I have done myself, maybe related: > vs >= and unsigned vs signed comparisons
profiling time
wondering why the lavalamp app is 150mb
someone extracts it to see
110mb of fonts
why do i only check whose turn it is once
im playing like 200 moves in the loop that starts immediately after
this could be the breakthrough
it was not the breakthrough
i dont even know how this happens
i dont think i saw it take a single piece except when it was in check
ok i think i actually
have something backwards in the code
it's playing too perfectly badly
was it also like that pre-minification?
i think its actually optimizing for the opponent's score
yes
but like
it's playing optimally badly
i think thats why its losing to random
like
its taking no pieces unless in check
and most of its moves place pieces on attacked squares

its actually impressive from a point of view
i think the backpropogation is prob just inverted
ok im doing another game
but this time im watching
i want to see if my bot makes a single capture
gm sam!
Token info ?
my chess bot is under 1024 tokens 
hi canvas chat has turned to nn but worse so i'm seeking refuge here. in other news i finally got git correctly set up in my new bazzite setup
Do u have idea to add chat in chess?
no probably not lol
git 
โ
i made something stupid
Round per volume
๐
Auto clicker
Crank the lever meme but the music slowly fades in.
-# Man my brain is tired if it is thinking in memes
This is creativity
welcome to /r/baduibattles
you'd fit right in
The crank window now explodes when overcranked beyond 100
and then another window pops up where you have to replace the crank with a spare one by dragging it to the volume crank window
does it do it with sound?
yep
plays the loudest explosion.mp3
since its also at 100%
for full immersion 
hell yeah
@tender river
i put a - on the backpropogation function
just to see what wouldhappen
it's playing the best damn chess ive ever seen
it actually was optimizing for worst play

isn't not taking a piece an illigal move btw?
why would it be?
this would make the start of the game rather challenging
OH
it finally clicked
the reason why my backpropogation is reversed
the moves coming out of the root node of my tree are mine
but that means the position they're coming from is the opponent's
i actually want max losses not wins i guess
such a me-coded story
trying to maximize wins, maximizes loses instead
im so proud
all this work wasnt for nothing
my bot now plays a really mean, really aggressive chess
Congrats! 
i have a stupid suggestion to make if you dont mind
what about a negative ELO rating chess bot
a bot that loses as much as possible is hard because it's solving the exact same problem as a bot that wins as much as possible, just for the other player
like its an identical problem
like calculating the fastest way to get their own piece checkmated
yes
that involves figuring out the fastest way for the opponent to checkmate you
which is what every chess bot tries to do, but for themselves
its the same thing 
but no one's done it before no?
i just did accidentally
shiro did
wait fr 
i was missing a minus in my code

oopies
i was wondering why it was so bad
i think i need to adjust my bot's time budget
it's burning through too much time in the early game
there's actually two ways to win a regular chess game
- checkmate
- waste your opponents time by making them stressed out and anxious from random and stupid moves
if you flip the board and only your pieces land standing, you win
the time is so tight
idk how to improve my performance too much
time management hard
time management so hard I'm afraid i'm losing my job to it 
how do I explain to people that I cant do coding non stop without looking at some "epic wombat facts" or whatever
then sitting here trying to estimate how much time I actually wasn't looking at wikipedia
You place a small rubber duck on the board and unleash chaos on the board.
my bot is definitely better than random now
makes a lot of questionable moves but
progress
i think the future for this bot is finding a way to reduce the tree width
if i can optimistically trim branches early that would help a lot
i mean, i do put thought into stuff like that
explaining why you like certain things is interesting
I just picked a color first time I was asked and stuck with it
i dont
i just like what i like
i can associate reasons of it that i thought up afterward
but i definitely didnt come to like things like my favourite colour for particular reasons
such is true with my favourite number
once day i just decided it was my favourite
never changed my mind about it so i guess i was right
bwaa


i wont
yeah I kinda dont get that
lemme vibe code this
how can you like a color
i view it more favorably than other colours i guess
I just like blue
you offer me a choice between two colours
I pick the blue one
whether that's because it's my favourite, or whether that's why it's my favourite, is a valid question though
if I had to pick a color I would select a random one
which is kinda how I landed with red
#cba6f7 
that better not be
???
its my banner color too xdx
-# (what were you thinking
)
https://colornames.org/search/
throw cd2edb in here
that's what I thought yours was at first
๐ฅ
THATS CRAZY
Amazing color
i dont get it
forwarding that to gen brb
Forgot to like the name
huh
there's a feature I wanna implement into my bot
I was considering it a while ago but figured I wouldn't have the tokens
currently the tree it builds is discarded and rebuilt each turn
follow your dreams and deadlines
but ideally it re-roots it to the traversed move sequence
ooh easy perf win
yup yup
I can reuse parts of the tree I've already explored
with how it's coded, the move I make will be the most explored move in the tree
just stick a global var in there 
so it should be a significant speedup
well it's not that easy
the trouble is that even if I know what move I made from the last tree, I don't know what move the opponent made
there's no feature to get that info so I would have to work backwards to figure it out myself
you probably can make the board drom those moves
I think I take the hash of the current board, undo the last move on the board, get legal moves of that and see which move produces the hash I want
yesh
but I only have 23 tokens to add all of that and the reroot code
so I'm not sure it fits
FUCK!!!!
was probably the stupid fractal pattern of search stages that i gave colorful function names to
i do wonder if there's a better way to do that
But arena app gives full list of moves from the game every turn?
With opponent's move being last
And i think it also restarts the bot every turn so you cant remember last move calculations. Maybe this one is wrong i cant remember how i got this info
not like it really needs that
Yeah i thought its strange
But i tried to check something with global variable being changed and the next move it got reset. So i assumed it goes like that.
Iirc
Maybe there are some settings in the arena app for this
that's mean
wait so then i don't need a while loop running the thing, and only need a main function that runs once?
It has to be checked
it's so close
If im right then yes but it will make it inconvenient to debug cause you'll have to restart it every time
Not like wrapping it all in while costs a lot of tokens but
yeah only saved me like 4
If its like that then it can save some
Have you tried hooking your bot to the arena?
Does it work like that?
nope
this code hasn't run once
Ooh
i don't think it'll need much reworking once i do start troubleshooting it, but i'm sure it'll need some
You'll also need to process commands from the app, if we are using UCE
Or maybe shiro will allow us to do it "outside of the token limited area"
disables inlining
does inlining via const propagation
thanks gcc
I'm trying to figure out if stuff crashes if you cast a function into a function that has more parameters
it shouldn't, probably, right?
no clue
Code seem good
Asm lol
at worst this should just waste some stack space, but it should cleanup after
I feel like it must crash
same
well yeah that's why I'm trying to test it
need to lookup if that's ub
Pacify the error
It will just override alligned shit in function and its going to collapse
Or something
Hmmm
I dont know assembly very well though
Tell me error and i will give solution or error
Why couldnt they name their operators normally
<=>
int attribute((noinline)) call(int a, int b, TwoInputs fun) {
fun(a, b);
}
yippee
Basically i wanted to say any keywords
jmp puts
Yes like that
never read any code from the 90's
Jmp doesnt look bad
their vars be like
b
a
jm
Yeah i have a bunch of old people in my company who name all their variables like bool_1 bool_2 int_15
movups
Unclear code
they're so cool they have a dissassembler running in their heads that just can't name variables
are you sure they didn't hire a decompiler like dnspy as a dev

VFMADDSUB132PD - Fused Multiply-AlternatingAdd/Subtract of Packed Double Precision Floating-Point Values
.asciz "lol"
.size .L.str, 4
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "%d %d\n"
.size .L.str.1, 7
.ident "clang version 20.1.8"
.section ".note.GNU-stack","",@progbits
Hmm
So it worked?
Maybe lucky nothing got broken
Or depends on functions themselves
it is undefined behavior to call a function through an incompatible function pointer type 
so it may break at any point
surely it'll be fine 
only takes 4 tokens to define the ints
sure
at least that's everything it needs in 991 tokens, just need to actually run it and fix it

I was thinking "i wonder wjen my package arrives cuz i kinda need it rn" and roght then the delivery driver appeared infront of my house
I manifested him
This calibration mic is a lot smaller than expected

lol
huh
it seems I can't find any old apk about discord as well
up to down only have the latest one
well it seems only apk mirror have the old apks
but need to install apkmirror installer which is a bit weird, but at least it works
Let me ask, is it another UI update or is it new features
tbh I should be dumb and press the update button on Google play, and after I updated it it runs poorly on my phone, when I selected a channal the screen will suddenly went blank and after swapping different channels again then it will become normal
this is the only reason I switch back to slightly older discord ver
i'm using the image because of anson's situation and because old mobile discord is still so much better than the new versions
but in case you were wondering what they've done recently:
arrows
my discord hasn't update
I got sniped by a discord update on PC that I couldn't deal with because immutable. Glad to have options in that case
do you guys meant the android discord?
Android discord is the current discussion yep
My android discord looks unchanged so far 
Is there some mega update ahead again 
Or do you mean very old versions
Seems like arrows according to t up there
newer versions are like 5x laggier than version 126.21
click on a channel and wait for the messages to load
Where do i find these arrows
never used to do that
i still have the old version and have tried both, it's very noticeable and i don't know how they think it's ok
I at least am still staring down an update button
I'm on 296.17 
app has barely changed appearance or functionality they just push awful updates and never fix issues
that's why it's been grey screens so much while loading a channel
yep
My experince has already been suboptimal the last couple of days.
god imagine implementing av1 encoding for anyone other than NVIDIA users smh
i just want my streams to not be blocky as hell is that too much to ask for
yes, your issues are not even on their to-do list
you will get ui updates just to fuck with you
and ads
and nothing more
Calibration said right surround wasnt tweeting well. Found out its tweeter is completely fucked
A new one is like 70 bucks 
Most of the tweeter is fine, its just the dome is dented and the really tiny copper wires are broken
So the part that actually makes the sound is dead basicly
if you really care abt that it's money well spent i guess
Ill just try to find the cheapest possible replacement
I guess for 5 2ndhand speakers with 15 total drivers, having only 1 broken is not too bad


I bought a replacement, 80 bucks with shipping 
is this thing new in vs2022 
Ghostty indeed


just updated and this still crashes 
on the C bot too
wait what
is it randomly crashing 
Room correction be crazy. It gave right height -7dB
Bruh
It also gave a really weird EQ to the right surround cuz the tweeter is broken
fearful concurrency 
I hope u have fun with ur surround
I will 
Once everything works
But it doesnt
New tweeter if they still have them in stock should be here in 2 weeks. Im expecting my order to get cancelled tho
bwa

da hail is that
it looks bad
What did I just approve?????
Ts crazy (Adding and removing the same thing is crazy)
Ping is very high
122000 ms
Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
error: failed retrieving file
Operation too slow. Less than 1 bytes/sec transferred the last 10
Wtf
Incresed the gap ig
I... had that same reaction too. I was, going through approvals. and didn't notice this, until I was re-reviewing them for the approval message
WHEREEE? The gap is the same.
Literally, the rest of the lines
extra space(s)?
formatting change, comments were shifted more to the right
Ooooh, I did not see that. (I'm stupid, lmao)
it's weird though, is it tabs not spaces? usually you'd only do this to align the comments in one column
It is, an automated agent tho. Idk what it was thinking, ngl
true
or use tabs
so the editor aligns them
Ahh
the renderer i guess
I guess
which one? (I wanna use one too, lol. Seems like it might be kinda efficient / easier to pack into a binary)
Nuitka
I have in planning ones my right hand fix soon
For now i will need help from chatgpt or claude
code?
nuh uh no code
kaaaay. Then idk how to debug that either ๐คทโโ๏ธ
yeah I'm getting that too
and when the arena chess gui segfaults, it doesn't close the bots
which then ensure that my terminal is utterly unusable to close them
couldn't tell you why your bots are segfaulting, they genuinely don't on my end
my bots stopped segfaulting for some incomprehensible reason
cute-chess seems to work fine
perfect
does it support tournaments tho
it does also output a nice overview of the tournament results
oh bred I have big news
my chess bot is now under 1024 tokens
and it works really well

it turns out
I had the evaluation flipped
and it was optimizing for worst moves
now it plays a mean chess
that sounds ideal clearly
it was doing it so well that I suspected it just from watching it play
it only captured while in check and almost always moved pieces to attacked squares
its just an appimage which is really convenient
what's an appimage
like a bundle of dependencies and the app
so to run it all you need is just $ ./Cute_Chess-1.4.0-x86_64.AppImage
(it was made in 2008)
oh awesome
thats new
just don't be british ez
oh neat cute chess also allows concurrent games
mmm
gonna go illegal move hunting to farm bug reports
so you can do actual bot tournament
interesting
huh?
the previous gui also allowed bot tournaments
this just speeds it up massively if you have lots of bots and want to do several rounds for each pairing
time to go illegal move hunting

illegal moves again
make sure you rebuilt bots since pulling new api ver
i fixed a bunch of issues
once again ???
gonna hunt some more but its looking like its imagining pawns
can you check if theres any weird moves in these games consistently
e.g. en passant or castling
those have historically been troublesome
phrr
wait what
even if it imagined a pawn that doesnt make sense
its in check

i never hit these issues
1. Na3 d5 2. g3 c6 3. f4 b6 4. c4 g5 5. Qb3 h6 6. Qf3 Bg4 7. Qg2 a5 8. Rb1 Bd7
9. Qxd5 Bg7 10. Nc2 Bc8 11. Nh3 Rh7 12. Kd1 h5 13. d4 Ra7 14. Qe6 Ra8 15. Qf5 b5
16. Rg1 Bf6 17. Qxb5 Bd7 18. Qb4 Rg7 19. g4 Qc8 20. Qa3 Qa6 21. gxh5 Kf8 22. Qb3
Bf5 23. Qa3 Bxc2+ 24. Ke1 Bxd4 25. Qf3 Qb5 26. Nxg5 Bxb1 27. Rg2 Nd7 28. a4 Qxa4
29. c5 Qa1 30. Qh3 Ke8 31. Qb3 Nb6 32. Qb5 Nd7 33. Nxf7 Be5 34. Qb6 a4 35. b3
Be4 36. h6 Kf8 37. Qb7 Bc7 38. h3 Qb2 39. Rxg7 Ke8 40. Rg5 Be5 41. Bd2 Bc3
42. Qxc6 Bxd2+ 43. Kd1 Ra6 44. Qg6 Rf6 45. Qxf6 Qa1+ 46. Kxd2 Bd3 47. Qb2 Nb6
48. Qf6 Bb1 49. c6 Nc8 50. Ke1 Qb2 51. Qg6 Bc2
52. Nd6+ {Black makes an illegal move: b1c2} 1-0
this one doesn't seem to die
lemme try the C bot and see if it dies here
shimo not test every single chess move

phrr
tbf its only a ~6% per game in my experience
I can't fucking stand these random jumps in IDA's disassembly.

shiro the c bot is imploding with no error logs
classic
Just... Why?!
works on my machine 

i suppose thats all that matters
?
๐คซ

Im making activities in
Using ###### js
just checking you can make cute chess run a tournament of stock c bot vs stock c bot and nothing implodes?
currently running stock c bot vs my own bot and it hasnt imploded
ill try stock vs stock in asec

i have been ticking the box "recover crashed engines"
oooh wait

this might be a quirk of the 500 moves thing
500 moves
?
I think its using the same instance of the bot for every tournament round?
still using static buffer
yes

yeah then the example C bot will only play 500 moves in total before dying
why
OH
lol
makes sense
well usually matches wont last that long
ill have 50 turn rule draws enabled (if possible)
nono
the problem is it was using the same instance of the program for each match
ragequit
this is frustrating
my bot can clear the random bot in taking material
but its just
not fast enough to solve mates
and it keeps blundering 
now to figure out how to debug this

need better pruning
iterative deepening also help solve checkmates better
doesnt apply to my approach 
all i need is improved heuristics
and maybe a blunder protector
om
this makes it work btw
but is uh, nonideal
perfect
restart bot when die
jkjk ill try to find whats crashing
nice
hashing working
idk if i can fit hashing tho

Replacement xbox i was meant to remove the capacitor off weeks ago is apparently a 1.6 model
So doesnt even need new caps
is neuro's LLM local ?
or is it using a cloud based model using Lora's to assist it ?
if local i'd be super curious about the hardware used.
local, almost certainly
you can find vedal's specs in #1326303411041206303 (though idk how up-to-date that section is)
sorta random question, but for the actual tournament are you planning on keeping the same instance of the program for every run or starting them fresh every game?
probably the same instance with recovery enabled, I'll change the example bots to have while loops instead of for loops at some point
fair, just thinking that might cause some funky logic when it comes to caching tree traversals / timekeeping
idk if cute-chess can do that directly
New batch is in
I'm quite confident Neuro's LLM runs on another PC with more VRAM though
nice shipping label
yes it says so in the #1326303411041206303 doesn't it
I don't see it saying so, Neuro and Vedal's streaming PCs have the same amount of VRAM
xb360 gta 5 disk is tough
I'm confident there's a 3rd PC somewhere with either multiple 3090s, or one of the enterprise AI GPUs
then vedal's lying
or it's a recent change
Or he just hasn't told anyone about it
24GB for an LLM at the level of Neuro sounds too small
why are you confident about this
$ ./example_bot
uci
id name My Chess Bot
id author Author Name Here
uciok
isready
readyok
ucinewgame
position fen 6r1/8/8/7r/3b4/8/1p1k4/6K1 w - - 32 142
go wtime 300000 btime 300000 winc 0 binc 0
Floating point exception

you do sound a little 

fpe
I'm not home for another like
Bigger LLM for better quality, or separate LLMs for both Neuros
7h so
I now own roughly 15 copies of gta5
And if an enterprise GPU, more bandwidth for better inference speed
ah wait
none of these require a separate PC
smh shiro
there are legal moves
classic
admittedly
how does it not see that
Well the current PCs as far as I'm aware don't have more than those GPUs stated
Unless Neuro's PC secretly had an A100 added to it
that's a super rare situation actually
it's double check
I don't think I've had a test case for double check yet
Well, who knows anyway, in my head it seems likely but my head is also full of pixels so I don't know
1. a4 Nc6 2. b3 h5 3. d4 d6 4. Kd2 e5 5. e3 Rh7 6. Qg4 g6 7. Qf4 Qf6 8. Be2 Be6 9. Qf3 Bh6 10. g3 Ke7 11. Qxh5 Bd5 12. Nf3 Bg7 13. Bb2 Ke8 14. Na3 Qf5 15. Ba6 Bf6 16. Rhd1 g5 17. Rab1 Nd8 18. Rh1 Bc6 19. Rhe1 Qh3 20. g4 bxa6 21. b4 Rb8 22. Kd3 Qxg4 23. Qh3 Bb5+ 24. Kc3 Qxd4+ 25. Kb3 Rb7 26. Qc8 Qc3+ 27. Kxc3 Rxh2 28. Nxb5 g4 29. Ba3 Rb6 30. Ng1 c6 31. f4 Rd2 32. Bc1 Be7 33. Qxc6+ Nxc6 34. Nf3 Nb8 35. Kxd2 Nf6 36. Nxa7 Kd8 37. Kd3 Nc6 38. Nxc6+ Kc7 39. Rb2 a5 40. Kd2 Nd7 41. Ng5 Nb8 42. Nxf7 exf4 43. Nd4 Rc6 44. Ne6+ Kb6 45. Ke2 Ka7 46. e4 Kb6 47. c4 Rc5 48. Ra2 Rg5 49. Nd4 Bf8 50. Rf1 Rb5 51. Nf3 Rd5 52. Rd1 Kc7 53. Nd4 Kb6 54. Re1 axb4 55. Nd8 Re5 56. Nb7 f3+ 57. Kf1 Rxe4 58. Ree2 Nc6 59. Bf4 Re7 60. Bh2 Nxd4 61. Kg1 Re8 62. Bg3 Ka6 63. Re5 Ka7 64. Ra5+ Kb8 65. Re2 Re6 66. Ra2 Nb3 67. Rc2 Nd2 68. Bf2 Kc8 69. Nxd6+ Kc7 70. Ne4 Rb6 71. Rb2 Bd6 72. Ra8 b3 73. Rg8 Nb1 74. Ra8 Na3 75. Ra5 Be7 76. Rc2 Bf6 77. Rd2 Bc3 78. Ra8 Bh8 79. Bc5 Rd6 80. Kf1 Kd7 81. Ra5 Kc8 82. Re2 fxe2+ 83. Ke1 Kd7 84. Ng5 Kc7 85. Ra7+ Kb8 86. Bf2 Be5 87. Rh7 Nc2+ 88. Kxe2 Ra6 89. Rh2 Bb2 90. Rg2 Ne1 91. Nf3 Rxa4 92. Nh2 g3 93. Bd4 Kb7 94. Kxe1 Kc7 95. Kf1 Kd7 96. Bh8 Ra3 97. Bf6 Kc6 98. Rc2 Ra6 99. Bh4 Ra3 100. Bg5 Ra2 101. c5 Ra6 102. Bd2 Kb5 103. c6 Ra5 104. Rc5+ Kxc5 105. c7 Kd5 106. Bb4 Kc6 107. Kg1 gxh2+ 108. Kh1 Rc5 109. Bc3 Bc1 110. Bg7 Ra5 111. c8=N Kb5 112. Bh8 Kc6 113. Bg7 Kc7 114. Na7 Kb7 115. Bf8 Ka6 116. Bb4 Bg5 117. Be7 Rc5 118. Nc8 b2 119. Bf6 Bc1 120. Kg2 Rc3 121. Kf1 Kb5 122. Be5 Rxc8 123. Bb8 Kb4 124. Ba7 Rg8 125. Bg1 hxg1=R+ 126. Kf2 R1g3 127. Kf1 Rb8 128. Ke1 Kc3 129. Kd1 Rd3+ 130. Ke2 Rh8 131. Kf1 Rd4 132. Kf2 Rh2+ 133. Ke1 Rh1+ 134. Kf2 Rh8 135. Kg1 Rd5 136. Kf2 Bh6 137. Kg1 Kd2 138. Kf2 Rh5 139. Kf1 Bg7 140. Kf2 Rg8 141. Kg1 Bd4+``` is the pgn
which uh
(it did move before providing check a fair bit, but worth pointing out)
oh also how is the rust API looking
it crashes less than the c api
how

it just panics instead of segfaulting
but like the only thing I had to fix was my handling of empty move arrays
!ban internet

tl;dr rust doesn't like it when you make a slice with a null pointer as the base
even if its len 0
makes sense
just pushed changes
the null check probably happens before any length arithmetic
ye I basically had to do it here
previously that unsafe bit would panic
at some point I kinda wanna make it so that if you build in release it also builds the C api in release
but thats a soonโข task
omw to make a blockhead out of stockfish
yeah once you have this all together if you could write some short build instructions
so I can verify that I can build it on my end
literally nepal


rule 3 not violated ๐คซ
idk there's not a whole lot, just:
make sure you have clang (I could probably change it to gcc but bindgen uses clang so w/e)
git clone https://github.com/owobred/chess-competition-rust-bindings/
cd chess-competition-rust-bindings
cargo run / cargo run --release (or cargo build, result is put at target/<debug|release>/chess_bot)
can I have gcc and clang
in what way
I already have gcc
I don't want to uninstall to get clang
you can
bin/c[c,++} -> default compiler (usually gcc or clang)
bin/g{cc,++} -> gcc
bin/clang{,++} -> clang


is there a convention for which I'm meant to call or nah
meant to call what
like should I be running cc instead of clang
call cc only if you are not using any clang/gcc specific features
idk
cc is a c spec compliant compiler
pretty sure I'm not doing anything clang specific shruge
gcc and clang both support most of each other's features
if you dont know if its safe to use cc, use a specific compiler
ideally the one you are testing with

either way
it doesn't really matter that much
someone using rust can surely install clang

after 3 weeks of my sisters tablet being stuck in customs, i have received a bill of 90 bucks import costs 
thank god im not the one paying
this is actually me playing all of these games

wtf

how did defender not pick you up
koniibot 
ban konii for cheating
I'm tempted to send my compiled bot to bred so she can find bugs in it
but what if he reverse engineers it

shiro literacy rates dropping globally




tv blue screen hiding in your vm 
ty konii
surely I would have no need to reverse engineer the bot as it would be worse
i dont see a reason to recreate flawed design
I actually don't think I can beat my bot on 1 minute time
I always lose
it doesn't play super genius but it plays way faster than I can
and the moves average out to sensible
how about on 15 minute

can it beat magnus carlsen yet
ye

1 second
there's a couple touches I wanna add to the rust api so its a little less awful to use
like adding bitwise ops back to the bitboards

huh actually now I think about it coroutines could be very fun if they're not banned
actually nvm they probably wouldn't give the benefit I was thinking of because done() blocks
also random thought
is it theoretically possible to misuse signals so I can ponder whilst the enemy is thinking
like theoretically if I alarm(0) and have a signal handler registered

ive been thinking about more path pruning stuff, but the problem with thinking about the opponents intentions is that the opponent might be the dumbest fuck in existence 
assuming they only do smart choises is a gamble
i mean if they're purely bad then they just lose no?
its more a risk if they can bait you into wasting all your time
this is reasonable to worry about but as bred said it's often a non-issue
if you assume the opponent plays well and are wrong, it usually improves your position
not that many cases where your success is fully reliant on the opponent playing well, but it can happen
well, what if i prune a branch that looks bad at depth 1 but is actually good at a further depth 
that's why you go deeper than depth 1
then you had a bad pruning metric I think?

that too
hmmm
but yeah pruning early is hard
often it's just a heuristic to prune moves that are probably bad
how much time do we have again?
1 minute
per round? 

no increment
so fast code is a concern too

there's a tradeoff between looking at better moves and more moves
the more heuristics and logic you use, the longer it takes to process a line of moves
maybe ill do dynamic depth, fewer legal moves means we can search deeper that round
and ofcourse we cache that
don't forget the quiescence search
the what
tbh for how unstreamlined the rust version is
I'm actually kinda proud of that token count
nah its a non issue
this is how humans play too
you assume that the opponent will make the optimal move
if you dont, you lose the zero sum game

ok
like I could probably cut a few by just doing a use chess_api::*;

offload as many tokens into the chess api as possible 
I am also very likely to add some cheeky deref impls
c gets those for free
as well as all operators
exactly

there's no issue with implementing functionality that exists in the original
hmm
if we cache previous depth searches, than we already know for the next search which paths are unoptimal, which gives us more time for even more searches
shiro can i make haskell bindings 
does the token counter support haskell

if
- the token counter supports it
- I can figure out how to build it
- someone makes the API bindings
I'll support it
generally those are the requirements
Unfortunately Kotlin fails part 1

check that it's not commented out in the Cargo.toml
any commented out packages have dependency hell that prevents them being uncommented

though admittedly I didn't try only uncommenting one language at a time
and rebuilding
that could work
you can switch to 0.23.0 and comment out a couple (iirc bash,markdown,ocaml and another one) and then it builds
but pointing it to a kotlin file blows up when trying to instantiate something
kotlin
surely a 0.23.0 fork wouldn't be too hard
!
0.23 was the newest version that doesn't break the program for me
there's 0.25 but that broke pretty much everything in tcount
surely if I email the developer they'll update it
besides half the languages don't support that it seems
buket

oddly philosphical
honestly rust might have less silly syntax shenanegans than expected
what am I looking st
just kinda suprised at how close their token count is

I am too lazy to manually do rand at this very moment
also
surely I won't need it in my actual bot
surely
well if you do want to
i think a good way is to get the Zobrist hash of the first board as a random seed
then LCG
fair
actually a Fibonacci lfsr would work


use {rand::{*, seq::*}, chess_api::*};
fn main() {
loop {
if let Some(mov) = Board::get().get_legal_moves().choose(&mut thread_rng()) {
push(mov);
}
done()
}
}
does this work

it's not near the token limit
I think it being easy to read is more important
there might be beginners who wanna try the challenge 
no
but
why not 
they can worry about shrinking it on their own
if I implement some cheeky clones
use {rand::{*, seq::*}, chess_api::*};
fn main() {
loop {
if let Some(mov) = Board::get().get_legal_moves().choose(&mut rng()) {
chess_api::push(*mov);
}
done()
}
}
this compiles
not with c macros
I'm running out of things to macro
im too good
not that many of my code segments are repeatable

can you remove semicolon



never ending




















