#programming

1 messages · Page 215 of 1

tender river
#

the token counter should be generally usable outside of the competition

#

even if i didnt make it have good ux

surreal sapphire
#

its stuff like list comprehension that will make a huge difference imo

pulsar edge
#

who needs ux anyways

keen hatch
#

Can a bot just meow in the chat and refuse to play chess?

tender river
#

if you figure out c ffi and manage to write a bot in 1024 tokens (which are just characters), sure

real sierra
tender river
tender river
real sierra
#

not sure if cute-chess-cli will render it tho

tender river
#

putStrLn "happy birthday, shiro!"

real sierra
#

you do have to come up with a name for your bot, too

#

so start thinking

cedar plume
#

saw the announcement, it's time to cook neuroHypers

glass flower
#

botbot mhm

final tinsel
glass flower
#

IHaveAnErmgi how do i configure cute-chess to run my bot and stockfish

surreal sapphire
#

not including initialization etc

real sierra
#

use the + at the bottom to add a new bot, and set "Command" to something that will start your bot

#

(instructions for linux, may differ for windows)

alpine frigate
glass flower
real sierra
#

if you want stockfish, you'll have to download it from their site and add stockfish the same way (cute-chess comes with no preinstalled engines)

final tinsel
#

what would the easiest/simplest/least likely for me to mess up way for me to do this, as i dont currently have a c/c++ compiler lol

real sierra
#

anyone have suggestions?

glass flower
alpine frigate
sage crag
surreal sapphire
sage crag
final tinsel
#

cuz like i have decent recent experience with python, but its been a bit since ive done any c/c++ and the compiler was always the most troublesome part of that for me

real sierra
#

do you develop on windows, sbg?

sage crag
#

for (auto x : vec) a.push_back(x * x);

#

also works fine

glass flower
#

scrajj do you even need a for loop?

final tinsel
sage crag
real sierra
#

c compilers on windows YES very pain

sage crag
real sierra
#

i usually elect to just make a linux vm over installing c compiler on windows

opaque sigil
#

just download llvm, it's not that bad

real sierra
#

somehow easier

final tinsel
#

i got one... somewhat working on my school laptop, but that thing is sentient now and DOES NOT LIKE ME

sage crag
#

use msys2

final tinsel
#

i mean i have WSL

#

i could use that

opaque sigil
#

even better

glass flower
#

annytfSittu i'll be using rust for my bot. probably the best language i can from lower level options

final tinsel
#

sigh i was hoping to just avoid using C or C++ at all here... neuroSadge

sage crag
#

you dont have to MyHonestReaction

#

just compile it and you're done

real sierra
#

c compiler is just for building the library, it's a one-time thing

final tinsel
real sierra
#

salute i feel that

final tinsel
#

so i still need to get it

real sierra
#

i wish i could compile it for you but

#

too platform specific

#

and also danger

final tinsel
#

fair fair

alpine frigate
sage crag
real sierra
#

or what if my particular compiler makes specific optimizations for my platform

sage crag
#

you arent compiling it with native optimisations so you only have to choose arch

real sierra
#

Susge r u sure...

glass flower
real sierra
#

i dont know enough about compilers ill mess it up

sage crag
real sierra
#

i also am scared of sending someone a binary and then it bricks their pc or something

surreal sapphire
#

no Makefile?

opaque sigil
#

shiro you're compiling for what, a 15yo common denominator

real sierra
cedar plume
final tinsel
alpine frigate
real sierra
cedar plume
#

and in the rare chance the binary actually breaks something, that's on them

alpine frigate
#

just use a vps, least risk

real sierra
#

C interpreter glueless

alpine frigate
#

if it gets bricked. haha funny

glass flower
#

Awkward the rust api doesn't compile on windows...

sage crag
sage crag
glass flower
#

pthread.h classic

#

IHaveAnErmgi what should i replace pthread with for it to compile on windows

real sierra
#

uh oh

sage crag
#

or something

glass flower
surreal sapphire
#

r u using rustup

glass flower
opaque sigil
#

--target x86_64-pc-windows-gnu or sth

#

i think this assumes you have the toolchain installed first though

#

so you'd need to run rustup target add x86_64-pc-windows-gnu first enub

glass flower
#

Awkward but how do i make the rust-analyzer use that target

sage crag
#

bilewater ost extended

opaque sigil
#

don't utter that name

surreal sapphire
#

you can change ur cargo.toml to specify the target triple

#

iirc

glass flower
#

i already have gnu target

glass flower
sage crag
#
[build]
target = "x86_64-pc-windows-gnu"
sage crag
real sierra
final tinsel
#

it didnt give me an error, but i dont know where the file went

opaque sigil
#

wherever you ran the command

#

windows search doesn't check wsl enub

final tinsel
final tinsel
tender river
surreal sapphire
#

:d are we pro using namespace std here

final tinsel
opaque sigil
#

only for saving tokens

final tinsel
surreal sapphire
#

also how do yall pronounce std

opaque sigil
#

stud

final tinsel
real sierra
final tinsel
#

one sec

sage crag
#

phrr

#

phr

tender river
sage crag
#

ph

#

p

real sierra
#

idk how the other file paths would resolve if that happened

glass flower
#

scrajj it still does not want to compile...

final tinsel
surreal sapphire
final tinsel
#

WHERE DID IT GO

real sierra
#

dont underestimate the token limit

final tinsel
#

is there a verbose logging flag for compile?

real sierra
#

it leads to scary places

real sierra
final tinsel
opaque sigil
#

are you sure it even finished

#

windows programs like to silently die

real sierra
#

maybe paths on the .c files too

sage crag
#

naming things hardest part of making projects

tender river
#

just use wsl neuroDinkDonk

sage crag
#

ye just wsl

final tinsel
sage crag
#

ye bad

#

use msys2 then

final tinsel
sage crag
#

then installing clang was just pacman -S clang

final tinsel
opaque sigil
#

won't msys2 gcc create a dll

#

so the file is useless anyway

sage crag
final tinsel
#

...hm

real sierra
#

Awkward it does?

final tinsel
#

nono that sounds right

opaque sigil
#

i mean, you're compiling for windows

final tinsel
#

i see no leaf?

#

where leaf?

real sierra
#

ctypes should still work with a dll, no?

sage crag
real sierra
#

you might just have to change the path it checks

#

in pychessapi.py

glass flower
#

IHaveAnErmgi do i have to change the clang command to fix the compilation error? i don't think its a rust issue

opaque sigil
#

it should work yeah

glass flower
#

pthread.h YES

#

file not found

opaque sigil
#

do you depend on pthreads shiro enub

real sierra
#

right Awkward

#

i do depend on pthreads Awkward

opaque sigil
#

there we go

real sierra
#

those arent on windows are they Awkward

opaque sigil
#

nope

glass flower
tender river
alpine frigate
#

What are cpu limits?

tender river
real sierra
#

wsl has pthreads

opaque sigil
#

yup

glass flower
real sierra
#

beyond that i dont have much to tell you on cpu limits

#

crunch numbers

sage crag
tender river
sage crag
#

ermleaf

final tinsel
#

sigh opening wsl.

man i didnt want to look at gnuradio today vedalDepress

sage crag
#

:ermLeafL: :ermLeafR:

sage crag
final tinsel
#

wait also if i compile it on wsl its not gonna run on standalone windows where i have everything else tho, right...?

real sierra
#

tentative limit is something like 4GB

sage crag
real sierra
#

i wouldn't advise getting too close to that limit

alpine frigate
#

erm

tender river
#

pthreads

real sierra
tender river
sage crag
surreal sapphire
final tinsel
real sierra
#

i'll look into if i can fix the pthreads issue but it seems kinda complicated Awkward

tender river
# real sierra i'll look into if i can fix the pthreads issue but it seems kinda complicated <a...
real sierra
#

do i just make my own pthreads.h and have it wrap windows functions? Tomfoolery

opaque sigil
#
#

gl

real sierra
sage crag
#

if you want to do that

real sierra
#

2005 virus lookin

sage crag
real sierra
#

i just wrap windows functions for similar thing OK

#

done

sage crag
#

dont use pthreads then

tender river
#

shiro have you never used sourceforge enub

sage crag
opaque sigil
#

i'm jealous

sage crag
#

c11 has threads.h

#

you dont even need pthread

glass flower
final tinsel
tender river
#

somebody didnt use their pc in 2010s

opaque sigil
#

apparently vcpkg's pthreads package just uses pthreads4w on windows

#

interesting

real sierra
tender river
#

so was i

sage crag
real sierra
#

first 3 or 4 years

#

er is that primary schoo,

#

whatever

sage crag
#

bless you

opaque sigil
#

has anyone ever heard of Fano–Elias coding

tender river
#

i enrolled in 2010

opaque sigil
#

wtf is this crap

real sierra
sage crag
tender river
sage crag
#

it will work

#

i remember this for a fact

real sierra
glass flower
sage crag
#

also msvc has it now i think

alpine frigate
sage crag
real sierra
#

i will work on transitioning to threads.h then

#

will semaphore.h still work Susge

#

nope perish

real sierra
#

r u sure

sage crag
#

use mtx_t instead

real sierra
#

🥀

glass flower
#

SMH shiro not using the latest crossplatform way of programming...

sage crag
#

write your own semaphore its not that hard with a backing mutex

real sierra
#

does threads.h have semaphores

sage crag
sage crag
real sierra
sage crag
real sierra
#

didnt say it was

sage crag
real sierra
#

if its not hard for me its even less hard for windows

sage crag
#

blame c committee

#

pthreads is posix threads, threads is c threads

glass flower
#

Think shouldn't it just be a simple find and replace?

sage crag
#

is it ever a simple find and replace with a language as old and tech-debt filled as C

keen hatch
#

a long time ago I wrote in cpp... and now I'm doing who knows what... ehh

sage crag
#

ermplode yourself

keen hatch
sage crag
#

and your username hasnt changed this whole time

tender river
glass flower
#

annytfSittu well.. i guess i have to wait for you guys to figure it out. i can't figure out how to compile it

opaque sigil
#

wsl neuroPogHD

glass flower
#

scrajj how does that solve anything...

opaque sigil
#

it supplies the things windows doesn't enub

#

like pthreads

glass flower
#

what

opaque sigil
#

you said it broke because it couldn't find pthread.h right
that's not a thing on windows but on linux it is and since wsl2 is just linux it should work there enub

real sierra
#

soon™

tender river
real sierra
#

already working on replacing pthreads

tender river
#

cute chess in wsl, clang in wsl

glass flower
tender river
#

it is a solution MyHonestReaction either way shiro's working on switching away from pthreads

glass flower
#

Awkward switching the whole dev environment to work on something isn't a solution. its a bandaid for missing crossplatform

tender river
sage crag
#

nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn

glass flower
#

Awkward i have wsl installed.. i used it for docker desktop.

tender river
#

ye idk what your setup is but vscode or windows terminal just support wsl ermShark

glass flower
#

i use vscode Awkward

tender river
final tinsel
#

ngl wsl is super easy to use with vscode

glass flower
final tinsel
#

u do wsl --install in powershell, then remote into it using the official wsl extension for vscode

sage crag
#

plumeria

#

flower

#

why all flower names too long for projects

#

not catchy evilSMH

glass flower
#

but then.. how would i test the bot

tender river
#

cute chess in wsl

final tinsel
#

also

#

erm

glass flower
tender river
#

or better yet

#

use __builtin_clz

real sierra
#

CAUGHT copy pasted code

final tinsel
#

not helpin ur case here

tender river
glass flower
#

comfi im just gonna wait until you guys figure out windows support. don't want to install a linux distro just for this

final tinsel
#

HAHA i literally just changed long unsigned to long long unsigned and it worked

#

ITS COMPILED

#

ON WINDOWS

#

NEYEYEAYAYYAYAYAHAHA

#

HAPPY BIRTHDAY SHIRO

glass flower
glass flower
final tinsel
#

almost just went to fork and update with my fix on my school github

with my real name on it

real sierra
#

i will probably deny the PR given how many changes im making on my end

#

easier to just add long over here than it is to resolve a merge conflict

final tinsel
keen hatch
final tinsel
#

you wouldnt kill a baby pull request, would you?

real sierra
final tinsel
#

-# totally wasnt also doing this so i could learn how the whole fork/pull whatever system works cuz ive procrastinated actually doing so for years

#

also, anyone have a link to the right stockfish version/site and all?

glass flower
#

Awkward how do i make stockfish dumber in cutechess?

real sierra
#

then no platform-specific long shenanigans

#

i've pushed both the long fix and the replaced pthreads.h fix @tender river @final tinsel @glass flower

#

please let me know if there are any issues because i obviously didnt test very long

tender river
#

scala supports js interop i wonder if i could create a web page for the token counter evilWheeze

final tinsel
#

i am officially in the "it works, dont touch it" stage of the libchess.so file so uh yeah

real sierra
final tinsel
#

i changed long to long long and ran it inside UCRT64 terminal

#

aur naur

#

ok this is likely a me problem

#

gimme a sec

real sierra
#

@sage crag how does a shebang work on windows

tender river
real sierra
#

cutechess win may be an adventure

#

make sure file ext is .py and that your default program is the right python ver, and pray?

tender river
#

you could create a bat file that runs the python file

#

it may or may not work

final tinsel
#

i tried to do with just a command but it didnt like it

#

maybe it wants full paths?

real sierra
#

idk why but i also found cute chess was seldom happy with something like that

tender river
final tinsel
#

ah ok

real sierra
#

even with full path

tender river
#

also you wouldnt happen to have any spaces in the full path would you susge

real sierra
#

cute chess is seldom happy if the command is not just a single path

tender river
tender river
real sierra
#

u can \ the space out?

#

mayb?

tender river
#

yeahh just \ it

#

surely \ has no meaning in windows paths

real sierra
#

does that work on win

#

can also put the path in ""

final tinsel
final tinsel
#

surely just renaming the folder can't cause any other issues

tender river
real sierra
#

nono i mean put the individual paths in ""
"M:\...\python.exe" "M:\...\example_bot.py"

final tinsel
#

yea no its fine with the spaces

real sierra
#

yeah i had similar issues

final tinsel
#

...frick

glass flower
real sierra
#

those return longs...

tender river
sage crag
#

@real sierra neuroDinkDonk

#

use wsl

#

use wsl

real sierra
sage crag
glass flower
#

OkayEGG just added .into and it works

tender river
real sierra
#

i will nuclear explode u

sage crag
tender river
final tinsel
#

NOW IT DOESNT EVEN SHOW AS AN OPTION EVEN THO IT LET ME SET IT AAAAAAAAAAAA

real sierra
sage crag
glass flower
sage crag
#

ye not trust long

#

dangerous

tender river
tender river
#

probably on 128-bit cpus vedalStunned

glass flower
#

YAAAY it works now.... somewhat. no idea how to initialize tho

glass flower
sage crag
final tinsel
keen hatch
#

It seems I've solved the issue with the cuda oom... that's good neuroHappiCat

sage crag
tender river
#

not very long evilSMH

final tinsel
#

cmoooooooooooooooooooooooooooooooooooooooooon

real sierra
#

uploaded new version with long switched to uint64_t OK

sage crag
tender river
#

do i make toknt web

sage crag
#

2 = 1

tender river
final tinsel
#

shrio

real sierra
glass flower
sage crag
#

web => silksong

#

silksong => insert 30 rosaries

tender river
#

how do i insert more evilGamba

real sierra
sage crag
#

insert 30 rosaries => capitalism commentary

#

capitalism commentary => against rule 3

#

against rule 3 => ban

final tinsel
#

anyone know why no initializey? neuroSadge

tender river
#

ye shiro ban konii evilSMH

sage crag
tender river
#

its easy to fix on linux

#

on windows you have to figure out yourself

#

you can try removing spaces and quotes

tender river
#

i don't guarantee it working

final tinsel
tender river
#

or is it just when passed to cmd /c?

tender river
#

but i dont know for sure

glass flower
tender river
#

has to be a valid uci bot

#

try with some random one you download from the internet

final tinsel
#

stockfish loads

glass flower
#

Awkward it works with stockfish

glad path
#

I added the "hovering" system prompt, seems to improve things a bit

tender river
#

then could be windows pthreads issue evilShrug

glass flower
#

i get the engine debug. so it is running my main function atleast

final tinsel
#

when i used pyinstaller to try and .exe-ify it still didnt work

tender river
#

note that not a single person tested it on windows

#

use linux or wsl or wait until someone (could be you) does make it work on windows

glass flower
tender river
#

wait for shiro to switch away from pthreads first tho

real sierra
#

i already did switch away from pthreads

#

i even pinged you

tender river
#

i thought its about longs neuroNotNoted

glass flower
#

mhm seems like the chess api doesn't work

#

idk

alpine frigate
#

btw what grammar is toknt using? It's counting #include <iostream> as 5 tokens, while treesitter only counts this as 2 tokens

tender river
#

you can do "iostream" for fully standards complaint counting

#

i dont do it because header names are only parsed as a single token in very specific circumstances

#

which i dont want to implement

alpine frigate
#

💀

stoic turtle
tender river
#

treesitter also counts #define j j j jqoj j ja k aj j as a single token

alpine frigate
#

discrimination against C++

final tinsel
#

aight imma try and get 8 hours for the first time in a while, ill see yall later

tender river
real sierra
stoic turtle
#

python

tender river
#

and which os

alpine frigate
stoic turtle
#

windows 11

tender river
keen hatch
#

epic fail... I forgot to replace tokenizer neuroD

Token 40: '<SPECIAL_40>'
Token 41: '<SPECIAL_41>'
Token 42: '<SPECIAL_42>'
Token 43: '<SPECIAL_43>'
Token 44: '<SPECIAL_44>'
<|VOICE|> encodes to: [1060, 6495, 1156, 25313, 21758, 6495, 1156, 1062]
tensor([[    1,     1,     3,  5675,  3120,  1534,  6495,  1156, 25313, 21758,
          6495,  1156,  1062,  4204,  1063,  1032,     4,    42, 26607, 29930,
         34311,  1046,     2]], device='cuda:0')
['<s><s>[INST] What does <|VOICE|> mean? [/INST]<SPECIAL_42> marks spoken dialogue.</s>']
tender river
#

tree-sitter is wrong and it isnt actually built for the purpose of counting tokens so its fine for it to be wrong

glass flower
#

IHaveAnErmgi how does UCI work in the chessapi?

tender river
# alpine frigate So if I push a patch? I get my two tokens?

and <iostream> would be a single token if i implemented the very specific rules:

header name preprocessing tokens are recognized only within
#include and #embed preprocessing directives, in __has_include and __has_embed expressions,
as well as in implementation-defined locations within #pragma directives. In such contexts, a
sequence of characters that could be either a header name or a string literal is recognized as the
former.

if you want to support that go ahead not stopping you thebodiesareintheceiling

real sierra
#

all of the UCI-facing stuff is handled by the chess API in a separate thread

#

you shouldn't need to interact with it directly

glass flower
real sierra
#

a gui typically sends something like:

uci
position startpos
go infinite
#

after which the chess api would unbreak from whichever api call it's halted on

glass flower
#

mhm well.. the gui tells me that it can't initialize. and also no options so.. Think

#

(tho i assume no options is normal)

real sierra
#

no options is normal, those are implemented by the engine

stoic turtle
real sierra
#

can't initialize is not normal though

tender river
#

windows NeuroPossessed good luck shiro neuroNya

real sierra
stoic turtle
#

would it be better if I used my mac?

real sierra
#

time to download clion

tender river
stoic turtle
#

I'll do that in a bit then

tender river
#

shiro will fix windows at some point realistically, you could help him with that if you want to

sage crag
glass flower
#

Think chess_get_board fails to initialize

tender river
#

until then we dont have a clear "do this and that to run your bot" path for you evilShrug

stoic turtle
#

if I do stuff on my laptop I can work on it at school tho

glass flower
#

rust

#

i swapped out the .c files for the updated ones

tender river
#

i should probably test the nonpthreads version too

glass flower
#

Think looks like it

real sierra
#

issues wouldn't be too surprising

final tinsel
#

It’s been 10 mins since I started a stockfish vs stockfish game and then went and brushed my teeth and all, and they have made zero moves. Leaving it on overnight to come back to tomorrow and look at

glass flower
#

comfi well.. have fun debugging. i have no idea how threading in c works

#

huhh for me stockfish moves take like 10 seconds at most

true hemlock
#

this is the lowest wattage my 13900 engineering sample pulls

#

0.5GHz on 2.7W lmao

#

also 3.9GHz on only 9.3W

#

everytime apple fans yap aboout how "efficient" ther chips are imma show them this

sage crag
tender river
sage crag
true hemlock
#

i've made full rants about how "ARM = efficient" is completely misleading

#

but my simplest argument would be about how some max/ultra M chips can easily pull 300-400W

#

most apple shill only looked into base TDP/idle power consumption

#

also apple's chip pipeline are made for low clock high IPC and they have their whole ecosystem built around that in mind

#

and x86 is way more versatile with higher clocks

#

2 different worlds, different things

sage crag
#

mobile arm chips are typically good for how little heat they put out on idle or low consumption

#

but as soon as you go to high consumption it kinda switches with x86 neuroExplode

true hemlock
#

heat dissipation factor is a thing too, apple chips are made massive

sage crag
true hemlock
#

also x86 has a lot of advantages with CISC

sage crag
#

there's a lot of misinformation about this spread because lots of pre-uni education says that "risc is more efficient than cisc, due to pipelining etc"

true hemlock
#

and benchmarks that shows apple chip has higher performance aren't usually a good set point to compare between arm and x86 due to different instruction implementations and most of it are being pure compute workload which gives the higher IPC pipeline (expecially vector) quite the advantage

sage crag
true hemlock
#

also RISC still mostly useless in versatility and its not widely used

stoic turtle
#

All I know is my mac lasts like 5x longer than my windows laptop

sage crag
#

with arm specifically, the ISA is customised per cpu, but arm also has a crazy large instruction set

#

its not really "risc" in its purest form

sage crag
true hemlock
sage crag
#

in hardware, risc is not very common though

rich ibex
#

remember to normalize your normals kids, just spent 2hrs+ on a bug just for it to be a normal i forgot to normalize evilDeadge

sage crag
#

well, except in embedded

glad path
sage crag
#

rv5 is everywhere in embedded

true hemlock
real sierra
#

NAHH no threads.h on windows?

#

windows please

#

just have a single damn library

real sierra
#

Prayge saved

true hemlock
glass flower
#

scrajj i have no problem compiling

tender river
sage crag
tender river
#

wait i forgot about avr neuroCatUuh

#

but its not risc-v its just risc

#

also esp32 are making risc-v not just xtensa devices apparently

#

glueless neuroSadA

real sierra
tender river
glass flower
#

NAILS gcc.... rust bindgen only works with clang.. surely that wont make a difference glueless

real sierra
tender river
#

old compiler

real sierra
#

salute joever

#

have to install new c compiler on windows

tender river
#

try msvc neuroDinkDonk

#

its not an advice i would give lightly vedalDepress

#

you dont have to install full visual studio

#

you can just install the build tools

real sierra
tender river
#

though they're going to be a pain to use without something like cmake

real sierra
#

found download

real sierra
#

not that i know how to use cmake

tender river
#

ye but you havent written a cmake file

real sierra
#

surely it'll pregen one

#

it cant be that hard to make the file i need

glass flower
tender river
#

ye cmake is so easy colonthree

glass flower
#

this is gonna be fun to watch catEat

real sierra
#

-7GB

#

how are the build tools this big

tender river
whole flax
#

woah chess bot competition

real sierra
#

YES chess bot competition!

whole flax
#

i like the restriction

real sierra
#

thanks! much inspiration from the video in the credits

opaque sigil
tender river
#

evilNodders sounds good ye shiro do that

real sierra
#

i dont even know how gcc is installed

opaque sigil
#

pacman -Syyu should do the trick (second y might be optional I don't remember)

real sierra
#

some cursed build tools bundle im sure

opaque sigil
#

no

real sierra
#

i dont have it then

#

that's gcc.exe

opaque sigil
#

where does gcc.exe live

real sierra
#

uhhh

opaque sigil
real sierra
#

mingw

#

bundled with clion it seems

opaque sigil
#

tf

tender river
#

actually i'm impressed nobody asked how to use toknt yet evilWheeze

opaque sigil
#

shiro do yourself a favour and just download the llvm installer from their GitHub then

#

And use clang

glass flower
real sierra
#

SCHIZO mingw SCHIZO msvc SCHIZO wsl SCHIZO clang

true hemlock
glass flower
#

mhm write your own compiler

real sierra
#

try all of them SCHIZO

opaque sigil
#

Native dev is fun on windows isn't it

tender river
#

isnt windows just lovely NeuroBounce

glass flower
midnight sigil
#

that's crazy

real sierra
#

msvc doesn't have threads.h either

#

wait yes it does

#

it built anyway even tho it said it couldnt

glass flower
real sierra
#

i got a .lib file Erm

glass flower
real sierra
#

im sure its fine

lament igloo
#

windows defender is going crazy monkaE

real sierra
#

now to install python catdespair

glass flower
#

winget python mhm

real sierra
#

wait maybe it already here

#

prob old ver tho

glass flower
lament igloo
real sierra
#

latest i have is py 3.11

#

im sure thats fine glueless

true hemlock
#

5.1GHz 10.4W

#

this is definitely way more efficient than ANY of apples chip

#

see what i meant now

#

efficiency can't even be compared nor measured because of bunch of nonlinear factors

#

so neither ARM nor x86 is more efficient

glass flower
real sierra
#

whos gonna tell em

lament igloo
glass flower
obsidian mantle
#

Sooo
Is it going to work on windows?

#

neuroMonkaOMEGA learning linux to make ches bot

real sierra
#

huh.

#

that's... awkward

opaque sigil
glass flower
#

.so Looking

opaque sigil
#

They should have a way to get the suffix

real sierra
#

i changed the name of the file to .so

opaque sigil
#

Or just do the check yourself ig

real sierra
#

ez file rename

glass flower
#

glueless surely that works....

real sierra
opaque sigil
#

This isn't linux shiro

tender river
real sierra
real sierra
#

fine i rename it back to .lib Sadge

tender river
#

but build dll instead of lib

#

lib is a static library

#

you have to build a shared library

real sierra
#

RAGEY fucking windows

glass flower
#

catEat skill issue

real sierra
#

nuclear explosion bomb incoming windows

#

ok cmake cache

#

take my options no complaining

#

stackoverflow my beloved

lament igloo
#

Virus:Win32/Sality.AT SCHIZO

#

bro how many

tender river
#

use ctypes.CDLL('chess') (or 'chess.dll') probably

real sierra
#

nah itll work as is

#

trust

glad path
#

cant you run something to recursively delete those

lament igloo
#

would reformatting the drive truly erases all traces of this Sality virus

glad path
#

the sality things

lament igloo
#

cus i swear this shit is making me crazy SCHIZO

obsidian mantle
#

what the deal with dll and lib?
You cant replace lib without replacing the exe using it, but you can with dll?

glass flower
glad path
#

i mean

#

you can backup to cloud

#

and nuke the drive

lament igloo
opaque sigil
real sierra
lament igloo
#

and whenever i try to click "Start Action" 30 more popup

glass flower
real sierra
#

its compiling to something but not a dll

#

wtf is a .lib

#

i dont understand SCHIZO

glass flower
#

static library. dll is dynamic link library

real sierra
#

OH

#

wiat

glass flower
#

static libraries get compiled into the exe. dll can exist next to it

real sierra
#

no that didnt fix it NeuroBwaa

glass flower
#

catEat compile a dll....

real sierra
glass flower
#

catEat well.. change that

real sierra
glad path
#

or jut install an antivirus

glass flower
#

if you use cmake i think its like 1 option you need to set. or chang the project or something idk what your cmake file looks like catEat

real sierra
#

I DID IT

glass flower
real sierra
glass flower
lament igloo
#

i should just fully wipe the drive yo

real sierra
#

ok

#

i switch mutex type to recursive

#

wait Susge

#

that doesnt make sense...

real sierra
#

idk how deadlocks are possible Susge

#

i make sure they wouldn't be

glass flower
#

CatChest deadlock? you mean that new valve game

glad path
#

valve can't make new games

#

they like

#

forgot how

real sierra
#

ahhh it is recursive mhm true

#

but its not a deadlock, it's intentional

glass flower
real sierra
#

unless it can only be unlocked by the locking thread

glass flower
#

Think only one way to find out

real sierra
#

i mean if thats the case then you just cant implement semaphores

glass flower
#

uuh why did it work on linux tho? are they automatically recursive?

real sierra
#

and it also doesnt make much sense if mutexes have to be locked and unlocked in the same thread Om

opaque sigil
opaque sigil
#

Shiro please

real sierra
#

that doesnt make sense

#

well it does

#

but it doesnt

glass flower
real sierra
opaque sigil
#

You lock

real sierra
#

you took away my semaphores RAGEY

#

not my fault windows is lacking basic support for threading features

glass flower
#

RAGEY just find a library for it then

opaque sigil
#

Every other thread that tries to lock blocks until the one that has the lock unlocks

real sierra
opaque sigil
#

Mutexes are just semaphores with 1 ticket

glass flower
real sierra
#

besides it works on linux nuhuh

glass flower
#

uuh why tho..

real sierra
#

windows fault

glass flower
#

uuh that seems more like a lucky accident that it works on linux

real sierra
#

my semaphore was initialized with 0 before

keen hatch
#

One thread locks a mutex, another waits until the thread that locks the mutex unlocks it... that's the whole point.

glass flower
#

mhm btw... windows has semaphores

real sierra
#

theres no shard semaphore lib between win and linux nuhuh

#

only shared threads.h

#

The behavior is undefined if the current thread has already locked the mutex and the mutex is not recursive.

glass flower
opaque sigil
#

Are you trying to lock the same mutex multiple times

glass flower
#

Awkward wait.. nvm thats rust

real sierra
#

mandatory for the functionality

opaque sigil
#

That's stupid

#

Don't do that

glass flower
#

Erm thats stupid

real sierra
#

bruh wdym stupid

opaque sigil
real sierra
#

if you want a semaphore you can wait on

opaque sigil
#

It makes no sense

#

You already have the lock

glass flower
#

Erm why would you want to lock the same thread multiple times

opaque sigil
real sierra
#

ok ur jsut not gonna listen

#

not worth explaining

opaque sigil
#

I'll listen

real sierra
opaque sigil
#

actually curious

#

There must be a misunderstanding somewhere

real sierra
#

the flow of events is like this

#
  • initialize semaphore
  • start second thread for UCI processing
  • wait for second thread to post semaphore
#

these 3 all happen in the first thread in that order

#

you can't initialize the semaphore in the second thread, or you could hit the wait before it's initialized

#

the wait is mandatory to ensure you dont return to bot code without the UCI library having initialized the board state from the gui

#

if you want to implement the semaphore with a mutex, this means the semaphore mutex must be locked by the time you reach the wait

opaque sigil
#

That sounds like you want a condition variable

real sierra
#

but then you must lock it from the same thread

real sierra
#

tho

#

i havent looked at condition variables

#

could work

opaque sigil
#

So the main thread blocks until it gets flipped by the other thread

real sierra
opaque sigil
#

Semaphores work I guess but that's really scuffed and not what they're made for

real sierra
#

it worked OK but yeah it did feel like a contrived use case

keen hatch
real sierra
#

0 count semaphore

real sierra
#

it needs to be multithreaded tho

#

the UCI interface must process input while inside user bot code

#

which does not have pause points

opaque sigil
#

You basically implemented a condition variable with a semaphore

real sierra
#

ok ill look into condition vars and see if these work

opaque sigil
#

You confused me because I thought you used a semaphore as yknow, a semaphore enub

#

Idk if c even has condition variables

#

If not you can always do it with atomics I guess

real sierra
#

:D

#

thats why im happy you mentioned it

opaque sigil
real sierra
#

it seems a bit complicated to use though

#

there aren't a lot of suggestions as to how to best use them

opaque sigil
#

It's a bit convoluted for such a simple use case I guess

real sierra
#

i think i see how i wanna do it tho

#

mhm lets see if this works

opaque sigil
#

There is a pretty standard example on the c++ page (logic should be identical)

real sierra
#

it seems like it's working

glass flower
real sierra
#

there's some weirdness being printed to the console

#

but it seems functional

opaque sigil
#

If you're okay with busy looping you can also just use an atomic variable

real sierra
#

noper busy loop bad

#

could impact other bot

opaque sigil
#

I guess that's true

real sierra
#

seems like its working fine now

#

at least the concurrency aspect of it

opaque sigil
real sierra
#

i'll push these changes shortly once i test on linux as well

#

i made a small change to pychessapi.py ill also push, which automatically changes if it looks for dll or .so based on platform

spiral copper
#

hi, just a heads up for the chessbot event. the tokent repo can't be built with sbt if you're using openjdk 21,
I needed to downgrade it to openjdk 17 first.
I had no experience with scala so this was pretty confusing for meneurOMEGALUL

glass flower
#

PagBounce someone actually tried toknt

spiral copper
real sierra
tender river
#

either way there are prebuilt artifacts

#

they're just hard to fnid

opaque sigil
#

Doesn't it target java 8 anyway

rigid timber
real sierra
#

neuroHypers good news

#

py bot successfully added to cutechess

glass flower
real sierra
#

Working Directory should be the path to where your bot.py file is

#

my path happens to dox my entire existence so it is redacted

glass flower
#

mhm probably should write that in the py api readme

real sierra
#

YES im gonna test a little more on my end to ensure it works first

#

if you could give me another data point that'd be great

glass flower
#

annytfSittu sure... but i use rust

real sierra
#

oh right

#

no worries then

#

it's broken anyway neurOMEGALUL

#

interesting

glass flower
#

neuroKufufu you could just send the me the c api.... i can just replace them for the rust bindings

tender river
real sierra
#

fix what

tender river
#

fix having to set working directory

real sierra
#

MyHonestReaction wdym

#

thats not a bug

#

cute chess is running python

#

so if you want it to find the python bot you pass to python

#

you have to have it run python from the right working directory

glass flower
#

catEat you could still fix it

real sierra
#

those are cute chess settings nothing to do with me MyHonestReaction

tender river
real sierra
#

Shruge it wasnt working for the other person that tried it

tender river
#

was it working for you tho neuroCatUuh

real sierra
#

maybe it works now but i thought i'd just try it this way instead and it happened to work

real sierra
tender river
#

because the c api wasnt working either

real sierra
#

doesnt mean its the only problem

midnight sigil
#

how can it even crash

real sierra
midnight sigil
real sierra
midnight sigil
#

I opened a file and that's it

opaque sigil
#

A certified visual studio moment

glass flower
#

thats just visual studio

real sierra
#

ok so this one wasnt me SAVED

tender river
#

so chess.dll

glass flower
#

annySipping clang has a libclang.dll

tender river
#

evilShrug LoadLibrary("x") will load x.dll but dlopen("x") will load libx.so

glass flower
#

Think interesting

tender river
real sierra
#

RAGEY its doing the thing again where it uses moves from a freed array again

#

i fixed that issue how is it still happening

#

it doesnt happen on linux anymore

glass flower
#

Think sounds like undefined behaviour

olive sable
#

Goooodmorning neuroWaveA

#

Class in 40 min, gotta go neuroD

real sierra
#

sam woke up and im still awake

glass flower
#

catEat don't worry me too... its 8am

real sierra
hoary lion
#

time to play with wan2.2

glass flower