#programming
1 messages · Page 197 of 1
yes
also somehow my formatter doesn't kill it
but the formatter does add a trailing comma
was wondering how i would get my token count down further and then you guys mention C macros lol
have you seen the kinds of macros I've made
nope
feels like war crimes
do show
BRUH
that's where I'm at
the code is completely illegible
half of the keywords are macros
there's some other weirdness to it
I only have one kind of loop now
a for loop from i=0 to some limit I set
that's basically the only loop in my entire code
oh that's super weird
so I can macro it around
it means I reuse the exact same variable names for certain data types so I can bake them into macros too
i've been doing shit like this
whitespace doesn't count as a token
but yeah that's something
I see a bclose on the right
👁️
yep
bclose works on everything I love it
damn i could use macros everywhere
surprisingly tricky to figure out which are useful
the macro definition also counts as tokens
yeah obv
yes shiro
yeah
int main() {
while(1) {
Board *board = chess_get_board();
int len_moves;
if (Move *moves = chess_get_legal_moves(board, &len_moves))
chess_push(moves[rand() % len_moves]), free(moves);
chess_free_board(board);
chess_done();
}
}
could make that one smaller like this
probably

then add macros 


if you make a working fork that supports Haskell alongside all the other langs
that works for me
.{get_board, push, done} := @use("chess.hb")
.{rand} := @use("lily")
main := fn(): never loop {
if mov := get_board().get_legal_moves().get_wrapping(rand()) push(*mov)
done()
}
lack of glob imports really letting hblang down here

i'll also remove java



it looks cool
hblang 
🤫
linker symbol
lily is the hblang stdlib

anything i say is in there is in there
allowed


ye could 
my submission in my new language, JavaChess
stockfish();
4 tokens
source: trust me bro
the stdlib is pretty big already
but not complete

we got silksong before 0.2.0
"make binaries smaller for no reason" tracks

relevant skill
shiro

chay liked it 
it also not link to libc
lily.{target, config} := @use("../lib.hb")
@export("_start", fn(): never {
main := fn(args: []^u8): uint @import("main")
args: ^^u8 = @bit_cast(@frame_pointer())
target.exit_group(main(args[2..2 + @bit_cast((args + 1).*)]))
})
@export("memcpy", target.memcopy)
ok but
look at this though

my eyes
yes its not pretty 
also outdated

ye it reimplements the linux syscalls so it doesnt need libc
I'm not creative enough to make an eye catching robot chess banner
someone beam creative power into me
it's literally just that and then I can launch the contest I think
I'll fix API bugs as I go
1 month ish ya
my chess bot 1023 tokens

can't shrink anymore
actually that lie
I can still
#define voidf } void
maybe saves me some if I'm lucky
wait konii question
ProgramError := enum {
.SkillIssue;
}
ermie := fn(): Result(i32, ProgramError) {
return .err(.SkillIssue)
}
main := fn(): void {
if erm := ermie.to_ok() {
log.printf("hello {}", erm)
} else die
}
result



#define cond x
#define while_ while(cond) {
int main(int argc, char *argv[]) {
int x = 0, y = 0;
while_
#undef cond
#define cond y
while_
printf("hi\n");
}
}
}
?
what is #while_ 
technically you dont need to undef cond
I fix
that's fine my code already gives me warnings
but I know the order of operations better

test
test
d-bus connection
☎️
phone to pc
@stray dragon
in your experience of chess bot writing
are there any functions you feel are missing from the API
from a "this is common boilerplate that everyone will need" perspective
shiro for the love of god make Board* not publicly accessible 
its a singleton internally
so it shouldnt even be accessible as part of the public api
you can just enforce the initialization invariants internally

even if it didn't, it's all local to the bot so the only person harmed by corrupting the board is the bot user
you still can't submit illegal moves
the Gui will just disqualify you 
i wasnt talking about security
i do #include "bitboard.h" to import get_lowest_bit(bitboard) and floor_log2(bitboard) so i can do this to pull a piece's position out of the bitboard
i have no idea how Board is structured
including bitboard.h is legal 
I don't think it makes sense to do bitboard manipulations through the API given the function call overhead would be slower than the computation
but I can include convenience functions for some of the weirder bitboard ops
i just learned of something
yeah i feel it doesn't match the api that well either
__VA_TAIL__
bitboards are definitely kinda low level
maybe a function that just returns an array of ints, representing the positions 0-63 on the board for each piece
would a bitboard_get_x and bitboard_get_y work
that's doable too
no need for x and y
0-63 is perfectly fine i feel
yep
that'll remove tokens from my bot too
win-win

I'll add it to bitboard.h
and then maybe add some bindings for that to the py api
or reimpl it
@trim valve do you think bitwise ops would be faster in python or through bindings to C
this + a function to get the piece at the position would be good i think
maybe just the function to get the thing at the position
that would also shrink my implementation a lot
I can do that
would looking at existing apis help 
could just do a loop 12 times, one for each color of each piece, and then go positions 0 to 63 through the bitboard checking each position for a piece
would only need the thing to check if there's something at position or whatever
would you want get_piece_at to accept an int or a bitboard
i cant sleep
int
i think?
hmm

maybe both actually
yeah the conversion is just
(bitboard, position)
int index = highest_bit(bitboard)
welcome
not define
it's 12 pm here and i have not been to bed
it's something like __builtin_clz
no need
we just mask the bitboard representing the square with every piece bitboard and return the first one that is nonzero
that's why bitboards are fast

it could technically be a one liner
12 am here
programmer sleep schedules are fun
clever
4am to 7 am
PieceType get_piece_from_index(Board *board, int index) {
return get_piece_from_bitboard(board, ((BitBoard) 1) << index);
}
PieceType get_piece_from_bitboard(Board *board, BitBoard bb) {
return (bb & (board->bb_white_pawn | board->bb_black_pawn)) ? PAWN : (...);
}
bye im going sleepy 😴 sql to apacha pa


chayleaf tcount fork saves the Haskell world
yes
I found big token saves came from eliminating array indexing
[x] is 3 tokens
awesome
how does get_piece_from_index act between white and black pieces, if at all?
doesn't matter
1773 tokens
you can't have both a white and black piece on a square
if you want the colour that's a separate function

if the piece at a position is black, and my turn is for white, i want to make the black piece's position contribute negatively to the evaluation function
wait really?
but it might be easier to just have BitBoard get_my_pieces()
then you can just & them
0 means it's your piece
my solution before your api was a thing was to just have the pieces be + if white and - if black
white king = 6, black rook = -4, empty = 0
makes sense
easy to handle
I only look at pieces involved in moves at the moment
so I always know that the piece being moved from is mine
and the one being moved onto, if a capture, isn't mine
shruge it's python surely both are slow
if you do pypy
my evaluation function checks for the piece at a position on the board, and if that piece's color is different from the current turn's color, it contributes negatively to the evaluation function
if same color contributes positively
brain
#define while_(cond) while(cond) {
#define dclose ;}}
#define FUNC(ident, ...) ident() { __VA_ARGS__; }
FUNC(int main,
int x = 0, y = 0;
while_(x)
while_(y)
printf("hi\n")
dclose
)
i suppose could also just mask the other color's moves, sum the scores of the pieces on your side, then do the same for the enemy's side
megamind
my current solution for scoring is kinda lengthy
I think I have a macro popdiff or something
and its along the lines of
my scoring function is uhhh
#define popdiff(board, piece) count_ones(chess_get_bitboard(board, piece, WHITE)) - count_ones(chess_get_bitboard(board, piece, BLACK))
then for scoring I do
int x, y; x = y = 0; would be slower BUT if you define x/y as globals they are zero by default
score = 9*popdiff(board, QUEEN) + ...
int main() {
int x, y = x = 2;
return y + x;
}


i see
didnt know latter definitions can use previous ones on the same line
I have to get up early tomorrow. Goodnight

it because a = b; evaluate to b
i know that much i just didnt expect x to be accessible for y's assignment
@real sierra if you define any variables like int x = 0, int y = 0;
that factor line is crazy
ignore the tiny FFN i slipped in there to deal with position-based scoring
yeah lol

that's why there is a difference between ++a and a++
int main() {
int x = 0;
return ++x;
}
returns 1
int main() {
int x = 0;
return x++;
}
returns 0
yeah but they're just such cursed operators
yes its because its unordered
weird
huh did they not fix this
?
they were bothered enough to make the eval order of function args ordered at least iirc
there is no eval order for ++ but you can remedy it by using it in inside function or something
wontfix 
the almighty committee is never wrong
Order of evaluation of the operands of any C operator, including the order of evaluation of function arguments in a function-call expression, and the order of evaluation of the subexpressions within any expression is unspecified
its a good standard
on some platforms left to right is better, on some right to left is better

why does that work
it doesnt
, is ordered ye
its a trick
smh
yeah that's unary +
wait it does work
i thought it was tricking me by essentially return ++x;
nope 
the x++ is the same as x though
for obvious reason
ok but this is cursed
2?
not 3?

why would it be three
konii 
im adding them together
you arent
no you're not
theres a comma
no

its useful 
ban this 
yummy
t pot
ban this 
depends on the chocolate tbh
hi konii

ew why
azabwaa
based
unbased
bwaazaka
but it's like
solid
but it good

it no good
thinking about all the things I'd add to my bot if I had tokens
it's contents are: cocoa, low fat cocoa, and a pinch of vanilla
I have 4 tokens
sell tokens
expression
to play a single round of rhythm game at an arcade
azaka you should join the chess contest
classic brain short circuit

wtf is a chess contest
an advanced debuggin session
???
I'm planning to host a chess bot tournament
battle royale 
you have wooden chess board
so do everyone else
bots will have a source code limit of 1024 tokens
you have to be the last one

why is it wooden
I can just smack others with the wooden chess board
I heard you're good with obfuscated or shrunken code
easy
so I feel like it'd be up your alley
ye that point

why would give wooden chess board if not intending to hit people with
idk you should have given a metal one
do you bludgeon people in baseball
only i get a metal one
you don't?
cheating
not cheating its in the rules
i feel like you shouldn't answer this one chief

as in as part of the game or
like me personally

how does konii versioning work
that's for me to know and for you to fruitlessly guess
not typically
yes
how long does this leaf stay damn I've been here for three days nonstop
rules didn't say to follow the rules 
week
is NewLeafAbyss.gif your favorite gif
rite of passage
rules didnt mention me specifically
that means im an exception

it's 3dgifmaker76610.gif
I'm amazed the Zobrist hashing code actually works
there are more magic numbers in that feature than I've ever used before
the name feels like a deeznuts joke
thats like... every hash 
and it mostly worked first try
It has also been applied as a method for recognizing substitutional alloy configurations in simulations of crystalline materials.
STOP

To win just make your bot random, and if you lose you go back in time to change the seed. You only have to do it once to do it a million times

Ok now back to bed

this is actually possible in a way
ye just time machine
you just play a random series of moves on the local board

takes about 20 token
and if you lose you unwind back to start and try again
it's like what I'm doing but with less brainpower
this is just brute forcing in chunks

no, because using a uniform representation would be stupid
the board is stored as 64-bit bitboards, one per piece per color
optimizing for space is only useful when you have lots of data
yes me stupid
you not stupid 
you can definitely store the board in smaller amount of memory
stupid be fast though, 256 bits can compare in one clock cicle
im optimised for space not because i have lots of data but because im very cheap to clone
but chess bots are a compute bound task

how much 
or 2 if you double pump
separate boards per piece type make it very easy to generate moves
actually i dont feel like it sorry
more than you can afford
you dont have to answer
for example, all pawn moves for white can be obtained by shifting the pawn board north one square
hmm
I did the math, you can technically fit all 13 pieces for 64 positions in 237 bits
which is just a left shift by 8 bits under the hood
doesnt sound that cheap
blazing quick

cost is relative
wake up chat wake up wake up wake up wake up wake up wake up wake up wake up


eliv queue wake up
???
eliv queue goto &&eliv queue
only possible if the pawns are in their own data structure to begin with
having to search for them would be too slow
Wth is an eliv queue?
ye i see how this can be difficult for ESL
english have adjective before noun
toll free amogus car vc
this is also a difficult part of english
nouns can be adjective
eliv is the friends we made along the way
nouns technically can't be adjectives but we removed the feature of hyphenating noun sequences
ragey
Ye wd have that too, i just dont know what you're talking about
brains don't brain logically is one of the best threads I've seen on the internet
~Shiro ⚫

fastest way to zero
on x86 sure
shiro i have your brain scan 
you deserve to be a plushie
that's only because the microcode has a built in fast-path for a xor a
I zero with my eq_0_sc macro 
no, give me

well also because you don't have to load no value other than one register
5 bytes
also not the fastest way to zero memory of width > register size
what will you use it for
memset algos go crazy
you dont have to loads more than one register with mov variants too 
you can also & 0
the only reason its used is convention
it's mostly specialized instructions not algos
yeah but you see you have to load that 0 from asm
my stack computer project 
immediate constants arent loaded from "asm"
where did you get all those puters to stack
they are loaded from cpu cache 
Everytime i see "asm" i read it as my name but then i realize i readn't 
sleep deprivation
you're asm now
especially with & 0, it has the same specialisation as a ^ a
the dispatch cost for the instruction is more than any actual work it does

which is why pipelining is good 
you cannot have my token
hail the almighty pipeline
can't fit
give me all your trade secrets i can be trusted

to my knowledge I have the only actual chess bot so far
other than t's
but idk how T's performa
i have the api 
Why do you hail something when hail is ice rain?
yeah I'm not really supposed to have one yet
but I figure I'll be fixing bugs during the contest so
I figured it fair
a chess NN nostalgic
I'm excited to see if anyone tried a neural net
one really simple optimisation you can try is fiddling with evaluation function
i.e. logarithm weighting
or sqrt
I treid once to do reinforced NN with chess
my method doesn't really need an evaluation function, I wonder if I should just throw it out
try disabling it and playing it against the version that has it
it only uses it for breaking ties with stalemates
smort
evalation isn't the probleme it the 4096 diffrent moves you can make on a chess board
evolution algorythm
doesn't know about the token limit 
seems too low a number
#neurotic-neurons chess edition
someone did this in seb lague's tournament
actually super impressive to compress 2 min of video into a bot
it from 64 postion on the board to 64 = 64*64 for one piece but alpha go cut the tree by non valid in the NN
video black and white, image is 64 pixels

225 kb
don't need 30fps though
assuming you can store max 64 bits in one token uncompressed
each frame can be 1 bitboard
30fps too high, 10 will be enough for everyone
which is 3600 tokens naively
max 8192 bytes of data
if you use run-length encoding im sure you can get that down to basically nothing already 
gives you 68 bytes per second of video
Anyway it not my project I want to but Neuro inside of a 3D printed human
rle on "video" does not sound efficient
do it temporally
I think their implementation stored the durations until flip for each pixel
ye seem like easiest way
Do you know ONI ?
then you no need store per frame
smort
how to store that though
clever does a lot of lifting here
load bearing word
It a an asteroid simulation from the makers of "Don't Starve " and "Don't Starve Together"
you can just pack it into a struct
linker error sorry
doesn't mean no brain though, just have to find it
The original 121 seconds with 30 fps consist of 121 * 30 * 64 = 232.320 bits being displayed.
This gets compressed to 52.873 bits, so it fits in 827 ulongs = 827 tokens.
just uses rle


you can probably pack a pixel and its duration into a single u16
into a u8
128 frames, one bit color
there's a better way of doing it than that im pretty sure
but i cant remember the method
need to compute if most pixels stay one color for more than 128 frames or not
i think they dont
gotta fit RLE decompressor + video decoder into the rest of the tokens

WorstBotEverMade
pretty easy 
is it better to stream the video directly while you decompress or decompress then read from an array

if you are just doing RLE the first is pretty easy
I think stream while decompress
have to wait between frame anyway
time for compute
if it resets every move too much time to think
it does not
i couldn't find this morning
memory 
i was interested what happened
what happened with what?
i think you just moved topics 
ye you dont need to do this
store 64 bits that encode the colours at the beginning of the video
and then the video data can just be the frame length until the colour toggles
then you get the full width of the integer for frame length
ooooh
there so many edge cases with chess rules 
see storing it is cool
like how not all attacked squares are legal moves
not that it matters since its better to use a u16 than a u8 anyway 
also have to store per-pixel offset indices
and not just for check reasons
unnecessary
64 bits only required
for the colours
why so many bits though
64 squares
for black/white colors?
bitmap
but can't really use a bitmap here, because all the temporal stuff no?
struct Video {
col_bitmap: u64,
data: Box<[u16]>,
}
first 5 bits can encode the pixel number
where byte (i+64*j) stores the ith delay until flip for pixel j
then have a 64 byte array of pointers into that, one per pickle
advance pointers as delays expire
oops
pointer too big
it fine
this is the best way i have thought of
factorio
not many token
factorial chess bot
video
factorio mod with bindings to chess api
(grey spots are clouds)
send moves to the chess comparator
my brain isn't ready to handle factorio memory bank logic
not talking about video decoding
it supports true color too
thats why there are 2 video circuits in the decoder
with a unified timing loop
store time as floats

tell tell

I wanna go home 
I wanna make token
and fix api
I think actually I get many free token if upgrade API 
and not find a car on its side preferably
yeah your thing was generating weird invalid moves or not seeing moves

Okay nearly everything ready 🪛 (will take some weeks)
did you ever spot an obvious pattern
Actually how do I see what mods are alreaedy made for Neuro
tag
neuro car in factorio
not really but a lot of them were to do with nonexistent pawn moves
make a 3d model in blender
do you think ved would join the chess contest
I might try and do a minimal repro of some in a bit but have to do some other stuff first
well Oni is actually also an autism game
here is the output of 10k games
only if he can make a stream out of it

modify the game sprite a bit, sprinkle some pink
I'm scared to look how many hours I have on it


search for illegal move: and it should tell you exactly what move prompted the game to explode
@real sierra note to self investigate this pgn
everything before the curly braces is the pgn leading up to it
you can kinda just ignore the square bracket stuff, its just metadata
Oxygen Not Included?
oooh do you want to make a neuro crewmate?
I love oxygen not included but I always get to the same point in the game and stop playing for some reason
I think I just solve all the immediate challenges and then run out of things to do
yes and let Neuro connect to it
seems a bit too complex with all the options for llm
?
go place a block, pick up resources, run on a wheel, etc etc etc
I let her control the priority queue for the task and set her own schedule
she'll be runing out of air like every two minutes
Only if she set free time while in carbon dioxide and idle there
minecraft ran somehow though
But it is chaos she won't go to the toilet or to her bed etc
I hunger for chess
What is also fun on this are the reversed roles Vedal plays as the player the almighty AI and Neuro get a taste what a human is.
neat im happy he's so keen to share specs
admirable
Ive been working on my own vision LLM (ofc lora training) trying to go for the highest token output .
Been quantizing my own gemma Abliteration :)
Running it on 2x 3090.
not with twitch in mind though. I started off with it being a "it joins discord calls and remembers voice/accents and tries to isolate out individual users.
i basically have whisper-x, and TTS all running on the 2nd gpu (for vram reasons) to not shard.. then running an EXL2 to have a higher token output for faster responses
a giant of a project for a discord bot
TWO WHOLE 3090 DAMN
haha yeah
it started with a 3090
but i was having so much fun i wanted it to grow
originally it was a old 9700k as well but i was like.. lets upgrade mobo etc etc.
I have no game agents or anything that front is new to me..
My idea was really just.. hey it can join friends and give people a great day. That part seemed to work so far!
Originally i was even driving voice inefficiently using RVC but yeah i wouldnt wana do that anymore!
that's great
i can post it somewhere. let me see if there is a channel that lets me
That's crazy how many tokens are you pushing rn
Let me check! I mentioned it before but Again this is from memory it was in the near 300's?
per second
the original one was very like.. bad because i wasnt streaming in and chunking tts properly and like.. it caused gaps in response
i dont wanna make a project. any place i can dump a conversational video?
If you keep talking you'll gain level and embed perm
Idk how long but not that long
ok ill do that! moment i posted it somewhere
doesnt embed.. oh well but yeah remember this was BEFORE proper chunking and streaming of TTS. voice needed work too but its getting better now
good latency also
i started properly retraining!
Latency should be far far far lower
does it do smart stuff like internet search
i guess it does kv for remembering users
you a leaf too
I'm using gemma 3 but abliterated. and then i will re-add restrictions based on people being bad to it and encouraging it to be bad.
Gladly im using discord so im not under scrutiny!
yes! Ive started turning to more assissant hybrid so its also a lil bit more useful!
wait that's crazy
crazy good
so others don't have to download
That's crazy

you said latency is better too now 
Chat
shadow

ive been working on it off and on for a month i believe
damn you're good
constantly migrating because the AI toolset is changing so fast and it leaves me wanting more
@sage crag lawsuit target 
ye
im def not wanting to capitalize on it. i work in entertainment so making people happy is kinda my job and i see it can give people some fun so
lawsuit
maybe i should eventually make it not believe she is korone and just give it her own backstory system prompt
Capitalism my beloved
it has a vector db and a deep memory! pc has 64GB ram but i can expand it to 96gb like my other pc's
not !
i didnt mean now lol
there.. how 1 typo can completely change the message lol!
im just running lots of freelance jobs to like.. maybe allocate more money to it as it grows.
Now get her to sub 1 second latency
she can! the issue at the time was about the chunking of TTS
Fair enough nice
the vision is also really really fast. about 50~80 milisecond per snapshot it generates tokens.. altho like token generation slows down in vision to probably a low 50's ? im not sure i havent benchmarked
i learned it to recognize humans and remember their names
but yeah most people use GGUF for their AI.. i use exl2 but not many people quantize EXL2~3
EXL2 relies on a full vram load of an LLM but because of it its 9% faster then any GGUF
(of the same model)
Yea ur the first one i saw that doesn't use a shitty setup
its kinda funny i went from .. anti AI to kinda falling in love with it some months back and been studying up hard hard hard during my breaks
mine can break out in spontanious singing btw
during sentence!, laugh and cough too!
typedef struct {
uint64_t bitmap;
uint16_t *delta;
} Video;
void video_unpack(Video *video, uint64_t *bitmaps) {
Video vid = *video;
bitmaps[0] = vid.bitmap;
uint64_t frames[64] = {0};
for (uint16_t delta; (delta = *vid.delta++);) {
uint8_t px_idx = delta & ((1 << 6) - 1);
uint64_t frame = frames[px_idx] += delta >> 6;
if (vid.bitmap ^= 1 << px_idx) {
bitmaps[frame] |= (1 << px_idx);
} else {
bitmaps[frame] &= ~(1 << px_idx);
}
}
}
i wrote the decompression algorithm
i think
im still figuring out how i wanna deal with being interrupted though..

we simple people, we forget to init variables
used 3090's are kinda cheap here... relatively
Wtf where do you live
Here they are like 700 used
its when you get in the 5090 territory it becomes expensive.. but the issue is well... 32gb vram 2x.. its a boost but for the cost..
Netherlands. Only catch: Power costs are high
Tell me the street you grew up at
but i have a large home solar farm so i can sustain mine using it
damn bro
Why
tax agency doing ANYTHING to fish information to tax me more
Actually since im here.. does anyone know more about the game agents?
I found one for minecraft ofc.. i think neuro probably uses it too since it moves in a similar fashion.. but i found projects like lmgame..
I didnt like the games they have trained on though
@real sierra
void video_unpack(Video *video, uint64_t *bitmaps) {
Video vid = *video;
bitmaps[0] = vid.bitmap;
uint64_t frames[64] = {0};
for (uint16_t delta; (delta = *vid.delta++);) {
uint8_t px_idx = delta & ((1 << 6) - 1);
uint64_t frame = frames[px_idx] += delta >> 6;
if (vid.bitmap ^= 1 << px_idx) bitmaps[frame] |= (1 << px_idx);
else bitmaps[frame] &= ~(1 << px_idx);
}
}
so its something im exploring.
Only thing i was looking at was RL agents
For a while
things get messy when training.. training outside of loras is where things actually get expensive.
why did i accept *video








what
I don't like weird operators



it special








two leafs so confusing