*1050A jury found Rennard Cawkwell guilty of communicating with a minor with the intent to commit a specified sex offense ( Pen. Code, § 288.3, subd. (a) ) and annoying or molesting a child ( Pen. Code, § 647.6, subd. (a)(1) ).1 The trial court sentenced him to four years in prison and ordered that he register as a sex offender under section 290.
After Cawkwell was sentenced, the Legislature established a diversion program for defendants diagnosed with qualifying mental health disorders. (See Stats. 2018, ch. 34, § 24; § 1001.36, subd. (a).) A few months later, the Legislature amended the diversion scheme to eliminate eligibility for defendants charged with (as relevant here) offenses that require registration under section 290. (Stats. 2018, ch. 1005, § 1; § 1001.36, subd. (b)(2)(B).)
Cawkwell's only contention on appeal is that we must remand this matter to allow the trial court to consider granting him mental health diversion under section 1001.36. To this end, he asks us to conclude that (1) section 1001.36 as originally enacted applies retroactively, and (2) the subsequent amendment *1051eliminating eligibility for certain defendants (like Cawkwell) cannot apply retroactively due to the ex post facto clauses of the state and federal Constitutions.
We conclude that because all relevant legislative activity occurred years after Cawkwell committed his offenses, he could not have relied on the prospect of receiving diversion when he committed his offenses. Thus, the amendment eliminating eligibility for sex offenders like Cawkwell is not an ex post facto law. Accordingly, assuming (without deciding) the mental health diversion statute would otherwise apply retroactively to Cawkwell, he would nevertheless be ineligible for diversion.2
The judgment is affirmed.
FACTUAL AND PROCEDURAL BACKGROUND
In 2010, Cawkwell was convicted of several sex offenses, imprisoned, and ordered to register as a sex offender. He was released on parole in 2012, subject to conditions prohibiting him from contacting minors, possessing pornography, or accessing the internet.
Between November 2015 and April 2016, while still on parole, 46-year-old Cawkwell-pretending to be a 16-year-old boy named "Renny"-maintained an online relationship with 16-year-old Kayla M. After *746a month or two of online chatting, Kayla and Renny became online "boyfriend and girlfriend" and their conversations turned sexually explicit. Renny wrote that he wanted "to make love to" Kayla and "[q]uite frequently" told her he wanted "to have oral sex with" her. Renny told her that when he got off probation in March (when he was actually scheduled to be discharged from parole), they could meet in person and he could see her naked. Renny told Kayla he would give her a cellphone so they could communicate without her parents knowing.
In March 2016, about one week after Cawkwell was discharged from parole, he showed up at Kayla's house unannounced and asked to speak with his "girlfriend." Kayla's older brother, who was home alone, told Cawkwell to leave and reported the encounter to the police.
About two weeks later, Cawkwell again showed up unannounced when Kayla's 12-year-old sister was home alone. Cawkwell, holding a small box *1052with a phone emblem on it, asked the sister if she would give the box to Kayla. After the sister declined, Cawkwell eventually left.
Law enforcement obtained and executed a search warrant on Cawkwell's residence. They found a new cellphone (still in its box) and a used cellphone hidden in the garage. On Cawkwell's used cellphone, police found "several images" of underage girls, including pornographic images of a 14-year-old girl named Cecilia.
Based on his conduct with Kayla, Cawkwell was charged with one count each of communicating with a minor with the intent to commit a sex offense ( § 288.3, subd. (a) ) and annoying or molesting a child ( § 647.6, subd. (a) ). Based on his possession of photographs depicting Cecilia, Cawkwell was charged with one count of possession of child pornography by a registered sex offender (§ 311.11, subd. (b)).
Cawkwell testified at trial that he is autistic and has the mentality of a teenager. He claimed he had no intention of following through on his sexual messages to Kayla; he just wanted to see how she would react to them. He also claimed Cecilia unsolicitedly sent her nude photographs to him and he deleted them as soon as he realized what they were. Cawkwell acknowledged he was subject to parole conditions from his prior convictions, but added, "I don't care what parole says"-the conditions "don't mean anything."
A forensic psychiatrist testified in Cawkwell's defense. He assessed Cawkwell's IQ as being "between very low functioning and ... intellectual disability." He diagnosed Cawkwell with "autism spectrum disorder, level 1, with intellectual impairment."
The jury found Cawkwell guilty on the charges relating to Kayla, but could not reach a verdict on the child pornography count relating to Cecilia.3 Cawkwell admitted he had strike and prison priors, but moved under Romero4 to "strike" them based on his autism and intellectual impairment.
The trial court denied Cawkwell's Romero motion and imposed the upper term of three years (18 months, doubled for the strike prior) on the conviction for communicating with a minor with the intent to commit a sex offense, plus one year for the prison prior. The court also imposed (but stayed under § 654) a 364-day sentence on *747the molesting/annoying conviction. The court ordered Cawkwell to register as a sex offender under section 290. *1053DISCUSSION
Cawkwell's only contention on appeal is that the ameliorative provisions of the mental health diversion statutes apply retroactively to his case, while the subsequent amendment eliminating eligibility for sex offenders (like him) cannot apply retroactively due to ex post facto considerations. We reject the latter contention and, accordingly, need not determine whether the statutes otherwise apply retroactively.
Effective June 27, 2018, the Legislature added two new sections to the Penal Code (§§ 1001.35, 1001.36 ) that authorize trial courts to grant "pretrial diversion" to defendants diagnosed with qualifying mental disorders. (See Stats. 2018, ch. 34, § 24.) Section 1001.36 gives trial courts the discretion to grant pretrial diversion if the court finds: (1) a qualified mental health expert has recently diagnosed the defendant with a qualifying mental disorder; (2) the mental disorder was a significant factor in the commission of the charged offense; (3) the defendant's symptoms will respond to treatment; (4) the defendant consents to diversion and waives his or her speedy trial rights; (5) the defendant agrees to comply with treatment; and (6) the defendant will not pose an unreasonable risk of danger to public safety if treated in the community. ( § 1001.36, subd. (b)(1)(A)-(F).)
If the court grants pretrial diversion, "[t]he defendant may be referred to a program of mental health treatment utilizing existing inpatient or outpatient mental health resources" for "no longer than two years." ( § 1001.36, subds. (c)(1)(B) & (c)(3).) If the defendant performs "satisfactorily in diversion, at the end of the period of diversion, the court shall dismiss the defendant's criminal charges that were the subject of the criminal proceedings at the time of the initial diversion." ( § 1001.36, subd. (e).)
On September 30, 2018-about three months after enacting section 1001.36-the Legislature amended the statute to (as relevant here) eliminate diversion eligibility for defendants charged with certain offenses, including "[a]n offense for which a person, if convicted, would be required to register pursuant to Section 290...." (Stats. 2018, ch. 1005, § 1; § 1001.36, subd. (b)(2)(B).) This amendment took effect January 1, 2019. (Ibid .)
Cawkwell's current convictions under sections 288.3 and 647.6 require him to register under section 290. (§ 290, subd. (c) ["The following persons shall register: [¶] Any person who ... is ... convicted ... of a violation of Section ... 288.3 ... or 647.6...."].) Therefore, under the operative iteration of the mental health diversion statutes, Cawkwell is ineligible for diversion. ( § 1001.36, subd. (b)(2)(B).)
*1054Cawkwell contends that although the initially enacted version of section 1001.36 applies retroactively to him because it is ameliorative (see, e.g., People v. Frahs (2018) 27 Cal.App.5th 784, 791, 238 Cal.Rptr.3d 483 [finding the statutes retroactive], rev. gr. Dec. 27, 2018, S252220), the subsequent amendment eliminating eligibility for defendants like him cannot apply retroactively due to the ex post facto clauses of the state and federal Constitutions. We disagree.
The California and federal Constitutions prohibit the enactment of ex post facto laws. ( Cal. Const., art. I, § 9 ; U.S. Const., art. I, §§ 9, 10.) "A statute violates the prohibition against ex post facto laws if it punishes as a crime an act that was innocent when done or increases the punishment for a crime after it is committed."
*748( People v. White (2017) 2 Cal.5th 349, 360, 212 Cal.Rptr.3d 376, 386 P.3d 1172 ( White ).) The ex post facto prohibition ensures that people are given "fair warning" of the punishment to which they may be subjected if they violate the law; they can rely on the meaning of the statute until it is explicitly changed. ( Weaver v. Graham (1981) 450 U.S. 24, 32 & fn. 17, 101 S.Ct. 960, 67 L.Ed.2d 17.)
When Cawkwell violated sections 288.3 and 647.6 between November 2015 and April 2016, the possibility of pretrial mental health diversion did not exist. The initial version of section 1001.36 was not enacted until more than two years later, in June 2018. Consequently, Cawkwell could not have relied on the possibility of receiving pretrial mental health diversion when he communicated with and annoyed/molested Kayla.5
Moreover, the Legislature's amendment of section 1001.36 to eliminate eligibility for defendants charged with sex offenses did not make an act unlawful that was not formerly unlawful, nor did it increase the punishment for the offenses with which Cawkwell was charged. (See White , supra , 2 Cal.5th at p. 360, 212 Cal.Rptr.3d 376, 386 P.3d 1172.) That is, Cawkwell was subject to the same punishment when he committed his offenses as he was after the Legislature narrowed the scope of defendants eligible for diversion. Thus, the amendment does not violate the ex post facto clauses of the state or federal Constitutions, and Cawkwell is ineligible for mental health diversion.
*1055DISPOSITION
Affirmed.
WE CONCUR:
HUFFMAN, Acting P. J.
IRION, J.
Further statutory references are to the Penal Code.
Because we need not determine whether the diversion statutes apply retroactively, we deny Cawkwell's motion for judicial notice of certain legislative history materials (specifically, Assem. Com. on Budget, Assem. Floor Analysis of Assem. Bill No. 1810, as amended June 12, 2018).
The trial court declared a mistrial as to this count and ultimately dismissed it on the prosecutor's motion.
People v. Superior Court (Romero ) (1996) 13 Cal.4th 497, 53 Cal.Rptr.2d 789, 917 P.2d 628.
By contrast, in People v. Perez (1998) 68 Cal.App.4th 346, 80 Cal.Rptr.2d 188, which Cawkwell contends is "control[ling]," the defendant committed his offense when a drug diversion program already existed and allowed diversion without a guilty plea . (Id. at pp. 349-353, 80 Cal.Rptr.2d 188.) Because the defendant could fairly have relied on the existing diversion program when he committed his offenses, the Perez court concluded a subsequent amendment to the diversion program was an improper ex post facto law because it effectively increased the punishment for the offense by requiring a guilty plea as a condition to diversion. (Id. at pp. 354-356, 80 Cal.Rptr.2d 188.) Perez is, thus, inapplicable.