Re: 18 a-g semesters, I do agree that it is on the low side but it’s remotely possible. My kid took a non-a-g class in 11th grade (Robotics) along with PE, so a student in that situation could possibly have only 8 a-g semesters for a year (assuming the student still has to take a math, science, English and SS class). But I would think that’s probably more of a profile of a student who wants to barely get by in HS as opposed to a UCLA candidate.
For high schools where the normal class schedule consists of 6 classes a semester, almost everyone student I know will have 22+ semesters (my kid had 31) of a-g for 10-11, so max UC capped would be more like 4.35. Many ambitious kids will take college classes in the summer or during the school year, or take PE during zero period so that they still have the full gamut of 6 classes to take, or take online AP classes.