Commit Graph

207 Commits

Author SHA1 Message Date
Waterpig
bb70889f6e TG Upstream Part 1
3591 individual conflicts

Update build.js

Update install_node.sh

Update byond.js

oh my fucking god

hat

slow

huh

holy shit

we all fall down

2 more I missed

2900 individual conflicts

2700 Individual conflicts

replaces yarn file with tg version, bumping us down to 2200-ish

Down to 2000 individual conflicts

140 down

mmm

aaaaaaaaaaaaaaaaaaa

not yt

575

soon

900 individual conflicts

600 individual conflicts, 121 file conflicts

im not okay

160 across 19 files

29 in 4 files

0 conflicts, compiletime fix time

some minor incap stuff

missed ticks

weird dupe definition stuff

missed ticks 2

incap fixes

undefs and pie fix

Radio update and some extra minor stuff

returns a single override

no more dupe definitions, 175 compiletime errors

Unticked file fix

sound and emote stuff

honk and more radio stuff
2024-10-19 08:04:33 -07:00
Waterpig
4c4930c71d Merge branch 'master' of https://github.com/tgstation/tgstation into pulls-tg-to-fix-shit 2024-09-08 00:59:39 +02:00
Y0SH1M4S73R
d1ccb530b2 Replaces Auxlua with the byondapi-based Dreamluau (#84810)
## About The Pull Request

Ever since byondapi went stable, I've been meaning to create a
replacement lua library that uses it instead of the auxtools-based
auxlua. After so many months, I've finally got the code just about into
a position where it's ready for a PR.

[Click here](https://hackmd.io/@aloZJicNQrmfYgykhfFwAQ/BySAS18u0) for a
guide to rewriting auxlua scripts for dreamluau syntax.

## Why It's Good For The Game

Code that runs on production servers should not depend on memory hacks
that are liable to break any time Dream Daemon updates.

## Changelog

🆑
admin: Admin lua scripting uses a new library that (probably) will not
break when BYOND updates.
/🆑

## TODO:
- [x] Convert the lua editor ui to TS
- [x] Include a guide for converting scripts from auxlua syntax to
dreamluau syntax
2024-07-28 18:45:49 +00:00
SkyratBot
ebc069d742 [MIRROR] Optimizes Reftracking (Bigly) (Plus harddel fixes) [MDB IGNORE] (#26138)
* Optimizes Reftracking (Bigly) (Plus harddel fixes) (#80443)

## About The Pull Request

### Reftracking BS

Alllright so reftracking is slow, really really slow.
That's a problem for me, both because I want it to be fast so I can more
efficiently torture players by running it on live, but also because it
impedes both local and CI runs.

So I've set out to micro optimize the DoSearchVar proc, one of the
hottest in the game.
I've done this in a few different ways.

#### The simple shit

Removing redundant proc args
Yeeting assoc arg setting (extra cost)
Moving if statements around to prioritize the more common case
Ignoring empty lists.

#### The not simple shit

Throwing our snowflake list checking into the sun
(Background, byond has some special lists that cannot be accessed like
an assoc list, trying to will lead to runtimes)
The way we handle this involves inspecting their ref string, and it eats
a LOT of time.

Faster then to mark all the lists we know are special by var name, and
then use try/catch to detect and silence anything that sneaks through
(this is on the order of like 1/3 per run, kinda curious what they are
tbh)
Thanks to MSO for the idea for this btw.

Removes the vars and logic that tied ref searching to clients.
It's not how this code is used, and it slows everything else down for
really no reason

Added support for handing in a known "hanging reference" count, and then
searching for that.
This lets us early exit the ref search if we find everything we were
looking for, which is REALLY powerful, and why I asked for refcount() in
the first place.

### Harddel Fixes

[Fixes some harddels w gulag stuff born of the 515 one way ref
issues](046d7daa03)

[Ensures proximity cameras clean their ref to their proximity datum if
it's
deleted](ff607e9ccb)

[Deleting a pipe connected via the gas_machine_connector datum to a
machine should also delete that machine (harddel
fix)](9eecca22e7)
## Why It's Good For The Game

All this combined speeds up refsearching massively, on the order of
hundreds of seconds, and makes it far less time consuming for both CI
and running on live.
I'll be bullying some servers semi soon, want to see what I can cut out.

* Optimizes Reftracking (Bigly) (Plus harddel fixes)

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2024-01-16 17:33:15 +01:00
LemonInTheDark
a3bb400816 Optimizes Reftracking (Bigly) (Plus harddel fixes) (#80443)
## About The Pull Request

### Reftracking BS

Alllright so reftracking is slow, really really slow.
That's a problem for me, both because I want it to be fast so I can more
efficiently torture players by running it on live, but also because it
impedes both local and CI runs.

So I've set out to micro optimize the DoSearchVar proc, one of the
hottest in the game.
I've done this in a few different ways.

#### The simple shit

Removing redundant proc args
Yeeting assoc arg setting (extra cost)
Moving if statements around to prioritize the more common case
Ignoring empty lists.

#### The not simple shit

Throwing our snowflake list checking into the sun
(Background, byond has some special lists that cannot be accessed like
an assoc list, trying to will lead to runtimes)
The way we handle this involves inspecting their ref string, and it eats
a LOT of time.

Faster then to mark all the lists we know are special by var name, and
then use try/catch to detect and silence anything that sneaks through
(this is on the order of like 1/3 per run, kinda curious what they are
tbh)
Thanks to MSO for the idea for this btw.

Removes the vars and logic that tied ref searching to clients. 
It's not how this code is used, and it slows everything else down for
really no reason

Added support for handing in a known "hanging reference" count, and then
searching for that.
This lets us early exit the ref search if we find everything we were
looking for, which is REALLY powerful, and why I asked for refcount() in
the first place.

### Harddel Fixes

[Fixes some harddels w gulag stuff born of the 515 one way ref
issues](046d7daa03)

[Ensures proximity cameras clean their ref to their proximity datum if
it's
deleted](ff607e9ccb)

[Deleting a pipe connected via the gas_machine_connector datum to a
machine should also delete that machine (harddel
fix)](9eecca22e7)
## Why It's Good For The Game

All this combined speeds up refsearching massively, on the order of
hundreds of seconds, and makes it far less time consuming for both CI
and running on live.
I'll be bullying some servers semi soon, want to see what I can cut out.
2024-01-16 02:17:03 +01:00
SkyratBot
067188d366 [MIRROR] Micro-optimize qdel by only permitting one parameter [MDB IGNORE] (#25889)
* Micro-optimize qdel by only permitting one parameter (#80628)

Productionizes #80615.

The core optimization is this:

```patch
-	var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+	var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```

We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.

* Micro-optimize qdel by only permitting one parameter

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-12-29 14:41:12 +00:00
Mothblocks
c1d68698fb Micro-optimize qdel by only permitting one parameter (#80628)
Productionizes #80615.

The core optimization is this:

```patch
-	var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+	var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```

We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.
2023-12-28 13:52:44 -08:00
SkyratBot
e06ec3e714 [MIRROR] Bumps compile to 515 [MDB IGNORE] (#25257)
* Bumps compile to 515 (#79134)

## About The Pull Request

LSP supports it, let's GOOOOOO
I've removed the 515 tests since they're stable, alongside the libcall
wrapper. left the rustgcall wrapper cause yaknow memes
Just removed all the 515 and 514 particular define wrappers. gaming

## Changelog
🆑
server: Minimum compile version has been bumped to 515. clients still
support 514 but we're gonna start using 515 restricted features for
serverside now.
/🆑

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>

* Bumps compile to 515

* Fixes a TGS regression in its API

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2023-12-02 21:48:21 -05:00
LemonInTheDark
1d6533c525 Bumps compile to 515 (#79134)
## About The Pull Request

LSP supports it, let's GOOOOOO
I've removed the 515 tests since they're stable, alongside the libcall
wrapper. left the rustgcall wrapper cause yaknow memes
Just removed all the 515 and 514 particular define wrappers. gaming

## Changelog
🆑
server: Minimum compile version has been bumped to 515. clients still
support 514 but we're gonna start using 515 restricted features for
serverside now.
/🆑

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2023-11-25 21:03:29 -08:00
SkyratBot
07378a986a [MIRROR] Code cleanup for qdel [MDB IGNORE] (#24919)
* Code cleanup for qdel (#79568)

## About The Pull Request
I want to put my hands in the engine. If you don't want me touching this
I am not hurt if its closed

Added 2 early returns and removes single letter vars
## Why It's Good For The Game
Code improvement
## Changelog
N/A nothing player facing

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>

* Code cleanup for qdel

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>
2023-11-11 00:59:48 -05:00
Jeremiah
065bb04dfc Code cleanup for qdel (#79568)
## About The Pull Request
I want to put my hands in the engine. If you don't want me touching this
I am not hurt if its closed

Added 2 early returns and removes single letter vars
## Why It's Good For The Game
Code improvement
## Changelog
N/A nothing player facing

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-11-10 19:41:19 -08:00
SkyratBot
b123605da2 [MIRROR] Implements byond_status() for harddel hunting [MDB IGNORE] (#23257)
* Implements byond_status() for harddel hunting (#77818)

## About The Pull Request

In addition, improves dump_harddel_deets usage to hopefully hit in unit
testing

byond_status() will dump as a part of find_references(). While I'd like
to expand that if we ever get a proper version, this is good for how we
have things setup rn.

* Implements byond_status() for harddel hunting

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-08-23 01:19:13 -04:00
LemonInTheDark
6d3e268f6a Implements byond_status() for harddel hunting (#77818)
## About The Pull Request

In addition, improves dump_harddel_deets usage to hopefully hit in unit
testing

byond_status() will dump as a part of find_references(). While I'd like
to expand that if we ever get a proper version, this is good for how we
have things setup rn.
2023-08-21 22:59:18 -07:00
SkyratBot
a4cf2e451c [MIRROR] Adds a system for logging metadata about hard deletes [MDB IGNORE] (#22878)
* Adds a system for logging metadata about hard deletes (#76956)

## About The Pull Request

I'm sick of the progress bar harddel, and I've ran into this problem in
the past, so I'm just gonna do something about it

If you want to provide an individual logged bit of info about a harddel,
you can override `/datum/proc/dump_harddel_info()` and return a string
containing "whatever"

Use of this should be limited, this could potentially clutter del logs,
especially if it's used on something that fails often, like pipes

I do think it's still useful tho. It's output ingame, in the logs, and
in unit test failures. Hopefully all nicely tho I'm only really 100%
sure about in game.

* Adds a system for logging metadata about hard deletes

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
2023-08-04 15:25:55 -07:00
LemonInTheDark
1fed91837c Adds a system for logging metadata about hard deletes (#76956)
## About The Pull Request

I'm sick of the progress bar harddel, and I've ran into this problem in
the past, so I'm just gonna do something about it

If you want to provide an individual logged bit of info about a harddel,
you can override `/datum/proc/dump_harddel_info()` and return a string
containing "whatever"

Use of this should be limited, this could potentially clutter del logs,
especially if it's used on something that fails often, like pipes

I do think it's still useful tho. It's output ingame, in the logs, and
in unit test failures. Hopefully all nicely tho I'm only really 100%
sure about in game.
2023-08-04 14:15:00 -07:00
SkyratBot
6dfe17306c [MIRROR] Pulls apart the vestiges of components still hanging onto signals [MDB IGNORE] (#21738)
* Pulls apart the vestiges of components still hanging onto signals

* update modular

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2023-06-18 13:18:23 +00:00
LemonInTheDark
ae5a4f955d Pulls apart the vestiges of components still hanging onto signals (#75914)
## About The Pull Request

Signals were initially only usable with component listeners, which while
no longer the case has lead to outdated documentation, names, and a
similar location in code.

This pr pulls the two apart. Partially because mso thinks we should, but
also because they really aren't directly linked anymore, and having them
in this midstate just confuses people.

[Renames comp_lookup to listen_lookup, since that's what it
does](102b79694f)

[Moves signal procs over to their own
file](33d07d01fd)

[Renames the PREQDELETING and QDELETING comsigs to drop the parent bit
since they can hook to more then just comps
now](335ea4ad08)

[Does something similar to the attackby comsigs (PARENT ->
ATOM)](210e57051d)

[And finally passes over the examine
signals](65917658fb)

## Why It's Good For The Game

Code makes more sense, things are better teased apart, s just good imo

## Changelog
🆑
refactor: Pulled apart the last vestiges of names/docs directly linking
signals to components
/🆑
2023-06-09 06:14:31 +00:00
SkyratBot
1de6e78b91 [MIRROR] Moves SSGarbage over to uid softref verification so refid reuses don't cause issues [MDB IGNORE] (#21678)
* Moves SSGarbage over to uid softref verification so refid reuses don't cause issues (#75600)

Before, long ago, if a `\ref` was reused on something that was deleted
the same tick, the old associated list based queue would cause the new
item to "override" the old one, keeping the list from duplicating.

To make ssgarbage faster, we moved the queue to a normal list of lists
some time ago, but now if something qdeletes, gcs, then something gets
assigned that same `\ref`id, then that thing also gets deleted, all
within the same tick, it will attempt to hard delete it multiple times
needlessly because it doesn't detect the ref reuse.

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>

* Moves SSGarbage over to uid softref verification so refid reuses don't cause issues

---------

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>
2023-06-07 16:18:09 +02:00
Kyle Spier-Swenson
83cd4cac3b Moves SSGarbage over to uid softref verification so refid reuses don't cause issues (#75600)
Before, long ago, if a `\ref` was reused on something that was deleted
the same tick, the old associated list based queue would cause the new
item to "override" the old one, keeping the list from duplicating.

To make ssgarbage faster, we moved the queue to a normal list of lists
some time ago, but now if something qdeletes, gcs, then something gets
assigned that same `\ref`id, then that thing also gets deleted, all
within the same tick, it will attempt to hard delete it multiple times
needlessly because it doesn't detect the ref reuse.

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-06-06 02:58:11 +00:00
Funce
68d843d070 [MIRROR] Quietens Spaceman when debugging UNIT_TESTS locally [MDB IGNORE] (#21548)
Quietens Spaceman when debugging UNIT_TESTS locally (#75570)

The contract is removed by virtue of testing.

Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
2023-05-31 17:11:46 -04:00
SkyratBot
120041c693 [MIRROR] Converts del logging to proper json, using json objects instead of building a text file [MDB IGNORE] (#21448)
* Reverts qdel logging to a raw text file (#75632)

## About The Pull Request

We log this information once, on SSgarbage shutdown. Putting it in a
json is kinda pointless, it exists to be read when we see massive
overtime from ssgarbage, that's all.

Something something reee my workflow.

## Changelog
🆑
server: qdel statistics are once again logged in qdel.log, instead of
the otherwise typical json logging system
/🆑

* Converts del logging to proper json, using json objects instead of building a text file (#75636)

## About The Pull Request

It's easier to parse, and makes more sense when you read it. This way
I'll never have to add yet another case to my parser for someone
changing where a space goes or something.

Moves qdel into its own category cause the old name looked ugly (yell if
this is dumb)
Added a bitfield to entries pulled from categories, adds a new flag that
enables pretty printing json lists.


## Why It's Good For The Game

IMPROVES my workflow

## Changelog
🆑
server: del logging is now done by outputting to a json file again, but
this time we're using ACTUAL json and not just a big text string with
newlines and shit
/🆑

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2023-05-31 17:05:23 -04:00
Jordan Dominion
44f88e49be Quietens Spaceman when debugging UNIT_TESTS locally (#75570)
The contract is removed by virtue of testing.
2023-05-30 01:21:55 +00:00
LemonInTheDark
b304b6523f Converts del logging to proper json, using json objects instead of building a text file (#75636)
## About The Pull Request

It's easier to parse, and makes more sense when you read it. This way
I'll never have to add yet another case to my parser for someone
changing where a space goes or something.

Moves qdel into its own category cause the old name looked ugly (yell if
this is dumb)
Added a bitfield to entries pulled from categories, adds a new flag that
enables pretty printing json lists.


## Why It's Good For The Game

IMPROVES my workflow

## Changelog
🆑
server: del logging is now done by outputting to a json file again, but
this time we're using ACTUAL json and not just a big text string with
newlines and shit
/🆑

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2023-05-26 12:40:18 -06:00
SkyratBot
8a9768cce5 515 DEPENDANCY UPDATES (#19873)
* Experiment flag for not caching ref on 515

* Update vv_outfit.dm

* MANUAL MIRROR https://github.com/tgstation/tgstation/pull/72657

* MANUAL MIRROR https://github.com/tgstation/tgstation/pull/73788

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: lessthnthree <three@lessthanthree.dk>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-03-26 23:35:04 +01:00
Mothblocks
486b569cb0 Fix 515 warnings from INVOKE_ASYNC and qdel experiment flag, treat warnings as errors in CI (#73788)
Fixes #72681
2023-03-05 23:37:11 -05:00
MrMelbert
3f659dd9d3 Revert "Rat Trap" (#73539)
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
2023-02-20 09:54:40 +13:00
LemonInTheDark
777b4dc367 Rat Trap (#73159) 2023-02-19 15:18:21 -05:00
SkyratBot
ef1ad8331a [MIRROR] Experiment with holding hard references to objects being qdeleted in 515 (saves 1.1+ seconds on init times, more on prod) [MDB IGNORE] (#18361)
* Experiment with holding hard references to objects being qdeleted in 515 (saves 1.1+ seconds on init times, more on prod) (#72033)

## 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

* Experiment with holding hard references to objects being qdeleted in 515 (saves 1.1+ seconds on init times, more on prod)

* fix missed underbarrels

* HEV radio

* Keeps gc_destroyed from getting updated on every step thru the gc queue. (#72401)

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.

* test fix

* final fix

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
2023-01-12 16:16:33 -05:00
Kyle Spier-Swenson
5ebb91f962 Keeps gc_destroyed from getting updated on every step thru the gc queue. (#72401)
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.
2023-01-02 22:07:22 +01:00
Mothblocks
0235cfb078 Experiment with holding hard references to objects being qdeleted in 515 (saves 1.1+ seconds on init times, more on prod) (#72033)
## 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
2022-12-27 08:04:49 +00:00
SkyratBot
257feb1be7 [MIRROR] More horrible 515 proc compatibility. [MDB IGNORE] (#17671)
* More horrible 515 proc compatibility.

* Feex

* Hopefully we're done now

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2022-11-27 14:46:36 -08:00
AnturK
84f69359a0 More horrible 515 proc compatibility. (#71333)
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.
2022-11-22 07:55:43 +00:00
SkyratBot
375fea374a [MIRROR] Optimizes qdel related things (slight init time savings) [MDB IGNORE] (#17240)
* Optimizes qdel related things (slight init time savings)

* lang holder

* cleanup custom spawners slightly

* ref update

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-10-30 23:15:38 -04:00
LemonInTheDark
85b2d5043d Optimizes qdel related things (slight init time savings) (#70729)
* 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
2022-10-30 00:09:15 -07:00
SkyratBot
b87c7279b0 [MIRROR] Adds MC initialization stages. Earlier stages can fire while later ones init. Fixes tgui chat reconnection banner showing during init. [MDB IGNORE] (#13089)
* Adds MC initialization stages. Earlier stages can fire while later ones init. Fixes tgui chat reconnection banner showing during init. (#66473)

* 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.

* Adds MC initialization stages. Earlier stages can fire while later ones init. Fixes tgui chat reconnection banner showing during init.

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
2022-04-25 14:25:23 +01:00
Kyle Spier-Swenson
565319095f Adds MC initialization stages. Earlier stages can fire while later ones init. Fixes tgui chat reconnection banner showing during init. (#66473)
* 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.
2022-04-24 21:29:06 -07:00
SkyratBot
65b8082678 [MIRROR] Harddel Fix Pack #42 + Better Live Reftracking Support [MDB IGNORE] (#10639)
* Harddel Fix Pack #42 + Better Live Reftracking Support

* awooga

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-01-12 21:57:49 +00:00
LemonInTheDark
f8aad14ae8 Harddel Fix Pack #42 + Better Live Reftracking Support (#63877)
* Hard Del Fixes, Ref Tracking Changes
2022-01-12 22:46:13 +01:00
SkyratBot
05e3188e09 [MIRROR] Adds an additional queue to the qdel subsystem to quickly filter out things that garbage collect within the first second. [MDB IGNORE] (#9604)
* Adds an additional queue to the qdel subsystem to quickly filter out things that garbage collect within the first second. (#62969)

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.

* Adds an additional queue to the qdel subsystem to quickly filter out things that garbage collect within the first second.

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
2021-11-22 00:37:09 -05:00
Kyle Spier-Swenson
7083cc2e4b Adds an additional queue to the qdel subsystem to quickly filter out things that garbage collect within the first second. (#62969)
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.
2021-11-21 19:41:11 -08:00
SkyratBot
5c95967cad QDEL_IN harddel prevention (#60937) (#7669)
QDEL_IN could hardel if the timer was greater than 5 minutes (time for the qdel queue)

we can use weakref to prevent this

Co-authored-by: BraveMole <bsouchu@gmail.com>
2021-08-21 10:16:26 -04:00
BraveMole
af48bdaaef QDEL_IN harddel prevention (#60937)
QDEL_IN could hardel if the timer was greater than 5 minutes (time for the qdel queue)

we can use weakref to prevent this
2021-08-20 14:28:34 -04:00
SkyratBot
5170b9ecda The Failsafe can now recover from an deleted MC (#60846) (#7664)
* 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

Co-authored-by: Gamer025 <33846895+Gamer025@users.noreply.github.com>
2021-08-20 18:53:14 +01:00
Gamer025
3da51f515d The Failsafe can now recover from an deleted MC (#60846)
* 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
2021-08-19 22:30:39 -07:00
SkyratBot
b0c01e40af [MIRROR] Del The World: Unit testing for hard deletes (#7589)
* Del The World: Unit testing for hard deletes (#59612)

Co-authored-by: SteelSlayer <42044220+SteelSlayer@ users.noreply.github.com>

* Del The World: Unit testing for hard deletes

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@ users.noreply.github.com>
2021-08-17 18:58:57 +01:00
LemonInTheDark
cd576ab519 Del The World: Unit testing for hard deletes (#59612)
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
2021-08-15 21:09:26 -07:00
SkyratBot
d18e837d27 [MIRROR] Raises the base gc queue time from 2 minutes to 5 (#6908)
* Raises the base gc queue time from 2 minutes to 5 (#60174)

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

* Raises the base gc queue time from 2 minutes to 5

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2021-07-14 15:30:38 +01:00
LemonInTheDark
162bfb436c Raises the base gc queue time from 2 minutes to 5 (#60174)
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
2021-07-14 04:09:05 -03:00
SkyratBot
78afb2bccf Adds configs to disable laggy hard deletes (#6559)
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
2021-06-28 14:19:27 +01:00
Kyle Spier-Swenson
7ace8da9e0 Adds configs to disable laggy hard deletes (#59750)
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
2021-06-28 10:31:03 +12:00