Skip to content

Support 1295 GUI source groups with fixed-width filenames - #96

Open
Borealis-Thoon wants to merge 3 commits into
GralDispersionModel:V2701from
Borealis-Thoon:codex/extend-gui-source-groups
Open

Borealis-Thoon wants to merge 3 commits into
GralDispersionModel:V2701from
Borealis-Thoon:codex/extend-gui-source-groups

Conversation

@Borealis-Thoon

@Borealis-Thoon Borealis-Thoon commented Sep 14, 2026

Copy link
Copy Markdown

This revision addresses the filename compatibility feedback in #96 and targets V2701. It accompanies GRAL core PR #54.

Source groups are now limited to numeric IDs 1..1295. IDs 1..99 retain their original names. The two-character filename sequence is 01..99, A0..Z9, 0A..9Z, then AA..ZZ. Uppercase letters avoid A0/a0 collisions on ordinary Windows directories. The existing leading zero is retained in modulation filenames: emissions001.dat, emissions099.dat, emissions0A0.dat and emissions0ZZ.dat.

The shared codec is used for concentration, deposition and odour filenames, including ZIP entries, and all modulation read/write/delete/copy paths. Numeric IDs remain in definitions, source inputs, temporal/receptor headers and decay settings. The GUI supports definition editing, all four source types, compact result arrays, actual-ID modulation/totals/decay mapping, and reordered receptor selections.

Complete filename protocol

The companion core adds lazy concentration blocks for normal concentration, deposition, odour gradients and both transient fields. It preserves particle traversal, cell locks, RNG settings and checkpoint phases. It does not yet implement the proposed ring-buffer scheduler. Measured storage savings depend on occupied groups; dense workloads retain a speed and allocation cost. The core PR documents the measurements and validation limits.

Validation on Windows/.NET 10.0.9:

  • Release build passes with the baseline nine warnings.
  • 11 cases and 5923 assertions.
  • All 1295 filename tokens are unique without case sensitivity and round-trip correctly.
  • 1295 named definition rows save and reopen.
  • 302 groups in source file I/O, modulation and decay; 302 computed/301 selected receptor groups in reverse order.
  • GUI-generated inputs through the core and back to GUI mean-result evaluation over two synthetic steps.
  • Five legacy files for four source types and IDs 1..99 are byte-identical to the original GUI.

Reproduction instructions

The earlier Int32 extension is preserved on the archive branch. Its decimal filenames at ID 100 and above are a separate experimental format; use a fresh computation directory when switching. IDs above 1295 are rejected rather than silently remapped.

This is a proposed shared format for review. Extended projects need both patched repositories. The tests do not establish annual-scale performance, scientific convergence, or every interactive workflow. Checkpoint restarts require the identical ordered groups and unchanged inputs. Drawing PR #95 remains separate. Upstream version labels and RNG configuration are unchanged.

@MarkusKuntner

Copy link
Copy Markdown
Member

This is a great piece of work that I've avoided so far because, in the end, GRAL will also need to be modified—especially to reduce GRAL's memory usage when many source groups are used.

The names of the emissionXX files, as well as the names of the GRAL output files contained in the ZIP containers, should be backward-compatible. My idea was to keep two characters but use different ASCII characters starting at source group 100. For example, A0–A9 through Z0–Z9, a0–a9 through z0–z9, and then 0A–9A through 0z–9z;
This results in over 1,000 possible source groups. After all, the number of sources within each source group is unlimited.

In GRAL, memory usage would need to be reduced, which must be done carefully so that performance does not suffer too much. One possible approach would be to create a ring buffer for concentrations, compute all sources or particles of a source group in parallel, and write the calculated concentration while the parallel computation of the next source group begins. However, this is still just a rough concept that I haven’t yet worked out in detail. A solution would also need to be found for the transient concentration arrays; otherwise, many source groups would be useless because the memory requirements would increase very rapidly.

Best regards
Markus

@Borealis-Thoon
Borealis-Thoon changed the base branch from main to V2701 September 15, 2026 02:49
@Borealis-Thoon Borealis-Thoon changed the title extend gui source groups Support 1295 GUI source groups with fixed-width filenames Sep 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants