## Introduction

As organisms proceed through development, they typically experience changing environments. For example, different life stages may encounter pronounced differences in resource availability, predator abundance, and various abiotic factors, such as temperature (Krebs and Loeschcke 1995; Ragland and Kingsolver 2008; Woods 2013). These developmentally variable environments may result in life stage-specific evolutionary responses that are particularly evident in organisms with complex life cycles, wherein morphologically, physiologically, and behaviorally distinct stages are adapted to distinct ecological niches (Kingsolver et al. 2011; McGraw and Antonovics 1983; Moran 1994; Schluter et al. 1991).

Stage-specific evolutionary responses are modulated by genetic variances and covariances among traits, with the added dimension of genetic covariance across development (Moran 1994). Just as genetic correlations among traits constrain evolutionary responses, genetic correlations among the expressions of a single trait across development may also produce constraints (Gomulkiewicz et al. 2018). In other words, tightly correlated traits respond to selection as a unit, in combinations that may or may not convey the highest fitness (Lande and Arnold 1983). Thus, negative genetic correlation among fitness-related traits across development may constrain stage-specific responses, whereas the absence of genetic correlation permits the independent response of traits in each developmental stage (Anderson et al. 2016; Freda et al. 2017).

Determining the level of genetic constraint between fitness-related traits across development is thus critical to understanding the mechanisms by which environmental adaptations evolve in organisms with complex life cycles (Levy et al. 2015; Sinclair et al. 2016). Thermal hardiness, the ability to maintain performance despite stressful environmental conditions, is one of the best-studied traits with respect to environmental adaptation (Hoffmann et al. 2003). However, most empirical studies focus on only a single developmental stage, typically reproductive adults (Bowler and Terblanche 2008). Freda et al. (2017) recently showed that genetic variation for cold hardiness among isogenic Drosophila melanogaster lines from the Drosophila Genetic Reference Panel (DGRP; Huang et al. 2014; Mackay et al. 2012) is not genetically constrained across different developmental stages. Quantitative genetic analyses revealed ample, heritable genetic variation for thermal hardiness in adult flies and in earlier (larval) developmental stages, with no evidence for genetic correlations across stages. This lack of genetic correlation suggests that thermal hardiness can evolve independently in juvenile and adult stages that experience different thermal habitats, a result confirming observations that artificial selection on one stage does not elicit correlated responses in another (Gilchrist et al. 1997; Tucić 1979).

Although the results of Freda et al. (2017) suggest a lack of developmental genetic constraint, this study was conducted in a single developmental environment (25 °C constant), which does not account for plasticity in response to variable thermal conditions encountered in nature. A comprehensive understanding of the phenotypic response to variable environments is critical, because genotype-by-environment interactions (GxE) can change genetic variance and covariance (De Jong 1990), enhancing or diminishing constraints that alter evolutionary trajectories. In particular, developmental acclimation, physiological changes that occur as a result of different environments experienced during development, can have lasting effects on thermal hardiness across the life cycle (Colinet and Hoffmann 2012). For example, exposing developing larval stages to relatively cold environments typically improves cold hardiness in adult flies (Fallis et al. 2014; Gerken et al. 2015; Overgaard et al. 2008). The effects of developmental temperature on larval thermal hardiness are unknown, but a three-way interaction between Genotype, developmental stage, and environment (GxDxE) could influence genetic (co)variances among developmental stages and ultimately evolutionary responses.

Figure 1 illustrates a set of hypothetical relationships among trait values (here, a metric of cold hardiness) measured across developmental stages, developmental acclimation temperatures (18 and 25 °C), and genotypes (e.g., isogenic lines). Within an acclimation temperature, significant genetic correlations occur when there is variance among genotypes (genetic variance), but each genotype performs similarly in the larval and adult stage. This is not the case for DGRP isofemale lines acclimated at 25 °C (Freda et al. 2017), illustrated in Fig. 1 by the crossing orange lines (representing GxD), each representing the performance of a single genotype in the larval and adult stages. Acclimating at a lower developmental temperature increases cold hardiness, illustrated in all panels in Fig. 1 by higher average hardiness values for the blue (cool; acclimated at 18 °C) lines vs. the orange (warm; acclimated at 25 °C) lines. Acclimation may additively increase hardiness across all genotypes without changing the variance among genotypes (GxD + E; Fig. 1a). Alternatively, GxDxE may cause a change in variance at 18 °C rearing relative to 25 °C rearing while the genetic correlation across development remains zero (Fig. 1b, c). In order to cause cross-stage genetic correlations, developmental acclimation must maintain some variance among genotypes, and those genotypes must perform similarly at that acclimation temperature in both life stages (Fig. 1d). In other words, the blue lines representing genotypes in Fig. 1 must be roughly parallel, preserving the rank order of genotypes across stages. In Fig. 1d, a GxDxE produces a genetic correlation between stages acclimated at 18 °C, driven mainly by a genetically variable acclimation response that universally increases hardiness of both stages relative to acclimation at 25 °C. These scenarios are specific to our example of developmental acclimation in D. melanogaster and are not exhaustive. However, they illustrate how environmental temperature might fundamentally change genetic correlation structure, and thus genetic constraint (Via and Lande 1985).

To examine the evolutionary potential of developmental acclimation, and its effects on GxDxE, we measured genetic (co)variance of two thermal hardiness traits in D. melanogaster across larval and adult stages and across developmental acclimation temperatures in a factorial design (Supplementary File S1). In nature, developmental acclimation represents an important, short-term response to temporal and spatial environmental variability, though different developmental stages may experience a different range of environments. In temperate regions, D. melanogaster larvae experience extreme high temperatures during spring and summer within their oviposition site (Ashburner 1981; Dillon et al. 2009). However, D. melanogaster adults overwinter (Saunders et al. 1989; Schmidt et al. 2005) and thus are more likely to experience extreme cold temperatures. This difference in the thermal environment between adult and larval stages may result in developmental stage-specific adaptation or maladaptation, depending on the genetic covariance across stages and environments. Whether adaptive or maladaptive, the results could drastically affect long-term evolutionary trajectories of the species.

In this study, we explore genetic variability in cold hardiness, heat hardiness, and developmental acclimation by exposing both larvae and adults from 39 genotypes (isofemale lines) from the DGRP. The 39 genotypes were developmentally acclimated by rearing at warm and cool temperatures followed by acute heat and cold stress exposures. We used this factorial design (illustrated in Supplementary File S1) to test the effect of developmental acclimation on genetic variances, across stage covariances, and the occurrence of GxDxE. As described above, detection of GxDxE is not itself evidence for a cross-stage genetic correlation; we also directly estimate heritability and genetic correlations in both rearing treatments. In addition, we also tested for cross-stage correlations in plasticity itself (i.e., change in thermal hardiness across developmental acclimation treatments), cross-trait correlations between cold and heat hardiness, and cross-environment correlations for both cold and heat hardiness.

## Materials and methods

### Drosophila Genetic Reference Panel Lines

The Drosophila Genetic Reference Panel (DGRP) is comprised of 205 isogenic lines of Drosophila melanogaster that were initiated from a single natural population in Raleigh, North Carolina (Huang et al. 2014; Mackay et al. 2012). This design maintains naturally segregating variation as genetic variance among isogenic lines. A total of 39 genotypes were used in this study, which represent a subset of the 139 used previously to test for genetic correlation across developmental stages in cold hardiness (Freda et al. 2017). All genotypes were obtained from the Bloomington Drosophila Stock Center (Indiana University, Bloomington, IN, USA).

### Line rearing and maintenance

Fly populations giving rise to experimental groups were reared under standard, low density conditions in vials (Morgan and Mackay 2006). All flies were reared on media containing cornmeal, molasses, and yeast. Propionic acid and benzoic acid were also added as anti-fungal and anti-bacterial agents. To increase oviposition rates, vials were lightly sprinkled with dry active yeast. Experimental flies were developmentally acclimated by rearing from egg-to adult at cool (18 °C) or warm (25 °C) temperatures on a 12/12 light-dark (LD) cycle. Experimental flies were collected for assays at predetermined developmental time points for larval and adult measurements (see below). All experimental flies were the progeny of adults reared at low densities (five males and five females per vial) at 25 °C and 12/12 LD. These parents were sorted under light CO2 anesthesia and then placed on fresh media for oviposition. Oviposition occurred at 25 °C for all experimental flies. These vials containing 5 males and 5 female parents were transferred every 24 h to fresh media for 6 days. After each transfer, vials from the previous day, containing eggs, were then moved to the cool (18 °C) or warm (25 °C) developmental acclimation temperature. The first set of replicate vials (day 1) were discarded to remove any residual effect of anesthesia on oviposition rates.

### Survival assays

Larval assays were conducted at 120 h (5 days) post-oviposition for replicates developmentally acclimated at 25 °C and 168 h (7 days) post-oviposition for those developmentally acclimated at 18 °C, using third instar feeding larvae that were extracted from media using a 20% w/v sucrose solution and transferred to a new vial following the protocol of Nöthiger (Nöthiger 1970) and Freda et al. (2017). During the heat and cold hardiness measurements, larval vials were immersed in a recirculating bath (ECO RE 2025, Lauda Corporation) containing a 50/50 mixture of distilled water and propylene glycol held at the test temperature (see below) for 1 h. Temperatures measured from thermocouples inserted into vials with food confirmed that the food remained unfrozen at the cold test temperature. After exposure, vials were removed from the recirculating bath and placed at 25 °C for recovery, regardless of the developmental acclimation treatment. After 9 days (216 h), the proportion of successfully eclosed adults was used to score larval survivorship (Bing et al. 2012; Freda et al. 2017).

Adult assays were performed on 5–7 days post-eclosion flies. For flies developmentally acclimated at 25 °C, adults emerged and were collected 10–12 days post oviposition. In flies developmentally acclimated at 18 °C, emergence and collection occurred 19–21 days post oviposition. Experimental flies were sorted and separated into groups of 10 by sex under light CO2 anesthesia upon eclosion. Separate, same-sex vials were returned to their respective developmental acclimation conditions (12/12 LD at either 18 °C or 25 °C) for 5 days to recover before cold or heat hardiness was measured. Adults were transferred to new food after 3 days during this 5 days period to ensure that the food was fresh. After 5 days of recovery, adult flies 5–7-days-old (5–7 days post eclosion; 408 h post oviposition) were placed in empty vials and exposed to either cold (−6.5 °C) or heat (38 °C) stress for 1 h. After this exposure, flies were transferred to vials containing fresh media and placed at 25 °C, 12/12 LD for recovery. After 24 h, we scored individual flies capable of coordinated movement as alive, and all others as dead (Colinet and Hoffmann 2012; Gerken et al. 2015; Kelty and Lee 2001).

To test if vials with food and empty vials reached test temperatures at significantly different times, iButtons® (Part Number: DS1925L; Maxim IntegratedTM) were placed at the bottom of empty vials or buried within the media. For cold stress, empty vials (used in adult assays) reached the test temperature (−6.5 °C) only slightly faster (~3 min faster on average) than vials containing media (used in larval assays), representing a difference of only 5% of the 1 h exposure. For heat stress, there was only a 1-min average difference between food vials and empty vials, with food vials reaching 38 °C 1 min faster (a difference of 1.7% of the 1 h exposure).

### Experimental design

At extreme, stressful temperatures, organisms generally display a roughly logistic relationship between survival and temperature (Lee and Denlinger 1991). To simplify measurements, we wished to capture as much of the variation in survival as possible using a single temperature. Freda et al. (2017) applied −5 °C as the stressful cold temperature because pilot studies revealed that survival after exposure to −5 °C was most highly correlated with cumulative survival across a range of stressful temperature exposures in both larvae and adults compared to other tested, single temperature exposures. However, a lower stress temperature (−6.5 °C) was used in this study because adults reared at 18 °C had relatively high survival following cold stress at −5 °C compared to larvae reared at 25 °C in the previous study. Developmental acclimation at 18 °C increases cold hardiness, and a lower test temperature increases among-line variance, avoiding a high frequency of 100% survival in replicate trials. For heat stress, we generated survival curves for both larvae and adults from four DGRP lines (data not show) using survival data after a 1 h exposures to 36, 37, 37.5, 38, and 39 °C. For both larvae and adults, 38 °C was selected as the test temperature, because the average survival in both larvae and adults was closest to 50% at this temperature (LD50). This temperature is also in agreement with the LD50 of similar heat stress experiments on other D. melanogaster genotypes (Fallis et al. 2012; Morgan and Mackay 2006).

We implemented factorial experimental designs to model the effects of developmental stage, acclimation temperature, and their interaction on genetic variation (among lines) in cold and heat hardiness. Separate, full factorial experimental designs were as follows for both cold and heat hardiness experiments: 39 genotypes × 2 developmental stages × 2 developmental acclimation temperatures × 5 replicate vials for each genotype, developmental stage, sex (adults only), and developmental acclimation temperature (Supplementary File S1). Each replicate consisted of a total of 20 individuals (20 larvae or a total of 20 adults with 10 males and 10 females assayed in separate vials to prevent mating). Although vials were separated by sex we did not separate sexes in the analyses as sex was not determined for larvae.

### Thermal hardiness, plasticity, GXE, and GxDxE

We modeled the effects of temperature, stage, genotype (line), and their interactions on thermal hardiness using a generalized linear model (glm) with a logit link function and binomial distribution implemented in the glmer function in R (Team RC 2018). Terms retained in the best fit model were interpreted as significantly affecting thermal hardiness. The full model was specified as:

$$\begin{array}{l}{\mathrm{logit}}\left( y \right) = {\mathrm{stage}} + {\mathrm{temp}} + {\mathrm{stage}} \times {\mathrm{temp}} + {\mathrm{line}} + {\mathrm{rep}}\left( {{\mathrm{line}}} \right) \\ + \;{\mathrm{line}} \times {\mathrm{stage}} + {\mathrm{line}} \times {\mathrm{temp}} + {\mathrm{line}} \times {\mathrm{stage}} \times {\mathrm{temp}}\end{array}$$
(1)

where stage, temp, line, and rep(line) model the effects of developmental stage, developmental acclimation temperature, genotype, and replicate vial nested within line. All main and interaction effects including genotype (line) were modeled as random effects, and all effects excluding line (i.e., stage, temp, stage × temp) were modeled as fixed effects. Here, GxE is modeled by the line × temp term, while line × stage × temp models GxDxE. We excluded sex from the models, because sex could not be determined for larvae that did not successfully eclose. We used backward model selection to identify the best fit model and to estimate statistical significance of individual terms by dropping interaction terms and calculating likelihood ratio statistics (best fit models also had the lowest calculated AIC scores, data not shown). Finally, we estimated thermal plasticity (β) as the difference between survival when developmentally acclimated at 18 °C compared to survival when developmentally acclimated at 25 °C for both cold hardiness and heat hardiness assays (Gerken et al. 2015). Here, we estimated β using linear contrasts of the parameter estimates of the best fit glm, adding a fixed stage × temp interaction parameter where necessary to allow separate estimates of β for both larvae and adults. We used the same approach to estimate mean survival proportions and 95% confidence intervals (CIs) for all stage × temp combinations (back-converting to the original scale using the inverse logit function), and to test the null hypothesis of no differences in survival between life stages at each acclimation temperature. For all models, we checked for over/underdispersion using the ratio of the sum of the squared Pearson residual to residual degrees of freedom, a reasonable estimate of the dispersion parameter at large sample sizes (Venables and Ripley 2002). All ratios were close to one, with only slight underdispersion (dispersion estimates ranged from 0.87 to 0.94).

### Heritability and genetic correlation

The broad-sense heritabilities (H2) of cold hardiness and heat hardiness within developmental stages and developmental acclimation temperatures were estimated as the proportion of the variance among lines divided by the total variance (among and within lines). The heritability is broad sense, because the among-line variance does not separate additive and dominance variance in this isogenic line design (Falconer and Mackay 1996; Lynch and Walsh 1998). Though methods are available to estimate narrow sense heritability among isogenic lines using marker-based relatedness matrices (Yang et al. 2011), power calculations as described in (Visscher et al. 2014) suggested that these approaches yield very low power (~0.23) at our sample size of only 39 lines using the estimated DGRP relatedness matrix (Supplementary File S2). Thus, we proceeded with broad-sense estimates.

Variance components for cold/heat hardiness within each stage × temp combination were estimated using generalized linear mixed models similar to the one described above. The adult model for each metric (cold or heat hardiness) at each developmental acclimation temperature was:

$${\mathrm{logit}}\left( y \right) = {\mathrm{sex}} + {\mathrm{line}} + {\mathrm{rep}}\left( {{\mathrm{line}}} \right)$$
(2)

The larval model was the same, except that it excluded the effect of sex. We also estimated the broad-sense heritability of plasticity for each stage and each trait (cold or heat hardiness) as the proportion of variance associated with GxE divided by the total variance in the following model:

$$logit\left( y \right) = sex + temp + line + line \times temp + rep\left( {line} \right)$$
(3)

Where line × temp models GxE, and the fixed effect of sex was only included for adults. We estimated 95% CIs for each estimate by repeating the variance component calculation 500 times on data sets where genetic line was randomly sampled with replacement. We also tested the hypothesis that the heritability estimates were significantly different from random expectations by estimating a null distribution, randomly permuting the association between replicates and lines (within stages and temperatures) 1000 times and comparing the observed H2 estimate to the null distribution using a two-tailed test.

The genetic correlations between larval and adult thermal hardiness under each developmental acclimation treatment were estimated as:

$$r_g = \frac{{{\mathrm{COV}}_{{\mathrm{A}}{\mathrm{L}}}}}{{\sqrt {\sigma _{{A}}^2 \times {\sigma _{{L}}^{2}}} }}$$
(4)

where COVAL represents the covariance between adult and larval thermal hardiness (cold or heat) and $$\sigma _{{A}}^2$$ and $$\sigma _{{L}}^2$$ are the variance among lines for adults and larvae, respectively. Variance and covariance were estimated using generalized linear mixed models as above. The values for $$\sigma _A^2$$ and $$\sigma _L^2$$ were estimated as the among-line variance from the separate adult and larval models that were used to estimate broad-sense heritability. We estimated COVAL as the among-line variance from a generalized linear mixed model of the combined larval and adult data including a fixed effect of stage (Harbison et al. 2013) and random effects of line, line × stage, line × temp, and rep(line). CIs were estimated, and permutation tests performed as above. Genetic correlations were also calculated across developmental acclimation temperatures and across trait type (heat hardiness and cold hardiness) within developmental stages using equation four, substituting developmental acclimation temperature or stress type for stage. Phenotypic correlations were estimated for all the above comparisons using the Pearson correlation of line means. Though our experimental design did not allow us to estimate the genetic correlation for plasticity across stages and traits, we did estimate the phenotypic correlations as above, where plasticity (β) was estimated as the difference in mean survival at 18 vs. 25 °C developmental acclimation temperatures for each fly line.

## Results

### Acclimation and stage-specific thermal hardiness

Developmental acclimation at 18 °C increased cold hardiness relative to acclimation at 25 °C (Fig. 2a). However, the effect differed between larvae and adults (best model included a significant stage × temp interaction; Table 1A; P << 0.001) with a significantly smaller estimate of β (survival proportion at 18 °C–survival proportion at 25 °C) for larvae compared to adults (0.26 for larvae vs. 0.32 for adults; Z = −5.3, p << 0.001). For heat hardiness, developmental acclimation at 25 °C increased heat hardiness relative to acclimation at 18 °C (Fig. 2b), but β did not differ significantly between stages (no significant stage × temp interaction; Table 1B; β = −0.21 for larvae, −0.18 for adults; Z = −0.23, p = 0.82).

Adults were significantly more cold hardy, on average, than larvae when reared at 18 °C (Fig. 2a; Z = 12, p << 0.001) and when reared at 25 °C (Z = 7.3, p << 0.001). Larvae tended to be more heat hardy than adults, but not significantly, when reared at 18 °C (Fig. 2b; Z = −1.4, p = 0.17) and when reared at 25 °C (Z = −1.6, p = 0.11).

### GxDxE interactions

We found clear evidence for GxDxE. The best model of cold hardiness, including data from all stages, developmental acclimation temperatures, and lines, included a line × stage × temp interaction (Table 1A; LR = 65, p< 0.001). In particular, genotypes demonstrated highly variable adult cold hardiness when reared at 25 °C, but the variation decreased markedly (genotypes performed more similarly) when reared at 18 °C (green dashed lines, Fig. 3a). In contrast, variation among genotypes was more similar across rearing environments for larval cold hardiness (solid purple lines, Fig. 3a). Likewise, there was significant GxDxE for heat hardiness (best model included a line × stage × temp interaction; Supplementary File S2B; LR = 237, p< 0.001), though in this case variances among lines remained roughly comparable across developmental acclimation temperatures in both stages (Fig. 3b). Note that Fig. 3 illustrates norms of reaction, or the relationships between hardiness and acclimation temperature for each genotype. Average thermal hardiness for genotypes across stages relative to predictions in Fig. 1 appear in the discussion.

### Heritability

Broad-sense heritability (H2) for cold hardiness and heat hardiness for each developmental stage under both developmental acclimation conditions were all significantly different from zero based on permutation tests (Table 2A, B), suggesting that the population in Raleigh, NC, from which the DGRP was founded, has substantial segregating genetic variation for thermal hardiness that is visible to natural selection. Adults exhibited slightly higher H2 for cold hardiness under both developmental acclimation conditions when compared to larvae. The H2 estimates for heat hardiness were greater in magnitude than the H2 for cold hardiness in both larvae and adults. As was observed for H2 for cold hardiness, adults had higher H2 for heat hardiness compared to larvae. Finally, plasticity itself was also heritable for both cold hardiness and heat hardiness in both adults and larvae, though estimates were generally lower than those for cold and heat hardiness (Table 2C).

### Cross-stage, cross-temperature, and cross-trait correlations

Cross-stage genetic (rg) and phenotypic (rP) correlations between cold hardiness in larvae and adults under both developmental acclimation conditions were not significantly different from zero, with comparable results for heat hardiness (Table 3A; Supplementary File S3A, B). Plasticity of larval and adult cold hardiness were positively phenotypically correlated (Table 3A; Supplementary File S4A; rP = 0.34, p = 0.034). Plasticity of heat hardiness was not significantly correlated between larvae and adults, though the estimate was positive (Table 3A; Supplementary File S4B; rP = 0.24, p = 0.14).

In contrast, the genetic and phenotypic correlations between developmental acclimation temperatures within developmental stages (18 vs. 25 °C) were all significant for both cold and heat hardiness (Table 3B). Thus, genotypes that tended to be more hardy at one developmental acclimation temperature were also more hardy at the other developmental acclimation temperature. Genetic and phenotypic correlations between cold hardiness and heat hardiness within stages and developmental acclimation temperatures were all non-significant except for larvae developmentally acclimated at 18 °C (Table 3C). In addition, estimates of correlations between plasticity of cold hardiness and plasticity of heat hardiness within developmental stages were not significantly different from zero (Table 3C).

## Discussion

### Patterns of developmental acclimation

Plastic responses of thermal hardiness to developmental acclimation temperature have been well documented in adult D. melanogaster (Colinet and Hoffmann 2012; Gerken et al. 2015) and other organisms (Chatterjee et al. 2004; Cuculescu et al. 1998; Das et al. 2004; Terblanche et al. 2005). Our data support these previous observations, and provide evidence that acclimation also affects larval thermal hardiness. In both larvae and adults, acclimation at a temperature close to the stress temperature significantly increased hardiness (Figs. 2a, b and 3), consistent with the hypothesis that thermal acclimation is often adaptive (Ayrinhac et al. 2004; Hoffmann et al. 2003; Noh et al. 2017).

Though the average trend was toward greater hardiness at the acclimation temperature closest to the stressful temperature, there was substantial genetic variance in reaction norms in both developmental stages (GxE, though this is subsumed by GxDxE, see below). This variance includes genotypes that are negative acclimators, e.g., with greater cold hardiness when acclimated at 25 vs. 18 °C (2/39 in larvae and 1/39 in adults) or greater heat hardiness when reared at 18 vs. 25 °C (7/39 in larvae and 10/39 in adults) (Fig. 3). To our knowledge, this is the first record of negative acclimators occurring in D. melanogaster larvae but negative acclimators have been recorded in D. melanogaster adults in previous studies investigating thermal hardiness (Fallis et al. 2014; Gerken et al. 2015). Overall, there were fewer negative acclimators in both stages for cold compared to heat hardiness and the variance associated with the line × temp interaction is larger for heat hardiness vs. cold hardiness (cold stress line × temp σ2 = 0.041; heat stress line × temp σ2= 0.11).

### Thermal hardiness is genetically decoupled across development

Detection of significant GxDxE for both heat hardiness and cold hardiness suggests that genetic variability in reaction norms (GxE) may be stage-specific in D. melanogaster. However, GxDxE did not produce significant genetic correlations across developmental stages in either environment, suggesting that the previous observation of a lack of correlation (Freda et al. 2017) is robust to variable environments (rearing temperature) and performance metrics (cold vs. heat hardiness). In particular, at both 18 and 25 °C acclimation temperatures, genotypes exhibited a crossing pattern in Fig. 4, whereas roughly parallel lines would suggest similar trait values in both stages for a given genotype (Fig. 1d). These results provide additional evidence that distinct genetic architectures underlie variation in cold stress hardiness in larvae and adults of D. melanogaster and provide evidence of developmental stage independence for heat stress hardiness and acclimation responses as well. Thus, different life stages appear to be free to independently evolve in response to stage-specific environments. Our experiments provide direct estimates of cross-stage correlations that do not differ significantly from zero and align with previous results based largely on correlated response to selection in holometabolous insects (Dierks et al. 2012; Gilchrist et al. 1997; Loeschcke and Krebs 1996; Tucić 1979). We refer to this lack of genetic correlation as ‘genetic decoupling’ across development, a pattern that has also been observed in other invertebrates and in amphibians across metamorphosis (Anderson et al. 2016; Johansson et al. 2010; Rawson and Hilbish. 1991; Shaffer et al. 1991) and even across ages within life stages (Everman et al. 2018). These findings suggest that genetic correlations across development for physiological traits may often be weak, emphasizing the importance of measuring quantitative genetic parameters at appropriate developmental landmarks, as selection typically fluctuates across development (Kingsolver et al. 2011).

Though thermal hardiness per se appears to be genetically decoupled across developmental stages, evidence for genetic decoupling of plasticity (the acclimation response) is equivocal. Our experimental design did not allow us to directly estimate genetic correlations of plasticity (β) across life stages, but we did estimate a significant, positive phenotypic correlation for cold hardiness (Supplementary File S5A; rp for heat hardiness was also positive, but non-significant). And, phenotypic correlations typically suggest underlying genetic correlations (Roff 1995). This raises the possibility that similar sets of genetic variants may affect the acclimation response in both larvae and adults, a somewhat surprising result given the lack of cross-stage genetic correlations for thermal hardiness at either acclimation temperature in this study. However, theory and empirical evidence suggest that different genetic variants may influence the expression of a trait within an environment vs. the plasticity of the trait among environments, including thermal plasticity in D. melanogaster (Schlichting and Pigliucci 1993; van Heerwaarden and Sgrò 2017).

In addition to the evidence suggesting genetic decoupling of thermal hardiness, our results show that adults were more cold-hardy than larvae across rearing conditions, whereas heat hardiness did not differ significantly between life stages. (Fig. 2a, b). Higher cold hardiness in adult vs larval Drosophila has been widely observed (Bing et al. 2012; Czajka and Lee 1990; Jensen et al. 2007). This observation is consistent with the adaptive argument that adults are also the overwintering stage exposed to the coldest temperatures (Colinet and Hoffmann 2012; Saunders et al. 1989; Schmidt et al. 2005). However, to our knowledge, there are no reports of differing heat tolerance in larvae compared to adults. We did observe a non-significant, but consistent trend towards greater heat tolerance in larvae across acclimation temperatures, which might be expected given that larvae that cannot readily escape from rotting fruit attaining extremely high temperatures when exposed to direct sunlight (David and Van Herrewege 1983; Feder et al. 1997; Lachaise et al. 1988).

Whether or not larvae are more heat hardy than adult flies, they do not appear to be genetically constrained by hardiness phenotypes expressed in the adult stage. Stage-specific thermal phenotypes are a common observation across insects (Kingsolver et al. 2011; Marais et al. 2009; Neargarder et al. 2003; Radchuk et al. 2013) and other taxa (Diederich and Pechenik 2013; Turschwell et al. 2017), though genetic correlations are rarely measured. Overall, our phenotypic and genetic observations are consistent with the adaptive decoupling hypothesis, which postulates that different developmental stages are relatively free to evolve in response to unique niches that vary across the life cycle, allowing for stage-specific niche adaptation (Moran 1994).

### Cross-environment and cross-trait correlations

Although a lack of genetic correlation was observed between developmental stages, we estimated strong genetic and phenotypic correlation for thermal hardiness across developmental acclimation conditions within developmental stages for both cold hardiness and heat hardiness (Table 3B). These results indicate that, within a developmental stage, most segregating genetic variants influencing thermal hardiness under one developmental acclimation condition are likely to also influence thermal hardiness in the other developmental acclimation condition. Ørsted et al. (2018) also estimated positive genetic correlations across rearing temperature environments using DGRP lines, but the correlation did tend to decline with increasing dissimilarity among environments. They also note that similar patterns have been observed elsewhere (Sgrò and Blows 2004; Stinchcombe et al. 2010), suggesting that acclimation responses can substantially change the physiological responses underlying traits such as thermal hardiness.

In contrast, heat hardiness and cold hardiness were not genetically correlated in both larvae developmentally acclimated at 25 °C (but were correlated in larvae reared at 18 °C, see below) and adults under both developmental acclimation conditions (Table 3C). We also investigated the relationship between cold stress plasticity (βC) and heat stress plasticity (βH) within developmental stages and found no correlation between the two in both larvae and adults (Supplementary File S4B). This result indicates that some mechanisms underlying cold hardiness and heat hardiness (and acclimation responses affecting each trait) are distinct and that D. melanogaster larvae and adults probably employ unique mechanisms to deal with each stress type. Indeed, it has been shown that the majority of loci significantly associated with heat hardiness and cold hardiness are unique in D. melanogaster (Morgan and Mackay 2006; Norry et al. 2008) and other insects (Zhang et al. 2015).

Surprisingly, cold hardiness and heat hardiness were moderately genetically correlated in larvae developmentally acclimated at 18 °C (Table 3C). Though we did not observe any significant cross-stage genetic correlations at any developmental acclimation temperature, this result does illustrate how the environment can influence genetic covariance among traits. Given that larvae appear to be less cold stress adapted, developmental acclimation at 18 °C may be chronically stressful, upregulating a general stress response that protects against multiple stressors. There is evidence for a general stress response in yeasts and Drosophila (Gasch et al. 2000; Sørensen et al. 2017), and other studies have documented that acclimation in one environment enhances resistance to multiple stressors (Aggarwal et al. 2013; Hoffmann 1990; Krebs and Loeschcke 1994). If such general, protective responses often produce genetic correlations among stress responses, the correlated evolution of multi-stress resistance in response to natural selection imposed by one particular stressor may be a general phenomenon. Indeed, artificial selection on one stressor often results in the correlated evolution of other stress responses (Bubliy and Loeschcke 2005; Hoffmann and Parsons 1989). However, our results suggest that these multi-trait correlations, and thus correlated evolution may depend on both developmental stage and on the developmental environment.

### Summary

Overall, our results provide substantial evidence that thermal hardiness and developmental acclimation responses are decoupled across metamorphosis in D. melanogaster. We do provide evidence that environmental variation can substantially alter genetic correlations among traits (heat hardiness and cold hardiness), but not genetic correlations across development. Our results are consistent with the apparent, independent, stage-specific adaptation to distinct thermal niches by different developmental stages in insects. However, the specific physiological responses to thermal stress that are unique to juvenile and adult stages remain undescribed and require further study. Furthermore, it is important to determine if species with similar life histories also exhibit unconstrained thermal hardiness responses across ontogeny. This knowledge is an important consideration to make when attempting to model the evolutionary trajectories of species in a world where the climate and seasonality are rapidly changing.

### Data archiving

Data available from the Dryad Digital Repository https://doi.org/10.5061/dryad.t7f058k