Skip to content

Conversation

@mandolaerik
Copy link
Contributor

@mandolaerik mandolaerik commented Dec 5, 2025

No description provided.

@mandolaerik mandolaerik requested review from jhbaarnh and lwaern-intel and removed request for lwaern-intel December 5, 2025 23:11
@mandolaerik mandolaerik marked this pull request as draft December 5, 2025 23:12
@mandolaerik
Copy link
Contributor Author

Remaining work:

  • update docs properly
  • I did some quick hackery to make existing if compat.xyz in dml.globals.enabled_compat checks work unchanged. I should actually go through these and re-express them as breaking changes. And revert some supporting code.




compat_features = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

once we eliminate uses of dml.globals.enabled_compat, this should be moved to its only use in dmlc.py

@syssimics
Copy link
Contributor

PR Verification: ❌ failure

@mandolaerik mandolaerik force-pushed the pr/replace-compat-features-with-breaking-changes branch from 3ccafbc to 85fff3c Compare December 6, 2025 10:34
by_version = {}
for feature in compat.features.values():
if (feature.last_api_version.str in api_versions()
for feature in breaking_changes.changes.values():
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider s/feature/change

```
> [!NOTE]
> When the change is disabled, proxy attributes are not created for all
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

'''
Up to Simics 7, DMLC's type checking was very lenient compared to GCC,
especially for method overrides and uses of `extern` macros. When this
change is enabled, type checking becomes strict and consistent with C.
Copy link
Contributor

Choose a reason for hiding this comment

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

More consistent with C. Dammit, I'm now realizing that I'll have to make another pass at this because you've made substantial changes to the documentation beyond just inverting the language used and saying "change" instead of "feature". That is going to tie up this PR, because you will be forced to defend the changes you've made to the documentation I've written. If you want to avoid that, please be less revisionist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More consistent with C.

What I wanted to say is that it's consistent with how C code is generated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed verbally

indices used when calling the method were within bounds. When this change is
enabled, indices are implicitly range checked. If enabling this change causes
crashes, it indicates a bug in your model that could lead to memory
corruption without the range check.
Copy link
Contributor

Choose a reason for hiding this comment

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

Like here, see! You remove entirely the emphasis both in the short and long doc about just how bad failing the assert is and the implication to how users should enable the change even if we can't force them to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went through my changes, AFAICS I only removed significant chunks in two places. Moved removals to a separate commit.

The overall problem was that the docs were backward and headache-inducing, and flipping the polarity of some words did not help; it was better to rephrase everything.

typed parameters were inlined as constants, which had some
unintuitive semantic implications. In DML 1.4, constants are only
inlined in parameters declared using `inline` as quasi-type. When
this change is enabled, DML 1.2 only inlining constants in untyped
Copy link
Contributor

Choose a reason for hiding this comment

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

DML 1.2 only inlines constants

provisional feature is explicitly enabled.
where the [`simics_util_vect` provisional feature](provisional-auto.html#simics_util_vect)
is not enabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

stray artifact

and port.objtype in {'port', 'bank'}
and compat.port_proxy_ifaces in dml.globals.enabled_compat):
and breaking_changes.remove_port_proxy_ifaces
not in dml.globals.enabled_breaking):
Copy link
Contributor

Choose a reason for hiding this comment

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

I've never liked how verbose these checks were with compat, and now we're making it worse. Consider adding an .enabled() helper function to the BreakingChange class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, maybe we can move enabled_breaking to a class member of breaking_changes.BreakingChange; this pattern is not without precedence.

Factor out major-specific stuff to separate test, and rename
latest_api_version to default_api_version. The idea is that the
default API version is compatible with all major versions we care about,
therefore we use that to run most tests; tests that rely on something
newer can annotate that explicitly by e.g.
`/// DMLC-FLAG --breaking-change`.
This lets us use whatever hardcoded isolated one-time hacks to preserve
their legacy behaviour
Done in separate commit to make rename detection happy
Comment on lines 2168 to 2171
and (compat.dml12_misc not in dml.globals.enabled_compat
and (breaking_changes.remove_misc_quirks in dml.globals.enabled_breaking
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure it was right to auto-add the dml- prefix; maybe it's clearer and more greppable if we spell out the prefix. In this example, the 'dml12' part of dml12_misc_int effectively deemphasized the condition as extra uninteresting dml 1.2 junk.

@mandolaerik mandolaerik force-pushed the pr/replace-compat-features-with-breaking-changes branch from 85fff3c to a808cba Compare December 8, 2025 21:21
Comment on lines 266 to 255
then that **definitely signifies a bug in your model; a bug that would
very likely result in memory corruption if the assertion were not to
be made.**'''
then that signifies a bug in your model that could
lead to memory corruption without the range check.'''
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to neutral language that says the same thing. The feature is important for those who spend much time on problems root-caused to memory corruptions, it's not up to us to decide. People are running sanitation tools that probably catch most such memory corruptions. IIRC, some of the overflows detected in the wild by the range check were not real corruptions (because it just logged something without accessing state). I.e., the code is inherently dangerous and unsafe but can't actually cause problems yet.

I agree it's a sane check that everyone should enable as soon as possible, but the same goes for most breaking changes. If we care, the best we can do is to actively push people to enable the check.

Comment on lines 206 to 213
Passing `--no-compat=suppress_WLOGMIXUP` to DMLC has almost the same effect
as passing `--warn=WLOGMIXUP`; either will cause DMLC to report the warning
even when the Simics API version in use is below 7. The only difference
between these two options is that if `--no-compat=suppress_WLOGMIXUP` is
used (and `--warn=WLOGMIXUP` is not), then `WLOGMIXUP` may still be
explicitly suppressed via `--no-warn=WLOGMIXUP`. In contrast,
`--warn=WLOGMIXUP` doesn't allow for `WLOGMIXUP` to be suppressed at
all.'''
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this because it's a lot of text and I don't understand why a user needs it. If they get the warning somewhere, then they will fix it. If that's impossible somewhere (which is unlikely), then they can use --no-warn as usual, no need to remind them.

Comment on lines 201 to 204
to avoid overwhelming users with warnings, as the faulty pattern that
`WLOGMIXUP` reports is very prevalent within existing code. Addressing
applications of the faulty pattern should be done before or as part of
migration to Simics API version 7.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed some text that felt redundant. It follows from how breaking changes work that WLOGMIXUP will be enabled during migration to API 7, and it follows from the previous mention of "overwhelming" that you want to fix those violations if you care about not getting overwhelmed.

@syssimics
Copy link
Contributor

PR Verification: ❌ failure

@mandolaerik mandolaerik force-pushed the pr/replace-compat-features-with-breaking-changes branch from a808cba to a56fb0b Compare December 9, 2025 06:55
@mandolaerik mandolaerik force-pushed the pr/replace-compat-features-with-breaking-changes branch from a56fb0b to 23d8793 Compare December 9, 2025 21:06
@syssimics
Copy link
Contributor

PR Verification: ❌ failure

def enabled(self):
# `None` happens in unit tests; assume everything is enabled
return (True if BreakingChange.enabled_breaking_changes is None
else self in BreakingChange.enabled_breaking_changes)
Copy link
Contributor

Choose a reason for hiding this comment

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

(BreakingChange.enabled_breaking_changes is None
 || self in BreakingChange.enabled_breaking_changes)



@change
class dml_remove_legacy_attributes(BreakingChange):
Copy link
Contributor

Choose a reason for hiding this comment

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

It's replacement, not pure removal. Use no_legacy_attributes or modern_attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is pure removal. Before the change you get both the normal attr and a proxy pseudo-attr; the only change is that the proxy is no longer added.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the proxy attributes removal breaking change. This is the SIM_register_attribute breaking change.



@change
class dml_remove_port_obj_param(BreakingChange):
Copy link
Contributor

@lwaern-intel lwaern-intel Dec 10, 2025

Choose a reason for hiding this comment

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

this is a rather terrible name which when read could be understood as the exact opposite of what the feature does

<tt>uint<i>NN</i></tt> types; this can sometimes have unexpected
consequences. The most immediate effect of disabling this feature
@change
class dml12_fix_int_quirks(BreakingChange):
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix int quirks? That's a strange way of putting it, when the intent is rather to strip away strange legacy behaviors. Not blocking, but I encourage you to give naming another think.

`experimental_vect` is disabled, DMLC forbids the `vect`
syntax.
@change
class dml_forbid_experimental_vect(BreakingChange):
Copy link
Contributor

Choose a reason for hiding this comment

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

ban_ or no_. In general, I'm sensitive to the length of these names, especially now we slap on the dml prefix on everything...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe vect_requires_provisional?

Copy link
Contributor

@lwaern-intel lwaern-intel Dec 11, 2025

Choose a reason for hiding this comment

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

I like that. Or rather, vect_needs_provisional.

Copy link
Contributor

@lwaern-intel lwaern-intel Dec 11, 2025

Choose a reason for hiding this comment

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

no wait that won't make sense once we get RAII. Uhh... legacy_vect_needs_provisional? but augh now it's long again

Copy link
Contributor

Choose a reason for hiding this comment

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

no_implicit_simics_util_vect?????

Copy link
Contributor

Choose a reason for hiding this comment

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

oh dammit just pick no_experimental_vect

'''
Up to Simics 7, DMLC's type checking was very lenient compared to GCC,
especially for method overrides and uses of `extern` macros. When this
change is enabled, type checking becomes strict and consistent with C.
Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed verbally

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