Skip to content

Sinkhole fixes#543

Merged
memo33 merged 5 commits into
NAMTeam:stagingfrom
memo33:sinkholes
May 31, 2026
Merged

Sinkhole fixes#543
memo33 merged 5 commits into
NAMTeam:stagingfrom
memo33:sinkholes

Conversation

@memo33

@memo33 memo33 commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator
  • adds a GH action script that scans RUL0 for the most common type of sinkhole bugs (mismatches between CellLayout and ConsLayout)
  • fixes various potential sinkholes identified by the script

Example output:

===> Controller/RUL0/5000_RHW/5F00_FARHW/5F20_FARHW_Curves.txt
Potential sinkhole bug in ConsLayout at cells (0, 1):
  538: CellLayout =............
  539: CellLayout =...abbbb+..<
  540: CellLayout =.....bbbb...
  541: CellLayout =....^.......
  ---
  548: ConsLayout =............
  549: ConsLayout =...-----...<
  550: ConsLayout =....----....
  551: ConsLayout =....^.......

This might not catch every sinkhole out there. If any others are found, the criteria in the script can be extended. (It might become necessary to parse the CheckTypes then.)

@UlisseWolf

Copy link
Copy Markdown
Contributor

I have no problem with implementing this script to avoid the sinkhole bug.

One possible suggestion to avoid further problems is to create an instruction page on CellLayout and ConsLayout.

@memo33

memo33 commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator Author

The Wiki is a good source of information: https://www.wiki.sc4devotion.com/index.php?title=RUL0#ConsLayout

@caspervg

caspervg commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Haven't gone over the script
code and changes entirely just yet, but did want to throw in that in DBPFKit I set up a full RUL0 parser in CPP that could be useful for other kinds of validation or as inspiration for the Scala script: https://github.com/caspervg/DBPFKit/blob/main/src/RUL0.h
https://github.com/caspervg/DBPFKit/blob/main/src/RUL0.cpp

It didn't yet do actual validation of the Cell/ConsLayout agreeing, so that's a nice feature I'll add there :)

Comment thread src/scripts/syntax-check-rul0.py Outdated
Comment thread src/scripts/syntax-check-rul0.py Outdated
Comment thread src/scripts/syntax-check-rul0.py Outdated
@memo33

memo33 commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator Author

in DBPFKit I set up a full RUL0 parser in CPP that could be useful for other kinds of validation or as inspiration

Thanks for the link. I hadn't seen your code yet, but knew you had been working on a RUL0 parser. For the purpose of a linter, C++ is a bit too cumbersome to work with for me though. As you can see, I took the quick and dirty approach, not trying to 100% validate the entire syntax.

I'll set this PR back to draft to make the suggested changes. I might also try to add a check for the following criterion, as it's a good indicator for sinkholes: Static cells (i.e. not tagged optional or check) in the cell layout should not use . in the constraint layout.

@memo33 memo33 marked this pull request as draft January 18, 2026 19:44
@caspervg

Copy link
Copy Markdown
Contributor

in DBPFKit I set up a full RUL0 parser in CPP that could be useful for other kinds of validation or as inspiration

Thanks for the link. I hadn't seen your code yet, but knew you had been working on a RUL0 parser. For the purpose of a linter, C++ is a bit too cumbersome to work with for me though. As you can see, I took the quick and dirty approach, not trying to 100% validate the entire syntax.

Yeah for sure, for linting this code makes a lot more sense 😅 The setup to get the DBPFKit parser running in the Github Action container would be very overkill. Just thought I'd link it in case it offers ideas for other linting options

by also checking for static cells with constraints set to `.` and by
checking for missing `CheckType` definitions.
@memo33 memo33 marked this pull request as ready for review January 20, 2026 18:34
@memo33

memo33 commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator Author

Done with the changes.

@UlisseWolf UlisseWolf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me

@memo33 memo33 merged commit c8152d9 into NAMTeam:staging May 31, 2026
2 checks passed
@memo33 memo33 deleted the sinkholes branch May 31, 2026 10:57
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.

3 participants