#programming

1 messages ยท Page 206 of 1

real sierra
#

its even stdlib

#

just like malloc

obsidian mantle
#

oh i can just #define int my_int and access my_int locally its all useless

real sierra
#

ok so question

#

C submissions will be compiled using gcc -Wall -std=c23 -O3 -o bot_exec bot_source.c -L. -lchess -lm (not looking for suggestions)

opaque sigil
#

i wonder if it's because of internal state that needs to be kept

real sierra
#

for C++ submissions is it sufficient to just replace gcc with g++

#

or are the options different

opaque sigil
#

and weird platform specific implementations

#

though i guess the 2nd part doesn't really apply since with malloc you have different ways of getting memory pages too enub

opaque sigil
#

-Wall -Wextra -Wpedantic or bust

#

if it fails to compile you get disqualified

clear sedge
rigid snow
real sierra
#

i can probably leave that off

#

(though it would be funny to see)

clear sedge
#

-std=rust prayge

real sierra
#

rust++

clear sedge
#

my c++ ain't c++ing

#

heavens forbid i try to return a class that derives from another class, why of course it should naturally just try to copy the base class by default! i think???

real sierra
#

your first mistake was using c++

clear sedge
#

why is the base class behavior taking precedent over the overriden one

#

someone kill me please

real sierra
#

is it actually an override?

clear sedge
#

it is

real sierra
#

double check the signature

clear sedge
#

i even slapped a big ole override onto it

real sierra
#

no idea then

clear sedge
#

that's what i'm sayin

#

gdb isn't helping :(

tender river
real sierra
#

1032 tokens

#

just need to find 8 more

clear sedge
#

i saw nothing

real sierra
#

mhm true

#

i can no longer afford to have my increment and decrement on separate lines

#

must move into the conditions

#

1024 neuroHypers

clear sedge
#

i figured it out oh my lord

#

unique pointers to the rescue

real sierra
#

uh oh

#

broke my bot catdespair

opaque sigil
clear sedge
#

undefined reference to typeinfo fuck my life

opaque sigil
#

Welp that didn't last long

clear sedge
#

i figured it out again :D

real sierra
#

something is wrong with the tree reroot fun

#

after the first turn it starts solving for the wrong side's pieces

sage crag
#

phrr

real sierra
#

hi fren

sage crag
#

:happie:

opaque sigil
#

Hii konii

tender river
#

who

tender river
real sierra
#

i cant figure out whats going on here

sage crag
real sierra
#

im

#

so confused

sage crag
real sierra
#

its just spitting out garbage

#

is this a library issue

#

like

#

none of these make sense

#

at all

#

these are not only moves for the wrong player

#

but none of them are legal

#

wtf happened

sage crag
real sierra
#

im super concerned

#

might be valgrind time

sage crag
#

Divers once found a strange lump of bronze in a shipwreck near Greeceโ€ฆ but inside was something no one expected: a 2,000-year-old โ€œcomputer.โ€ Known as the Antikythera Mechanism, this ancient device could predict eclipses, track the stars, and reveal the genius of a lost world. Was this proof that the Greeks were centuries ahead of their ti...

โ–ถ Play video
real sierra
#

classic antikythera

#

ok it was a problem with my code not the api

rigid snow
real sierra
#

code trying to checkmate itself again Gladge

rigid snow
#

i am not saying it's not

#

is ye you or yes or both

sage crag
rigid snow
#

or a controversial public figure

clear sedge
#

i physically pogchamped

#

string parsing is theoretically complete for my json parser

#

!!!

#

god bless std::wstring_convert
no idea what they were smoking with std::codecvt tho

opaque sigil
#

I'm lazy I just use simdjson enub

clear sedge
#

see i'm lazy in a different direction that leads me to doing more work

real sierra
#

bot made illegal move

#

move finder problem? or an edge case when my bot is low time

#

no way of knowing

sick owl
#

Okay, so Magistral Small 2509 is cracked in my testing

#

I believe the benchmarks indicating it beats Medium 1.1

#

It also uses very few tokens for simpler queries compared to Qwen 30BA3B

real sierra
#

im so lost

#

so the bot explores this line in a position i gave it

info time 660 nodes 9729 info pv c2c4 d3c2 d2b1
#

in this position, c2c4 is mate

#

?

#

to confirm this, i tried adjusting the test input to make the move c2c4 before giving the board to the bot

#

and sure enough the bot says there's 0 legal moves

#

sooo

#

..?

rigid snow
#

bun ffi does not fucking support structs

sage crag
#

!felloff

stiff micaBOT
real sierra
#

!cookie

rigid snow
nocturne olive
tender river
#

they should probably be added to the general api

sick owl
tender river
tender river
nocturne olive
rigid snow
#

it should probably just be a node binding in the first place

real sierra
#

do you mean

#

passing a board by value

sage crag
#

/tldr

real sierra
#

or something

stiff micaBOT
#

๐Ÿช neurOMEGALUL Om nom nom
You've given me 33 cookies! | I've received 245356 cookies total!

nocturne olive
tender river
rigid snow
#

boards are passed as pointers which is fine

real sierra
#

i dont remember the functions you mean

sick owl
#

Something I very much appreciate them for

nocturne olive
#

Very silly

#

Well I still don't have enough need for LLMs to warrant programming an inference interface

sage crag
real sierra
sick owl
#

Offline and it beats Google Translate/DeepL in quality

rigid snow
#

i still don't have enough need for any llms let alone any locally runnable ones. i put $60 on openrouter on a whim half a year ago and i have only spent $6 since then

nocturne olive
sick owl
#

Poor twitch chat neuroD

rigid snow
nocturne olive
sick owl
rigid snow
#

yeah sure but i prefer to talk to humans and use llms for technical stuff

#

the first part they may do well

sick owl
#

See for me its mainly quick info retrieval and translation like I said earlier, I do use cloud for programming

#

But for simple questions, translations and web search I'd rather have the privacy of a local model and save some money in the process

nocturne olive
#

Cloud models are too pricy for me, I simply just don't vibecode

rigid snow
#

web search
<insert search engine> is right there

nocturne olive
#

Eh, LLMs can usually parse the data into a form where you get a more direct answer to specifically your problem

sick owl
#

I don't vibe code but I do use cloud models as a second opinion on stuff and to generate simple functions quickly to cut down on dependencies

sick owl
nocturne olive
sick owl
#

If I just want to grab the release date of something quickly for example or get a word definition its much nicer

sage crag
#

rand should be mutable i have failed

sick owl
nocturne olive
#

Rust be silly

rigid snow
#

if openrouter ever brings code completion apis those $60 will evaporate fast
somehow they still don't have code completion but have audio input and image generation

#

i do miss tab complete from copilot

tender river
nocturne olive
sick owl
sage crag
sick owl
#

I don't mind that my stoopid questions might make their way into training data if it means free access to GPT-5-High for the rare query that really needs it

cloud horizon
sage crag
cloud horizon
#

done

sage crag
#

WRONG

#

ye need /cookie

nocturne olive
cloud horizon
sage crag
#

126054 cookie

tender river
cloud horizon
#

!felloff

stiff micaBOT
cloud horizon
#

canvas first

sage crag
#

average user have give nuro 0.94 cookie

stiff micaBOT
#

๐Ÿช neurOMEGALUL Om nom nom
You've given me 6 cookies! | I've received 245358 cookies total!

rigid snow
ivory plinth
#

๐Ÿช

stiff micaBOT
#

๐Ÿช neurOMEGALUL Om nom nom
You've given me 4 cookies! | I've received 245359 cookies total!

rigid snow
#

i am less generous

#

my cookie worth more

tender river
#

evilSMH cookie fungible

real sierra
#

debugging hell

hollow spruce
#

Yo

real sierra
#

my janky code is breaking spectacularly

#

and i have no idea why

#

everything ive tried is working right

hollow spruce
#

Show me ?

hollow spruce
# real sierra debugging hell

Give me list of problem u have
{
i give the bot a chess position where there is a one-move checkmate on the board
however, i see that when it explores this position, it finds more moves after the checkmate
but if i make this move on the chess board myself and give it this board instead, it correctly states there are zero legal moves
}

real sierra
#

i give the bot a chess position where there is a one-move checkmate on the board

#

however, i see that when it explores this position, it finds more moves after the checkmate

#

which is not possible

#

but if i make this move on the chess board myself and give it this board instead, it correctly states there are zero legal moves

#

that's my issue

tender river
real sierra
#

shouldn't be shared

hollow spruce
tender river
real sierra
#

YES was a logical place to start

hollow spruce
hollow spruce
#

LITTERY Convert cannot be run

real sierra
#

ah.

#

wait

sage crag
#

@real sierra i recently learn something

hollow spruce
sage crag
#
for (;;) { continue; }
while (1) { continue; }
loop: { goto loop; }
#

for bytecode interpreter, last one save two token

real sierra
#

goto carry

#

tho

#

actually i see

rigid snow
real sierra
#
// Makes a new, blank board. Caller responsible for freeing.
static Board *create_board() {
    Board *board = (Board *)malloc(sizeof(Board));
    memset(board, 0, sizeof(Board));
    clear_board(board);
    board->can_castle_bk = false;
    board->can_castle_bq = false;
    board->can_castle_wk = false;
    board->can_castle_wq = false;
    board->fullmoves = 1;
    board->halfmoves = 0;
    board->last_board = NULL;
    board->en_passant_target = 0;
    board->whiteToMove = true;
    board->refcount = 1;
    return board;
}

// Creates a shallow copy of the given board
static Board *clone_board(Board * board) {
    Board *new_board = (Board *)malloc(sizeof(Board));
    memcpy(new_board, board, sizeof(Board));
    new_board->bb_black_moves = NULL;
    new_board->bb_white_moves = NULL;
    //new_board->last_board = NULL;
    if (new_board->last_board != NULL) {
        new_board->last_board->refcount++;
    }
    return new_board;
}
#

think i found part of prolbem

sage crag
real sierra
#

the assumption made was that refcount is initialized in create_board so clone_board no need worry

#

but then clone_board overwrites refcount with the value in board

#

during the memcpy

#

so it needs to explicitly be set to 1

sage crag
#
loop: switch (*pc++) {
  /*exit*/ op(return 0)
  /*print*/ op(__builtin_printf("hello\n"))
}
#

ye bytecode interpreter actually so easy people think it complicated SMH

tender river
sage crag
#

computed goto would be fun but ye so many token neuroSadA

sage crag
#

phrr

stark needle
hollow spruce
stark needle
#

I had a weird dream where i played chess with shiro in vrchat

sage crag
#

wpedantic

rigid snow
hollow spruce
#

I hate most google cloud shell

stark needle
rigid snow
#

why are you awake

#

why am i awake

rigid snow
#

neuroDinkDonk eu chatters go sleep

sage crag
#

nompe

stark needle
real sierra
#

im even worse at chess

#

my bot is already better than me

tender river
#

neuroDinkDonk eu chatters wake up

hollow spruce
stark needle
#

What I'm gonna do is

tender river
#

eu โœ…

sage crag
#

eu chatters eu chatters

stark needle
#

Eat a whole package of gummy bears

sage crag
tender river
sage crag
#

bad

#

eat two package of gummy bear

stark needle
sage crag
#

dont care

hollow spruce
#

Bro heat waves
In raining season

rigid snow
#

diabetes neuroHyperYay

sage crag
#

yay

stark needle
rigid snow
#

are you actually schizophrenic or is that a figure of speech

stark needle
#

I am unfortunately

rigid snow
#

oh

stray dragon
#

:(

stark needle
#

It's not fully diagnosed yet cause it needs 6 months but my doctor told me it's obvious and unlikely to improve

rigid snow
stray dragon
#

rip

stark needle
#

I just take it in a fun way cause what else am i supposed to do lol

rigid snow
#

good, embrace it

sage crag
#

@real sierra is your system little endian or big endian

#

this matters for my vm

sage crag
#

im packing the bytecode into 64 bit literals to save space

#

but this means that endianness will affect the order the bytecode is interpreted

real sierra
#

will the vm be LE if my main system is LE

sage crag
real sierra
#

cuz i have no idea how to check on the vm Om

rigid snow
#

moderate endian

real sierra
#

actually

#

i have no clue how to check on my main system either

#

both systems are x86 i believe so

#

should be LE

#

on both

sage crag
#

vm 700 mb/s "hello!" throughput

#

pure C 842 mb/s throughput

#

83% of C performance

real sierra
#

probably faster than python LOL

sage crag
#

yes indubitably

#

every vm ive written has been faster than python

real sierra
#

in this small of a footprint tho

#

super impressivbe

sage crag
#

not really, most of the work is still being done by c

#

the art of making a performant vm is to delegate more of the work to the host machine neuroPogHD

#

bytecode is 0x0201, this is the whole vm

#

its not really a big deal to get to 83% of c printf performance when all the vm is doing is handling a loop and a native printf call

real sierra
#

wait

#

how does that switch work

sage crag
#

ye magic

real sierra
sage crag
#

#define op(...) case __COUNTER__: __VA_ARGS__; goto loop;
leaked

real sierra
sage crag
#

if i swap instruction by mistake whole program break

#

but save so many token

real sierra
#

ive identified the issue

#

somehow, i'm not undoing all the board moves im making

#

idk what i changed to cause that

#

its not the simulate function sus

#

somewhere else...

#

the spacing on something like tree ->moves[i] doesnt matter right

sage crag
tender river
#
for (int i = 10; i --> 0;) printf("%d\n", i);
real sierra
#

my brain is so fried

#

idk where the issue is

#

it all loks correct

#

it's only sometimes that it changes too? NAHH

tender river
sage crag
#

ohhh

#

you trick

tender river
sage crag
#

i-- >0 MyHonestReaction

#

godbolt is complaining but my local compiler isnt

stray dragon
#

also unnecessary

sage crag
sage crag
stray dragon
#

--i

sage crag
#

no no its different

stray dragon
#

?

#

why have >0

#

if anything over 0 gets treated as true

tender river
#

can change to --> 5 evilShrug

stray dragon
#

and 0 is treated as false

sage crag
#

i--:
9
8
7
6
5
4
3
2
1
0

stray dragon
sage crag
#

--i:
9
8
7
6
5
4
3
2
1

stray dragon
#

i swear it wasn't like that though

#

hmm

sage crag
#

noper

tender river
#

++i preincrement i++ postincrement

stray dragon
#

wait

#

AH

sage crag
#

--x evaluate to x-1

#

x-- evaluate to x

stray dragon
#

i see why i was thinking --i instead of i--

#

it was because of the oppositev version i used

sage crag
stray dragon
#

for(i=-1;++i<64;)

sage crag
stray dragon
#

in that case the ++i makes it go from 0 to 63 instead of 0 to 64

sage crag
#

i compiling with -std=c23 -Wall -O3

#

on both

#

both clang

#

but godbolt doing funny

real sierra
#

OH

#

i think i get it

stray dragon
#

(shiro did not get it)

sage crag
real sierra
#
while_ moves-- bclose
            chess_undo_move no_args_after_board
            __builtin_printf("undid move, need to undo %d more\n", moves);
        }
#

ive been using structures like this

#

no worky right

#

oh sorry let me unmacro all that

#
while (moves--) {
            chess_undo_move(board);
            printf("undid move, need to undo %d more\n", moves);
        }
#

but

#

this no worky

#

because even if moves is already 0

#

it has to evaluate the condition

#

which will drop moves to -1

fast pagoda
real sierra
#

what a terrible title

#

was this video made just to spite me

#

W channel tho

fast pagoda
#

It was made to ruin your life

real sierra
#

anyway

#

i bet if i move the move-- out of the condition

#

problem disappear

#

tragic tho because now my token count go up by 1 NOODANCEBUTFAST

fast pagoda
#

Regression progression

real sierra
#

actually it go up by 2 catdespair

sage crag
real sierra
#

the semicolon

sage crag
real sierra
#

if move 0 entering loop

#

it still decrement move

#

which bad

#

because condition always evaluated at least once

tender river
#

theres do while or goto but maybe more tokens

real sierra
#

it fine

#

just gotta find token savings elsewhere

tender river
sage crag
#

waitge

#

lie

#

ye

#

while(move & --move) MyHonestReaction

tender river
real sierra
#

wholesome

#

but i need moves = 0 after the loop

tender river
#

still less tokens colonthree

#

even if you move --moves back to loop body

sage crag
#

use do while

#
int main() {
    int moves = 0;
    do __builtin_printf("%u\n", moves); while (moves--);
}

print 0

#
int main() {
    int moves = 10;
    do __builtin_printf("%u\n", moves); while (moves--);
}

print
10
9
8
7
6
5
4
3
2
1
0

real sierra
#

good news

tender river
real sierra
#

bot fix

#

bad news

#

1029 token

#

5 token where Susge

delicate dust
#

I'm curious, what are you doing shiro?

real sierra
#

tldr im planning on hosting a chess bot contest here

sage crag
#

chess is side effect not main goal

real sierra
#

entries have a source code limit of 1024 tokens

#

ive put my bot together to help test and am trying to make it fit in the limit

#

it like fitting elephant in suitcase tho

sage crag
#

why is there a sticker on my face

delicate dust
#

so, like code golf?

real sierra
sage crag
#

code golf ye

#

token golf

real sierra
#

but tokens instead of source code len means you dont have to minify it to an illegible mess at least YES

delicate dust
#

got it, pretty interesting

real sierra
#

for example look at this beautiful function of mine

tender river
#

best_score_eq_best_score_gt_score_best_score_or_score_sc

sage crag
real sierra
#

its readable

sage crag
real sierra
delicate dust
#

This explains the use of macros

real sierra
real sierra
tender river
real sierra
sage crag
#

a = b

#

a == b

sage crag
real sierra
#

im a math major they're the same thhing to me

tender river
#

fake math major evilSMH

real sierra
#

i wonder how long this is with the macros expanded

sage crag
#

ye real math major is actually programmer

sage crag
tender river
real sierra
#

ooo konii right tho

#

lets see

#
shiro@chess-box:/stg/backend/api/c$ cat test.c | wc -c
12011
shiro@chess-box:/stg/backend/api/c$ gcc -E test.c | wc -c
47791
delicate dust
#

I haven't touched c in so long, that seeing it makes me feel old

tender river
real sierra
tender river
#

remove and recount

real sierra
#

ill comment out the headers

#

Huh

shiro@chess-box:/stg/backend/api/c$ gcc -E test.c | wc -c
7845
#

smaller..?

tender river
#

ye wc

sage crag
#

ye wc

real sierra
sage crag
#

sym_super_symbol -> { } {}

real sierra
#

write to file and token count

opaque sigil
#

almost as if not including headers means those aren't preprocessed

tender river
#

| java -jar toknt.jar /dev/stdin

opaque sigil
real sierra
#
shiro@chess-box:/stg/backend/api/c$ java -jar /stg/backend/token_count/toknt-assembly-0.1.0-SNAPSHOT.jar ./test.preprocessed 
?
#

needs .c?

tender river
#

ye

#

how is it supposed to know the language evilSMH

real sierra
#
shiro@chess-box:/stg/backend/api/c$ java -jar /stg/backend/token_count/toknt-assembly-0.1.0-SNAPSHOT.jar ./test.preprocessed.c
1587
#

not bad

#

i think thats a decent token compression ratio

#

can i compile the .so with -O3 ????

#

i havent been, i wonder how much performance it's cost me

#

@sage crag MONKA

Please note the warning under -fgcse about invoking -O2 on programs that use computed gotos.

#

you were sure you werent using those right

opaque sigil
opaque sigil
sage crag
#

cost too many token

#

not worth performance gain unless i have token to spare later

#

computed goto cool technique

#
void *labels[] = {
  &&erms, &&ermies
}
goto *labels[*pc++];
erms:
  return 0;
ermies:
  printf("hello!\n");
  goto *labels[*pc++];
#

just cost lot of token

#

fast for bigger instruction sets but can be slower for tiny instruction sets since goto

#

computed goto have good performance characteristic generally especially for vm with simple instructions

#

since branch prediction

#

ye

opaque sigil
#

damn cpus with their annoying crutches

sage crag
#

computed goto faster than function ptr LUT too

#

cant remember why

#

probably local stack + inlining

tender river
real sierra
#

how do i get 5 more tokens Sadgi

sage crag
#

not use seem painful

#

koni got more simple

#

less token

#

switch

#

invisible

real sierra
#

tokens

#

where are teh tokens

#

i cant find anywhere to save even one token

#

well thats a lie there's still stdbool

#

but thats permanent

stray dragon
#

why stdbool anyways

tender river
#

ye use char same thing

real sierra
#

we have a bond

#

its ok i found a new macro Evilge

#

just had to rename some variables

stray dragon
#

anyways time to figure out how chayleaf's token counter works so i can set it up

sage crag
real sierra
#

saved 3 tokens

sage crag
tender river
real sierra
#

just need 2 more

tender river
#

then java -jar toknt.jar file.c

stray dragon
tender river
stray dragon
#

1, 0

sage crag
#

101 also truthy

#

1 << 16 also truthy

#

bool give you true false

real sierra
#

i have no actual reason

#

i just like stdbool

sage crag
#

so you dont have to include it in the main program

real sierra
#

WAI

#

YOU'RE RIGHT

sage crag
#

ye ofc

#

koni alway right

#

i already did that after all jah

real sierra
#

.

#

chayleaf...

#

why does removing #include <stdbool.h> save me 7 tokens

tender river
#

# include < stdbool . h > colonthree

real sierra
sage crag
#

# include < stdbool . h >

#

7

real sierra
#

i thought it was 2 or 3 tokens this whole time

#

includes are expensive

sage crag
#

you can also remove stdint this way

real sierra
#

i dont have stdint

#

just stdlib and chessapi

sage crag
#

well its in your chessapi.h anyway

real sierra
tender river
#

doesnt chessapi include stdbool neuroThink

real sierra
#

good thinking konii

sage crag
#

ye

sage crag
#

koni smart

real sierra
#

thats what konii pointed out

#

so i can remove stdbool

#

and still get my bools Stronge

#

ty chessapi

sage crag
#

koni already use

real sierra
#

1019 tokens NOWAYING

sage crag
stray dragon
sage crag
#

uint8_t *pc = (uint64_t[]){0x201};

#

can you see if this compile

#

on your machine

#

it compile on my machine but not on godbolt

stray dragon
#

i go to latest commit i see files changed

#

no jar file

#

i go through entire repo

#

no jar file

sage crag
real sierra
stray dragon
#

i would not have found it without that screenshot wow

real sierra
#
shiro@chess-box:/stg/backend/api/c$ gcc -Wall -std=c23 -O3 -o bruh bruh.c -L. -lchess -lm
bruh.c:3:15: error: initialization of โ€˜uint8_t *โ€™ {aka โ€˜unsigned char *โ€™} from incompatible pointer type โ€˜uint64_t *โ€™ {aka โ€˜long unsigned int *โ€™} [-Wincompatible-pointer-types]
    3 | uint8_t *pc = (uint64_t[]){0x201};
      |               ^
sage crag
#

why'mst

real sierra
#

different size?

sage crag
#

noe not problem me

real sierra
#

u use same gcc opts?

sage crag
#
main.c:38:10: warning: incompatible pointer types initializing 'uint8_t *' (aka 'unsigned char *') with an expression of type 'uint64_t[1]' (aka 'unsigned long[1]') [-Wincompatible-pointer-types]
   38 | uint8_t *pc = (uint64_t[]){0x0201};
      |          ^
real sierra
#

actually i have -Wall on

#

is that issue

sage crag
# real sierra u use same gcc opts?

buildPhase = ''
tcount main.c
mkdir -p $out/bin
cc main.c chessapi.c bitboard.c -o $out/bin/${name}
'';

env.CFLAGS = "-std=c23 -Wall -O3";

real sierra
#

you may be answering this question a lot if there aren't instructions anywhere YES

tender river
sage crag
#

git ci

real sierra
#

or actually i guess im probably answering this question a lot Aware

sage crag
#

basic SMH

real sierra
#

idk i just build jar from source

sage crag
sage crag
stray dragon
tender river
#

neither do i neuroSad2

stray dragon
#

my condolences

sage crag
#

work forever until your bones are dust

stray dragon
#

oof ouch owie my bones

sage crag
#

dus t

real sierra
#

why bot unironically bongclouding

#

on both white and black now

tender river
#

good move evilNodders

sage crag
#

dumbot

#

no token left for opening book evilWAJAJA

stray dragon
#

NOOOOOOOOOOOOOOOOOO

#

i am crumbling away

sage crag
#

no you are t

real sierra
#

salute my brother

#

it is time to shed tokens

sage crag
#

t send me your source code

#

i will reduce token

stray dragon
real sierra
#

im so confuse

#

my bot still trying to lose as white

#

but won anyway

#

?

#

i think the checkmate finder is working but the rest isnt

sage crag
tender river
#

inting on purpose to reduce the opponent's guard and find a checkmate in their opening

real sierra
#

its a really weird checkmate too

stray dragon
#

behold my creation

real sierra
sage crag
stray dragon
#

i've removed everything unnecessary

#

can you make it negative pretty please

sage crag
stray dragon
#

true

sage crag
#

nopy

#

i lied

#

that 1 << 64

stray dragon
#

oh

#

ok

sage crag
tender river
#

ye that nopy

sage crag
#

๐Ÿ›

#

nopy worm

#

worm with leg

stray dragon
#

evil laugh for undisclosed reason

#

i wonder why it suddenly increased the tokens though

tender river
#

nopy ๐Ÿ›

stray dragon
#

nopy ๐Ÿ›

real sierra
sage crag
#

ye remove includes

tender river
#

๐ŸŽท๐Ÿ›

sage crag
#

woah

#

nopyphone

#

@real sierra neuroDinkDonkneuroDinkDonkneuroDinkDonkneuroDinkDonkneuroDinkDonk

#

your chessapi.h doesnt have #pragma once

real sierra
#

uuh is problem?

sage crag
real sierra
#

how would it be imported twice

sage crag
stray dragon
sage crag
real sierra
#

i c

sage crag
#

two file

#

two include

#

suddenly do twice

real sierra
#

pragma once non-standard sus

sage crag
#

nopie

tender river
#

clang gcc

stray dragon
#

YIPPEE multiline macros don't cost extra

tender river
#

msvc

real sierra
#

In the C and C++ programming languages, #pragma once is a non-standard but widely supported

stray dragon
#

i can make nice looking code

real sierra
#

--wikipedia

tender river
sage crag
#

can

#ifndef ERM
#define ERM erm

// library here

#endif // ifndef ERM
real sierra
sage crag
#

but

#pragma once
#

ye so easier

real sierra
#

OK i do

sage crag
#

is updated header file anywhere

tender river
#

vedalNo

#ifndef ERM
#define ERM

// library code

#endif // ifndef ERM
sage crag
#

ERM macro for erm

sage crag
#

actually it updated source file but

#

sadgi

tender river
#

shiro doesnt use git he just updates the files in the repo manually

sage crag
#

bred do this too

real sierra
sage crag
#

why header file on it own

#

badge

#

use submodule

#

explode you

real sierra
#

nuhuh i dont know what any of that means

tender river
real sierra
#

all roasting me SMH

sage crag
#

shimo

real sierra
#

i should just take my header back

sage crag
#

too late i already save

real sierra
#

scammed

sage crag
tender river
real sierra
#

everyone just ask for code so can bulli me Sadgi

stray dragon
#

ok interesting so with all the defines and includes commented out the difference is just 3 tokens between tcount and toknt

#

hmm

real sierra
#

this is so frustrating TheVoices

#

when bot play white, is cracked

#

ish

#

but when play black, sucks

stray dragon
#

maybe it's the evaluation function?

sage crag
#

flip sign when playing as black

stray dragon
#

^

real sierra
#

already do

#
        rv_assign __builtin_abs(score_gap) >= 4 ? score_gap < 0 : -1;

sage crag
#

then unflip

real sierra
#

,

stray dragon
#

oh so -1 is considered 1 token in tcount, while in toknt it's 2 tokens

#

so all negatives are probably a bit extra tokens now

#

also noticed that "" went from 2 tokens to 1 token

real sierra
sage crag
#

sym

stray dragon
#

why care

#

is fine

sage crag
#

is literal

#

easy fix

stray dragon
#

little tiny change

tender river
#

nERMd what does the standard say

real sierra
sage crag
real sierra
sage crag
real sierra
#

should i stop using <> in imports and switch to ""

tender river
stray dragon
real sierra
stray dragon
#

damn ok

real sierra
#

just convention to use <> for builtin

sage crag
stray dragon
#

thought <> was for standard imports and "" was for local imports

sage crag
#

cant use <> for local import

stray dragon
#

oooh interesting

sage crag
#

can use either for standard import

tender river
#

neuroDinkDonk konii wrong

sage crag
#

prefixed or something SMH

real sierra
stray dragon
#

anyways found a macro that was actually adding 2 tokens

#

smh

real sierra
#

"" will still check standard directory, it just checks local first

#

so switching to "" is better

sage crag
#

dies ire

tender river
#

correct standard

sage crag
tender river
sage crag
#

last minute

#

canbas

tender river
real sierra
#

made debug output for bot

#

can see entire game tree now

#

wonder if can make output json...

tender river
#

OhISee C23 has _BitInt

#

_BitInt(32) -> u32

#

or i32 rather neuroCatUuh

opaque sigil
#

i wonder how gcc implements this

#

since clang presumably just uses the existing types from llvm

tender river
#

so i dont think its that much more effort

#

i don't do this properly since i treat preprocessor tokens as regular tokens

#

but i dont care neuroKufufu

#

i disregard the standard when it says i need to do more work

real sierra
tender river
# real sierra <:Susge:888573531468734555>

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.

shiro i'm not implementing this thebodiesareintheceiling

opaque sigil
real sierra
#

implementation-defined locations

#

screw trhat

opaque sigil
#

My favourite part about #pragma is the Pragma macro

maiden geyser
real sierra
#

classic canvas

#

hey

#

can someone sanity check me

#
(0xff & 0x010303050900 << P)
#

what does this return for P from 1 to 6

#

im starting to think this is wrong

#

actually this is wrong in so many ways

#

wtf Om

tender river
#

0 0 0 0 0 0 you're welcome Neurorb

real sierra
#
(0xf & 0x9953310 >> 4*P)
#

potentially improved

real sierra
#

explains a lot

real sierra
sage crag
real sierra
#

OK nice

tender river
#

neural

real sierra
sage crag
sage crag
real sierra
#

whats it doing

sage crag
real sierra
#

good for it

#

konii do u see the emote in the big vc status

tender river
sage crag
#

its actually doing

ldr $1 2382829
stm [2] $1

where $2 contains an address to an 8 byte section of memory

#

and what im doing here is printing out:
*pc, regs[1], *ptr (where $1 == regs[1], *ptr == [2])

#

3 instructions

#

yay

#

already at 192 token

real sierra
#

:D

#

it work

sage crag
real sierra
sage crag
#

havent optimised tokens at all though

real sierra
#

yea ur gonna have to compress those instructions big time

sage crag
#

also im encoding in bytes not 64 bit literals for now

real sierra
#

ya that'll already be an 8fold increase in code space

tender river
#

9/2 fold

sage crag
#

also also havent implemented the fancy bytecode format

#

ideally i would be using the top one for space but its so much effort

real sierra
#

if you're really careful with code gen, you could try to generate repeat sequences of instructions aligned to the 64-bit word size

#

by padding with no-ops or something

sage crag
#

codegen evilWheeze

tender river
real sierra
#

then you could #define multiple 64-bit values at a time

sage crag
#

im writing it myself catdespair

real sierra
sage crag
#
#define leb128_r ({uint64_t o = 0, s = 0; uint8_t b; do b = *pc++, o |= (b & 0x7F) << s, s += 7; while(b & 0x80); o;})
real sierra
sage crag
#

will c automatically zero variables if i leave them undefined

tender river
#

only globals

sage crag
#

no it will not

#

drat

real sierra
#

i fixed bot again

#

now its wicked good as white

#

lets see how it plays as black PauseSama

#

i find it amusing that if my bot runs out of time it just plays the opponent's last move Om

#

results inconclusive but it looks like it plays quite well as black now, idk if it can find mates tho

#

5head play holy

#

the rook is hanging but if the knight moves, it dies because the only tile it can escape to is guarded by bishop

sage crag
#

nerd play

real sierra
# tender river

๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ ๐ŸŽ

#

๐Ÿ‘‘ ?!

sage crag
real sierra
#

why you doin that

#

im actually pretty sure i know why

#

but it dont make sense either way

sage crag
#

this code is vile

#

and it works neuroPogHD

#

b and o are uninitialised neuroPogHD

#

is that safe neuroPogHD

real sierra
#

no

#

i dont

#

i dont know how that works

sage crag
#

read it

#

from memory

#

that is macro to read it

real sierra
#

im scare

maiden geyser
stray dragon
real sierra
#

LOW TOKEN

wispy tundra
#

This is a better place to ask.

real sierra
# wispy tundra

im not sure unfortunately, i imagine there's some kind of web api

#

@lament igloo know anything?

lament igloo
#

i would NOT want to know more cus cursed code and network requests Smilley

#

no wonder why the site couldn't handle that much ppl