Reverts tgstation/tgstation#73159
Pretty sure this wasn't supposed to be merged, considering it disabled a
test, a workflow run, and implements an atom New override
Keeps gc_destroyed from getting updated on every step thru the gc queue.
Fixes logic that assumed gc_destroyed is the time the object first
qdel'ed. it used to get updated on each stage of the garbage controller
and there are 3 stages.
Added list index defines for the inner gc item list.
## About The Pull Request
Adds `EXPERIMENT_515_QDEL_HARD_REFERENCE`, which will queue to the GC
subsystem using hard references rather than `\ref`. This is only
possible in 515 because of the new `refcount` proc. `\ref` is very very
slow and has some nasty knock on effects, so removing its usages where
possible is good.
This is an explicit opt in define because I want to give us the ability
to test 515 on live while only testing 515 itself, not our experimental
changes. We have a few more of these we want to do so I made a separate
file for them. They're auto-defined in unit tests so we see them with
the alternate test runner. In a perfect world we'd test both on and off,
but eh.
Closes https://github.com/tgstation/dev-cycles-initiative/issues/10
So i left over some basic `/whatever/proc/format` uses in the original
PR this fixes it.
Notable exceptions to the rule:
- Paths in add_verb/remove_verb, we need full path instead of a name
there to access verb metadata so we can't use proc ref macros there.
- regex.Replace, found out that it does not accept call by name. Instead
i added new REGEX_REPLACE_HANDLER so we can at least try to mark these.
There's still leftover global procs that do not use GLOBAL_PROC_REF but
they functionally equivalent so that's for later.
I don't see any reasonable way to grep for this. But if you got any
ideas please share.
* Moves spawners and decals to a different init/delete scheme
Rather then fully creating and then immediately deleting these things,
we instead do the bare minimum.
This is faster, if in theory more fragile. We should be safe since any
errors should be caught in compile since this is very close to a
"static" action. It does mean these atoms cannot use signals, etc.
* Potentially saves init time, mostly cleans up a silly pattern
We use sleeps and INVOKE_ASYNC to ensure that handing back turfs doesn't
block a space reservation, but this by nature consumes up to the
threshold and a bit more of whatever working block we were in.
This is silly. Should just be a subsystem, so I made it one, with
support for awaiting its finish if you want to
* Optimizes garbage/proc/Queue slightly
Queue takes about 1.6 seconds to process 26k items right now.
The MASSIVE majority of this time is spent on using \ref
This is because \ref returns a string, and that string requires being
inserted into the global cache of strings we store
What I'm doing is caching the result of ANY \ref on the datum it's
applied to. This ensures previous uses will never decay from the string
tree.
This saves about 0.2 seconds of init
* Adds MC initialization stages. Earlier stages can fire while later ones init.
Removes TICK_LIMIT_MC_INIT config for barely doing anything to speed up init and being inconvenient to work with if fires and inits can happen at the same time.
Before, all items deleted would sit in a queue for 5 minutes, with all shrinks and expansions of said queue requiring byond to copy all of these items over to the new list.
Theory: 99% of items soft-delete within byond within the first second. (5 minutes is only needed because a byond quirk with items referenced by verbs)
Result:
Within the first 7 minutes of a local test launch and round start, ~35,000 things get qdeleted.
Of those 35 THOUSAND things, only 12 things failed as still referenced with a 1 second pre-queue.
Said 12 things passed as garbage collected at the 5 minute queue.
(Note: 30 thousand of these items are from world start and round init.)
I have no data on how much this speeds anything up, leaving a 30 thousand list (that has to be copyed every time qdelete processes it and cuts off the items it processed) hanging around for no reason for the first 5 minutes of the round was all i needed to justify the pr.
* The Failsafe can now recover from an deleted MC
Its also more reliable and can handle a situation where its main Loop runtimes and the MC is stuck
* Reset defcon level correctly
Oops left that in from debugging the levels
* Correctly recover SSasset
* Only decrease defcon if MC creation failed
Also add some sort sleep between emergency loops
* Makes the last two emergency actions manual procs
Since they are kinda unstantable its probalby best
if only admins call these manually
Its also more reliable and can handle a situation where its main Loop runtimes and the MC is stuck
You can also now debug Master/New()
While there will most likely never be any situation where the MC is just gone its still good to know that the game can recover from such a situation
For example maybe someone messed up a SDQL query or maybe someone wanted to delete the MC to create a new one hoping the Failsafe would do so for him
This queue allows things that hold refs to objects intermitently to free them on their own, without causing
harddels. A big part of this is byond, who will occasionally hold refs to an object for up to I think? 5
minutes. The old timer was lower for fear of memory leaks, but that's not as big a concern anymore
cl
server: Added configs to disable laggy hard deletes once they lag the server too much.
admin: laggy hard deletes only output once per type path.
/cl
closes#58379
1 second was too long in the current lag market.
(postpone doesn't work here because of a bug i'll fix in another webedit in another pr since its actually a mc bug)
Sourced from #59118 and a cursed project I'll pr later, This pr contains a lot of harddel fixes for stuff that pops up after a player interacts with something. I'm not gonna list them all here because there's something like 60 130, check the commit log if you're curious
Oh and I moved ref tracking screaming to a separate define, and made some optimizations to the thing in general. I think that's it, this pr is a bit of a frankenstine
* Ref Tracking: Revengance
Fixes reference tracking ignoring self references due to a poorly thought out tick checking system.
Fixes reference tracking ignoring the contents of assoc lists
Makes the reference tracking printouts actually describe what list the ref is in, rather then just saying "list"
Adds REFERENCE_TRACKING_DEBUG, a define which toggles tracking info for the ref tracking procs, which allows for
oversight on how the proc is working
Allows for direct calls of qdel_and_find_ref_if_fail(), makes it use ref rather then REF(), fixing it breaking
for mobs. (Ditto for the qdel hint which does the same thing)
Moves REAGENTS_TESTING out of the reftracking define block
Makes unit tests define REFERENCE_TRACKING, REFERENCE_TRACKING_DEBUG, and FIND_REF_NO_CHECK_TICK
Adds a unit test that sanity checks the reference finder proc
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm
We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous.
There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this.
Hi codeowners!
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
* Uses 514's map_cpu var when it's available
* Uses auxtools for the debugger, to supply cross verison compatibility
* Nukes extools reference tracking, reinstates the old ref tracking system
- Backtick-escape code samples which contain `[]` syntax.
- Fix all crosslinks to nonexistent symbols.
- Somewhat improve docs for qdel defines, research defines, dynamic mode, and others.
- Remove unused bloodcrawling defines.
Some crosslinks to defined but undocumented symbols remain. For BYOND builtins, a future dmdoc version may link those symbols to their entries in the DM reference. Other symbols could be documented by a future PR.
New "file" crosslinks as used in `research.dm` are slated for release in a future dmdoc version.
Noticed this tonight.
There was once 3 collection timeouts when there was the pre-queue; now there's only 2, but there's still 3 timeout levels.
The unintended impacts of this are...well, a LOT of false positives.
Needless to say, unless something garbage collected INSTANTANEOUSLY, it would be marked as a failure.
Likewise, it meant queued hard deletes had to wait a full 2 minutes before they were actually hard deleted instead of just 10 seconds (Oh dear, who knows what problems that's been causing!)
This should all be fixed now.
Less time wasted on false positive GC failures and more time spent on hunting down actual failures.
* Fixes the 50% time dilation on every server by removing demos, an admin only tool that is the laggiest thing on the planet for incredibly little gain.
* appeases the linter
* demos (ported from yogstation)
rustg update + write with no format
use external hook for logging
use proper log vars
fix + clarifying comment
don't start the log
release build of rust-g
fix something caught by the lint
Update code/__DEFINES/subsystems.dm
Co-Authored-By: Jordan Brown <Cyberboss@users.noreply.github.com>
Update code/controllers/subsystem/demo.dm
Co-Authored-By: JJRcop <jrubcop@gmail.com>
Update code/controllers/subsystem/demo.dm
Co-Authored-By: JJRcop <jrubcop@gmail.com>
moves hooks out of a dedicated file
len = 0 to Cut(), remove semicolons
untyped loop
* updated rust_g
* 513 updates
If you came here thinking this was some game feature then you are in the wrong place. Here is where I ramble about code.
This adds /datum/element as a sort of sibling to components. Only one of each type gets instanced and they do not get tied directly to any particular thing like a component does. Basically they're a very lightweight component for doing simple functionality that doesn't have much state.
Originally this concept came about as a kind of component that could be shared between many parents to reduce some resource costs. Doing this would allow us to componentize more behaviors that are a part of too many things to be viable to have a whole component for every single one. For example a component on every space turf would be entirely unviable. With elements it's much more reasonable.
This implements a prety bare framework and a couple components are migrated to it. It's ready to be used but I fully expect I'm going to need to refine how it works for all the usecases we'll want it for.
Also: this fixes the qdeleted signal. This signal isn't even possible because after qdel is done there's nothing to receive a signal anyway. I've changed it to a qdeling signal instead. I need it to work for some elements to know when to clean themselves up.
Unlike normal subsystems, if the garbage collector is tick_checked into pausing, rather than run next game tick to resume, it waits the full 2 seconds again.
I added that change because hard deletes can sometimes cause a large amount of lag, and so doing one again the next game tick is a stupid idea when 1 hard delete can cause a tick overrun on its own.
Now it only applies this when doing hard deletes, running again next tick otherwise.
* station lovin' happened so fast
* Update stationloving.dm
* less qdel memes
* imbue soul signal
* rename imbue soul signal
* dupemode
* henk
* Update atoms_movable.dm
* Update nuclearbomb.dm
* Update nuclearbomb.dm
* Find references fix.
Made it go from taking years to hours
Removed Datum based recursion, this was unneeded.
Fixed it calling a proc for what ended up being a costly noop millions of times (this was a moderate speed up as it would call DoSearchVar on every fucking number or string or null in a things vars list.)
Fixed it calling itself on the vars list. luckily it only checked keys, so this didn't stack overflow.
I'm intentionally leaving the debugging stuff in right now so that its on the record somewhere. I'll remove that when I pr line by line profiling as its own separate thing
* Remove debugging stuff
* i forgot