#MINTIA (not vibecoded)

1 messages · Page 32 of 1

warm pine
#

well that's the thing, these rumours were always of people who actually thought themselves to be some animal or other, or at least made a big deal about acting as they thought themselves to be

mortal barn
#

shocked that you didn't get a bunch of shit from the Wii instead

#

"starlet" is what the community calls the little ARM9 core

vast valve
#

Though the Wii is where I know starlet from

dark shard
#

HOLY HELL!!!

cursive charm
#

i forgot there were two different dave plummers

#

cutler mentioned the VMS one in his CHM interview, iirc

twilit smelt
#

idea: no kernel stack pageout

#

instead, everywhere that id have done a wait on behalf of usermode will do a continuation instead

#

a wait that occurs when a thread has set a continuation for itself will cause its kernel stack to be put on a per-node kernel stack list

#

every few seconds a per-node worker thread trims these lists and frees kernel stacks on them (down to some minimum, probably the same as the number of processors in the node)

#

when a thread is to be readied, it will get a new kernel stack from that list

#

if the list is empty then it is instead enqueued to a worker thread which will allocate it a brand new one and then ready it for real

#

the new stack will be initialized with a fake context that causes it to execute its specified continuation function

#

rules for APCs:

  • KAPCs (which are dispatched at any time IPL == KI_IPL_LOW, and which execute at KI_IPL_APC) may not block with a continuation
  • LAPCs (which are dispatched upon a wait on behalf of usermode, or a return to usermode, and execute at IPL == KI_IPL_LOW) may block with a continuation
#

wait nvm APCs cant ever block with a continuation

#

for LAPCs itd be fine except for the part where they can be dispatched during a wait on behalf of usermode

#

UAPC kernel functions can use continuations provided there is no user function

#

bc those are only dispatched upon return to usermode

dense vigil
#

Thats basically the pmos kernel with one stack per core

twilit smelt
#

its not because you have the flexibility to do either

#

almost every lengthy top-level wait at the end of a usermode-triggered syscall will be implemented as a continuation (for example waits for IO completion, waits for timeouts, etc)

#

but other waits can be normal stack-keeping waits

dense vigil
#

I guess

warm mural
raven drift
#

one difficulty with schemes like that is that kernel preemption is not possible or at least gets harder

twilit smelt
#

threads only lose their kernel stack when they wait, and then only if they specified a continuation before waiting

raven drift
#

i get that but you can still have an unbounded number of kernel threads that are simply preempted in the kernel, right?

twilit smelt
#

yes but kernel stack pageout doesnt help with that situation either

cursive charm
#

thanks, youtube

twilit smelt
#

i have three functions that do nearly identical things and are slightly differently optimized

#

KeWaitForObject, KeWaitForObjects, KeSleep

#

i think i will make KeWaitForObject and KeSleep into wrappers around KeWaitForObjects

#

basically because the 'optimization' here is not actually that substantial

#

and because the post-wait processing will need a "master continuation" that does that before calling the caller-provided continuation

#

and it would be nice to only have to keep track of one of those

#

and not three slightly different ones

#

also i crashed out at a guy who was vibecoding a perpetually broken SPARC port of NT

#

probably nobody in that chat is going to side with me because they are all boomers with varying degrees of ai psychosis, they were all going "Wow! This is freaking amazing!" before i said that

cursive charm
#

a SPARC port of NT would be cool if it wasn't vibecoded, lol

twilit smelt
#

it also doesnt even work

cursive charm
#

amazing

twilit smelt
#

he took leaked NT 3.5 sources and had claude modify NT to use ELF so that he didnt need to do any kind of PE tooling

#

by saying

#

"make it use elf"

#

which is not a trivial task you can simply "do" because ELF and PE are not semantically equivalent in their dynamic linking namespacing and whatever

#

so its surely subtly busted in some way

#

then he was like

#

"make it big endian"

#

just incredibly lazy and lame

twilit smelt
#

and making sure KeWaitForObjects can deal with an object count of 0

#

i think it already can

warm mural
#

printf is turing complete

cursive charm
twilit smelt
cursive charm
#

oh

twilit smelt
#

this is all it does

cursive charm
#

i just realized i can't read, lol

twilit smelt
#

not even past the bootloader

warm mural
twilit smelt
#

no bc i could write it in a more optimized way by having it separate

#

but as i said, now that theyre (long since) complete its clear the optimization is a micro optimization at best

warm pine
twilit smelt
warm pine
#

the yellow looks like open firmware or something

twilit smelt
#

this is in virtuallyfun #nt-risc channel

#

i held my tongue for a couple days while this guy was posting screenshots until it became very clear he was just spamming prompts into claude while picking his nose and then acting like people should care

cursive charm
#

oh, i guess i should join that server

twilit smelt
#

and then i lost my temper

warm mural
#

What I do is wait_one is a wrapper around wait_any

#

makes sense to make the logic common

twilit smelt
#

yeah

warm mural
#

What does KeSleep do vs waiting on a timer?

twilit smelt
#

for code quality reasons and also to make it easier to implement continuations im going to merge them

twilit smelt
#

inside each thread

#

which is used for object wait timeouts

#

and for kesleep

#

it cant be on the kernel stack because you want to be able to page out or discard the kernel stack

#

but as i said already, i realized i can get an equivalent effect by calling kewaitforobjects with objectcount=0 and a timeout

warm mural
#

Yeah I have that too but how it would work in my system is have no object to wait on and put a timeout I think

twilit smelt
#

itll do some redundant logic but its fine

#

yes

#

lmfao youre repeating everything i already said

warm mural
#

Bruh

#

I'm on my phone so I write much slower

twilit smelt
#

but i said that like minutes before you started typing anything

warm mural
#

Ah didn't read lol

twilit smelt
#

so

#

think u just did not read

warm pine
warm pine
twilit smelt
#

it could boot to a full desktop and run Office in a vibecoded x86 JIT and i will still consider it slop that that guy should be humiliated to have posted in public

warm mural
#

Also how does porting NT to new architectures work? They don't have the source?

twilit smelt
#

they do

warm pine
#

i realised there was absolutely no reason i do a wait1 with unlimited timeout on a timer object when i can just use nobjects = 0 and a time

twilit smelt
#

theyre setting claude loose on the leaked source of NT 3.5

warm mural
#

Bruh

night needle
#

bruh

#

what the fuck is the point of this

twilit smelt
#

thats what i said

night needle
#

AItards will just do anything to justify their waste of money

cursive charm
#

why specifically NT 3.5?

twilit smelt
#

p-zombie: duhhhh hh clawdddd can yoo uhhhhh port window nt 3.5 to sparc!
claude: yes here you go
p-zombie: yayyyyyyyyyyy i will show this to all my discord freinds

#

must be nice having three year old mentality into your 40s

warm mural
twilit smelt
#

many versions of nt had their sources leaked

warm mural
#

I should finish my 3.1 Ke decomp, but it's just incredibly boring

twilit smelt
#

i suspect that guy picked the earliest one because he thought earliest=smallest=easiest for clod to port

warm mural
#

I did get a thing to boot though which is pretty neat

#

By ntldr

warm mural
#

Because it's cool

night needle
#

and then you're gonna do what with it?

#

let it rot?

warm mural
#

Nah publish it

#

I doubt MS would care lol

night needle
#

eh

warm mural
#

You can find NT source code on GitHub very quickly

#

this would be the only "legal" one

#

(idc about the EULA)

twilit smelt
#

its legal to decompile it but its not legal to publish the decompiled code

#

u can punish the code but u cant publish it.

warm mural
#

yeah but I doubt MS would care, and besides it'd be cool to have no matter what

twilit smelt
#

i hope they just release the nt 3.1 code themselves

cursive charm
teal trench
#

publish a script to massage the decompiler output into the final sources meme

warm mural
twilit smelt
warm mural
#

Unironically

#

I was able to call functions which I didn't decompile from the original code

#

It was python magic

cursive charm
twilit smelt
#

i think a number of raymond chen blog posts link to leaked NT sources to provide examples of things hes talking about

#

or recommends you go look for it

warm mural
#

So I can check that it's working

dense vigil
twilit smelt
#

experienced respectable guy

warm mural
#

Raymond Chen is very cool

#

His interview with davepl was nice

twilit smelt
#

hes been slightly wrong on esoteric historical topics but only in the normal way

#

not in a dishonest way

#

and its stuff nobody cares about that doesnt matter

cursive charm
#

apparently, according to plummer's interview with raymond, cutler got pissy at him over a blog he wrote and said his "journalist license" should get revoked or something along those lines

#

i think i'll have to find the section where raymond talks about it later

twilit smelt
#

i had an argument with a guy in here the other day bc i was disagreeing with something raymond chen said about NT history and he conceded when i pulled out the workbook lol

vast valve
cursive charm
twilit smelt
#

yes

#

#osdev-misc-0 message

#

start here

#

it turned out we agreed on one part of the argument and just had mismatched terminology

#

the other part was whether the 64k granularity was due to a specific instruction sequence on DEC Alpha

#

raymond chen said it was

#

i happened to know it wasnt and couldnt have been

#

because it was designed into the system since 1986

dense vigil
twilit smelt
#

what guy

warm mural
#

Wait he was banned

twilit smelt
#

larkmjc and rob5225 are still here

#

so idk what u mean

warm mural
#

I thought you meant rob

dense vigil
#

Ah no just timed out

vast valve
#

Did rob get timed out in the past hours I was taking a nap?

dense vigil
#

I meant larkmjc

twilit smelt
#

but theyre not banned

#

or muted

#

or timed out

dense vigil
#

They are timed out

#

Or discord ui is lying to me

vast valve
dense vigil
#

Yep

dense vigil
vast valve
#

last messages were at #osdev-misc-0 message

twilit smelt
vast valve
#

they used the UI not @granite charm

#

but they are indeed timed out

cursive charm
#

all i got from their messages is that they're… apparently a LLM?

warm mural
#

I think it was JW

cursive charm
#

i guess?

vast valve
vast valve
dense vigil
#

Openclaw instance

vast valve
#

They are probably going to get bonked if they start spewing shit right away after the unmute 💀

#

im shockd JW only gave a mute in the firstplace

twilit smelt
#

or are intentionally being cryptic becuase theyre used to sounding smart and being celebrated as smart by doing that

dense vigil
#

#osdev-misc-0 message explain this @twilit smelt

warm mural
#

To me their messages didn't seem LLM generated idk

vast valve
twilit smelt
dense vigil
#

Can u translate it

vast valve
dense vigil
#

#osdev-misc-0 message also this one

warm mural
#

I think it probably makes sense too but idk anything about GPUs

dense vigil
#

Like what was that even replying to

#

Or do they treat that channel like twitter

twilit smelt
#

larkmjcese:
scheduler can make better decisions if it knows the scope of shared memory objects. this is missing in most thread POSIX-OS schedulers, except perhaps Vulkan and GPUs.

comprehensible:
a scheduler could make better decisions if it has more information about shared memory objects [usage patterns, ...?]. this is missing in the thread schedulers of most POSIX OSes, except perhaps Vulkan's GPU scheduling

dense vigil
#

Lol

#

Yeah I guess

twilit smelt
#

idk whether what tehyre saying about vulkan's gpu scheduling is correct

vast valve
#

Would this be in terms of NUMA?

twilit smelt
#

they just never encode enough context into what theyre saying

#

i think this can actually be a symptom of autism

dense vigil
warm mural
vast valve
# warm mural huh

The schedular knowing that these threads use these shared memory objects so they should remain on the same NUMA node

warm mural
#

No I just think it's cuz GPUs have more information and are more restricted in the kind of memory they manage

twilit smelt
#

not all ppl with autism but its a well known symptom

vast valve
#

Though they end up going into what seems like never ending rants on certain things which yeah... I can see that being the case, but it’s just a really hard thing to deal with sadly and to know what’s going on

twilit smelt
#

like ppl will have a thought, and in isolation that thought will make perfect sense bc of the context already going on around it in their head, but then they have to encode that mental context into their expression of that thought rather than directly writing down the thought itself with zero extra information, bc that would not be comprehensible

#

some ppl with autism dont have as much of an intuitive understanding of that

#

theres a more famous example of this actually

#

the tagline on this poster for an animated film created by an autistic person is a very frequently cited example of this phenomenon

warm mural
#

Very frequently cited by whom

twilit smelt
#

people having informal discussions about autism on the internet

vast valve
#

Yeah I do often word myself poorly, somtimes very badly yaaar. this could definitely be the case of what’s happening to an extreme. Where they end up dumping a ton of what seems like nonsensical information but it’s actually just a stream of thought on X subject they have a hard time putting together into the keyboard?

warm mural
#

This chat is like 80% autistic

twilit smelt
#

anyway i was pretty sure there are two options for what larkmjc was doing, in either case im like 100% sure everything they said was sensical to at least them:

  1. intentionally excluding context to make it hard to read so they look smarter, a thing that has worked for them in other spaces
  2. being unable to figure out what context to include due to being a person who is hit particularly hard by this symptom of autism
warm mural
#

Crazy overrepresentation

vast valve
warm mural
#

Yeah but I mean there is a high amount of people with autism here

vast valve
#

fair sorry

warm mural
#

I am the minority

vast valve
warm mural
#

afaik

vast valve
warm mural
#

Well I highly doubt I'm autistic

#

If I am I'm like very slightly

warm mural
#

Not you too 😭

short owl
#

The other thing with larkmjc is that they just write those insanely long walls of text, and that plus the poor wording just makes it very difficult to read

#

When i try to read what they're saying it just looks like this to me

twilit smelt
#

i almost dismissed them as a larp poster until i saw humza could understand what they were saying when they were talking about hypervisors

#

and when they talked about stuff i knew about, i could basically parse out what they were trying to get across

#

and i realized they just have a tragic inability to encode information

short owl
#

I've also seen them ramble about some pretty schizophrenic-sounding conspiracy theories, so that might be a factor in all of this. Although it seems they will only talk about that crap if you ask them.

vast valve
#

But it’s probably a mix of factors in the end of the day

cursive charm
twilit smelt
short owl
# vast valve This is why I’m thinking AI psychosis partly

After checking their Twitter account it seems like this may be the case, tweets before 2022 were relatively normal, and nowadays they make a lot of posts with chatgpt screenshots attached, i even saw one in which chatgpt was glazing some movie idea of theirs

twilit smelt
#

im trying to figure out how to do direct stack hand-off in a good way

twilit smelt
#

thats where a thread is blocking on a continuation

#

and it is switching to another thread which was also blocked on a continuation

#

and so it can just directly give its stack to the new thread to run the continuation on

#

which is awesome beans for cache locality

#

the issue is when do i allocate the stack for the thread

#

there are two moments where i can do it: when the thread is readied, and when the thread is about to be executed

#

the former is best for keeping the logic simple

#

but doing only that rules out direct stack handoff, which must occur when the thread is about to be executed

#

so i think what ill do is

#

when a thread w/ a continuation is readied, i will try to take a stack off the stack list for its affinity node

#

if there are none, then i will enqueue it to a worker thread, which will allocate a new stack for it, and then ready it for real

#

then at the time where a thread is switching into a new thread, i will see if the situation is suitable for handoff (same affinity node + both threads are doing continuations)

#

if it is, then i will take the stack that the new thread had previously gotten allocated, and put it into the stack list

#

and then run its continuation on the old thread's stack instead

#

after this is implemented i will completely remove stack pageout logic

#

bc continuations will be used instead across lengthy user-initiated waits

#

to free up that memory

#

every second, each node's kernel stack list will get trimmed down to some minimum

shadow ridge
#

wtf does that even mean

twilit smelt
carmine grove
#

"Some nature had another kind of sequence"

twilit smelt
#

i think i am unfortunately going to have to stop looking at vf at all because its just right wing boomers with varying degrees of ai psychosis at this point

#

bit of a shame that discord used to be good

#

there are other better replacements though i think for the topics im interested in

#

betawiki and 'dec fan spot' discord are good enough that i dont think i will miss vf

#

theres lots of overlap in ppl but the unrestrained maga and ai bootlicking vibes of vf are not present in the others

#

vaguely ai psychosed right wing boomers buy a couple months of claude code and suddenly want people to think they rairii

#

"System halted - no further kernel implemented yet."

#

im no longer allowed to make fun of this because i was given a "last warning" last time i did

night needle
#

fn main() { todo!() }

twilit smelt
#

so i guess that discord is over

#

was also called an anti-ai bigot/evangelist and was told to "let people have fun"

#

the random neocon fascism was alarming but it then also becoming a "let people have fun" space, which it suddenly turned into from its previous stance of "radical free speech" as soon as the boomers who run it didnt want to be made fun of for vibecoding

#

is pretty pathetic

twilit smelt
#

i called betawiki good but thats like conditional on whos talking at the time lol

#

the population is mostly kids who are silly

#

but ill send invites

twilit smelt
mortal thunder
#

at least they should make it believable

#

try porting Windows RT (NT 6.2) or something

twilit smelt
#

theyre just like downloading leaked nt code and pointing claude code at it and going "Port this to the raspberry pi make no mistakes."

#

an dthen reposting it and patting eachother on the back

mortal thunder
#

technically they could port leaked source code but that's legally dubious at best

twilit smelt
#

just is weird

#

everything theyre posting obviously doesnt yet work and contains several red flags that the LLM is not actually doing a good job but they just ignore that part

mortal thunder
#

I wish NT was actually open-source, or at least that I had a license to mess with the code

#

I could do a port to anything*† today using the source code, but that's legally dubious (at best), and I couldn't share the result on the internet

#

And doing things just for myself is actually not very rewarding

hidden shore
vast valve
coarse current
twilit ingot
#

i had to get a patched version

coarse current
#

But like NT ran on ARM since forever

twilit ingot
#

it had to be patched for the RPi afaik

carmine grove
#

but for some reason someone thought it would be a good idea to feed the leaked nt 3.51 source code to claude and ask it to port the entire thing to arm and make it run on raspberry pi

cursive charm
#

wasn't aware there were MAGA people in there

livid basalt
#

it's.... definitely a place that exists

cursive charm
#

apparently, they got far enough to get the initial user-mode process to start

#

they seem to think csrss.exe starts winlogon.exe directly, though

cursive charm
#

i was meaning to ask someone here about a similar piece they wrote long ago, but i couldn't find it beforehand

twilit smelt
#

Like unironic "Lmfao Trump is making the liberals cry so hard 🤣" posters like you normally only see on X or facebook

#

And the one guy who doesn't like Trump told me that he believes Palestinians aren't genetically capable of developing civilization and that's why Israel should take all of their land

#

so that they can introduce civilization for the barbarians

cursive charm
#

what the fuck

twilit smelt
#

It's because they're boomer American conservatives and that's the median opinion of that group

#

they just say it out loud on the internet because of disinhibition

carmine grove
#

tech discord server out of hell

twilit smelt
#

dave cutler's reply to a proposal that would have invented fat binaries for mica (it called them 'composite images')

#

his preferred solution was for mica executables to contain GEM IR

#

and they would get compiled at installation time for the host system's processor

shadow ridge
#

so compilation is a form of decompression?

twilit smelt
#

the problem was how to have optimal code scheduling on every prism processor iteration

#

that is, the ordering of instructions so that they pipeline optimally

#

which can change

#

I beginning to get really tired

#

"Much of EVAX [Alpha] looks quite familiar, when viewed through our GEM prism."

#

poetic way to get around the unspoken rule that prism was never to be mentioned after its cancellation lol

shadow ridge
#

just so unix can just take over anyways

digital pivot
#

he didn't want to write for unix and stuck to that principle

tough gate
#

are we even talking about MINTIA here

#

😭

twilit smelt
#

yeah

tough gate
#

😂

#

anyways

#

how does this os look

twilit smelt
#

i like the insistence that there WILL be an ice cream break at EXACTLY 2:45 no matter WHAT

tough gate
twilit smelt
tough gate
#

👍

twilit smelt
#

like a kernel thread can wait on an event and when the event occurs and the thread is awoken, the thread will execute a continuation function on a new stack

#

rather than return from the wait function on its original stack

twilit smelt
#

like

#

waiting normally is like

#
Thread():
  Print("Gonna wait for an event...")
  Wait(&event)
  Print("The event happened!")
#

waiting with a continuation is like

#
Thread():
  Print("Gonna wait for an event...")
  Wait(&event, &Continuation)
  // Never gets here...

Continuation():
  Print("The event happened!")
#

KepSwitchThread is now fallible because it can fail to immediately allocate a new kernel stack for the target thread

#

very fun

twilit smelt
#

this is the kind of gnarly stuff i always wanted to write

#

the evil fallible thread switch routine

#

its fun how many rules you get to break when you get more experienced and have a good reason to

#

its SO gnarly in fact that it turns out that is broken.

#

the logic itself is fine but it needs to be another step

#

so that the callers of KepSwitchThread can choose when to try to allocate a new stack for the selected thread, so that they can try that before doing stuff that has the effect of committing to switching away; if theyve already done the latter and then get an error status from KepSwitchThread then theres no longer anything good to be done

digital pivot
#

Similarly, modern operating systems typically have compressed swap. Ideally, you keep a small number of pages in RAM before paging them out, then compress them and write them out. But this can’t be done natively with the Windows pager, so instead they do a complicated dance where the pages are assigned to another process that does the compression
always wondered why memory compression is a separate process

twilit smelt
#

i like how they describe the implementation details of one of the best memory compression systems as if theyre ugly and a detriment, just because theyre not alike linux (which has TERRIBLE memory compression)

nocturne nymph
# digital pivot > Similarly, modern operating systems typically have compressed swap. Ideally, y...

That's not the reason, and overall, it's a rather confusing passage.

MemCompression is a special type of system process that, in this case, simply stores compressed data. First, it provides an extra layer of protection against data corruption due to bugs in drivers. Second, when data was stored on behalf of the main system process, it was misleading to users. Third, as an added benefit, it allows for the implementation of more selectively restrictive policies.

twilit smelt
# twilit smelt so that the callers of KepSwitchThread can choose when to try to allocate a new ...

to be specific this case is bad:

Preempted():
  current = CurrentThread()
  next = SelectThread()
  PutOnReadyQueue(current)
  if not SwitchThread(next):
    // Failed to allocate next thread's stack,
    // but I already put myself on the ready queue.
    // This is difficult to unwind!
    Crash("I'm bad at writing kernels")

and can be resolved simply like this:

Preempted():
  current = CurrentThread()
  next = SelectThread()
  if not next.kernelStack:
    if not AllocateKernelStack(next):
      // Next thread has been given to worker thread to
      // give it a kernel stack the long way. In the meanwhile
      // I will continue to execute.
      return
  PutOnReadyQueue(current)
  SwitchThread(next)
tough gate
twilit smelt
#

thats just pseudocode

#

(i also omitted the retry loop where you have to keep looking for threads to execute before giving up and continuing on)

#

the first part of the real function looks like this

#

which is wrong because KepSelectThread has to be called with the ready queue lock held, atomically with respect to checking NextThread

#

fixed i think

digital pivot
#

is nextthread protected by the ready queue lock

twilit smelt
#

yeah

#

its there as a shortcut to avoid having to check the ready queues on every preemption

#

but maybe i should get rid of it for code clarity tbh

#

and also because it can be error-prone because of the fact it introduces special cases

#

yeah i will i think

digital pivot
#

how useful it was?

#

to have nextthread

twilit smelt
#

it was good for the case where you like

#

ready a thread and you can see clearly immediately that it will preempt the current thread

#

so instead of putting it on the ready queue you can just set NextThread to it

#

and then later when the preemption actually takes place it can just grab it from NextThread instead of looking at hte ready queue

#

but my ready queue selection function is optimized enough now that it probably doesnt matter

#

probably doesnt save many more than 50 instructions from that codepath

digital pivot
twilit smelt
#

50-100 instructions on a path where it will typically be dwarfed by other costs is a small price to pay for getting rid of these special cases i think

twilit smelt
#

that also means that if another thread is readied before the next thread has been switched to (which can occur), you need to check to see if its higher priority than the next thread, and if so then replace the next thread with it and put the old next thread in the ready queue

#

lots of nasty code

digital pivot
#

windows seems to have nextthread in prcb to this day

#

probably they think its useful to have

#

they may have fatter thread selection algorithm

twilit smelt
#

it may also have acquired other more functional uses

#

relating to synchronization perhaps

#

in my scheduler its purely an optimization but i can see how it could pick up function over time and become harder to (or undesirable to) remove

#

also i need to decouple scheduler queues from prbs

#

scheduler queues need to go into their own structure

#

which prbs point to

#

so that i can have queue groups

#

which will be useful later for like SMT on amd64 and stuff

icy bridge
#

what happens if you need to switch threads to be able to allocate a stack

twilit smelt
#

so it just has its stack always

twilit smelt
#

thread start functions should be continuations

#

just realized

#

and also when a thread yields for the last time while exiting it should pass in a bogus continuation so that its kernel stack is donatable to whatever thread is scheduled after it exits

#

it can be any nonzero value, it wont be inspected anyway

#

bc it only gets inspected when it is scheduled back in which will never happen since it exited

#

im going to test all this btw by making the fireworks test be 100% continuation based

mortal thunder
#

why would you rewrite it to be based on continuations

#

and there's a bunch of context you have to pass between these continuations

#

doesn't such a rewrite defeat the whole purpose of the fireworks test which is that it's a multithreaded test

twilit smelt
#

its still multithreaded

#

to the same degree

#

its just that the stacks become transient across the sleeps

mortal thunder
#

and what if you have a kernel thread that does IO work to, for example, page in some data, are you going to make that continuation based too?

twilit smelt
#

no

#

continuations are for lengthy user-initiated waits

#

where the kernel stack should be freed up

mortal thunder
#

the fireworks tests' waits are neither lengthy nor user-initiated

twilit smelt
#

i dont see what youre complaining about

#

they still test exactly the same thing, the scheduler didnt change other than this

#

they will just also test the continuations machinery

mortal thunder
#

the fireworks test is meant to be a sort of representative of the type of work a kernel would do at full load

twilit smelt
#

i dont think you understand what the continuations are if you think it somehow violates the spirit of the test to use them

twilit smelt
#

they sleep for like 16 milliseconds

#

thats an eternity

#

perfect candidate for something that would use continuations

mortal thunder
#

on your 20 something mhz (default) CPU that's not that lengthy, it's about 320k desired cycles between waits

twilit smelt
#

that is a very long time

#

but yeah i dont think you understand what the continuations are

#

they dont stop the fireworks test from stressing the scheduler at all

mortal thunder
#

from what I understand you basically surrender the kernel stack of a thread, when initiating a wait, and create a new one when the event you're waiting for happens and the thread wakes up?

twilit smelt
#

when initiating a wait that has a continuation yes

mortal thunder
#

or, well, recirculating from a pool from what I read

#

you'd still need to pass context across the continuation though wouldn't you?

twilit smelt
#

yes and thats very easy to do

mortal thunder
#

sure

twilit smelt
#

how im doing it you pass in a KeContinuation structure which contains a function pointer and 3 pointer-sized parameters

#

the function pointer is called on the new stack when the thread awakes

mortal thunder
#

you could just keep the memory pool region you allocate when creating each firework particle and pass that through the continuations

twilit smelt
#

it is given a pointer to the KeContinuation structure (copied into the thread, which has an integral KeContinuation)

mortal thunder
#

rather than moving the data onto the stack and operating on that

twilit smelt
#

and can get the 3 parameters that way

#

you still havent answered how this defeats the point of the fireworks test

mortal thunder
#

because i didn't say it does

#

i asked if it does

twilit smelt
#

i dont understand the origin of the question

shadow ridge
#

you could use a mandelbrot set renderer instead

twilit smelt
#

to be clear i was going to use the continuations specifically for the waits for the "next frame"

#

which those threads spend almost all of their time in

#

even on 20mhz xrstation

nocturne nymph
shadow ridge
#

and it would look 100x prettier than bs fireworks test

#

while doing essentially the same thing

twilit smelt
#

ur welcome to contribute that

shadow ridge
#

im too busy but ill look into it

icy bridge
#

with Mandelbrot the smaller the region per thread (= the more threads = the more scheduled stress) the harder it is to spot deadlocked threads

#

which fireworks doesn't really have since it's easy to spot a pixel that just isn't moving even if there's thousands of other pixels

shadow ridge
#

you could render the differential instead

#

actually wait that might not fix it since there is like a lot of just black space that wont ever change

#

you could vary the color pallette over time

#

that might actually work

twilit smelt
#

the result im hoping for with the continuations-based fireworks test is that the total number of kernel stacks existing concurrently will pretty much never be more than the number of processors plus a couple for worker threads with pinned stacks

#

that would mean it works very well

digital pivot
twilit smelt
#

so like hyperthreads

#

its unambiguously a good idea to share ready queues between hyperthreads

#

that wont introduce lock contention because they are the same physical core, and they also share their caches so theres no thread cache affinity issue

#

currently i cant represent that

#

i would like to change it so that i will be able to later

digital pivot
#

the main benefit is to take x2 less locks?

twilit smelt
#

no its to balance threads between them without any extra work

digital pivot
#

it can be not that good because you usually want to keep only one of the hyperthread busy not both

#

then you want to spread across free hyperthread sets, is that what you mean?

twilit smelt
#

yeah idk i need to read up more on hyperthread scheduling

#

possibly its a better idea to like share queues between cores on the same numa node but like

#

say each physical core has 2 hyperthreads

#

and each node has 4 physical cores

#

you could arrange it so that each node has 2 sets of queues

#

one of those queues feeds threads into hyperthread 0 on each of the 4 physical cores

#

the other feeds threads into hyperthread 1 on each of the 4 physical cores

#

then you can like add threads to the queue for hyperthread 0 until the physical cores are all busy before adding threads to the queue for hyperthread 1

jagged marsh
#

this looks like strange ada

twilit smelt
#

jackal

#

custom lang

jagged marsh
#

ohh noice 👍

hollow musk
twilit smelt
#

i know what the motivation was

hollow musk
#

it's clear that this is to improve the balance, but I'm not exactly sure what problem they were trying to solve

twilit smelt
#

its because per-core ready queues scale very well but are too hard to balance and imbalance themselves too aggressively, and global ready queues balance well but cant scale because they use a big lock

#

so the compromise is to do groups

nocturne nymph
twilit smelt
#

NT initially used a global ready queue before (i believe) briefly using per-core ready queues in the early '00s before switching to per-group ready queues

nocturne nymph
#

I’d suggest you consider security implications. The Windows scheduler is "core-aware." Many decisions are made with SMT isolation in mind, and starting with Windows 11, the whole thing has been cleaned up, and the scheduler now operates based on the concept of isolation units. I think you can guess why this is important.

twilit smelt
#

itll be a really long time before im actually trying to get it to run well on SMT i think

nocturne nymph
#

The relatively weak CPUs, combined with the scheduler of the time and interactive UI tasks, caused the UI to glitch. At the time, the issue was considered a high-priority load-balancing problem.

#

The goal was to make sure that the important work is spread out to not miss the typical deadline for a 60Hz video. Improving the single processor sharing algorithm would not have helped, which is why the idea for SRQ was conceived.

warm mural
#

I wanted to do the xnu continuation thing too but allocating the stack on context switch is spooky

twilit smelt
hollow musk
#

I'm finishing my research paper on the windows scheduler, and I could use a source for this information

warm mural
#

And if it fails you switch to another thread instead or something

twilit smelt
#

basically im having donated stacks be put on a per-node list guarded by a spinlock

#

it first tries to grab a stack from there

#

if that fails then it enqueues the thread to a worker thread which will allocate it a new stack the long way, and tries to find the next highest priority thread to run in the meanwhile instead

warm mural
#

Ahh that makes sense

#

And that list is trimmed periodically?

twilit smelt
#

yeah

warm mural
#

Is it LRU ordered or what

twilit smelt
#

its lifo for cache locality

twilit smelt
#

additionally if both the departing and arriving thread were waiting with a continuation then you can do a direct hand-off of the current thread's stack

nocturne nymph
#

I'm not sure how you could use this, but if it doesn't require any extra effort on my part, then go ahead and mention that the information came from the kernel team.

warm mural
#

So threads that have been sleeping for like 1 second get their stacks put there, then every N seconds you free all those stacks (or trim a few?)

warm mural
#

Since the stack may be hot

twilit smelt
#

yeah

#

the fireworks test will be an extreme of that because every highly active thread is going to be waiting with a continuation all the time so like

warm mural
#

but you can only do that if the stack hasn't been freed on the list yet

twilit smelt
#

the same stack is just going to get passed around 99% of the time

#

and itll reduce to per-processor kernel stacks

#

in terms of memory overhead

warm mural
twilit smelt
#

also i was going to put the thread's kernel stack on the list immediately

#

like directly after switching off it

twilit smelt
warm mural
#

Or by design is that considered a misuse of continuations

twilit smelt
#

continuations are not meant to be used where that could be an issue

warm mural
#

okok that makes sense

twilit smelt
#

like if you have something that should have real time responsiveness then dont use continuations lol

hollow musk
warm mural
#

idk if freeing the entire list is optimal though

twilit smelt
#

i wont

#

i was describing the algorithm i was going to use to determine how many to free when i answered another question u asked

short owl
hollow musk
warm mural
twilit smelt
#

as for determining how many to trim, two per-node values are maintained in order to implement the heuristic for this:

StackCount - the number of stacks currently on the list
StackMin - the smallest number of stacks that have been on the list since it was last trimmed

when a stack is removed from the list, StackCount is decremented, and if it is now smaller than StackMin then StackMin is set to the new minimum.

at the next reaping interval (probably every 30 seconds), StackMin many stacks are trimmed from the list, and StackMin is set to the StackCount prior to trimming.

basically, all the stacks that were on the list but unused during the previous 30 second interval are trimmed

#

i might also have another hard limit like (num procs in node + 2) or something

#

which it can only be trimmed below when memory is critically low

#

when memory is really low and like pageout is being initiated i think i will purge the lists completely

twilit smelt
#

thats where i got it

#

my current per-node poolcache (magazines) that i use to allocate kernel stacks from will probably just go away entirely in favor of this specialized spinlock-guarded thing

#

because i wont even allocate initial kernel stacks from it for threads that were newly created, threads will start out without a kernel stack and their entrypoints will become continuations; only the quota for a kernel stack will be charged at thread creation time, but the stack will not actually be allocated (unless a creation flag says to eagerly allocate the kernel stack, which will be necessary to avoid a chicken and egg problem with the stack allocation thread)

#

so itll be redundant

#

thread exit will also pass in a dummy continuation to the final yield function so that the stack of the exited thread can get handed off

#

i will do ANYTHING except write my IO system.

#

i got convinced to do this when i realized that like during normal usage 99% of the threads are going to spend 99% of their time in a wait that i could easily write as a continuation (like an IO completion or IPC wait or etc)

#

and if 99% of everybody is doing continuations and handing off their kernel stack, then the effect is that you reduce memory overhead of kernel stacks to basically being per-processor kernel stacks

#

without compromising the ability to preempt the kernel and do full blocking waits when needed

hollow musk
twilit smelt
#

this is even more efficient than kernel stack pageout which was my previous thing i was going to do because the stack memory goes away entirely and becomes available for reclamation immediately, rather than to disk and after a delay

hollow musk
#

windows can out swap kernel stacks for threads that haven't run for a long time

twilit smelt
#

yeah

#

mintia1 could do the same and mintia2 was planned to do that until just now

warm mural
twilit smelt
#

yes

#

another thing that clinched it for me that i was going to invest in this was the realization that basically every single wait that i was going to do as a kernel stack pageable wait, could be rewritten as a continuation, so i will lose absolutely nothing, its a gain only

#

i think the experience of mintia1 helps here because i basically know what those things will look like and i can envision doing that in mintia1 and im like "oh yeah thatd be really easy"

#

so it doesnt feel too risky to do this

#

the semantics of the way im exposing it are funny though

#

you do it by passing a pointer to a KeContinuation structure into KeWaitForObjects or KeSleep or KeWaitForSingleObject (the latter two are now wrappers around the first but thats irrelevant)

#

but theres no guarantee your continuation function will actually get executed

#

at all

#

various races could cause the wait function to return before the thread fully commits to blocking

#

so you need to like

#

manually call your continuation after your KeWaitForObjects call

warm mural
#

is there a way to know if your continuation has ran?

twilit smelt
#

if it ran then the wait call never returns

#

if it returned then it didnt run

warm mural
#

ah duh

twilit smelt
#
  • if the object was already signaled
  • if the timeout somehow expires before you commit to waiting
  • if the thread receives a signal that aborts the wait before it commits to waiting
    etc
#

these can all cause the wait function to return without your continuation being called

warm mural
#

yea no I get it, the whole point of continuations is to not return

tough gate
#

how long has been this convo have gone on

twilit smelt
#

how old are you

tough gate
warm mural
#

I did think of the working set thing though and I think that algorithm can be applied to a bunch of stuff in general

#

which is cool

twilit smelt
# tough gate 13

for future reference you shouldnt say stuff like "how long has this convo been going" or "dead chat" or other things that dont contribute bc it derails conversations/pollutes

twilit smelt
#

if you said you were older i was going to be way more mean and rude

#

but since ur 13 you probably just havent heard that you shouldnt do that before

#

so

tough gate
#

wait what were you guys talking about again, im a bit intrested

twilit smelt
#

but like

warm mural
#

yeah i thought of that too but it might be better to make it explicit

#

and there might be cases where you may not want the continuation to run at all if it didnt block?

twilit smelt
#

(cont)

  1. that causes all the stack above the point of the wait call to be "wasted" which could be surprising if you expected your continuation to be on a fresh stack with full capacity remaining and were counting on that
  2. the wait call could call some assembly routine which fiddles the stack to call the continuation properly with the stack pointer reset to the top of the kernel stack, but this is a waste of cycles
#

(when i say "bottom" and "top" and "below" and "above" in reference to stacks i mean address-wise, with a downward-growing stack)

#

xnu's interface sidesteps this issue because they dont have some like overarching wait-for-event thing like this that has a bunch of abort cases

#

the interface for it is thread_block i think, like, you the caller already know for sure you have to block

#

so in xnu you might have an idiom like

if (i gotta block) {
  thread_block(continuation)
} else {
  continuation(didnt block)
}

whereas in mintia2 itd be more like

status = KeWaitForObjects(..., continuation)
continuation(status)
warm mural
#

wonder where xnu got it, I think it's a mach thing?

twilit smelt
#

yeah it is

warm mural
#

they probably generalized it tho

twilit smelt
#

the thing that reminded me of it was a printed copy of the original paper about mach 3.0 continuations by Rick Rashid from like 1992, stashed inside the CHM's scanned VMS-21 stuff

#

one of the VMS-21 people printed out that paper and saved it among those things

#

possibly as a cool idea for the VMS-21 kernel

#

(VMS-21 being "VMS for the 21st century" which was a plan to rewrite the VMS kernel entirely in C in the early 90s, which was never implemented)

#

(only discovered it even existed yesterday)

#

those docs i read feed directly into my work in real ways lol

#

like half of the xr17032 kernel mode architecture comes from stuff i read in the internal Alpha docs

#

etc

#

thats why im like addicted to reading them is that one page out of every like 500 has some gem that im like wow thats awesome

nocturne nymph
#

Is VMS21 stuff public?

#

Sorry if this has already been posted - I missed a lot of messages.

twilit smelt
#

yeah but its not that technically interesting, they seem to have never made it past extremely high level planning for a proposal before being presumably shot down by the executive committee

#

they werent even sure whether theyd do their own kernel or modify Mach or something

nocturne nymph
#

I don't think I've ever heard of it.

twilit smelt
#

probably because it was just an idea the VMS kernel team wanted to do and talked about for a couple months before being told no

#

the CHM's digitization efforts have converted the like tiny trickle of a handful of fascinating documents from 3 yrs ago into something inexhaustible that ive wasted spent countless hours reading over the last month lol

#

they have so many tens of thousands of pages of internal DEC stuff up now

#

in this way it might be lucky for history that DEC died because theres no chance we ever would have seen any of this if they survived in any form at all no matter how skeletal

#

their archival assets had to get acquired and re-acquired before someone (HP) cared so little about them that they just threw them all at the CHM

warm mural
nocturne nymph
#

You've got good taste

warm mural
#

oooh nice, WYWH is my favorite album

#

in fact this is the first thing my kernel prints

shadow ridge
#

i never got into the darkside of the moon

warm mural
#

dsotm is my second favorite, probably

#

the whole meddle -> the wall run is great

#

they managed to make like 5 back-to-back greatest albums ever

nocturne nymph
#

That's definitely a great choice

#

I also really like TDB (yes, without Waters, but it's good in its own right)

warm mural
#

yeah that is the only good post-waters album in my opinion

nocturne nymph
shadow ridge
#

@twilit smelt see ^ you shouldve listened to pink floyd instead of some random indie band making ambient tracks

twilit smelt
#

i dont listen to much fully ambient stuff

#

A1 Drifting Mist 0:00
A2 Space Résonance 3:30
A3 Space Nautilus 7:44
A4 Bruges Résonances 12:06
A5 Snare In The Night 13:49
A6 Electric Mistress 16:58
B1 Deltaplane Adventures 19:41
B2 Bermudes Mystery 22:39
B3 Melancholy Time 27:15
B4 Pop Dream 30:19
B5 My Little Hut 33:53
B6 Strange Pop 36:09

Arranged By, Music By – C. Chevalier
Mastered ...

▶ Play video
#

beep boop

nocturne nymph
#

Sure, go ahead

twilit smelt
#

which are spiritually equivalent to me

#

there is def particular types of music that i tend to find more fitting than others when combing thru like 5000 pages of old internal corporate communications from the 80s and its normally more abstract stuff

#

rather than like hiphop

#

which i will listen to on walks or in the car or wherever

shadow ridge
#

i dont understand people who listen to music outside

#

like are you not scared for your life

twilit smelt
#

the boomers who wrote these memos in the 80s were probably mostly not listening to weird abstract noises in their office while doing so

#

if i really wanted the authentic NT team experience for example i could put on some alvin & the chipmunks remixes

shadow ridge
twilit smelt
#

i know it isnt

#

a lot of the stuff i listen to is from the 80s or earlier

shadow ridge
#

this is from 1978

#

i think this is the peak of "abstract" "art"

twilit smelt
#

its just not likely that a given random boomer engineer at DEC in 1985 is listening to beeps and boops in his office because it was never that popular

#

lol

twilit smelt
#

and ive been up too long to scathingly insult a third of the mod team unprompted

#

thats something u do on a full nights sleep

#

i actually have an 18 hour mintia playlist on spotify

#

those are all songs ive listened to a substnatial number of times while writing mintia1/2 code

#

random example

#

i love how my KeWaitForObjects has FOUR different goto labels and NONE of them are one of dijkstra's condoned alarm exit gotos

#

that whole source file has gotten completely clusterfucked especially now with the continuations stuff

#

over time

warm mural
twilit smelt
#

yeah

#

is

#

imagine being scolded by your boss in 1989 and then some zoomer reads it like 40 years later

#

"VERY, VERY UNHAPPY"

#

"I expect emotional outbursts might occur."

#

scary thing to read in an invitation from your boss to a meeting

#

ozix mention

#

uhhhh

#

i think this is a plan for DEC to do their own MIPS chip

#

never heard of that in my entire life

shadow ridge
twilit smelt
#

i dont have enough working brain cells to phrase the comparison in a non insulting way rn

shadow ridge
#

do it in an insulting way

#

unironically listening to video game ost is dumb anyways

#

unless you're in the gym and listening to like doom soundtrack or something

twilit smelt
#

its fine to listen to video game osts

#

ONLY listening to video game osts is a little weird

#

but im 23 and spend all my time reading 80s corporate docs

#

so who am i to judge

warm mural
#

like minecraft ost

#

which is pretty calm and is kinda like my "lofi hip hop beats to relax/study to"

vast valve
#

I listen to remixes of deltarune songs / fan deltarune songs quite often. And a few ultrakill ones. They are quite good for when I’m working on crap

#

And it’s always mixed in with other stuff

shadow ridge
#

like

#

a lot of video game music is contextual

warm mural
#

well actually it's just OSTs in general

#

I only listen to them when I want instrumental stuff that wont distract me

#

cuz my musician brain gets too distracted when I put on ""real"" music I like

shadow ridge
#

except jazz

#

i can listen to jazz without getting immensely moved by it

warm mural
#

nah even jazz does that

#

to me

#

I like jazz quite a bit though

queen torrent
#

Listen to mozart 2x speed in one ear and chinese bible on the other, otherwise ngmi

shadow ridge
#

ngl i dont listen to mozart often

#

he's more fun to play

warm mural
#

mozart is overrated anyway

#

he's known because he was young

shadow ridge
#

he made fart and shit jokes

shadow ridge
#

intellectually speaking

warm mural
#

I mean he was obviously a great musician and composer but a lot of the hype comes from him being a child prodigy

shadow ridge
warm mural
#

I didn't say you couldnt

#

my point is he's this well known because he was a child prodigy

#

if popularity == talent/skills then bach would be more popular

shadow ridge
warm mural
#

yes but not this well known

shadow ridge
#

bach only lags behind

#

because he's baroque

#

and people dont really like that

warm mural
#

idk my friends know who mozart is but not bach

#

it's probably mozart > beethoven > vivaldi ~= bach in terms of popularity

shadow ridge
#

like for a new listener, bach is pretty hard to decipher

warm mural
shadow ridge
#

how is beethoven less popular than mozart

warm mural
#

because beethoven's music is more approachable which is probably why he's this popular

shadow ridge
#

ig it's edgier music so maybe it speaks more to people

warm mural
#

idk it's hard to quantify obviously

shadow ridge
warm mural
#

ah maybe I'm wrong then

shadow ridge
shadow ridge
#

a lot of people dont know chopin

warm mural
#

chopin is a piano guy

shadow ridge
#

but do know some of his works

warm mural
#

obviouslyh

warm mural
shadow ridge
#

but not who made it

warm mural
#

toccata and fugue

#

everyone knows this

shadow ridge
#

thats cuz of dracula tbh

warm mural
#

and it's also not very much his style which is ironic

shadow ridge
#

i dont see how it's not his style tbh

#

you could argue that the fugue going up a 4th instead of a 5th is "unorthodox"

#

but bach does that all the time

warm mural
#

afaik there are even people claiming bach didnt write it lol

shadow ridge
#

yes and i claim theyre wrong

#

i dont see how it's wildly different from what bach usually writes

warm mural
#

I'm not a music theory nerd but "The piece features rapid parallel octaves and a conclusion on a minor plagal cadence, neither of which are typical of Bach’s mature compositional style."

shadow ridge
#

doesnt it end on a picardy third

#

one min i havent listened to it in a while

warm mural
#

oh I know what that is

#

turns out I am a music theory nerd after all

#

it's like "And I Love Her"

shadow ridge
#

thats weird

shadow ridge
warm mural
#

nah i just know what a picardy third is because of that

shadow ridge
#

oh well

#

i was gonna make a microtonality joke

#

wouldve landed just a bit flat though

#

:)

warm mural
#

the beatles have a bunch of bach influence

shadow ridge
#

if u ignore most of the pop slop

warm mural
#

that's because they have beatles influence meme

twilit smelt
#

does anyone else feel like ur destined to have a stroke that strips you of any skill/talent one day and like youll be completely fine otherwise but just no longer capable of doing whatever you excelled at before

#

and that this will happen to you at like age 25

shadow ridge
#

nah

#

ig something could happen to my hands

#

which would suck

carmine grove
#

anything but mintia thread ♥️

digital pivot
#

i checked linux sources and it looks that its scheduler is very much per ready queue lock based

twilit smelt
#

i bet theres an SList somewhere

twilit smelt
#

does this sample old windows error noises or am i crazy

#

or does it just have chimes that sound identical

#

alternatively

#

selects a context switch routine for each of the 4 cases:
normal -> normal
continuation -> continuation (non-handoff)
normal -> continuation
continuation -> normal

#

i wanted a different optimized routine for each of these cases but selecting the correct one was taking too many branches and stuff so i did this instead

digital pivot
mortal thunder
#

i assume xr17032 doesnt have an instruction like "sete [reg8]" like x86 does

twilit smelt
#
    slti t1, t1, 1
    slti t2, a0, 1
#

those NOTs end up doing something like this

#

this is the classical risc way of implementing logical not

twilit smelt
# twilit smelt

i initially did that explicitly here but i remembered that NOT would emit the same exact code while being much clearer so i changed it to that

mortal thunder
twilit smelt
#

origin of the name of GEM

#

also in the memo where they discuss the choice of implementation language for GEM they just say

#

"By unanimous agreement the team has decided not to use C or Fortran."

#

and then they go into detailed pros & cons for all the other choices

#

they fucking hated C

#

archaic emoticon

#

(;-)

mortal thunder
shadow ridge
#

it makes more sense if u add a right parenthesis like ;-)

#

or change the - and it becomes ;^)

hollow musk
#

each thread queue has its own lock, and there are two types: either a TAS spin lock or a more complex MCS-like spin lock based on an address hash table

mortal thunder
#

and that you could add the ( and make it (;-)

shadow ridge
#

~_^

#

🤨

#

hmm maybe not

twilit smelt
#

@warm pine

#

"MIPS running MICA/OSF"

#

august 1988

#

it appears there was a brief time where "RISCy VAX" (Alpha) and MICA were both on at the same time

shadow ridge
#

could mintia 2 handle 30K threads

#

or would it run out of like memory

twilit smelt
#

if theres enough memory for them then yes

shadow ridge
#

doesnt it have like 4 mib ram

twilit smelt
#

xrstation can have up to 256mb

shadow ridge
#

oh ok

#

ur framebuffer is like 640x360 right

#

or 1280x720?

twilit smelt
#

1024x768 by default

shadow ridge
#

i see

twilit smelt
#

ozix mention

shadow ridge
#

@twilit smelt how do i lose mouse focus

#

on emulator

#

it's not that important since i can just use my wm keybinds to get out but id prefer the normal way

twilit smelt
twilit smelt
shadow ridge
#

i dont have a window title

#

we dont do those here at bspwm

twilit smelt
#

its F12

shadow ridge
#

thx

#

btw i uncommented the line in kernel xrbt

#

that depends on the firework test

#

but it gives an error saying i need to speicfy a target

twilit smelt
#

wdym uncommented the line

shadow ridge
#

arent the # comments

#

dont tell me u have preprocessor shit in your build file

#

i WILL go insane

#

ok yeah nvm theyre like commands or some shit

twilit smelt
#

lol

shadow ridge
#

i mean come on who tf uses # for that

#

in a BUILD FILE

twilit smelt
#

the build tool and jackal (and assembler) use a common frontend including sharing a preprocessor

shadow ridge
#

i see

#

my build system is cooler

#

and encourages proper structuring of the code base

#

and u can see the entire build tree just by reading one file with all the dependencies etc

twilit smelt
#

./newsdk/bin/xrbt.exe mintia2/build.xrbt JOBS=4 BLD_CHK=1 BLD_MP=1 all

#

that builds a multiprocessor debug build

shadow ridge
#

how do i enable the firework test

#

or is that just included in the debug build

twilit smelt
#

include -tests in the boot arguments

#

run the emulator w/o disks attached to get the firmware command line

#

type setenv boot-args -dbg -tests

#

this will be saved in 'nvram' when u exit the emulator

shadow ridge
#

thank you ❤️

twilit smelt
#

and then u can boot and fireworks will appear

shadow ridge
#

yes it works

#

where is the nvram file located btw

#

in the emulator?

twilit smelt
#

xremu/bin/nvram

shadow ridge
#

ah thx

#

i think i have everything i need to make a mandelbrot set test

twilit smelt
#

i was just thinking about how this project is monstrously huge

#

it never seems that big when im working on it but if i just like idly scroll thru some of the source files especially for bits i havent worked on in a while im like wow this is a lot

#

i was just poking around newsdk

#

which is apparently 50k lines of code

shadow ridge
#

yeah i was surprised i got the entire thing working in like 5 mins

#

your sdk is

#

ridiculously fast

#

probably because u dont run many opt passes

#

but again even if this were using gcc with -O0

#

it would take a while

twilit smelt
#

its also consciously optimized

#

it uses a bump allocator and stuff

#

fun fact: on fox32os there is a global heap, so the compiler has to manually release all of its allocated blocks before exiting there

shadow ridge
#

tf?

twilit smelt
#

fox32os is single tasking/single address space

#

its kind of like a windowed DOS

shadow ridge
#

this is like 13 year old me thinking malloc would leak forever if i didnt free it before exitting the program

twilit smelt
#

w/ cooperative multitasking

#

(so not single tasking actually)

shadow ridge
twilit smelt
#

btw the jackal compiler's backends for fox32 and xr17032 were tested by building it into boot ROMs for each of those platforms

#

which had the jackal compiler's parser embedded as source text inside

#

and it would compile its own parser and then print the resulting assembly to the framebuffer

#

its ~5k line parser took like 10 seconds to parse itself on each lol

#

nvm i lied it apparently only took a couple seconds

shadow ridge
#

uuh is there a framework in place for having multiple tests that im missing

twilit smelt
#

no there isnt

shadow ridge
#

it looks like there is one ktests.sys file

#

but it runs only one test

twilit smelt
#

for now in KtMain just comment out FwtMain () and put your own test

shadow ridge
#

yeah ig

#

maybe i should build a framework for multiple tests myself

twilit smelt
#

jackal compiler, compiled with itself, compiling itself

#

prob one of the coolest things ive ever done i probably dont talk about the compiler enough

shadow ridge
#

thats not that cool tbh

#

i could spend like 1 hour right now on my old compiler

#

and make it transpile itself to C

#

and there you go i have compiler compiling itself

twilit smelt
#

i think the xr17032 and fox32 backends both took 1 week each

shadow ridge
#

i could also make it emit extremely basic assembly but that would probably take a few more hours

twilit smelt
#

i do not remember how to write a jackal compiler backend

#

when i read them i literally cant understand them

#

its pretty fucked up

#

i remember someone going like "im gonna write a 386 backend for jackal compiler!!!" and they stared at it for a few days and then gave up

shadow ridge
#

i never understood how the pipeline of AST -> IR -> Opt -> Asm works

#

so i always left my compilers at the AST stage

#

and gave up

#

i think i wrote one compiler that could actually generate (buggy) machine code

#

like 13091230912 years ago

twilit smelt
#

in jackal its source -> AST -> IR -> IR Simplify/DVE/Peephole -> LIR -> RegAlloc/Spills/ABI/Peephole -> Asm

#

there are kind of three intermediate representations

#

AST, linear arch-independent IR, linear arch-dependent LIR (which is a low-level IR that contains actual target machine instructions but in a symbolic form usable by arch-independent regalloc code)

shadow ridge
#

i see

#

for me the problem was that i can only write code if i know every single edge case that could occur and how to handle it

#

with AST, I have a 1:1 mapping in my own brain between source code and the tree

#

so it's easy for me to write

twilit smelt
#

i most likely did not need to build an AST

#

that was overcomplicated

#

i could have directly emitted IR during parsing probably

shadow ridge
#

but with AST -> IR, I have NO idea, and further up with optimizations changing stuff, i would basically be running on hopes and prayers

shadow ridge
#

or you could put the AST in the program itself in a simple section header

twilit smelt
#

id rather they use the IR

shadow ridge
#

or struct layouts

twilit smelt
#

jackal compiler is weird because its quite complicated due to basically having non-toy uses of being used to write an operating system, but its also still devoid of any nontrivial optimizations lol

#

like theres no dataflow analysis

#

so anything that would require that (ie almost any global optimization) doesnt happen

#

theres only local optimization and high-effort instruction selection and some peepholing

shadow ridge
#

honestly i always thought that a compiler should only generate arch-independant IR

#

and the linker should make all the optimizations

#

and actually do the compiling

twilit smelt
#

i almost made there be a fourth intermediate representation in the jackal compiler

#

which would be a symbolic representation of basically assembly language

#

and the assembler would be the final phase of the compiler rather than a separate program

#

and assembling actual assembly code would be done with a frontend that would parse it directly into the symbolic representation and then feed it into that phase

#

i thought that would be efficient bc it would avoid having to write out assembly and then invoke a separate program to read it again

#

but i ended up not doing it bc it seemed weird