#MINTIA (not vibecoded)
1 messages · Page 32 of 1
shocked that you didn't get a bunch of shit from the Wii instead
"starlet" is what the community calls the little ARM9 core
It’s personalized results, I get a bunch of random shit unrelated to the Wii and VMS
Though the Wii is where I know starlet from
HOLY HELL!!!
i forgot there were two different dave plummers
cutler mentioned the VMS one in his CHM interview, iirc
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
Thats basically the pmos kernel with one stack per core
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
I guess
Oh yea I wanted to do that too, you can do it in the kernel too no?
one difficulty with schemes like that is that kernel preemption is not possible or at least gets harder
Why?
you may have misread what i said
threads only lose their kernel stack when they wait, and then only if they specified a continuation before waiting
i get that but you can still have an unbounded number of kernel threads that are simply preempted in the kernel, right?
yes but kernel stack pageout doesnt help with that situation either
thanks, youtube
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
a SPARC port of NT would be cool if it wasn't vibecoded, lol
it also doesnt even work
amazing
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
i think i can implement KeSleep in a very similarly optimized way (reusing the integral thread timer and whatever) by having it call KeWaitForObjects with an object count of 0 and a timeout
and making sure KeWaitForObjects can deal with an object count of 0
i think it already can
i'm just wondering if he just threw a source leak at claude and told it to change a bunch of stuff there
oh
this is all it does
i just realized i can't read, lol
not even past the bootloader
Is WaitForObject not a wrapper around WaitForObjects
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
some new fan NT port?
read above
.
the yellow looks like open firmware or something
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
oh, i guess i should join that server
and then i lost my temper
What I do is wait_one is a wrapper around wait_any
makes sense to make the logic common
yeah
What does KeSleep do vs waiting on a timer?
for code quality reasons and also to make it easier to implement continuations im going to merge them
it uses the integral thread KeTimer
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
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
itll do some redundant logic but its fine
yes
lmfao youre repeating everything i already said
.
but i said that like minutes before you started typing anything
Ah didn't read lol
he will need arab money to get this anywhere that way, assuming it could even amount to anything interesting
i ended up doing this just the other day
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
Also how does porting NT to new architectures work? They don't have the source?
they do
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
theyre setting claude loose on the leaked source of NT 3.5
Bruh
thats what i said
AItards will just do anything to justify their waste of money
why specifically NT 3.5?
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
Because it was leaked
many versions of nt had their sources leaked
I should finish my 3.1 Ke decomp, but it's just incredibly boring
i suspect that guy picked the earliest one because he thought earliest=smallest=easiest for clod to port
what for
Because it's cool
eh
You can find NT source code on GitHub very quickly
this would be the only "legal" one
(idc about the EULA)
its legal to decompile it but its not legal to publish the decompiled code
u can punish the code but u cant publish it.
yeah but I doubt MS would care, and besides it'd be cool to have no matter what
i hope they just release the nt 3.1 code themselves
leaks of XP SP1 and server 2003's source code are still on github, apparently
publish a script to massage the decompiler output into the final sources 
Yeah obviously that'd be a lot better
its also not uncommon for microsoft engineers to link people to them including in blog posts hosted on MS's own website lol
I did
Unironically
I was able to call functions which I didn't decompile from the original code
It was python magic
like how raymond chen linked to the officially released MS-DOS source code? lol
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
Which would be used to boot a desktop if I ever finish Ke
So I can check that it's working
What do you think of that guy
experienced respectable guy
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
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
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
Didn’t some Microsoft people end up linking to MAS shit directly aswell?
it might've been that specific blog of his where he talks about the allocation granularity, iirc
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
Lol that guy is already banned
what guy
Wait he was banned
I thought you meant rob
Ah no just timed out
Did rob get timed out in the past hours I was taking a nap?
I meant larkmjc
discord only shows mods that popup
Yep
How would you even know if you're not a mod lol
last messages were at #osdev-misc-0 message
bc i checked their last messages and didnt see anyone timing them out
all i got from their messages is that they're… apparently a LLM?
I think it was JW
i guess?
Yes
They just spew nonsense constantly
Openclaw instance
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
its actually sensical but they just dont have the ability to express themselves in a way anyone else can understand
or are intentionally being cryptic becuase theyre used to sounding smart and being celebrated as smart by doing that
#osdev-misc-0 message explain this @twilit smelt
To me their messages didn't seem LLM generated idk
Fair, but at some points it’s been majorly disruptive
this makes sense its just insanely poorly worded
Can u translate it
Yeah I don’t think it’s LLM stuff but it sounds like a person that uses LLMs a lot
#osdev-misc-0 message also this one
I think it probably makes sense too but idk anything about GPUs
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
idk whether what tehyre saying about vulkan's gpu scheduling is correct
Would this be in terms of NUMA?
they just never encode enough context into what theyre saying
i think this can actually be a symptom of autism
@twilit smelt does this one also make sense to you
huh
The schedular knowing that these threads use these shared memory objects so they should remain on the same NUMA node
No I just think it's cuz GPUs have more information and are more restricted in the kind of memory they manage
ppl with autism oftne have a compromised theory of mind where they have a hard time intuitively knowing what other people already know versus not, therefore they have a hard time encoding the right context into their communications
not all ppl with autism but its a well known symptom
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
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
Very frequently cited by whom
people having informal discussions about autism on the internet
Yeah I do often word myself poorly, somtimes very badly
. 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?
This chat is like 80% autistic
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:
- intentionally excluding context to make it hard to read so they look smarter, a thing that has worked for them in other spaces
- being unable to figure out what context to include due to being a person who is hit particularly hard by this symptom of autism
Crazy overrepresentation
It is also a spectrum and people struggle with different things with diffrent severity’s
Yeah but I mean there is a high amount of people with autism here
fair sorry
I am the minority
Is there a proper way to probe for this?
afaik
For now /s
I agree on this
Not you too 😭
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
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
larpmjc
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.
This is why I’m thinking AI psychosis partly
But it’s probably a mix of factors in the end of the day
of all the things to come back to, apparently, i wasn't expecting to see this
South Dakota v. Fifteen Impounded Cats, 785 N.W.2d 272 (S.D. 2010), is a 2010 Supreme Court of South Dakota civil forfeiture case brought by the U.S. state of South Dakota against fifteen cats that they had seized on the grounds of interfering with a driver's visibility. The seizure was challenged by the owner of the cats and the court found on ...
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
im trying to figure out how to do direct stack hand-off in a good way
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
well, but it had so fun anyway.
wtf does that even mean
something clear as glass to the writer
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
fn main() { todo!() }
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
Mind sharing an invite?
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
if i ever turn into a "let people have fun" guy for the first time in my entire life the second im being made fun of for an embarrassing thing im doing, throw me into a woodchipper
raspi2 NT
Windows NT 3.5
at least they should make it believable
try porting Windows RT (NT 6.2) or something
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
technically they could port leaked source code but that's legally dubious at best
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
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
not happening any time soon bill gates needs his 200th private jet
If they add more copilot buttons he can get a 201th one
Wasn't official Windows 10/11 already running on Raspberry Pi???
not fully official
i had to get a patched version
But like NT ran on ARM since forever
it had to be patched for the RPi afaik
yes
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
i got an invite to that server thru neozeed
wasn't aware there were MAGA people in there
it's.... definitely a place that exists
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
somebody shared this in the virtually fun discord server: https://lobste.rs/c/4v45hh
i was meaning to ask someone here about a similar piece they wrote long ago, but i couldn't find it beforehand
here, david again brings up ISRs, i guess: https://lobste.rs/c/wi4kpp
The regulars are literally all ultra right wing
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
what the fuck
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
tech discord server out of hell
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
so compilation is a form of decompression?
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
he didn't want to write for unix and stuck to that principle
yeah
why did it take you a good minute to say yeah
😂
anyways
how does this os look
i like the insistence that there WILL be an ice cream break at EXACTLY 2:45 no matter WHAT
nice note
im working on adding support for waiting w/ continuations
oh like SIGCONT?
👍
no
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
(dont) got it
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
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
"Adopting MTE would require a from-scratch redesign of core parts of the Windows virtual-memory subsystem"
i wonder if windows would support mte at all
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
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)
It already supports MTE.
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.
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)
what kinda programming lang is that
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
is nextthread protected by the ready queue lock
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
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
but it isnt in the queue anymore,no?
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
yeah
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
windows seems to have nextthread in prcb to this day
probably they think its useful to have
they may have fatter thread selection algorithm
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
what happens if you need to switch threads to be able to allocate a stack
the worker thread that allocates stacks does not wait with a continuation
so it just has its stack always
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
isn't the fireworks test meant to simulate some kind of intensive work which can't be continuation based?
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
why would it
its still multithreaded
to the same degree
its just that the stacks become transient across the sleeps
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?
no
continuations are for lengthy user-initiated waits
where the kernel stack should be freed up
the fireworks tests' waits are neither lengthy nor user-initiated
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
the fireworks test is meant to be a sort of representative of the type of work a kernel would do at full load
i dont think you understand what the continuations are if you think it somehow violates the spirit of the test to use them
also they are lengthy lol
they sleep for like 16 milliseconds
thats an eternity
perfect candidate for something that would use continuations
on your 20 something mhz (default) CPU that's not that lengthy, it's about 320k desired cycles between waits
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
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?
when initiating a wait that has a continuation yes
or, well, recirculating from a pool from what I read
you'd still need to pass context across the continuation though wouldn't you?
yes and thats very easy to do
sure
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
you could just keep the memory pool region you allocate when creating each firework particle and pass that through the continuations
it is given a pointer to the KeContinuation structure (copied into the thread, which has an integral KeContinuation)
rather than moving the data onto the stack and operating on that
and can get the 3 parameters that way
you still havent answered how this defeats the point of the fireworks test
i dont understand the origin of the question
you could use a mandelbrot set renderer instead
you phrased the question like using continuations somehow makes it no longer a multithreaded test
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
In Windows 11, the next thread selection machinery has also been significantly simplified thanks to a new atomic multi-CPU rescheduling mechanism.
you can use one thread per like 16x16 region (or even per pixel)
and it would look 100x prettier than bs fireworks test
while doing essentially the same thing
ur welcome to contribute that
im too busy but ill look into it
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
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
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
so that they can span multiple cpus?
multiple logical processors at least
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
the main benefit is to take x2 less locks?
no its to balance threads between them without any extra work
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?
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
ohh noice 👍
I'm not exactly sure what the motivation was behind its creation, but the windows scheduler uses per-group ready queues
i know what the motivation was
it's clear that this is to improve the balance, but I'm not exactly sure what problem they were trying to solve
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
These queues aren't about SMT.
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
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.
itll be a really long time before im actually trying to get it to run well on SMT i think
To be precise, the catalyst was the early ARM systems that NT was moving to.
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.
I wanted to do the xnu continuation thing too but allocating the stack on context switch is spooky
source?
i think i figured out how to do it safely and without introducing weird latency at the moments where it matters
I'm finishing my research paper on the windows scheduler, and I could use a source for this information
I think you need a fallible allocation (i.e won't sleep to wait for memory)
And if it fails you switch to another thread instead or something
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
yeah
Is it LRU ordered or what
its lifo for cache locality
I work at Microsoft.
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
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.
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?)
Oh that's really good
Since the stack may be hot
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
but you can only do that if the stack hasn't been freed on the list yet
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
How do you do this though? When do you decide to free the stack list
also i was going to put the thread's kernel stack on the list immediately
like directly after switching off it
i already have a per-node worker thread that does periodic tasks (the balance manager) so i was going to throw it in there
But then can't you end up with threads that have slept for like 2ms and got their stacks freed
Or by design is that considered a misuse of continuations
continuations are not meant to be used where that could be an issue
okok that makes sense
like if you have something that should have real time responsiveness then dont use continuations lol
you're kidding, right?
idk if freeing the entire list is optimal though
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
I don't think so, and we shouldn't dig any further on who they are 
then even if that's the case, unfortunately it isn't suitable as a source of information
One naive but good enough way would be to just keep a threshold in terms of memory size and when thats reached you free the N coldest stacks
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
btw this is the same as the magazine trimming heuristic in solaris
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
interesting
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
windows can out swap kernel stacks for threads that haven't run for a long time
Yeah this is kinda like a working set
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
is there a way to know if your continuation has ran?
ah duh
- 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
yea no I get it, the whole point of continuations is to not return
how long has been this convo have gone on
how old are you
13
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
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
okay
👍
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
wait what were you guys talking about again, im a bit intrested
i could make it so that if you passed in a continuation then the wait function will manually call it if it didnt block
but like
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?
(cont)
- 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
- 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)
wonder where xnu got it, I think it's a mach thing?
yeah it is
they probably generalized it tho
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
Is VMS21 stuff public?
Sorry if this has already been posted - I missed a lot of messages.
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
I don't think I've ever heard of it.
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
is your username a pink floyd reference by any chance?
It is
You've got good taste
oooh nice, WYWH is my favorite album
in fact this is the first thing my kernel prints
honestly the wall and wywh are the only pf albums i like
i never got into the darkside of the moon
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
If this has to do with an educational institution, I think we could back it up.
That's definitely a great choice
I also really like TDB (yes, without Waters, but it's good in its own right)
yeah that is the only good post-waters album in my opinion
A lot of the code in NT was written to the accompaniment of Pink Floyd
@twilit smelt see ^ you shouldve listened to pink floyd instead of some random indie band making ambient tracks
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 ...
beep boop
can I send you a DM?
Sure, go ahead
i like basically everything except country and toby fox undertale ost
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
i dont understand people who listen to music outside
like are you not scared for your life
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
note that what you call "abstract noises" isnt all that new
"Cri-Rhythmes", S Press Tapes, 1978
Buy (reissue): https://boomkat.com/products/cri-rythmes
Please drop a comment or PM if you'd like the audio removed.
this is from 1978
i think this is the peak of "abstract" "art"
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
Or Journey...
i was going to write something mean about the equivalence between these two before i remembered there are toby fox undertale ost listeners in this discord
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
lauryn hill cover art
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
why are you comparing game music to country music tbh
i dont have enough working brain cells to phrase the comparison in a non insulting way rn
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
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
i like video game osts when I wanna focus and wanna put something not too distracting
like minecraft ost
which is pretty calm and is kinda like my "lofi hip hop beats to relax/study to"
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
ig it's a case to case basis tbh
like
a lot of video game music is contextual
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
this is why i cant do work with music in the background
except jazz
i can listen to jazz without getting immensely moved by it
Listen to mozart 2x speed in one ear and chinese bible on the other, otherwise ngmi
he made fart and shit jokes
continuations in astral?
that already puts him above everyone here
intellectually speaking
I mean he was obviously a great musician and composer but a lot of the hype comes from him being a child prodigy
u can be a child prodigy and a great musician at the same time
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
nah he would be well known even if he wasnt
yes but not this well known
i think theyre about equally popular, no?
bach only lags behind
because he's baroque
and people dont really like that
idk my friends know who mozart is but not bach
it's probably mozart > beethoven > vivaldi ~= bach in terms of popularity
i think mozart music is more relatable cuz it isn't immensely contrapuntal
like for a new listener, bach is pretty hard to decipher
if mozart werent a child prodigy it'd probably be mozart = beethoven
how is beethoven less popular than mozart
because beethoven's music is more approachable which is probably why he's this popular
ig it's edgier music so maybe it speaks more to people
but if it was purely edge, prokofiev would be most popular
ah maybe I'm wrong then
not surprised tbh
i also feel like
a lot of people dont know chopin
chopin is a piano guy
but do know some of his works
obviouslyh
well yeah same for bach
like if you played op 9 no 2, anyone would know what it is
but not who made it
thats cuz of dracula tbh
and it's also not very much his style which is ironic
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
it's not a typical bach piece
afaik there are even people claiming bach didnt write it lol
yes and i claim theyre wrong
i dont see how it's wildly different from what bach usually writes
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."
oh I know what that is
turns out I am a music theory nerd after all
it's like "And I Love Her"
so you know music theory? name every note
nah i just know what a picardy third is because of that
oh well
i was gonna make a microtonality joke
wouldve landed just a bit flat though
:)
the beatles have a bunch of bach influence
a lot of modern music does tbh
if u ignore most of the pop slop
that's because they have beatles influence 
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
anything but mintia thread ♥️
btw i wonder how multi cpu reschedule can be atomic even in theory?
i checked linux sources and it looks that its scheduler is very much per ready queue lock based
i bet theres an SList somewhere
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
prcb has 3 slists and none of them see to be right for this context
how is the NOT operator implemented in assembly?
i assume xr17032 doesnt have an instruction like "sete [reg8]" like x86 does
set-if-less-than 1
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
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
ah neat, so you do have something like that
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
(;-)
i thought this was some strange punctuation because of the opening (
;-
it makes more sense if u add a right parenthesis like ;-)
or change the - and it becomes ;^)
in windows, it's just as granular
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
i mean im aware that ;-) is a wink
and that you could add the ( and make it (;-)
@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
if theres enough memory for them then yes
doesnt it have like 4 mib ram
xrstation can have up to 256mb
1024x768 by default
i see
ozix mention
@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
does it not tell you in the window title
its F12
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
wdym uncommented the line
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
lol
the build tool and jackal (and assembler) use a common frontend including sharing a preprocessor
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
./newsdk/bin/xrbt.exe mintia2/build.xrbt JOBS=4 BLD_CHK=1 BLD_MP=1 all
that builds a multiprocessor debug build
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
thank you ❤️
and then u can boot and fireworks will appear
xremu/bin/nvram
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
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
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
tf?
this is like 13 year old me thinking malloc would leak forever if i didnt free it before exitting the program
so literally templeos
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
uuh is there a framework in place for having multiple tests that im missing
no there isnt
for now in KtMain just comment out FwtMain () and put your own test
this is extremely meta
jackal compiler, compiled with itself, compiling itself
prob one of the coolest things ive ever done i probably dont talk about the compiler enough
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
i think the xr17032 and fox32 backends both took 1 week each
i could also make it emit extremely basic assembly but that would probably take a few more hours
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
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
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)
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
i most likely did not need to build an AST
that was overcomplicated
i could have directly emitted IR during parsing probably
but with AST -> IR, I have NO idea, and further up with optimizations changing stuff, i would basically be running on hopes and prayers
if you make your compiler build as a library, you can have other programs use the AST for various purposes
or you could put the AST in the program itself in a simple section header
id rather they use the IR
and it could read various type data etc.
or struct layouts
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
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
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