It dawned on me that there is some state being kept by Species that needs to be split up to be per-chromosome.
Some of this is wrong in SLiM 5, but has (apparently) not bitten anyone yet; for example, derived states at a position X in ANY chromosome will ALL list a substitution that has occurred at position X in ONE chromosome, I think. I have not confirmed that in practice, but it sure looks that way in the code.
The rest of it is just wrong in SLiM 6, because new architecture that has been constructed is not considering multiple chromosomes as fully as it ought to. In particular, the new top-level metadata table needs to list only mutations and substitutions that are associated with the chromosome being written out; right now I think metadata for ALL chromosomes is listed. Probably the fallout from this is going to mean that the mutation registry, the substitution list, etc., will all need to be divided up to be kept per-chromosome. Otherwise each write of a top-level metadata table would require scanning through ALL of the mutations, substitutions, etc., and filtering down to the ones associated with the chromosome being written. That would certainly be possible, but it wouldn't be very efficient, for a simulation with a bunch of large chromosomes.
Overall, I need to do another pass through both Species and Population, looking for state information that really ought to be kept per-chromosome instead. (I did that back in the design phase for SLiM 5, of course, but apparently I wasn't thorough enough!)
It dawned on me that there is some state being kept by Species that needs to be split up to be per-chromosome.
Some of this is wrong in SLiM 5, but has (apparently) not bitten anyone yet; for example, derived states at a position X in ANY chromosome will ALL list a substitution that has occurred at position X in ONE chromosome, I think. I have not confirmed that in practice, but it sure looks that way in the code.
The rest of it is just wrong in SLiM 6, because new architecture that has been constructed is not considering multiple chromosomes as fully as it ought to. In particular, the new top-level metadata table needs to list only mutations and substitutions that are associated with the chromosome being written out; right now I think metadata for ALL chromosomes is listed. Probably the fallout from this is going to mean that the mutation registry, the substitution list, etc., will all need to be divided up to be kept per-chromosome. Otherwise each write of a top-level metadata table would require scanning through ALL of the mutations, substitutions, etc., and filtering down to the ones associated with the chromosome being written. That would certainly be possible, but it wouldn't be very efficient, for a simulation with a bunch of large chromosomes.
Overall, I need to do another pass through both Species and Population, looking for state information that really ought to be kept per-chromosome instead. (I did that back in the design phase for SLiM 5, of course, but apparently I wasn't thorough enough!)