Skip to main content
The Core Builds Expression Layer is the set of Stream Expressions (SEL) deployed across all active templates. It is what separates Core Builds from a default AIOStreams install. The fleet deploys a curated set of ESEs, ISEs, and PSEs across active templates. Standard templates use the full quality gate stack; Lite variants keep safety filters while removing selected quality gates for broader coverage.

Expression Types

A stream matched by an ESE never reaches PSE scoring. ISE-matched streams jump to the top regardless of their PSE score.

ESEs — The Kill Stack

Standard templates run the full ESE quality stack; Lite templates retain safety filters while removing selected quality gates. The exact count varies by device, service, and template family.

Universal ESEs (all 42 templates)

These run on every template in the fleet:

Near-Universal ESEs (30–41 templates)

These run on almost all templates — some are omitted on Anime or Lite variants:

Quality Gates (Standard only)

These run only on standard templates — they can filter legitimate content on thin libraries:

Specialized ESEs (device and resolution)

LABS ESEs (Nightly only)

These are experimental and only appear on Nightly/Labs templates:
If the standard template returns very few results, switch to the Lite variant. If Lite returns results, one of the quality gate ESEs is filtering your content — most commonly the bitrate floor or low-seeder kill.

ISEs — Boost Stack

ISEs run after ESEs and before PSEs. Matched streams jump ahead of all ranked results regardless of their PSE score.

PSEs — The Ranking Engine

PSEs are the heart of Core Builds ranking. They use a tiered architecture — streams are matched against quality tiers from S (best) to E (fallback). The first PSE to match a stream determines its rank position. Two systems exist:
  • CB-style PSEs — simple resolution + quality filters. Used on standard/lite/speed templates.
  • IQR Tukey fence PSEs — statistical bitrate analysis with adaptive windows. Used on flagship templates (Apex, Essential 4K, Hybrid 4K, AllDebrid 4K).

Tier Architecture

4K Quality Tiers (IQR templates)

1080p Quality Tiers

Anime Quality Tiers

Three-tier adaptive logic (IQR Tukey fence)

Rather than fixed bitrate cutoffs (which break on thin libraries and new releases), IQR PSEs use live statistics computed from the actual pool of streams returned for each query. Tier 1 — IQR Tukey fence (≥4 peers) When 4 or more streams exist for a title, the fence is statistically sound:
The window is [Q1 - 1.5×IQR, Q3 + 1.5×IQR]. Streams inside the fence are ranked; outliers (suspiciously low bitrate or bloated) are skipped by this PSE tier and fall to lower tiers. Tier 2 — Min/max ±20% (1–3 peers) On thin results (rare titles, niche content), full IQR isn’t statistically meaningful. The PSE switches to a simpler min/max window:
Tier 3 — pow() decay fallback (0 peers) When no peers exist (brand-new release, no comparison data), the PSE falls back to an age-decaying window around the median:

pow() decay explained

pow(0.95, daysSinceRelease) produces smooth exponential decay: On release day, a wide window accepts most encodes — you want something to play. Over 90 days, the window converges on the median as more encodes appear and the statistical picture stabilises. This replaces the old hard 60-day cliff that caused all streams to drop in rank exactly on day 61.

Booster PSEs

After the quality tiers, these additional PSEs run across most templates:

720p Fallback PSEs

On 1080p templates with a 720p fallback tier, two PSEs catch lower-resolution content:

Pin Expressions

pin() is a side-effect function — it registers streams for reordering after PSE scoring completes. Elite group pins float specific release groups to the top; LQ group pins sink poor groups to the bottom.

Hybrid TorBox-Priority PSEs

The 4K Hybrid template adds a TorBox-cached twin PSE before each IQR tier:
This returns only TorBox-cached streams that match the IQR window. If no TorBox streams match, it returns [] and the all-service PSE runs as a fallback. Result: TorBox cache is always preferred over RD/other services when quality is equivalent. The 4K Hybrid template runs the most PSEs in the fleet (24) because each quality tier has both a TorBox-priority twin and an all-service fallback.

Execution Flow

The full pipeline from raw scraped streams to the final ranked list:
  1. ESEs execute first — each ESE returns streams to exclude. Matched streams are permanently removed. Infrastructure ESEs (flood guards, limits) run before quality gates (bitrate floors, seeder kills). Lite templates skip quality gates.
  2. ISEs execute second — matched streams jump to the top regardless of PSE score. Library, REPACK, cached-first, and digitalRelease streams always surface.
  3. PSEs execute third — each PSE returns matched streams. The first PSE to match a stream determines its tier position. Higher tiers (S) rank above lower tiers (E).
  4. pin() side-effects apply — after scoring, pin() calls registered during PSE evaluation reorder specific streams. Elite pins float to top; LQ pins sink to bottom.
  5. Sort chain applies — the 16-key stable sort breaks ties across all remaining dimensions. Per-type overrides (movies, anime, uncached) adjust key priorities.

Sort Architecture

AIOStreams uses a stable multi-key sort — position 1 is the primary sort; each subsequent key only breaks ties from prior comparisons. Core Builds templates use 16 sort keys across 7 sort sections: global, movies, series, anime, cachedMovies, uncachedMovies, uncachedSeries.

4K Global Sort Chain (16 keys)

cached → seMatched → seScore → seadex → resolution → quality → regexScore → visualTag → audioTag → audioChannel → language → encode → library → seeders → bitrate → size

Key Differences by Section


Release Group Scoring

Two systems work together: preferredRegexPatterns for top-tier boosts and rankedRegexPatterns for the full scoring ladder.

preferredRegexPatterns

Template-specific patterns with a strong positive boost. Score range: 70–100.

rankedRegexPatterns

107 inline scoring patterns sourced from Filtering/ranked-regex-patterns.json and applied on all non-Anime templates. These override Vidhin05’s synced zero-score entries by name matching — AIOStreams shows them as regexOverrides in the config diff. 4K templates carry 107 patterns (including UHD Bluray-specific entries). 1080p templates carry 103. Anime templates carry 0 — SeaDex handles quality selection. Every pattern string is an exact verbatim copy of a current Vidhin05 entry (elfhosted whitelist requirement).

syncedRankedRegexUrls

Points to Vidhin05’s file on all non-Anime templates. Supplements ranked patterns with Vidhin05’s 176-pattern set at score 0; the inline rankedRegexPatterns entries override scoring by name.

Dynamic Addon Fetching

All 42 templates use dynamic addon fetching (DAF) — adaptive exit conditions that control when AIOStreams stops waiting for scrapers. Instead of a fixed timeout, templates exit when enough cached results are available. Templates with addon groups define count(cached(previousStreams)) < 3 conditions that let slow scrapers run longer when cached results are scarce, then cut them short once enough results exist.

SEL Character Limits

AIOStreams enforces hard limits on expression size:
Do not grow the Final Limit (All) ESE further — it is already at 2,953 characters. Any addition risks hitting the 3,000 char hard limit and breaking import.