Repository navigation
fix : découpe et amincissement — deux lectures de mémoire indéfinie qui rendaient roofer non déterministe - #2
Merged
Conversation
The loop that merges each footprint's buffer ground points into its point cloud started from an uninitialised index, so whether those points were merged depended on whatever the stack held. It now starts at 0, so they are always merged, as the comment above the loop intends. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZBFfd55Us1zg7chCUDs5C
…ng past it gridthinPointcloud skipped points whose cell index was greater than the count raster's size, but not the one equal to it, so a point mapping to that cell read one element past the array. Whether it was kept, and whether a random draw was consumed, then depended on that memory, and so did every following point's draw. Footprint buffer ground points, which lie outside the footprint's raster, hit this case. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZBFfd55Us1zg7chCUDs5C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pourquoi
En portant le déterminisme (#1) sur le
mainofficiel (3DBAG#181), un bâtiment changeait encore d'une passe à l'autre. Deux lectures de mémoire indéfinie étaient en cause, hors de la reconstruction. Elles existent depuis 2024, donc aussi dans notre v1.0.0. Sur nos 7 393 bâtiments, elles ne s'étaient pas manifestées par chance.Ce qui est corrigé (un commit chacun, repris de 3DBAG#181)
StreamCropper.cpp,do_post_process) : la boucle qui ajoute au nuage de chaque emprise les points sol de sa zone tampon déclaraitsize_t poly_i;sans l'initialiser. Elle part maintenant de 0, donc ces points sont toujours ajoutés, comme le prévoit le commentaire.PointcloudRasteriser.cpp,gridthinPointcloud) : le testi > size()laissait passeri == size(). Un point de cette cellule lisait alors une case après la fin du raster de comptage. Qu'il soit gardé ou non, et donc tous les tirages aléatoires suivants, dépendait de cette mémoire. Ce sont les points sol de la zone tampon, hors du raster de l'emprise, qui tombent dans ce cas.Vérification
Mêmes 7 393 bâtiments, géométrie et attributs
rf_*comparés, horsrf_t_run:Par rapport au fork actuel (#1) :
rf_rmse_lod22) s'améliore de plus de 1 cm sur 1 bâtiment et ne se dégrade nulle part.Hors périmètre
Pour un point hors de l'emprise, l'indice de cellule (
static_cast<size_t>(floor(...))) déborde. Un point à droite tombe dans la ligne suivante, un point négatif fait un tour complet. Les points sol de la zone tampon sont donc soit écartés par l'amincissement, soit comptés dans une autre cellule. Je ne l'ai pas corrigé : cela change les points sol gardés. C'est signalé dans 3DBAG#181.🤖 Generated with Claude Code
https://claude.ai/code/session_01LZBFfd55Us1zg7chCUDs5C