Starting this month, California's smog check inspection is specifically going to look for modified engine-control software. OEM and CARB-approved aftermarket ECU tunes should be OK, but vehicles found to have unapproved ECU software will fail. According to the CA.gov website: "Beginning July 19, 2021, vehicles with software not provided by the original equipment manufacturer (OEM) or approved through a California Air Resources Board (CARB) Executive Order (EO) will fail smog check."
Note that the mere presence of non-conforming software is enough to fail. The inspection does not have to prove that the non-conforming software results in higher emissions levels. However, not all aftermarket software is non-conforming. Some ECU tuners have been able to get approval of their software from CARB.
First, a brief primer on California's smog check rules. Once a vehicle passes its fourth birthday, it requires a smog check if it's sold to a new owner. Once a vehicle is eight years old, it requires a smog check every two years, no matter what. A smog check is also required to register a vehicle in California if it is coming from another state. Vehicles from the 1975 model year or older don't require any smog check. You can read more on the state's smog check FAQs here.
This new test regimen is only for newer vehicles, those with OBDII ports, which provide a way to peek at engine-management software. Older vehicles get a visual inspection and/or a tailpipe-sniffer test. The website carbibles.com recently did a deep dive into the technical aspects of this issue, and that post garnered a huge number of comments on Reddit, some of which were rants but many of which were insightful. Check them out if you want to learn more.