carrier-explode Explode and decode carrier data GitHub About

Indexing

Indexing turns the records units write into rows of the D1 index (carrier-explode-index). It runs only in the extractor’s index queue consumer, one message at a time, and in two parts: facts, written once per record, and derivations, computed from all the facts of a platform. Derivations come from packages/schema.

Messages

MessageSent byDoes
releasea build unit’s last stepwrites the record’s facts
otaan OTA unit, for its fileswrites the files’ facts
routesan Apple OTA unitwrites the manifest’s SIM routes
rederiveindexing, a feed check, or by handstarts a platform’s derivation
derivea rederivederives 25 sources, then 25 releases’ changes, per message
reindexa reindex of every held recordwrites one record’s facts

Derivation runs once after a burst of facts, not once per record. A release or ota message reads at most about 96 MB of new profiles; one with more left queues itself again. A message that writes anything queues a cache purge.

Facts

Written once per content hash or per unit:

TableOne row per
releasesbuild (iOS, Galaxy) or build and Pixel
copiescopy of a source’s content on a line, from a release or an OTA file
profilesprofile, by hash: its identity, and what it says of a phone’s 5G radio
simsSIM rule a profile claims, or a modem configuration selects
routesSIM rule a platform’s routing sends to a source
modems, modem_configsmodem a release ships to some devices, and each configuration a device’s modem carries
ota_filesfile of an OTA feed
devicesphone a feed lists: boards, release day

Timelines

A source’s timeline is one entry per distinct content on each of its lines, newest first. A line is where one copy of a source lives:

PlatformLinesExample
Applethe main line; a model’s own line where the manifest gives it one (ByProductType)/ios/carriers/ATT_US/72.0
Pixelone per Pixel, by codename/android/carriers/tmobile_us/tokay/79000000034
Galaxyone per model/samsung/carriers/TMB/SM-S942U/17.0013

An entry is named by the file’s own version. When two contents share a version, the older is named by where it first appeared: 64.1@23a341 for an iOS build, 50.1@2022-04-12 for an OTA download. A source’s head is the newest release on its default line, or its newest beta when it has no release; on Android, the newest Pixel’s line.

Changes and phone states

A release’s changes are its sources against the release before it on its platform, by version: each source added, removed or changed, counted on every device, and linked to the entries on each side.

A phone state is what one phone reads from one carrier source for each feature, for every phone an indexed release lists:

PhoneReads
iPhonethe source’s head, with its own override file as a variant
Pixelthe file the newest build carrying the source ships it, over that build’s default.pb
Galaxyits own model’s newest pack

A state the carrier leaves unset is read from the defaults under it, and marked so.

Per source

TableHolds
entriesthe timeline
sourcesthe head’s hash; for a Pixel source, the default.pb its newest phone reads it over; when it last changed
settingsthe head’s every setting, as the file states it
base_settingseach default.pb’s settings, by hash: what a setting search shows for a key a head leaves unset
conceptsthe head’s concept values
phone_stateseach phone’s state of each feature
changeseach release’s changes

Only heads have their settings in D1; an older version is read from its profile in R2.

Carriers

A carrier is one or more sources, across platforms, linked by the SIM rules they claim. A source’s rules are those of its head’s identity and those its platform’s routing sends it. A source’s best match on another platform is the source there it shares the most rules with. Two sources are linked when one is the other’s only best match and the choice is mutual, or covers at least half of the choosing source’s rules; a tie links nothing. Sources on one platform are never linked to each other by their rules.

Two kinds of rule never link anything (About § Names and references):

RulesWhy
MCCs starting 0, 1 or 8, and 999assigned to no network by ITU-T E.212; test SIMs use them (00101, 99999)
246081, 24681the network 3GPP TS 31.121 conformance tests simulate

People correct the result in the links table, each with its reason: link joins two sources, split keeps two apart (for an Apple bundle, its iPad and Watch files too). Linking runs again whenever a head’s identity changes, and at the end of every rederive. A carrier is named after its first member: Apple’s before Pixel’s before Galaxy’s, then the one with most rules.

Reindexing

After a decoder change and a PROFILE_SCHEMA or MODEM_SCHEMA bump, a reindex reads every held artifact from obj/ into the new norm/ prefix, then writes every held record’s facts again, one record a message in key order, and ends with each platform’s rederive. Until a modem configuration’s new object is written, the site and the API serve its object from the schema before (PREVIOUS_MODEM_SCHEMA), whose shape the new one keeps.

See also