Skip to content

Add PatternOS: Neural, Statistical & Behavioral Analysis Engine#2433

Closed
Alekhyo-Biswas wants to merge 4 commits intoTurboWarp:masterfrom
Alekhyo-Biswas:add-patternOS
Closed

Add PatternOS: Neural, Statistical & Behavioral Analysis Engine#2433
Alekhyo-Biswas wants to merge 4 commits intoTurboWarp:masterfrom
Alekhyo-Biswas:add-patternOS

Conversation

@Alekhyo-Biswas
Copy link

@Alekhyo-Biswas Alekhyo-Biswas commented Mar 6, 2026

Description

This PR introduces PatternOS, a high-performance analytical engine designed to bring professional-grade statistical analysis, behavioral fingerprinting, and pattern detection to TurboWarp.

It allows creators to build robust anti-cheat systems, predictive physics models, gesture recognition profiles, and spatial trackers without needing to write complex mathematical algorithms from scratch.

Technical Implementation Details
Zero External Dependencies: All logic, including Welford's online algorithm for computing running variance and standard deviation, is handled natively within the class.

Highly Optimized: Variable syncing runs on a fast setInterval loop that safely checks for the runtime stage, ensuring 0 dropped frames without lagging the VM.

Namespace Safety: All opcodes are uniquely prefixed to guarantee zero conflicts with built-in Scratch blocks or other extensions.

Fully Secure: The extension runs entirely sandboxed without eval() or Function(), fully compliant with TurboWarp gallery guidelines.

Checklist
[x] Extension runs entirely sandboxed.

[x] All opcodes are unique.

[x] Uses high-contrast, fully verified 6-digit hex colors for UI stability.

[x] Includes standard metadata (Name, ID, Description, By, License).

@github-actions github-actions bot added the pr: new extension Pull requests that add a new extension label Mar 6, 2026
@Alekhyo-Biswas
Copy link
Author

I added documentation

@PPPDUD
Copy link
Member

PPPDUD commented Mar 7, 2026

You do realize that anyone can easily remove client-side anticheat from a TurboWarp project, right?

@PPPDUD PPPDUD mentioned this pull request Mar 7, 2026
5 tasks
@Alekhyo-Biswas
Copy link
Author

Alekhyo-Biswas commented Mar 8, 2026

You do realize that anyone can easily remove client-side anticheat from a TurboWarp project, right?

But the problem is, we need at least a minimum protection against hackers. If you have read the docs given in the code, you will notice that it is not necessary for it to be server-side (though most of the examples seem to be). Basically it can be used (in multiplayer games) on each player's side to check the movements and stats of other players (for example).

You may also notice that I not only included anti-cheat architecture, I also included a vast library of mathematical and statistical utilities, each of which are useful for something. I also used different colors for better accessibility.

#1: Detector Lifecycle: This category allows you to deal with detectors and their details

#2: Intelligent Ingestion: Deals with feeding the detectors with values

#3: Inconsistency and Anomaly: Good for dealing with outlying values etc. Can be used for anti-cheat to some extent.

#4: Predictive Engine: Mathematically predicts new values eg. useful for making single-player shooting games with difficult enemies and Rollback netcoding

Others are also there. Check them please

I put a lot of time into this. Is this a good idea? I am happy to correct any error you may find...

@PPPDUD
Copy link
Member

PPPDUD commented Mar 8, 2026

You do realize that anyone can easily remove client-side anticheat from a TurboWarp project, right?

But the problem is, we need at least a minimum protection against hackers. If you have read the docs given in the code, you will notice that it is not necessary for it to be server-side (though most of the examples seem to be). Basically it can be used (in multiplayer games) on each player's side to check the movements and stats of other players (for example).

Good point, I hadn't thought about that.

You may also notice that I not only included anti-cheat architecture, I also included a vast library of mathematical and statistical utilities, each of which are useful for something. I also used different colors for better accessibility.

#1: Detector Lifecycle: This category allows you to deal with detectors and their details

#2: Intelligent Ingestion: Deals with feeding the detectors with values

#3: Inconsistency and Anomaly: Good for dealing with outlying values etc. Can be used for anti-cheat to some extent.

#4: Predictive Engine: Mathematically predicts new values eg. useful for making single-player shooting games with difficult enemies and Rollback netcoding

Others are also there. Check them please

I put a lot of time into this. Is this a good idea? I am happy to correct any error you may find...

I'm personally not interested in adding this because you have a history of using LLMs in this project, but that doesn't mean that it's a bad idea, and another reviewer might be willing to approve this (@Brackets-Coder perhaps?).

For the record, I haven't done a proper code review yet, so it's possible that there's some really cool features that I didn't see at first glance.

@Alekhyo-Biswas
Copy link
Author

Do check it out...

'cos I'm a math guy, I added everything mathy and statistical here, and I am willing to add more

Why don't you guys suggest some...?

@Alekhyo-Biswas
Copy link
Author

Hello, anybody?

@Brackets-Coder
Copy link
Contributor

Brackets-Coder commented Mar 13, 2026

Hello, anybody?

"Patience, young Padawan" — Obi-Wan Kenobi

I'm not familiar with how this works so I don't believe I could provide helpful suggestions right now
Maybe another moderator can help you out?

@Alekhyo-Biswas
Copy link
Author

Hello, anybody?

"Patience, young Padawan" — Obi-Wan Kenobi

I'm not familiar with how this works so I don't believe I could provide helpful suggestions right now
Maybe another moderator can help you out?

No, I mean just check out its functionality on TurboWarp and tell me your reviews...
Also, can anyone let me know how long it takes for an extension to be approved and merged?

@Brackets-Coder
Copy link
Contributor

Brackets-Coder commented Mar 14, 2026

No, I mean just check out its functionality on TurboWarp and tell me your reviews... Also, can anyone let me know how long it takes for an extension to be approved and merged?

Anywhere from a few weeks to several years, this volunteer-based repository is notoriously slow.

@Alekhyo-Biswas
Copy link
Author

No, I mean just check out its functionality on TurboWarp and tell me your reviews... Also, can anyone let me know how long it takes for an extension to be approved and merged?

Anywhere from a few weeks to several years, this volunteer-based repository is notoriously slow.

I see...

@PPPDUD
Copy link
Member

PPPDUD commented Mar 14, 2026

Hello, anybody?

"Patience, young Padawan" — Obi-Wan Kenobi
I'm not familiar with how this works so I don't believe I could provide helpful suggestions right now
Maybe another moderator can help you out?

No, I mean just check out its functionality on TurboWarp and tell me your reviews... Also, can anyone let me know how long it takes for an extension to be approved and merged?

Generally speaking, we wait for ~2 months, find another more urgent PR, forget about what we were going to work on initially, and then the required checks start failing because the APIs changed, so everyone ignores your extension...

(this is mostly a joke)

@Brackets-Coder
Copy link
Contributor

Imagine the review process is like a puppy running around with ADHD and procrastination energy.

@Alekhyo-Biswas
Copy link
Author

Alekhyo-Biswas commented Mar 14, 2026

Wow, seriously...[insert your word]...analogy

Imagine the review process is like a puppy running around with ADHD and procrastination energy.

image

@Alekhyo-Biswas
Copy link
Author

Hello, anybody?

"Patience, young Padawan" — Obi-Wan Kenobi
I'm not familiar with how this works so I don't believe I could provide helpful suggestions right now
Maybe another moderator can help you out?

No, I mean just check out its functionality on TurboWarp and tell me your reviews... Also, can anyone let me know how long it takes for an extension to be approved and merged?

Generally speaking, we wait for ~2 months, find another more urgent PR, forget about what we were going to work on initially, and then the required checks start failing because the APIs changed, so everyone ignores your extension...

(this is mostly a joke)

what the heck?!?

@Alekhyo-Biswas
Copy link
Author

Alekhyo-Biswas commented Mar 14, 2026

On a more serious note, it looks like you guys didn't read the first part
pls check the thing out on tW

@PPPDUD
Copy link
Member

PPPDUD commented Mar 14, 2026

Imagine the review process is like a puppy running around with ADHD and procrastination energy.

This is comedy gold @Brackets-Coder.

@PPPDUD
Copy link
Member

PPPDUD commented Mar 14, 2026

Hello, anybody?

"Patience, young Padawan" — Obi-Wan Kenobi
I'm not familiar with how this works so I don't believe I could provide helpful suggestions right now
Maybe another moderator can help you out?

No, I mean just check out its functionality on TurboWarp and tell me your reviews... Also, can anyone let me know how long it takes for an extension to be approved and merged?

Generally speaking, we wait for ~2 months, find another more urgent PR, forget about what we were going to work on initially, and then the required checks start failing because the APIs changed, so everyone ignores your extension...
(this is mostly a joke)

what the heck?!?

I don't like it any more than anybody else, but of course none of us really know how to fix it.

@Alekhyo-Biswas
Copy link
Author

Hello, anybody?

"Patience, young Padawan" — Obi-Wan Kenobi
I'm not familiar with how this works so I don't believe I could provide helpful suggestions right now
Maybe another moderator can help you out?

No, I mean just check out its functionality on TurboWarp and tell me your reviews... Also, can anyone let me know how long it takes for an extension to be approved and merged?

Generally speaking, we wait for ~2 months, find another more urgent PR, forget about what we were going to work on initially, and then the required checks start failing because the APIs changed, so everyone ignores your extension...
(this is mostly a joke)

what the heck?!?

I don't like it any more than anybody else, but of course none of us really know how to fix it.

No, it's not like...I'm not blaming you, its just that...this sucks 😞

@Brackets-Coder
Copy link
Contributor

Brackets-Coder commented Mar 15, 2026

but of course none of us really know how to fix it.

I can tell you how to fix it:

Get 10 reviewers instead of just 6 and make them all full-time instead of just six people doing one review every two months. Of course, that would be totally impractical to ask and I like my schedule better how it is now...

@Alekhyo-Biswas
Copy link
Author

Alekhyo-Biswas commented Mar 15, 2026

but of course none of us really know how to fix it.

I can tell you how to fix it:

Get 10 reviewers instead of just 6 and make them all full-time instead of just six people doing one review every two months. Of course, that would be totally impractical to ask and I like my schedule better how it is now...

There are only six reviewers in this whole turbowarp repo?!
on another note, you don't want full-time stuff because that would require turbowarp to become priced (or have @GarboMuffin pretty much selling away his life) which is gonna be bad on us users

@PPPDUD
Copy link
Member

PPPDUD commented Mar 15, 2026

but of course none of us really know how to fix it.

I can tell you how to fix it:
Get 10 reviewers instead of just 6 and make them all full-time instead of just six people doing one review every two months. Of course, that would be totally impractical to ask and I like my schedule better how it is now...

There are only six reviewers in this whole turbowarp repo?! on another note, you don't want full-time stuff because that would require turbowarp to become priced (or have @GarboMuffin pretty much selling away his life) which is gonna be bad on us users

Technically we have 8 reviewers, but two of them set their membership to private for some reason.

@Alekhyo-Biswas
Copy link
Author

but of course none of us really know how to fix it.

I can tell you how to fix it:
Get 10 reviewers instead of just 6 and make them all full-time instead of just six people doing one review every two months. Of course, that would be totally impractical to ask and I like my schedule better how it is now...

There are only six reviewers in this whole turbowarp repo?! on another note, you don't want full-time stuff because that would require turbowarp to become priced (or have @GarboMuffin pretty much selling away his life) which is gonna be bad on us users

Technically we have 8 reviewers, but two of them set their membership to private for some reason.

Oh, I see...

@CubesterYT
Copy link
Member

I'm going to be real with you, I don't think we would merge this kind of extension at all

Just weighing in

@Alekhyo-Biswas
Copy link
Author

I'm going to be real with you, I don't think we would merge this kind of extension at all

Just weighing in

No probs, but why?

@PPPDUD
Copy link
Member

PPPDUD commented Mar 15, 2026

I'm going to be real with you, I don't think we would merge this kind of extension at all
Just weighing in

No probs, but why?

I'm not @CubesterYT, but it's possible that it has something to do with LLM usage.

@Alekhyo-Biswas
Copy link
Author

I'm going to be real with you, I don't think we would merge this kind of extension at all
Just weighing in

No probs, but why?

I'm not @CubesterYT, but it's possible that it has something to do with LLM usage.

Oh..

@TheOfficialCheeseFish
Copy link

TheOfficialCheeseFish commented Mar 19, 2026

i have a question, is this extension server sided?
because u said "robust anti-cheat"

@PPPDUD
Copy link
Member

PPPDUD commented Mar 19, 2026

i have a question, is this extension server sided? because u said "robust anti-cheat"

No, it's meant to detect suspicious patterns on the client's side from my understanding.

@Alekhyo-Biswas
Copy link
Author

Alekhyo-Biswas commented Mar 20, 2026

i have a question, is this extension server sided? because u said "robust anti-cheat"

Basically, it is supposed to be server-side on a real game engine
But since TurboWarp and most other Scratch mods have a shared cloud server on a P2P (Peer-to-Peer) architecture, when you are building a game (or any multi-user project), you detect others' data, and then run a check with their previous behaviour to statistically put up an opinion whether they are hacking (spoofing) or not. May not apply if you are using CloudLink V4 with your own server, then you can put in your own code in the server itself
If you are trying to mimic that using only Scratch (I consider you are using CloudLink without a server or a WebSocket direct connection to the TurboWarp WebSocket (wss://clouddata.turbowarp.org)), then use a custom username for the server, run a check if the username in a project matches the server username, then do all the checks.
Either way, putting it server-side or on the recieving end makes sure that the client (player) cannot bypass a "client-side anticheat" as @PPPDUD mentioned here
I hope I could answer your question 😄

@Alekhyo-Biswas
Copy link
Author

i have a question, is this extension server sided? because u said "robust anti-cheat"

No, it's meant to detect suspicious patterns on the client's side from my understanding.

Pretty much...

@GarboMuffin
Copy link
Member

How is an extension going to detect suspicious patterns in a way that works across many projects?

@GarboMuffin
Copy link
Member

GarboMuffin commented Mar 21, 2026

  • this was pretty clearly written by AI without much human involvement and without disclosure
  • welford's algorithm just computes the variance in a series of data
  • that primitive is not useful at all for detecting cheaters in any real-world use of cloud variables. happy to elaborate if you're unclear on what I mean by this.

@GarboMuffin
Copy link
Member

There is a reason why real games spend incredible efforts on their anti-cheat, and they have the advantage of having full control over their entire stack and have a trusted server. It's because you're not just detecting outliers in a series of numbers. You're doing a lot of very custom stuff that will be specific to the game.

There are a few places where something like this could make sense. Detecting autoclickers, for example, is probably a time where the standard deviation of time between clicks would be a significant giveaway. But that's not useful for cloud variables which already go through extensive buffering at multiple steps along the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new extension Pull requests that add a new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants