Repository navigation
Add fixed-timestamp IFC export, synthetic fuzz tests and OS CI matrix #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AndreyStartsev
wants to merge
1
commit into
IOExtend:main
Choose a base branch
from
AndreyStartsev:feat/reproducibility-fuzz-cross-platform-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+783
−30
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| using System.Globalization; | ||
|
|
||
| namespace RvtIO.Cli; | ||
|
|
||
| /// <summary>The <c>--ifc-timestamp <timestamp></c> option: fixes the UTC timestamp written into the STEP <c>FILE_NAME</c> header so | ||
| /// repeated IFC exports of the same input are byte-for-byte identical.</summary> | ||
| internal static class IfcTimestampOption | ||
| { | ||
| public const string Name = "--ifc-timestamp"; | ||
|
|
||
| private static readonly string[] ExactFormats = | ||
| [ | ||
| "yyyy-MM-dd'T'HH:mm:ssK", | ||
| "yyyy-MM-dd'T'HH:mm:ss.FFFFFFFK", | ||
| "yyyy-MM-dd'T'HH:mm:ss", | ||
| "yyyy-MM-dd HH:mm:ssK", | ||
| "yyyy-MM-dd HH:mm:ss", | ||
| "yyyy-MM-dd", | ||
| ]; | ||
|
|
||
| /// <summary>Reads <c>--ifc-timestamp</c> from <paramref name="args"/>. Without the option <paramref name="timestamp"/> is null. | ||
| /// Accepts ISO-8601 timestamps (UTC when no offset is given) or non-negative Unix epoch seconds. Returns false with | ||
| /// <paramref name="error"/> set when the option has no value, is given twice or cannot be parsed.</summary> | ||
| public static bool TryParse(string[] args, out DateTimeOffset? timestamp, out string? error) | ||
| { | ||
| timestamp = null; | ||
| error = null; | ||
| bool seen = false; | ||
| for (int i = 0; i < args.Length; i++) | ||
| { | ||
| if (args[i] != Name) continue; | ||
| if (seen || i + 1 >= args.Length || args[i + 1].StartsWith("--", StringComparison.Ordinal)) | ||
| { | ||
| error = $"{Name} requires one ISO-8601 timestamp (for example 2026-01-15T12:30:45Z) or Unix epoch seconds."; | ||
| timestamp = null; | ||
| return false; | ||
| } | ||
| seen = true; | ||
| string raw = args[++i]; | ||
| if (!TryParseValue(raw, out var parsed)) | ||
| { | ||
| error = $"{Name} requires one ISO-8601 timestamp (for example 2026-01-15T12:30:45Z) or Unix epoch seconds."; | ||
| timestamp = null; | ||
| return false; | ||
| } | ||
| timestamp = parsed; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| private static bool TryParseValue(string raw, out DateTimeOffset result) | ||
| { | ||
| if (string.IsNullOrWhiteSpace(raw)) | ||
| { | ||
| result = default; | ||
| return false; | ||
| } | ||
| if (long.TryParse(raw, NumberStyles.None, CultureInfo.InvariantCulture, out long epochSeconds)) | ||
| { | ||
| try | ||
| { | ||
| result = DateTimeOffset.FromUnixTimeSeconds(epochSeconds); | ||
| return true; | ||
| } | ||
| catch (ArgumentOutOfRangeException) | ||
| { | ||
| result = default; | ||
| return false; | ||
| } | ||
| } | ||
| return DateTimeOffset.TryParseExact(raw, ExactFormats, CultureInfo.InvariantCulture, | ||
| DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out result); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Resolve the macOS test failures before merging the expanded matrix
The approved macOS job fails the same three cases on both target frameworks:
CompactValueFormatterTests.DegenerateAccuraciesPrintWhatPrints: ataccuracy = 0,value = 1234.5678expects-NaN m²but getsNaN m²;value = -0.0929expectsNaN m²but gets-NaN m².UnitDisplayEvaluatorTests.SlopeCloneClearsDimensionsAndUsesNativeNearVerticalSnapIncludingNegative: the near-vertical conversion differs by one bit (4663021752216772328expected,4663021752216772329actual).These assertions and their formatting/conversion code predate this PR; the new matrix exposes the platform assumptions. Nevertheless, its macOS job remains red and #39 explicitly requires tests to pass on all three operating systems. Resolve these differences without removing the macOS job or weakening the Windows reference checks, then rerun the full matrix. This run did not show a mesher regression or a fuzz timing failure.