#programming

1 messages ยท Page 217 of 1

fast pagoda
#

damn i want to watch wall-e again

glad path
worldly acorn
#

Might be

#

Nah same movie

glad path
#

"trust me ffrfr'"

midnight sigil
#

neuroCatUuh sir I think this can be refactored

sage crag
#

posix universal abi evilWheeze

glad path
#

what does teh b stand for ._.

fast pagoda
stray dragon
#

clang has worked, and apparently shiro's example bot is dogshit

obsidian mantle
#

threads doesnt work in cpp
its over

sage crag
glass flower
stray dragon
#

ah i see

midnight sigil
#

:SMH:

fast pagoda
#

i played 2 rng bots against each other for like 100 games i think the average game was over 200 moves

stray dragon
#

i've finally caught up

glad path
#

can someone write lua bindings for me

#

i am too lazy & too busy

sage crag
midnight sigil
#

forcing us to use extra tokens I see

sage crag
#

its true functions are more portable for ffi than c structs and globals

sage crag
fast pagoda
#

the board is on top of a picture of vedal and shiro at the christmas party (embarassing) so he cant expose it

#

the reason this was done was legitimate but classified

midnight sigil
#

shiro be yelling "I CAN CODE" to vedal frfr

final tinsel
#

i think im prob gna end this game...

glad path
midnight sigil
#

-11:34:16 time left slaps hard

glad path
#

fun fact: your code can't be more than ~7mb if i did the math right

rigid timber
#

how so?

final tinsel
glad path
#

no more than 64bits per token
no more than 1000 tokens i think

rigid timber
#

long variable names tho

glad path
#

in one token

final tinsel
glad path
#

its a rule

fair horizon
#

Trying to get the files fully setup is already draining me, I haven't even started coding yet ๐Ÿ˜ญ

rigid timber
glad path
#

I rounded everything

lime galleon
midnight sigil
#

I'm forced to halt

real sierra
final tinsel
glad path
#

shiro does it the api thinguy run on mac correctly

real sierra
#

haven't tried on mac but I would think mac is more similar to linux

glad path
#

grammar is not present in the above above sentence

midnight sigil
#

use en-croissant if you really want to do stockfish vs stockfish

glad path
#

en-croissant??

#

pawn-croissant thonk

midnight sigil
rigid timber
lime galleon
nocturne olive
#

I wonder how long it will take for the Kotlin bindings to be fully added

stray dragon
#

downloaded the setup, installed it, finished the installation, restarted the terminal, tried the command

#

neat

#

i'll use clang for now

real sierra
final tinsel
midnight sigil
#

Known issue

#

Fix here

nocturne olive
midnight sigil
obsidian mantle
#

wtf is this clang about ๐Ÿ’€ 4 gb ???

#

more?

midnight sigil
#

no?

obsidian mantle
#

what am i downloading

midnight sigil
rigid timber
midnight sigil
obsidian mantle
#

idk i googled install clang

rigid timber
midnight sigil
#

just don't use gcc

obsidian mantle
stray dragon
midnight sigil
#

either use msvc or clang-msvc

#

gcc sucks ass

stray dragon
#

shiro using gcc smh what an idiot

midnight sigil
#

imagine having to download mingw just in-order to compile a program

tender river
#

this problem isnt even gcc related

midnight sigil
tender river
#

t's gcc is just old

stray dragon
#

is fixed by not using gcc

stray dragon
fast pagoda
#

gcc is based wym

midnight sigil
stray dragon
#

it is literally THE MOST RECENT VERSION

final tinsel
#

so how i do this but with msvc instead lol gcc -shared -o libchess.dll bitboard.c chessapi.c

stray dragon
#

NOT EVEN 2 MONTHS OLD!!

rigid timber
midnight sigil
final tinsel
#

aaaaaaaaaaaaaaaaaaa

obsidian mantle
#

why does threads tell me __cplusplus is not defined if im compiling it through cpp project

tender river
midnight sigil
obsidian mantle
#

do i also need to wrap shiro's source into project with some cmake or

stray dragon
#

not if nobody finds out

#

also why .json

midnight sigil
frail mortar
stray dragon
#

that'd get super laggy so quickly

formal quartz
#

um if i could ask, if i would make a custom api interface for the chess tournament, i should just copy all the functionality of the existing ones for the api ddl?
sorry i have not really done this kinda stuff before

frail mortar
#

better idea? I only know jsonl rn

stray dragon
midnight sigil
#

sql is always there by your side

stray dragon
#

could implement it in txt or csv or use an actual database

stoic turtle
#

I am getting a fatal error: 'threads.h' file not found

I am on mac this time

midnight sigil
fast pagoda
#

csv/tsv is super ez cuz its just a nothing file

stray dragon
#

json is bad for storing messages like that because every time a message comes in your program will go "hmmm time to scan through this 200MB json file, find where to put this message in, and then overwrite the entire contents of said 200MB file with the new contents that have 1 more message stored"

nocturne olive
#

Kotlin bindings are real now

stray dragon
#

and you'd be doing that multiple times a second, probably

fast pagoda
tender river
fast pagoda
#

with jsonl it jsut needs to slap a \n and append

#

never open that ish

real sierra
# formal quartz um if i could ask, if i would make a custom api interface for the chess tourname...

if your question is about making bindings to the API for a new language then in general yes, if you make language bindings for the API it should just reimplement the provided functions and not add any other functionality
that said, one exception i've waived for this is memory management; if your language is garbage-collected and you wish to wrap some of the returned pointers in classes to be automatically freed by the garbage collector, that's fine
you can see the python bindings for an example of how this might work (found on the contest repo)

stray dragon
#

i see

midnight sigil
fast pagoda
#

this mf writing the chatlogs of grok

obsidian mantle
#

how do i link it its run through cmd vedalSTARE

fast pagoda
#

the entire corpus of messages it receives simultaneously in all convos

#

maybe then it'll be a prob

obsidian mantle
midnight sigil
obsidian mantle
#

i made a bat

frail mortar
midnight sigil
#

on right

fast pagoda
midnight sigil
#

you need to pass in the other c files

nocturne olive
stray dragon
fast pagoda
#

i saved 250k messages in jsonl sequentially without problems

nocturne olive
formal quartz
obsidian mantle
midnight sigil
stray dragon
fast pagoda
#

me irl

stray dragon
fast pagoda
#

throw shit at it till it works

stray dragon
#

oopsie daisy

#

wait is that even correct

#

i have no clue what i'm doing LOL

rigid timber
#

you can make it an exe, you just have to give it with exe to cute chess too

midnight sigil
#

if you're on windows you need a suffix

stray dragon
#

will test

obsidian mantle
nocturne olive
fast pagoda
#

every time anything ever happens w/ compiling reminds me that it was a good idea to swap linux

stray dragon
rigid timber
nocturne olive
#

Silly

fast pagoda
#

that would probably be fun

nocturne olive
#

Someone would have fun with that probably

rigid timber
#

wouldn't even be hard methinks

stray dragon
frail mortar
#
    path = _user_dir(uid) / "scratch.jsonl"
    with path.open("a", encoding="utf-8") as f:
        f.write(json.dumps({"u": user_text.strip()}, ensure_ascii=False) + "\n")
        f.write(json.dumps({"a": assistant_text.strip()}, ensure_ascii=False) + "\n")
    try:
        summarize_and_persist_if_ready(uid, every_n_pairs=10)
    except Exception:
        pass```
nocturne olive
#

This is the only complex function in my entire bindings ```kt
fun getLegalMoves(board: Board): Array<Move> {
val len = IntByReference()
val movesPtr = nativeBindings.chess_get_legal_moves(board.value, len)

    val moves = Array(len.value) { i ->
        val offset = i * MoveByPointer().size()
        MoveByPointer(movesPtr.share(offset.toLong())).toMove()
    }

    nativeBindings.chess_free_moves_array(movesPtr)
    return moves
}
formal quartz
nocturne olive
fast pagoda
nocturne olive
#

Every other function in the core API is a oneliner

fast pagoda
#

the other part is just appending, should be a-ok

midnight sigil
nocturne olive
#

This whole thing is just a bunch of oneliners

midnight sigil
#

I guess they have dumb-protections

stoic turtle
fast pagoda
stray dragon
#

yeah "cannot execute command"

midnight sigil
rigid timber
fast pagoda
#

system breached

obsidian mantle
#

guys i did it neuroHypers

rigid timber
#

neuroHypers illegal move

midnight sigil
#

hurray one more personal halted by shibo

#

whoever solves it first become a mod NeuroClueless

obsidian mantle
#

so it repeated last move

#

interesting

midnight sigil
rigid timber
stray dragon
#

time to get to work re-writing the entire bot then

tender river
rigid snow
sage crag
#

has competition started yet MyHonestReaction

midnight sigil
#

you can change your submission/entry until the deadline so it doesn't really matter

stoic turtle
tender river
#

neuro7 i can only suggest using an old version of the repo that uses pthreads

#

@real sierra apparently macos has pthreads but not threads.h evilWheeze

midnight sigil
#

gotta ask shibo if he accepts that

tender river
#

might want to ifdef that

tender river
stark needle
#

i got it shad_yippee

tender river
nocturne olive
real sierra
#

after i refactored everything to remove pthreads

fast pagoda
#

lmao

rigid timber
#

use pthreads if available and threads.h otherwise?

real sierra
#

catdespair my nice code...

nocturne olive
#

Oh the joys of C

midnight sigil
#

neuroPogHD gone

real sierra
#

ok ill address that after the windows issue as i have some ongoing changes here

rigid timber
nocturne olive
#

At this point just have separate code within ifdef for every platform

fast pagoda
#

it's fun how you might think c/cpp would have essentially universal support without issue given how prevalent and old they are

and then you try to do anything cross platform even on the same target arch and

midnight sigil
#

macos on the other hand...

#

completely isolated land

#

it has their very own dev environment/workflow

nocturne olive
#

I like Kotlin, it just works (tm)

rigid snow
#

that's js

real sierra
#

also it's not copy pasted, there's slight differences per-direction

#

blame pawns

rigid timber
#

I mean...

fast pagoda
#

i blame prawns

rigid timber
#

if it works it works... (it doesn't work, it gives invalid moves)

rigid snow
midnight sigil
#

โ™Ÿ๏ธ: neuroSadge

real sierra
#

the endianness of windows isnt different is it

#

i guess that might be processor specific

opaque sigil
#

No

#

That is a CPU thing

nocturne olive
#

Yeah it's from the CPU

fair horizon
#

Why is my compiler complaining that threads.h doesn't exist fml

real sierra
#

macos?

fair horizon
#

Windows, though I'm not using the WSL compiler thing so might have to do with it as well

obsidian mantle
#

how do i convert int to string in c ๐Ÿ’€ wtf is this language where my to_string

fair horizon
#

At last I will have to actually install WSL

real sierra
#

strtol and similar funcs wrong direction

#

if your int is between 0 and 9, you can just do '0' + i to make it a char

rigid snow
#

but wasn't it itoa or something

nocturne olive
rigid snow
#

copied from java

real sierra
#

fascinating

#

it seems only black is making illegal moves now

fair horizon
real sierra
#

nope i lied

nocturne olive
#

Weirdness

nocturne olive
rigid snow
midnight sigil
rigid snow
#

oh

rigid timber
hollow spruce
#

class Meta(type):
def new(cls, name, bases, attrs):
print(f"Creating class {name}")
return super().new(cls, name, bases, attrs)

class MyClass(metaclass=Meta):
pass

real sierra
opaque sigil
#

itoa is available in c it's just non-standard iirc

real sierra
#

@tender river are you really sure this is fine

hollow spruce
#

class Point:
slots = ("x", "y")
def init(self, x, y):
self.x, self.y = x, y

obsidian mantle
#

does string exist in c

#

or they are all chars

real sierra
#

char *

opaque sigil
obsidian mantle
#

how do i concat it to some text

#

impossible language

hollow spruce
#

?

obsidian mantle
#

so i need to make text a variable then shuffle some pointers right then move terminator or smh

#

not very humane

alpine frigate
obsidian mantle
#

for operation like "x" + to_string(i) + "y"

rigid timber
#

it's C, it's not meant to be humane

midnight sigil
real sierra
#

the point is that the supposed llu is later stored in an int *

#

i dont think it would explain the problems but ill try changing it

opaque sigil
#

It's fine

rigid snow
nocturne olive
opaque sigil
#

Assuming you don't have over 2^32 legal moves

nocturne olive
#

If you want that go to Python or Kotlin

real sierra
opaque sigil
obsidian mantle
#

now i remember
i saw it somewhere

midnight sigil
#

you can do a check on that if you're uncertain

real sierra
#

its so strange, particularly in the two engine case

hollow spruce
#

root@localhost:~# python3 -V
Python 3.12.3
root@localhost:~# python3.14 -V
Python 3.14.0rc3
root@localhost:~# python3.13 -V
Python 3.13.7
root@localhost:~# python3.11 -V
bash: python3.11: command not found

opaque sigil
#

Why would you even want to have it be an int in the first place

real sierra
#

not only is one getting the wrong length of legal moves array but the contents are also wrong

real sierra
#

but it'd be a change to the api header

midnight sigil
real sierra
#

so if it wont fix the problem then its not my concern for now

#

dont need to break more stuff

midnight sigil
#

suboptimal memory usage

#

time to remove sub-modules and test which part is not working neuroHypers

opaque sigil
#

Unless you somehow end up with negative moves it shouldn't make a difference at all I guess

midnight sigil
real sierra
#

i just dont understand what could be causing a windows-specific issue

hollow spruce
#

Chatgpt is help full

#

New string t โœ“
Not @steady otter ๐Ÿšซ

stray dragon
#

lol

#

wrong t

hollow spruce
hollow spruce
midnight sigil
stray dragon
midnight sigil
#

interuptions

hollow spruce
#

Example of template string

from string import Template

Suppose Python 3.14 adds a new t-string syntax, like:

tpl = t"Hello, {name}! Welcome to {place}."

Later, substitute values

ctx1 = {"name": "Alice", "place": "Wonderland"}
ctx2 = {"name": "Bob", "place": "Neverland"}

print(tpl.substitute(ctx1)) # Hello, Alice! Welcome to Wonderland.
print(tpl.substitute(ctx2)) # Hello, Bob! Welcome to Neverland.

#

From chatgpt

obsidian mantle
#

ok so it doesnt restart bot counter stays

#

so its api fault

#

i removed the cycle in main and it said "bot disconnects" after first move neurOMEGALUL

#

oh i get it

#

its supposed to be while true

hollow spruce
#

t-strings โ†’ placeholders are kept as a template; you fill them in later with data.

stoic turtle
#

if someone sends me the libchess.so will it work, or do I need to compile it myself

real sierra
#

not that it wasn't already known, but the problem is definitely in the C api

midnight sigil
#

it should work

#

as long as you both has the same system setup and arch

stoic turtle
#

ah, well thats the problem

midnight sigil
#

it's why linux users actually compiles their program everytime they install smth

clear sedge
#

or use appimages

hollow spruce
clear sedge
#

do you not know what an appimage is?

hollow spruce
clear sedge
fast pagoda
#

that makes it executable

clear sedge
fast pagoda
#

id think of appimages more like a container

#

like docker

clear sedge
clear sedge
#

but the next best thing to compare it with is portable .exes

fast pagoda
#

yeah i guess if you have no other context

#

the other thing i was going to say is like an Apk

clear sedge
#

yes

#

apk

#

that's a better example

fast pagoda
#

didnt know what would be the best to contextualize it lol

clear sedge
#

still, the most intuitive thing to compare it with is portable .exes imo

#

you double click it and the app works

midnight sigil
fast pagoda
#

oh fuck yeah i complain about this bridge still being in progress every time i can

#

Houstonโ€™s $1.45B Ship Channel Bridge is a rare megaproject that hit pauseโ€”then came back stronger. The 1982 four-lane box girder is being replaced by two cable-stayed spans with 8 lanes + shoulders, a 1,320-ft free span, ~187.6-ft vertical and ~530-ft horizontal clearance, and no piers in the channel. On January 7, 2020, Harris County issued...

โ–ถ Play video
#

unreal

clear sedge
#

engine

fast pagoda
#

5

clear sedge
#

it's in the game (sadly)

midnight sigil
clear sedge
#

give me 1% of that money and i'll spend it all on alcohol and die by the time i hit 30

clear sedge
#

a whole server rack to keep my alcohol in

fair horizon
#

Give me 1% of that money and I'll buy 3 muffins

clear sedge
#

3??

midnight sigil
obsidian mantle
#

so these are legal moves it finds turn 0

fair horizon
clear sedge
#

i hate beer

real sierra
#

g8h6 is a common bad move found

#

part of the bug im working on rn

clear sedge
#

i do however enjoy the feeling of being intoxicated

midnight sigil
clear sedge
#

hate alcohol in general taste-wise

obsidian mantle
#

basically it only found knight moves for some reason

fast pagoda
#

drink enough and the taste doesnt matter after a point

clear sedge
#

that is true, i have experienced that

#

i still don't remember what i got up to that night

#

thus i must.. not drink for the sake of my liver

#

such a cruel fate

midnight sigil
#

๐Ÿฅ€

obsidian mantle
#

shiro do you have something to dump the board into string in api

hoary lion
clear sedge
#

i could use one right now Stare_Lizord

midnight sigil
#

"Doctor told me not to consume any alcohol, I started drugging instead" NeuroClueless

real sierra
#

the issue comes somewhere before get_legal_moves apparently

obsidian mantle
#

why

clear sedge
real sierra
#

if i knew why an issue existed, it wouldnt

midnight sigil
obsidian mantle
#

you know what is before get_legal_moves
its chess_get_board

#

neuroHypers how do i see it

#

ok gotta work it

midnight sigil
#

are you sober

clear sedge
#

this is me while sober surprisingly enough

#

i am under the influence of a whole monster can though

fair horizon
#

I am once again shocked by how oblivious I can be, I spent half an hour waiting for a certain step in an installation process to complete when it turns out I just had to press enter to go the next step ๐Ÿคฆโ€โ™‚๏ธ

midnight sigil
clear sedge
#

no

midnight sigil
#

bro started consuming caffeine instead

clear sedge
#

i started with caffeine

#

then went to alcohol

#

now we're back at caffeine

midnight sigil
clear sedge
#

watch me turn my caffeine addiction into an alcohol addiction again

obsidian mantle
#

damn get_legal_moves is huge catdespair

midnight sigil
#

liver won't be having a rest soon I guess

clear sedge
#

pshhht

#

i'm fiiiine

#

i'll live 'til i'm 80 trust

midnight sigil
midnight sigil
obsidian mantle
#

its 1900

#

oh its only chessapi

midnight sigil
obsidian mantle
#

maybe with bitboard its 3k

midnight sigil
#

shouldn't be

#

who writes a bitboard implementation with 1000 lines

#

don't tell me

real sierra
#

yeah the psuedo legal move finder is broke

obsidian mantle
#

bitboards are already empty when it goes to get legal moves i think

real sierra
#

either that or

#

it's the move making code

obsidian mantle
#

unlocked this

real sierra
obsidian mantle
#

result

#

hold a sec

real sierra
#

per direction of movement

obsidian mantle
#

bla bla same lines again and again

real sierra
#

some of those being empty makes sense

obsidian mantle
#

only place with Xes

real sierra
#

but not this many

obsidian mantle
#

thats all

midnight sigil
real sierra
obsidian mantle
#

yes

#

no more X in bitboard bump

real sierra
midnight sigil
real sierra
#

this gives me a place to look at least

midnight sigil
#

mhm mhm

real sierra
#

i suspect either the move making code or the pseudo-legal move finder

#

need to know now if the board is actually devoid of pieces

#

or if the pieces are there and the moves are just not being generated

obsidian mantle
#

wait but it only prints 16 pseudo moves

real sierra
obsidian mantle
#

oh

real sierra
#

8 directions for north, northeast, etc.

#

and 8 for knight moves

obsidian mantle
#

neuroKufufu right

#

so it lost compas only knight works

real sierra
#

YES only the knight moves are showing up

#

and they're invalid knight moves

shadow sinew
#

How do I build and run toknt?

real sierra
#

@tender river ^

obsidian mantle
#

opp_pseudomoves are much more alive though

#

but it truly is opp, goes from white side while bot is black

#

so opp works but own moves dont

#

how the hell it works on linux more stable neurOMEGALUL

#

so get_pseudo_legal_moves is broken

#

hmmm

#

can i make the bot play as white

#

look at him go

#

apparently he cant play black but can white

#

still failed though

#

so white is bad too

#

he tried to move bishop like its a horse

fast pagoda
#

cuda 13 being 2gigs smaller than 12.9 is something

midnight sigil
#

pog big corps doing refactor?

#

investors go in!!!

stray dragon
real sierra
#

well as far as i can tell, the moves are being read and made correctly

fast pagoda
#

lmfaooooo

real sierra
#

so it must be get_pseudo_legal_moves

obsidian mantle
#

looking into it rn but its a bit messy for my eye nwero

midnight sigil
fast pagoda
#

chay when considering adding automated release to the build run: sleep

opaque sigil
#

too much effort NOPE

midnight sigil
opaque sigil
#

(ignore that it's like 5 lines to create a release too)

obsidian mantle
#

i'll start with pawns since they clearly cant move in correct directions on turn 1 and white pawns can

real sierra
#

i guess windows cant do addition YEP

shadow sinew
real sierra
#

good job windows

trim valve
opaque sigil
real sierra
#

ill refactor all adding and numbers out of the code (counting to 10 is too hard for microsoft)

stray dragon
#

it's just a jar file

#

if your os can run java you should be in the clear

real sierra
#

i built toknt from source

#

once sbt is installed you run it and it gives you an sbt shell or something

#

and then you run uhhhh

#

assembly ?

#

and it spits out a jar somewhere

#

hidden in 100 directories

opaque sigil
#

just run sbt assembly, no need to enter the shell

stray dragon
#

horrible process

opaque sigil
#

it's under target/scala-3.7.3/toknt-assembly-0.1.0-SNAPSHOT.jar

stray dragon
opaque sigil
#

(assuming you use 3.7.3)

shadow sinew
#

sbt assembly worked neurOkay

trim valve
real sierra
#

ul..?

shadow sinew
#

unsigned long?

real sierra
#

unsigned long worked fine on linux

#

but on windows...

stray dragon
shadow sinew
#

Try ull

real sierra
#

i had to change all the other longs to long longs elsewhere

#

but totally missed the ul-postifxed constants...

fast pagoda
stray dragon
#

MAKE A FUCKING .EXE FILE AND GIVE IT TO ME

obsidian mantle
#

install ide and libraries and compilers and cmakes and bitboards to run calculator

olive sable
#

i want to buy a new phone and new heaphones but i need the old ones to break first bwaadow

#

damn consumerism FRICK

real sierra
#

โœ…

obsidian mantle
#

was it that constant

real sierra
#

i'll push shortly

#

it was all the constants ending in UL

#

on windows, longs are half the size

formal quartz
#

man this dll stuff is confusing to get my hands on xD

real sierra
#

so various masks effectively only operated on the white half of the board

obsidian mantle
#

๐ŸชŸ smh

stoic turtle
formal quartz
obsidian mantle
#

ok how do i connect it to cpp now neuroAware

stoic turtle
obsidian mantle
#

hmm maybe clang will save me

real sierra
#

i've pushed a new version of the C API

#

please let me know if this fixes the outstanding issues

stoic turtle
#

so I don't need to install linux?

obsidian mantle
#

windows lives neuroLETSGO

fast pagoda
#

actually yeah linux is required sorry

real sierra
#

i dont wanna say anything until i have some more proof it works

#

"works on my pc" has not been a good metric so far

stoic turtle
#

I still get the fatal error thing

real sierra
obsidian mantle
#

how does it explain a bishop who decided to make a knight move vedalSTARE

#

if these constants seemingly only appear in pawns

real sierra
#

its more than just pawns

#

the constants appear for a number of bitboard functions

obsidian mantle
#

oh

stoic turtle
real sierra
#

namely, the masks in get_pseudo_legal_moves

shadow sinew
#

So I built the C example_bot but how do I connect that to cutechess? neuroReading

obsidian mantle
#

i was going to check pawn bitboard and it would be empty, then i would check its parts and probably discovered bad constant too

#

shiro was faster neuroSad2

real sierra
formal quartz
obsidian mantle
#

i got threads error when i tried to build it in C

real sierra
formal quartz
#

win 10

real sierra
#

it seems hit or miss if windows has threads.h

obsidian mantle
#

i can show error in visual studio when building with its embedded compiler how is it called msvcsn something

stoic turtle
real sierra
#

and macos seems to only have pthreads

shadow sinew
stoic turtle
#

ok back to installing linux

shadow sinew
#

I did

real sierra
shadow sinew
#

No exes on Linux ๐Ÿ˜›

obsidian mantle
fast pagoda
#

i dunno about you but i can click a .exe and run it just fine

#

on arch

real sierra
fast pagoda
#

totally nothing needed right ootb surely

obsidian mantle
#

the plus button is black and the background is black too, terrible design

#

oh are you on mac
then im no advisor here neuroCry

shadow sinew
#

I haven't built a libchess.so (haven't found any guide on that). I built bitboard.c and chessapi.c to libchess.a

obsidian mantle
#

i will try to figure out how to fix threads and build in cpp

shadow sinew
#

I can build an .so though if that helps.

opaque sigil
#

@tender river merge pr for toknt ci releases when you see this neuroDinkDonk

real sierra
#

i apologise lol

#

can you try just running the executable on its own to ensure it isnt crashing in some way on start?

#

you can use the following test input to get it to pass the first blocking api call:

uci
position startpos
go infinite

shadow sinew
#

When I start the executable on it's own it just idles. So no crash or anything.

stray dragon
#

ok tested new chessapi.c file, works

shadow sinew
#

Yeah that works.

real sierra
real sierra
real sierra
stray dragon
real sierra
#

is it marked as executable (chmod +x)?

shadow sinew
#

Okay now it worked for some reason.. thonk Maybe I had to start cutechess in the same working dir?

real sierra
#

maybe Hmm

#

well if it works it works

fast pagoda
#

cutechess is an unexpectedly heavy build lord wtf is in this thing

sage crag
real sierra
#

now then...

sage crag
#

c++ Awkward

real sierra
#

making this work on mac as well

fast pagoda
#

we out here Type typing

real sierra
#

need to use preprocessor directives to optionally use pthreads.h instead

real sierra
#

anyone know how portable __has_include is?

opaque sigil
#

i don't think there's anything more portable than that but i could be wrong

#

okay apparently it's part of the c++ standard but not the c one but it doesn't matter because every noteworthy c compiler is also a c++ compiler anyway enub

real sierra
#

NeuroBwaa wtf

#

how do i tell if i should use threads.h or pthread.h if i cant tell which exists and which doesnt

opaque sigil
#

it's fine

#

there are usually macros you can check

real sierra
obsidian mantle
#

so when buillding as cpp the only issue is crt_secure warnings which can be bypassed
and threads.h

threads.h is included in chess_api.c and doesnt get __c_plus_plus define for some reason

#

hmmm

#

so i need to include threads in cpp file

#

but chess api should remain c

opaque sigil
opaque sigil
obsidian mantle
#

ifdef mac pthread
else threads or smth

stoic turtle
#

I couldn't figure out how to get a linux vm running

obsidian mantle
#

do i really need to convert chessapi.c to cpp vedalSTARE

#

so threads see it

stray dragon
#

no

opaque sigil
#

it should already be valid cpp as is

obsidian mantle
#

how do i tell threads.h that its cpp
if its included in c file

#

threads error

#

not defined

#

threads.h included in chessapi.c

opaque sigil
#

that's fine

obsidian mantle
#

main cpp file calls functions from chessapi.c through chessapi.h which has extern c thingy

opaque sigil
#

the compiler defines that macro

obsidian mantle
#

do i just use clang

#

i really like visual studio debugging

opaque sigil
#

visual studio should come with clang too enub

#

or maybe that's an optional thing you need to enable

real sierra
#

good thing i just commented out all the pthreads code instead of deleting it

#

pthread_create and thrd_create have different signatures for the function they want

#

time for a cursed wrapper

real sierra
formal quartz
#

neuroHypers while shiro is working hard i found a bridge solution for the meantime at least

tender river
stoic turtle
#

mb I think I was one of those

stray dragon
#

example bot just leaves after one game? but it's doing stuff in a while(1){} loop

formal quartz
glass flower
#

YAAAAY seems like the c api is fixed for me too

formal quartz
stray dragon
#

wait it's just abandoning the game on the first turn? huh

obsidian mantle
#

if there are still bugs
lets rebrand tournament to "make chess api work without problems in under 1 month" neuroHypers

#

and then do the chess tournament NeuroPoggers

#

is this good?
fetched with github desktop idk if it worked

real sierra
#

i tentatively have the pthread.h support re-added, which will allow use on mac

#

going to run some tests to ensure it works before pushing but it should be a pretty straightforward change

obsidian mantle
#

it was ul right? and now its ull?

real sierra
#

should be ull, yes

opaque sigil
#

there's UINT64_C(num) for adding the suffix too btw

real sierra
#

that seemed ugly

opaque sigil
#

i mean yeah but who tf remembers all these suffixes

obsidian mantle
#

also more tokens

real sierra
#

and I wasn't sure if I should trust that, because I don't know what type (num) is when I type it

stray dragon
#

ok so it just disconnects immediately and does absolutely nothing else

real sierra
#

adding ull is the only thing I know for sure makes the literal a different type

stray dragon
#

guess i try resetting EVERYTHING in the file to the example bot

#

and now it works

#

ok

#

sure

opaque sigil
nocturne olive
#

Holy Kotlin STD ChessApi.getLegalMoves(board).associateWith { 1000 }

obsidian mantle
#

got stalemate too nice

#

looks like it actually works on windows but someone got problems with linux earlier today i think

#

neurOMEGALUL good luck linux guys

nocturne olive
#

For a very big operation

tender river
fast pagoda
#

i pooped out a shell script that autoclones toknt repo and then builds it + moves the .jar right in the root because malding and now my life is better AND people find me more attractive when i go in public

#

i will use it once and have wasted an hour

#

maybe twice

real sierra
#

I'll consider then, thought was type

nocturne olive
#

I have started writing the first version of my own Chess bot

#

In Kotlin obviously, and holy this STD is gonna be amazing for this

tender river
real sierra
#

kotlin sweep? PauseSama

#

can your extra tokens make up for a whole JVM in between

nocturne olive
#

Just look at this oneliner to generate a scored map from the legal moves on the board

#

I do need to make it mutable still, but that's tiny

real sierra
#

14 tokens

trim valve
#

scored?

stray dragon
nocturne olive
#

Yeah I'm gonna use at least on the first version scores to eval moves

stray dragon
#

quantifying how good each move looks

trim valve
#

oh right

#

I got confused because that snippet specifically did something different

tender river
opaque sigil
obsidian mantle
#

there is some clang++ that should be able to compile c and cpp together
but it fails

final tinsel
#

cuz of this event when i type ch into windows search to open chatterino i get cute chess instead neurOMEGALUL

tender river
#

and link to that

obsidian mantle
#

isnt so a mac or linux thing

#

and windows will explode

#

(im clueless)

tender river
#

windows is the problem of windows users i dont care evilSMH

nocturne olive
#

This is gonna be very interesting

tender river
#
  1. cc -o libchess.so -shared bitboard.c chessapi.c -fPIC
  2. c++ -o bot_exec -lchess bot.cpp
#

its technically possible that shiro's c files are cpp-compatible, but not guaranteed at all

#

so thats the best way to go about it

nocturne olive
#

On one hand, having to put ChessApi. before most API functions will eat some tokens, but on the other the Kotlin STD is amazing at making small code

obsidian mantle
#

whats cc

#

hard to search just 2 letters neuroSadge

#

oh i think i found it

#

so i have to install linux to do it
naaah

opaque sigil
real sierra
#

the pthread.h version isn't working

opaque sigil
nocturne olive
#

I'm gonna be making the absolute most out of type inference, dropping non-needed brackets and small stuff like that

real sierra
#

Susge why is this not working

nocturne olive
#

I'm not even at 128 tokens yet and I already have some kind of logic

real sierra
#

this should be a 1-to-1 faithful replica

stoic turtle
#

where the toknt releases at

opaque sigil
obsidian mantle
#

is it ok if i change chessapi to export it as dll and then link it to my cpp

#

(idk if it will even work)

stoic turtle
real sierra
#

you can export the chessapi as a dll to run it on windows, should be fine

opaque sigil
#

add a conditional attribute that's just empty on non-windows systems and make that the new default enub

obsidian mantle
#

but i need to add some shenanigans in it

real sierra
#

but i will be running the submissions on linux so don't rely on windows behaviour in your bot code

#

i'll be using the standard chessapi release, i would not suggest modifying it

tender river
real sierra
#

if the original needs changes please let me know

obsidian mantle
#

i mean if you will build it

#

and i somehow manage to build it on windows

#

and then there are problems with building it on linux

#

am i disqualified

real sierra
#

because it doesnt work with pthreads for some reason sus

tender river
real sierra
#

admittedly im not sure if this is an ethical testing method

#undef __STDC_NO_THREADS__
#define __STDC_NO_THREADS__ 1
opaque sigil
#

that's not how this works Awkward

clear sedge
#

right in front of my monster energy drink

#

come on

opaque sigil
#

sadly you can't gaslight the compiler

real sierra
obsidian mantle
#

do i just do it in filthy c then since its 99% chance i will not be able to participate with cpp

opaque sigil
#

okay fair then

obsidian mantle
#

i guess neuroCry

obsidian mantle
#

c is like x10 tokens

tender river
obsidian mantle
#

if i figure it out on windows

clear sedge
#

just don't use msvc/windows specific behaviors

#

easy

real sierra
#

idk anything about c++ so i cant help you neurowheeze

obsidian mantle
#

will shiro figure it out on linux?
what if it doesnt build

clear sedge
#

use posix like a sane person

#

you can build posix apps on windows

obsidian mantle
#

or i will have to install linux, master it, and figure it out on linux

fast pagoda
tender river
fast pagoda
clear sedge
#

you can literally open a linux mint vm, install vs code, and go from there

fast pagoda
#

unless you want to be 16bit only in holyC

obsidian mantle
#

shiro wont touch cpp code on linux

#

i will have to master linux then

#

yeah i will just do c then

#

whatever

fast pagoda
#

you can enable wsl2 and run vscode in gui with the wsl linked to it just fine

clear sedge
#

the struggles of windows c++ programmers

fast pagoda
#

when i was on windows i spent months with wsl2 being the only thing i actually run vscode from

obsidian mantle
#

if i had cpp chess api you would have struggles with your c NeuroRage

#

same with linux-windows NeuroRage

clear sedge
#

may i suggest looking into cygwin

fast pagoda
#

dont talk to me unless your environment looks like this ๐Ÿ˜ค

rigid timber
nocturne olive
#

There's so many little functions I never even knew about but that perfectly do what I need

real sierra
#

im not too sure what the issue is here with the pthread mode

fast pagoda
#

threading

#

is the issue

real sierra
#

oops left the test line in neurowheeze

fast pagoda
#

in general

clear sedge
#

general? you silly billy, this is the programming text channel!

real sierra
nocturne olive
#

I actually got the evaluation result getting to this short

#

This is crazy

real sierra
#

HOLY MAXBY

nocturne olive
#

No need to even sort

real sierra
#

I WISH

nocturne olive
#

Yeah there's so many amazing little convenience functions like this

real sierra
#

my maxby is macro'd to hell and back

#

and still prob longer

nocturne olive
#

Kotlin STD is amazing

clear sedge
#

me when i'm in an implicit behavior contest and my opponent is kotlin (i'm cooked)

tender river
#

not really implicit tho

nocturne olive
#

Only 145 tokens so far

tender river
#

its very clearly defined

clear sedge
#

where is it defined

nocturne olive
#

It's defined as the argument to the lambda passed to maxBy

clear sedge
#

what are you passing to maxBy

tender river
#

you're passing legalMoves to maxBy

clear sedge
#

it's so much syntactic sugar it's practically syntactic diabetes

nocturne olive
#

Well it saves tokens, so

real sierra
#

right mindset

tender river
#

and it is again clearly defined by the language standard

real sierra
#

abandon all morals to save tokens

nocturne olive
#

Indeed

clear sedge
#

syntactic diabetes

nocturne olive
#

But tokens

clear sedge
#

i do not condone this monstrosity

#

i'm sticking to my c

real sierra
#
#define bclose ) {
#

my c is beautiful

nocturne olive
#

Less tokens used means I can use add more functionality

real sierra
#

expanded, my bot is 1500 tokens ish

#

squeezed into 1024 with macros

clear sedge
#

there's a difference between explicit and defined

stoic turtle
#

how use token counter

tender river
nocturne olive
rigid timber
#

huh... so I got pthreads to compile on windows (also I hate vcpkg now), but it always gives me a1a1 as the only move kek

tender river
#

or what ( is

tender river
#

void is not an operator either???

clear sedge
#

it is literally an implicitly defined variable

#

you can't compare it to a type

opaque sigil
stray dragon
tender river
#

carry on you're beyond saving

nocturne olive
#

I just realized I'm using an outdated bindings version

clear sedge
nocturne olive
#

I gotta update it and the release on GitHub

#

I changed one little thing after compilation, that being how Move.promotion works

real sierra
#

gotta go for now bye

opaque sigil
#

kotlin is not implicit at all, now scala on the other hand with its implicit defs neuroKufufu

real sierra
#

ping me if you discover new bugs

olive sable
#

bugdancin @real sierra

obsidian mantle
#

ok so the plan is
i either code it on linux entirely
or do it on windows and then fix 5000 issues transporting it to linux

real sierra
#

theres a new branch on the git repo with experimental pthreads support, it doesn't work on linux but if you feel like finding the bug for me that'd be great neurowheeze

clear sedge
#

i prefer my languages with explicity

tender river
#

call it verbosity

#

languages are literally made to abstract away common operations evilSMH

#

if you cant abstract some repetition away thats a failure of the language

rigid timber
opaque sigil
#

chay go merge the thing so i don't have to grab the link to my fork when people want a release neuroDinkDonk

nocturne olive
tender river
obsidian mantle
#

or the opposite

#

where to i code with it, on windows or linux?

clear sedge
#

you run it in windows

#

to run a linux environment

stray dragon
nocturne olive
#

New fixed Kotlin bindings with the proper Move.promotions should be a thing now

obsidian mantle
#

i will spend 5 months setting it up dont i

clear sedge
#

no it's actually pretty simple

stray dragon
#

so you can use windows while having a virtual linux machine set up and running at the same time

clear sedge
#

i think at least

tender river
#

@real sierra you should use pthreads semaphores instead, shrimple as that evilHeyGuys

stray dragon
#

it's been made pretty easy to use

obsidian mantle
#

and i code in that enviroment and run bot there too

stray dragon
#

yep

fast pagoda
#

it's literally like

clear sedge
#

yes

obsidian mantle
#

and code in notepad

clear sedge
#

no

fast pagoda
#

wsl enable or something

#

in a terminal

clear sedge
#

you can use vs code

obsidian mantle
#

i gave it a gliplse it looks like a 1-2 week path to set it up (maybe im wrong)

fast pagoda
#

wsl --install

#

then wsl --set-default ubuntu

obsidian mantle
#

so i install that thing, then install vscode in it and im good to go?

fast pagoda
#

then wsl

clear sedge
#

yes

#

sudo apt install code iirc

#

while in wsl

opaque sigil
#

you don't install vscode inside wsl

fast pagoda
#

yep then wsl

clear sedge
#

you don't?

fast pagoda
#

yes you do

opaque sigil
#

you just connect to it from the host

fast pagoda
#

oh wait it tells you not to now

#

i forgor

opaque sigil
#

it installs the code server inside wsl2 and connects to that

#

just like with ssh

fast pagoda
#

you launch the wsl inside vscode terminal

clear sedge
#

doesn't wsl have its own wayland-comp/x-server or whatever

opaque sigil
#

yes but wslg sucks

obsidian mantle
#

soooo..
like i said.
master linux or die

fast pagoda
#

if you are in vscode, open your terminal (in vscode) and run wsl code . once it's installed

#

which again is just wsl --install (it does ubuntu by default) -> install the wsl extensio -> do that

clear sedge
obsidian mantle
#

this is pretty grim

clear sedge
#

you'll be fine

worldly acorn
nocturne olive
#

Look at all this token saving syntax

fast pagoda
#

using wsl2 for months in vscode got me to the point that i just installed linux from how much i preferred to use the freakin wsl2 over anything in my normal install but otherwise it works great for what it is

clear sedge
obsidian mantle
#

what if my linux is different from shiro's linux and it will all break
or does it not work like that

fast pagoda
#

no it does not work like that

nocturne olive
obsidian mantle
#

assuming shiro wont lift a finger helping fixing cpp code

nocturne olive
#

If someone wants to grab the Kotlin API and use it with Java, it should work fine

clear sedge
nocturne olive
#

Oh yeah semicolons are the death of Java

#

Compared to Kotlin

obsidian mantle
nocturne olive
#

Java is just not viable, Kotlin meta

opaque sigil
real sierra
obsidian mantle
#

alright downloading vscode lets see what i can do

fast pagoda
real sierra
#

now it would be a lot of annoyance to switch

#

I think

fast pagoda
#

it's pretty similar to just connecting to a remote linux machine and developing on it from vscode

real sierra
#

I'm also not sure if semaphore.h is everywhere pthread.h is

obsidian mantle
#

and i need the wsl machine running

fast pagoda
#

and by similar i mean pretty much identical

obsidian mantle
#

and hope it will all connect

real sierra
#

so if I already have a custom semaphore primitive why add the dependency

tender river