## Abstract

Structurally-complex habitats harbour more taxonomically-diverse and more productive communities, a phenomenon generally ascribed to habitat complexity relaxing the strength of inter-specific predation and competition. Here, we challenge this classical, community-centred view by showing that positive complexity-diversity and complexity-productivity relationships may also emerge from between-age-class, *intra-*specific interactions at a single-population level. In replicated outdoor pond populations of the medaka fish (*Oryzias latipes*), structurally complex habitats provide refuges to newborns and relax the strength of cannibalism, resulting in increased survival of age-0+ individuals, in elevated age-class diversity through more balanced age-class proportions, in a 80 % increase in population growth rate, and in dampened negative density-dependence indicating elevated habitat carrying capacity. The resultant higher population density in complex habitats was associated with increased competition for food among both age-0+ and age-1+ individuals, as revealed by their smaller and more variable body sizes. Our results highlight that positive complexity-diversity and complexity-productivity relationships may be considered as a generally-emergent property of all size-structured systems in which a larger body size brings a predation advantage. Hence, enhancement of habitat structural complexity may be seen as a pivotal management strategy not only in favour of taxonomic diversity, but also to increase the productivity of exploited populations and to improve the conservation status of endangered populations.

## INTRODUCTION

Anthropogenic changes and biodiversity loss are often congruent with a simplification in the physical structure of habitats. For instance, agriculture transforms complex, mature forests into pastures or grain fields that, eventually, may return to secondary forest which are structurally simpler than mature forest (Colorado Zuluaga & Rodewald 2015). In oceans, eutrophication, acidification, bottom trawling and dredging all tend to destroy the complex structure provided by benthic habitats such as coral reefs (National Research Council 2002, Rogers *et al*. 2014). In freshwaters, eutrophication may drive a loss of submerged macrophytes which are key to habitat structuring (Scheffer 2004). This ubiquitous and global simplification of habitat structure plays a central role in anthropogenic biodiversity loss and the disruption of ecosystem functions.

Many studies report that structurally-complex habitats favour increased species coexistence and higher numerical abundances and biomass in animal communities. This positive effect is generally ascribed to habitat complexity relaxing the strengths of both predation and competition, and thus allowing more species to coexist through spatial partitioning of limiting resources (F. E. Smith 1972, Crowder & Cooper 1982, Diehl 1988, Heck & Crowder 1991, Hixon & Menge 1991, Diehl 1992, Janssen *et al*. 2007, Kovalenko *et al*. 2012, Reichstein *et al*. 2013, Rogers *et al*. 2014).

In essence, the emergence of positive habitat complexity-diversity relationships strongly depends on predators being larger-bodied than their prey. In highly-structured and fine-grained habitats, movements are slowed down and encounter rates are reduced (Stenseth 1980, St Pierre & Kovalenko 2014). In particular, larger-bodied individuals selectively suffer from a reduced agility and from a reduced accessibility to microhabitats (Rogers *et al*. 2014). Hence, structurally-complex habitats decrease predator attack rates, resulting in a reduced risk of prey overexploitation and in relaxed apparent competition among prey (Holt 1987).

Historically, research on the ecological effects of habitat structural complexity has focused on interspecific interactions with, to our knowledge, a poor consideration for intraspecific interactions. This is despite that many populations are size-structured due to both overlapping age classes and to heterogeneous somatic growth rates within age classes. In such size-structured populations, apparent competition by definition is not possible, but large-bodied individuals often dominate in interference competition (Post *et al*. 1999, Le Bourlot *et al*. 2014), and may even cannibalize smaller-bodied conspecifics (Fox 1975, C. Smith & Reay 1991). It is therefore likely that, in size-structured populations, just like in size-structured communities, a high habitat structural complexity impedes the dominance of large-bodied individuals.

Accordingly, a few studies suggest that habitat structural complexity increases age-class diversity in the form of enhanced juvenile-adult coexistence, supports larger population sizes, and favours population persistence in laboratory populations of the guppy *Poecilia reticulata* (Yamagishi 1976, Nilsson & Persson 2013) and the mosquitofish *Gambusia affinis* (Benoît et al. 2000). However, given the paucity of studies dealing with habitat complexity in size-structured populations, the generality of positive complexity-diversity and complexity-productivity relationships at the population level remains questionable. Additionally, the respective contributions of competition and cannibalism to the emergence of complexity-productivity relationships at the population level remain largely unexplored. In this paper, we test the prediction that habitat structural complexity increases age-class diversity in the form of enhanced age-class coexistence and increases population productivity in the Japanese medaka (*Oryzias latipes*), and that the underlying mechanisms involve a relaxation in the strengths of both interference competition and cannibalism. Our results support our predictions on age-class diversity and population productivity, but point to cannibalism as the only underlying mechanism.

## MATERIALS AND METHODS

### Medaka fish

The medaka is an oviparous fish belonging to the group of Beloniformes, a sister group of Cyprinodontiformes which includes killifishes (Kinoshita *et al*. 2009). Medaka naturally inhabit slow-moving fresh- and brackish-waters of South-East Asia. Juveniles and adults have a highly-overlapping diet of zooplankton, small benthic invertebrates and filamentous algae (Terao 1985, Edeline *et al*. 2016). Due to its high thermal tolerance and ease of manipulation, the medaka can be used for parallel experiments in the laboratory, where generation time is 2-3 months under optimal light, food and temperature conditions, and in outdoor ponds, where perennial populations maintain themselves during years under natural conditions without any artificial feeding (Bouffet-Halle *et al*. 2021). For these reasons, the medaka is a good model species for studies in genetics, developmental biology, ecology and evolution (Kinoshita *et al*. 2009, Renneville *et al*. 2016, 2020, Diaz Pauli *et al*. 2019, 2020, Evangelista *et al*. 2020a, 2020b, 2021, Le Rouzic *et al*. 2020, Bouffet-Halle *et al*. 2021).

### Cannibalistic behavioural assays and predation window

Trophic interactions are often size-dependent (Woodward *et al*. 2005), such that the prey-to-predator body-length ratio is constrained to a specific range called the ‘‘predation window” (Claessen *et al*. 2000). The lower and upper limits of the predation window have far-reaching consequences for population dynamics and individual life histories, respectively (Claessen *et al*. 2002). We performed cannibalistic behavioural assays to determine whether medaka are cannibalistic under no-complexity conditions and, if so, to estimate the limits of their predation window.

Cannibalistic assays were performed with newborns (2-10 days old) and adults under laboratory conditions at the CEREEP (https://www.cereep.bio.ens.psl.eu/) at 21°C (±1.5 SD) in 45 complexity-free aquaria. Medaka newborns and adults were measured for standard body length (Sdl, from the tip of the snout to the base of the caudal peduncle, mean ± SD = 5.6 mm ± 0.7 in newborns and 22.8 mm ± 4.2 in adults), and adults were further determined for sex according to their secondary sexual characters (Yamamoto 1975, Kinoshita *et al*. 2009). The light regime followed the natural photoperiod at the time of experiment (12^{th} and 13^{th} March 2013), i.e., dark from 17:00 to 9:00.

Starting at 15:30 on March 12^{th} and during 17.5 hours, two newborns were presented to one adult (72h fasting) in 45 plastic aquaria (0.5 L, no habitat structure) filled with dechlorinated tap water. The number of surviving larvae in each aquarium were first counted after 2.5 hours and then every 3 hours, allowing us to study the kinetics of medaka cannibalistic behaviour (yielding n = 270 observations).

Following Claessen et al. (2002), we estimated the lower (δ), higher (ε) and optimal (φ) victim-to-cannibal Sdl ratios from behavioural data (taking the average Sdl for the two larvae). Specifically, we used the relationship between the probability of a cannibalistic attack and Sdl ratio estimated at first census (2.5 hours of cannibalistic assays), when most of the size-dependency in cannibalism was expressed (see Methods and Results). We arbitrarily defined δ as the lower-end ratio at which cannibalistic probability becomes less than 0.05, ε as the higher-end ratio at which cannibalistic probability becomes less then 0.05, and φ as the ratio at which cannibalistic probability is maximal.

### Replicated pond populations with varying habitat complexity

We performed two experiments, one in 2021 and one in 2022. In 2021, on 31^{st} March, 12 circular ponds (2m^{2}) were installed at the U3E experimental research unit (https://www6.rennes.inrae.fr/u3e_eng/), filled with dechlorinated tap water, and seeded with 2 L of a mixture of benthic detritus (decaying leaves and phytoplankton), benthic organisms and plankton collected in mature, fishless ponds using a kick net (0.3 mm mesh). Benthos and plankton additions were repeated on April 2^{nd}, 9^{th} and 13^{th} 2021. Additionally, on three occasions (April 2^{nd}, 9^{th} and 15^{th}) each pond received a solution of KH_{2}PO_{4} amounting to 10 μg L^{-1} of phosphorus. Enrichment was complemented on April 13^{th}, 19^{th} 27^{th} and June 4^{th} with additions of 1 L of an algal mixture (*Chlorella* sp. and *Desmodesmus* sp). All ponds were covered with an insect-proof net (1 mm mesh size). On July 1^{st} 2021, 4 more ponds were installed and submitted to the same seeding and enrichment treatments. Hence, the experiment included 16 ponds in total.

In ponds, we varied habitat structural complexity using single-layered, square patches of Maccaferri MacMat®. This floating polyamide geomaterial has a 3D, irregular mesh structure that mimics filamentous vegetation and provides crevices where small-bodied medaka can hide (Fig. 1a). The complexity structure covered either a low proportion of pond surface (from 3.1 to 9.9 %, mean 8.6 %, hereafter low-complexity treatment, n = 8 ponds) or a large proportion of pond surface (from 36.2 to 50 %, mean 39.4 %, n = 8 ponds, hereafter high-complexity treatment, Fig. 1b). We further added two floating plastic brushes in all ponds to mimic vegetation and ensure that spawning substrates for medaka were non-limiting (Fig. 1b).

On March 31^{st} 2021 (July 8^{th} for the four extra ponds), from 18 to 60 adult medaka (mean = 37) born in 2020 (hereafter “age-1+”) were randomly introduced in ponds. In order to vary the genetic background of the fish populations, we used medaka originating from the Kiyosu population (Toyohashi, Aichi Prefecture, Japan), as described in Renneville et al. (2020), as well as five other strains corresponding to different locations in Japan and provided by the Japanese National Bioresource Project^{1}: Hamochi, Higashidori, Inawashiro, Tokamachi, and Kushima. The six strains were not mixed in a pond, but seeded each in two separate ponds (one low-complexity pond and one high-complexity pond), except the Kiyosu strain that was seeded in 6 ponds (three low-complexity ponds and three high-complexity ponds). Preliminary analyses showed that medaka strains had no significant effect on population growth rate (Chisq = 7.29, DF = 5, p-value = 0.20) or body sizes (F_{5, 10} = 1.03, p-value = 0.45), and we therefore discarded the strain effect from our subsequent analyses.

From November 15^{th} to 17^{th} 2021, i.e., after the reproductive period, all fish from each pond were sampled using both hand nets and a seine net. In order to reduce fish handling and to provide fast and reproducible body-size measurements, fish were live-photographed in batches in a transparent tray set above a light source, and were released in their pond. These fish included a mixture of both age-1+ adults that were survivors from initial introductions and age-0+ recruits that were born in the ponds. After pre-processing with Gimp software to remove non-fish dark objects, each photograph was analysed in ImageJ through sequentially subtracting background, setting a threshold to extract individual fish shapes, and fitting automatically an ellipse to each fish shape using the “fit-ellipse” tool. Individual body length was equated to ellipse major distance.

In 2022, we repeated the same experiment as in 2021, except for two differences: we mixed medaka strains within a pond, and we amplified the contrast in habitat structural complexity. On March 22 ^{nd}, the 16 ponds were dried, all fish were collected, and fish, water and sediments were mixed and redistributed among the 16 ponds. Specifically, the medaka strain mixture in each pond was 3, 8, 7, 15, 8 and 25 fish from the Hamochi, Higashidori, Inawashiro, Tokamachi, Kushima and Kiyosu strains, respectively (66 fish per pond). The low-complexity treatment consisted in 0.063 m^{2} of single-layered geomaterial (3.1 % of pond surface), while the high-complexity treatment consisted in 0.750 m^{2} of five-layered geomaterial (187.5 % of pond surface). Similar to 2021, we added two floating plastic brushes in all ponds to mimic vegetation. Batch photographs for standard body length measurement using ImageJ were performed on November 8^{th} and 9^{th} 2022 and all fish were released in their pond.

### Statistical analyses

Data from cannibalistic assays in aquariums in the laboratory were analysed using an overdispersed binomial (logit link) generalized additive model (GAM) of the form:
where *C* is the number of larvae eaten, *i* indexes an aquarium (and cannibal individual), *T* indexes the time of census (n = 270 aquarium-by-time observations), π is cannibalism probability, β_{Sex[ i]} is a sex effect of cannibal individual *i, SdlR* is cannibal to victim Sdl ratio (cannibal Sdl / mean of the two victims Sdl), *f* is a tensor product of natural cubic splines with 3 knots, which was parsimonious in terms of smoother wigliness and, at the same time, captured the essential features of the cannibalism-size relationship. Finally, θ is a positive parameter accounting for a slight overdispersion in the data. Estimating a different *f* for each sex increased model’s generalised cross-validation score, and we thus preferred the simpler model including *Sex* as a fixed effect on the intercept. We fitted Model 1 using quasi-likelihood in the `mgcv` library (`quasibinomial` family) of the R software version 4.2.1 (Wood 2017, R Core Team 2023). This model explained 24.5 % of the deviance in the number of larvae eaten.

In pond populations, we tested for an effect of habitat structural complexity (Low vs. High) on medaka population dynamics using the Ricker logistic equation (Case 2000):
where *N* (*t* +1) is total fish number after reproduction (recruitment), *N* (*t*) is the number of age-1+ medaka parents initially introduced before reproduction (stock), r is the maximum *per capita* reproductive rate, and γ=r/ K measures the strength of negative density-dependence in the population. Specifically, we tested for an effect of habitat structural complexity on the density-*in*dependent r parameter, and on the density-dependent γ parameter using a Poisson GLM:
where *i* indexes ponds (n = 32), *y* indexes the year of experiment (2021 and 2022), α _{y} is a year-of-experiment effect on the r parameter from Eq. 1, β_{k[ i]} is habitat-complexity effect (Low vs. High) on the r parameter from Eq. 1, γ_{k [i ]} is habitat-complexity effect on the γ parameters from Eq. 1, and ϵ_{i} is an overdispersion parameter. To avoid any intercept-slope correlation, we standardized *N* (*t*) to zero mean (hence the *N*_{st} (*t*) notation in Model 2 equation). As a consequence of this standardisation, the α and β parameters in Model 2 do not estimate the slope of the Ricker stock-recruitment relationship at origin, but at an average level of the stock.

We assessed the effect of habitat structural complexity on the size distributions of age-1+ medaka parents and their age-0+ progeny in pond populations using a log-normal mixture model fitted to standard body lengths Sdl:
where ln is the natural logarithm, *i* indexes individual fish (*n* = 3423), *j* indexes age groups (age 0+ *vs*. age 1+, *J* = 2), *k* indexes the complexity treatment (low vs. high, *K* = 2), *p* indexes ponds (*P* = 16), and N is the normal distribution with mean μ and variance σ^{2}.

π _{j [i], p [i ], y[ i]} is the proportion of age *j* fish in each pond *p* in year of experiment *y* such that, for each *p* and *y*, . The α 1_{y [ i]} and β1_{y[ i ]} parameters capture year-of-experiment effects (2021 vs. 2022) on mean body lengths at age-0+ and age-1+, respectively. The α 2_{k [ i]} and β2_{k[ i ]} parameters capture the effects of habitat structural complexity (Low vs. High) on mean body lengths at age 0+ and age 1+, respectively. The α 3 _{y[i ], k[ i]} and β3 _{y[i ], k[ i]} parameters capture complexity-by-year interactions on mean body lengths at age 0+ and age 1+, respectively. The ξ_{p [i ]} and ζ _{p [i]} parameters capture random pond effects on mean body lengths at age 0+ and age 1+, respectively. Finally, Model 3 included heteroscedasticity in the form of a triple age class-by-complexity-by-year interaction on residual variance (line 1 of Model 3 equation).

Mixture Model 3 provided us with pond-specific estimates for the number of age-0+ *vs*. age-1+ medaka after reproduction at time *t*+1. We were thus able to estimate the specific effects of habitat structural complexity on the estimated production rate of age-0+ recruits per introduced spawner in a linearized Ricker stock-recruitment model:
where is the median posterior number of age-0+ fish produced, and is the posterior variance in , supplied here as data so as to propagate estimation uncertainty. Other variables and parameters are as in Model 2 and have the same biological interpretation.

Following a similar rationale, we modelled the median posterior number of surviving age-1+ fish after reproduction as: where and are the median and variance, respectively, in posterior number of age-1+ fish after their reproductive period. Hence, Model 5 propagates estimation uncertainty in the number of surviving age-1+ fish. Intercepts α and β capture the year-of-experiment and habitat-complexity effects on mean, ln-transformed survival probabilities of age-1+ fish through the reproductive period, and slopes γ capture the density-by-habitat complexity interaction on age-1+ survival probabilities. We preferred Model 5 to a Binomial or Beta model, which are more naturally adapted to modelling probabilities, but can not straightforwardly incorporate estimation uncertainty . However, as a complement to Model 5, we provide a Binomial analysis of age-1+ survival probabilities in Appendix 2.

We fitted Models 2-5 using Markov Chain Monte Carlo (MCMC) in JAGS 4.3.0 (Plummer 2003) through the `jagsUI` package (Kellner 2019). Priors were chosen to be weakly informative except in mixture Model 3, where we imposed the following constraints: (i) mean standard body length was smaller at age 0+ than at age 1+ (i.e., α_{1} <β_{1} and α_{2} <β_{2}), (ii) body-length variance was larger at age 0+ than at age 1+, as evidenced by a visual inspection of size distributions (i.e., ), and (iii) the number of age-1+ individuals after reproduction at time *t*+1 was not larger than before reproduction at time *t* (i.e., ). We further prevented label switching by assigning age-class 0+ to fish shorter than 10 mm and age-class 1+ to fish longer than 30 mm (Edeline *et al*. 2016, Bouffet-Halle *et al*. 2021). We ran 3 parallel MCMC chains until parameter convergence was reached, as assessed using the Gelman–Rubin statistic (Gelman & Rubin 1992).

We assessed goodness of fit of Models 2-5 by using a Bayesian P-value (Gelman *et al*. 1996). Briefly, we computed residuals for the actual data as well as for synthetic data simulated from estimated model parameters (i.e., residuals from fitting the model to ‘‘ideal’’ data). The Bayesian P-value is the proportion of simulations in which ideal residuals are larger than true residuals. If the model fits the data well, the Bayesian P-value is close to 0.5. Bayesian P values for Models 2-5 were equal to 0.49, 0.52, 0.12 and 0.07, respectively, indicating fits ranging from excellent to fair only (Gelman *et al*. 1996). The lower fit of Models 4 and 5 is explained by the fact that error variance was not freely estimated but supplied as data in these models.

Finally, the significance of the effects included in our models was assessed using a standard *t*-test for Model 1 (as provided by the `summary` function in R), or MCMC p-values (not to be confounded with the Bayesian P-value above), which quantify posterior overlap with zero in Bayesian Models 2-5. Specifically, at each MCMC iteration and for each model parameter, we computed Δ as the difference between posterior parameters under Low and High habitat complexity. We then computed MCMC p-values as twice the proportion of Δ for which the sign of Δ was opposite to that of its mean value.

## RESULTS

### Cannibalistic behavioural assays and predation window

The relationship between medaka cannibalistic behaviour and the victim-to-cannibal ratio for standard body length (Sdl) predicted by GAM Model 1 was nonlinear, and changed during the course of cannibalistic assays (Fig. 2A). At first census, after 2.5 hours of exposure, the cannibalism-Sdl ratio relationship followed a bell-shaped curve, thus validating the hypotheses of the predation window (Fig. 2B).

As time of victim to cannibal exposure was increasing, the relationship progressively became body-size independent. By the end of the assays (17.5 hours of exposure), victim survival probability was very low under almost all Sdl ratios (Fig. 2A). GAM Model 1 further showed that overall mean cannibalism probability increased significantly from 0.67 in female cannibals to 0.85 in male cannibals (Fig. 2A; β_{Male} = 1.01, SE = 0.288, t-value = 3.52, p-value < 0.001).

Due to this sex effect on cannibalistic voracity, the upper and lower limits of the predation window were sex-dependent (Fig. 2B). Specifically, predation window was slightly wider in male (δ = 0.09, φ = 0.26, ε = 0.41) than in female cannibals (δ = 0.13, φ = 0.26, ε = 0.38). These parameters show that newly-hatched medaka larvae are under strong cannibalistic risk (Fig. 3). An average-sized hatchling (3.8 mm Sdl) may be cannibalised by any 9.3-to-42.2 mm Sdl male (10.0 to 29.2 mm female) conspecific. This body-size range encompasses not only the whole range of parental body sizes, but also late-juvenile body sizes (Fig. 3), indicating that medaka larvae are exposed to both inter- and intra-cohort cannibalism.

### Replicated pond populations

In replicated pond populations, complex habitats increased the maximum *per capita* reproductive rate (Table 1-Model 2, positive β effect), as indicated by green lines being higher than red lines in Fig. 4A. Specifically, the *per capita* reproductive rate *N* (*t* +1)/ *N* (*t*) increased on average from 1.5 year^{-1} under a low complexity to 2.7 year^{-1} under a high complexity (80 % increase).

Additionally, medaka population dynamics were negatively density-dependent under a low habitat complexity (Table 1-Model 2, significantly negative γ_{0} effect), but a high habitat complexity dampened this negative density dependence (Table 1-Model 2, positive γ effect). Accordingly, the stock-recruitment relationship changed from flat at low habitat complexity (red lines) to positive at high habitat complexity (green lines), reflecting increased habitat carrying capacity (Fig. 4A). Fitting Model 2 without centring N( t), so as to preserve the original biological interpretation of r (see Methods), yielded a median posterior for K that increased under High habitat complexity from 82 to 194 fish in 2021, and from 59 to 143 fish in 2022.

Mixture Model 3 allowed us to quantify the effects of habitat structural complexity on age-specific natural log-transformed body-length distributions. Increased habitat complexity decreased mean body length in age-0+ medaka in both years of experiment (Table 1-Model 3, α_{2} and α_{3} parameters), and decreased mean body length in age-1+ medaka in 2022, when the complexity contrast was more extreme, but not in 2021 (Table 1-Model 3, β_{3} *vs*. β_{2} parameters).

In 2021 more complex habitats increased variability of log-transformed body-length in age-0+ fish (Model 3, σ_{age-0+, Low-complexity, 2021}=0.269 *vs*. σ_{age-0+, High-complexity, 2021}=0.303, MCMC P-value = 0.022), but decreased it in age-1+ fish (Model 3, σ_{age-1+, Low-complexity, 2021}=0.140 *vs*. σ_{age-1+, High-complexity, 2021}=0.113, MCMC P-value = 0.038). In 2022, age-0+ were too few in low-complexity ponds to provide any robust inference on body-length variability (MCMC P-value = 0.652), while more complex habitats increased body-length variability in age-1+ fish (Model 3, σ_{age-1+, Low-complexity, 2022}=0.102 *vs*. σ_{age-1+, High-complexity, 2022}=0.136, MCMC P-value = 0).

Model 2 is a model of unstructured population dynamics, where age-0+ and age-1+ individuals are lumped in *N* (*t* +1). Hence, from Model 2, it is not possible to tell whether the increase in *N* (*t* +1)/ *N* (*t*) under a high habitat complexity reflected increased *per capita* production of age-0+ fish and/or increased survival probability of age-1+ fish through the reproductive period. To answer this question, mixture Model 3 provided us with separate estimates for the numbers of age-0+ and age-1+ fish at *t*+1, and thus allowed us to separate these two effects using Models 4 and and 5 (see Methods).

Model 4, which was fitted to the number of age-0+ medaka, perfectly parallel results from Model 2 above. Specifically, *per capita* production of age-0+ fish strongly increased from on average 0.8 at low complexity to 3.1 under a high habitat complexity (Table 1-Model 4, positive β effect). Additionally, the habitat complexity-by-density interaction reveals a strong negative density dependence under a low habitat complexity (Table 1-Model 4, negative γ_{0} effect) that was dampened under a high habitat complexity (Table 1-Model 4, positive γ effect).

Patterns of age-1+ survival probability, as inferred from Model 5, were opposite to patterns of age-0+ production, suggesting opposite effects of habitat complexity on age-0+ and age-1+ fish. Specifically, a high habitat complexity *decreased* age-1+ survival probability, but significantly-so in the binomial model only (Table 1-Model 5 *vs*. Appendix 2: negative β effects), suggesting a relatively weak effect. The binomial model predicted that age-1+ survival probability decreased from 0.91 at low complexity to 0.77 under a high habitat complexity.

Furthermore, survival probability of age-1+ fish was *positively* density-dependent under low habitat complexity in both the Gaussian and binomial models (Table 1-Model 5 and Appendix 2: positive γ_{0} effects), and a high habitat complexity amplified this positive density dependence, but significantly-so in the Gaussian model only (Table 1-Model 5 *vs*. Appendix 2: positive γ effects), suggesting a weak amplification.

Taken together, results from Models 4 and 5 indicate that the positive effect of habitat complexity on medaka population growth rate resulted from increased *per capita* production of age-0+ fish, and was weakly opposed by depressed survival of age-1+fish.

## DISCUSSION

In multispecies assemblages, habitat structural complexity increases species coexistence and productivity through a relaxation in the strengths of both interspecific competition and predation (F. E. Smith 1972, Crowder & Cooper 1982, Holt 1987, 1987, Diehl 1988, 1992, Heck & Crowder 1991, Hixon & Menge 1991, Rogers *et al*. 2014). Our present results in medaka fish show that habitat structural complexity may further increase age-class coexistence, *per capita* reproductive rate and habitat carrying capacity at a single-population level. Hence, intraspecific processes may provide a substantial, but currently neglected, contribution to the positive effects of habitat complexity on biodiversity and productivity at a community level.

Our results may further be used to gain some understanding of the underlying ecological mechanisms that drive positive habitat complexity-productivity relationships. We show that increased age-class coexistence and productivity in medaka populations was mainly achieved through an increased *per capita* production of age-0+ recruits by their age-1+ parents which, in theory, may result either from increased parental fecundity (i.e., egg production) and/or from increased survival of newly-hatched larvae to the recruit stage. Our results, however, provide evidence against increased adult fecundity in more complex habitats.

Accordingly, both age-0+ and age-1+ medaka had smaller and more variable body sizes in more complex habitats, indicating increased competition for food (Ohlberger *et al*. 2013), and food shortage can hardly result in increased fecundity (Kooijman 2010). Additionally, age-1+ survival probability decreased in more complex habitats, consistent with negative effects of competition on fitness in age-1+ medaka, which are dominated by their progeny in competition for food (Edeline *et al*. 2016). Hence, we conclude that increased age-class coexistence and productivity of medaka populations in more complex habitats was not due to increased adult fecundity, but instead resulted primarily from increased survival of newly-hatched larvae.

Our laboratory assays demonstrate that, in complexity-free habitats, newly-hatched medaka larvae are exposed to strong cannibalism from both their parents but also from their earlier-born brothers and sisters. Hence, increased newborn survival in more complex habitats most likely resulted from a relaxed cannibalism, which drove the observed relaxed negative density-dependence of the stock-recruitment relationship. In perfect line with both experimental work (Dionne 1985) and theoretical models (Claessen *et al*. 2000), our results further show that a relaxed cannibalism in more complex habitats increased the strength of intraspecific competition for food (see above). The strong positive density-dependence in age-1+ survival probability in pond medaka populations may thus be explained by cannibalism which, through relaxing competition for food in which age-0+ dominate, allowed age-1+ medaka to indirectly limit their competitive exclusion and to increase their own survival probability.

While in experimental ponds in France cannibalism allow medaka to survive to age 2+ and then to contribute to two reproduce bouts in their life (this study, Bouffet-Halle et al. 2021), in the wild in Japan juvenile medaka exclude all age-1+ parents in exploitative competition for food, resulting in semelparous medaka populations (Terao 1985, Edeline *et al*. 2016). Two separate and non mutually-exclusive mechanisms may explain the dominance of age-0+ medaka in the wild in Japan. First, wild habitats are probably more structurally complex than the most complex ponds in our experiments. In particular, wild habitats often harbour shallow areas, which provide juvenile fish with absolute predation refuges (Radinger *et al*. 2023), but which were absent from the most complex ponds in our experiments. Second, summer temperatures are often higher in Japan than in France. Yet, metabolic gains under higher temperatures are larger for small-bodied fish, which thus have a competitive advantage under warm conditions (Vasseur & McCann 2005, Ohlberger *et al*. 2011, Edeline *et al*. 2013, 2016).

If the higher complexity of wild habitats explains the dominance of age-0+ medaka in the wild, then we could expect a hump-shaped habitat complexity-productivity relationship in medaka populations, with a shift along an increasing habitat-complexity gradient from a cannibal-mediated, age-1+ dominance at low complexity to an exploitative competition-mediated, age-0+ dominance at high complexity, resulting in maximal age-class coexistence and population productivity at intermediate complexity levels where the asymmetry in dominance is most relaxed. Maximal diversity and productivity at intermediate levels of habitat structural complexity is indeed observed in complex, multispecies communities (Crowder & Cooper 1982, Rogers *et al*. 2018), supporting the contention that complexity-diversity and complexity-productivity relationships measured at the community level may reflect processes acting at the population level.

Size-dependent cannibalism is a very common form of interaction in the animal kingdom (Fox 1975, Polis 1981, C. Smith & Reay 1991), and we thus expect habitat complexity to enhance age-class coexistence and population growth rate across a broad taxonomic range. Around the globe, habitat structural complexity in natural habitats is often provided by sessile organisms such as plants or corals. These “ecosystem engineers” become increasingly threatened by anthropogenic perturbations such as deforestation, eutrophication, bottom trawling and dredging, or by marine trophic cascades or ocean acidification, thus making biodiversity loss convergent with a global habitat simplification. Ample evidence demonstrates that such habitat simplification may entail a cascade of species extinctions in multispecies communities. Our study further suggests that, within the surviving species, increased dominance of large-bodied individuals may also reduce juvenile survival, and ultimately impair population productivity and long-term persistence. These results call for strong actions to preserve or restore habitat structural complexity, not only to increase taxonomic diversity, but also to enhance productivity of exploited populations, and to improve the conservation status of endangered populations.

## Author contributions

EE designed and contributed to performing experiments, analysed data and wrote the first draft version. EE, YB and DRR performed experiments. All authors contributed to result interpretation and draft improvements.

## Funding

This work has benefited from technical and human resources provided by CEREEP-Ecotron IleDeFrance (CNRS/ENS UMS 3194) as well as from financial support from the Regional Council of Ile-de-France under the DIM Program R2DS bearing the references I-05-098/R and 2015-1657. It has received a support under the program ‘Investissements d’Avenir’ launched by the French government and implemented by ANR with the references ANR-10-EQPX-13-01 Planaqua and ANR-11-INBS-0001 AnaEE France, and from Pépinière interdisciplinaire CNRS de site PSL (Paris-Sciences et Lettres) “Eco-Evo-Devo”. EE was further supported by grants from Sorbonne Université (program Convergences, project C14234) and from Rennes Métropole (AIS 18C0356).

## Data availability statement

All data and codes needed to run the analyses may be downloaded from https://entrepot.recherche.data.gouv.fr/dataset.xhtml?persistentId=doi:10.57745/KKITFP

## Acknowledgement

We are grateful to the NBRP medaka (https://shigen.nig.ac.jp/medaka/) and to Prof. Kiyoshi Naruse (NIBB Okazaki) for providing us with the medaka strains. We thank André De Roos for insightful comments on an earlier manuscript version. Alexandre Kempf, Solène Moulin, Louisiane Perrin and Morgan Verdeil provided invaluable help during behavioural assays. This experiment was approved by the Charles Darwin Ethical Committee (Ce5/2010/041).

## Appendix 1. Preliminary tests of strain effects on *per capita* reproductive rate and body sizes

We tested for a strain effect on *per capita* reproductive rate during the 2021 experiment (strains were mixed during the 2022 experiment) using a negative binomial GLM fitted by maximum likelihood in the `glmmTMB` library of R (Brooks *et al*. 2017):
where *i* indexes ponds (n = 16), NB is the negative binomial distribution, α_{S} is a strain effect on the r parameter from Eq. 1 (i.e., on population growth rate), β is the density-dependent parameter γ in Eq. 1, and *ϕ* is a overdispersion parameter estimated equal to 7.21. We then tested for a stain effect using a Chi-squared likelihood ratio test between Model A1 and a similar model that did not include any strain effect using the `anova` function of R.

We tested for a strain effect on standard body lengths Sdl using a linear mixed model fitted by restricted maximum likelihood in the nlme library of R (Pinheiro *et al*. 2018):
where ln is the natural logarithm, *i* indexes individual fish (*n* = 1917), N is the normal distribution, *p* indexes ponds (*n* = 16), and α_{S} captured strain effects on mean ln-transformed body lengths. The ξ_{p [i ]} parameter captured random pond effects. We then tested significance of the variance explained by α_{S} in the model using an F-test in the `anova` function of R.

## Appendix 2. Binomial analysis of survival probability of age-1+ medaka through the reproductive period

An alternative approach to modelling survival probability of age-1+ medaka, which does not propagate estimation uncertainty in age-1+ numbers but preserves the underlying Binomial process, consists in using an overdispersed Binomial model of the form: where is the median posterior number of age-1+ fish after their reproductive period, and ϵ is an overdispersion parameter. Other variables and parameters are as in Model 5 in the main text. Model A3 has a Bayesian P-value of 0.49, indicating an excellent fit to the data, and yields the following results:

## Footnotes

The text was polished and errros were corrected in Model 3 equation and in Figure 4.

https://entrepot.recherche.data.gouv.fr/dataset.xhtml?persistentId=doi:10.57745/KKITFP