Skip to content
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

[RFC] cleanup some deprecated options #14382

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

Dudemanguy
Copy link
Member

Felt like doing some janitor work again. All of these were from mpv 0.37 or earlier, and I see no reason to continue leaving these deprecated/useless options in the codebase for years. Let me know if you think if any of these are too soon. I also didn't document the removal of the OPT_REMOVED ones because mpv fails opening if you use any one of those so it's not really a terribly relevant interface change imo. Just the removal message goes away.

Didn't touch the --gamma-auto or --gamma-factor stuff since we already have a PR for that (#14369).

Copy link

github-actions bot commented Jun 18, 2024

Download the artifacts for this pull request:

Windows
macOS

@na-na-hi
Copy link
Contributor

See https://github.com/mpv-player/mpv/blob/master/DOCS/compatibility.rst#renaming-or-removing-options. It specifically says that both of these mappings can remain in the code for a long time. Unless these option names are reused by newly added options, I don't see any benefit in removing these messages, especially when they don't incur any maintenance burden and removing them makes errors less user-friendly.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 18, 2024

I would definitely insist on removing at least --fps, --cache-dir, --cache-unlink-files, and --sub-forced-only given that the names of those option aliases are so bad that it's the opposite of user friendly (hence why they got renamed in the first place).

@na-na-hi
Copy link
Contributor

na-na-hi commented Jun 18, 2024

I think it's OK to remove these aliases, but OPT_REMOVED serves exactly this purpose, right?

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 18, 2024

I personally think OPT_REMOVED is only useful in very specific situations since it still treats the option as invalid but just gives an additional message. Usually OPT_REPLACED or just adding a .deprecation_message will suffice. It's useful for when the semantics of some option completely changes and you want to inform users how to get back the old behavior. The recent --focus-on-open is a good example of that. But as time goes on, nobody needs to know that --gamut-warning used to be a separate option and it's just pointless code that should be removed.

@na-na-hi
Copy link
Contributor

I personally think OPT_REMOVED is only useful in very specific situations since it still treats the option as invalid but just gives an additional message. Usually OPT_REPLACED or just adding a .deprecation_message will suffice.

This difference worked when these options were never removed. These deprecated aliases simply stayed working so no special actions needed, and I don't think the users would take the deprecation warnings seriously enough. This whole option "cleanup" practice is a very new one started only 9 months ago (969c19c) which I think wasn't done with sufficient consideration, because these aliases suddenly stopped working without any information about replacements.

If you want to continue this practice (which I personally find no practical benefit), I would at least keep them as OPT_REMOVED for at least one release after removal of deprecated things.

@Dudemanguy
Copy link
Member Author

because these aliases suddenly stopped working without any information about replacements.

What? Deprecated aliases inform users about replacements. Some of them in that patch series were spitting out warnings for several years. If someone doesn't bother to spend two seconds to update/change the thing that was removed, why is this our problem?

If you want to continue this practice (which I personally find no practical benefit)

If nobody actually ever removes these things, then there's no point in ever deprecating them in the first place.

@na-na-hi
Copy link
Contributor

na-na-hi commented Jun 19, 2024

Deprecated aliases inform users about replacements. Some of them in that patch series were spitting out warnings for several years.

As I already pointed out, both in compatibility.rst and in practice, OPT_REPLACED options were never meant to be removed, because there are little benefit doing that. Options deprecated for removal use custom m_option.deprecation_message instead, and they still leave OPT_REMOVED behind.

Not to mention that several options in this PR only changed name 8 months ago, not even a year, and they're being removed without OPT_REMOVED at all.

If someone doesn't bother to spend two seconds to update/change the thing that was removed, why is this our problem?

The point of these things is to enable renaming options and removal of useless/broken code in a way that properly informs users while not leaving any real maintenance burden for the developers. The whole system was designed and used this way. Removing these information does nothing to improve code maintainability, since there are no code to maintain behind these flags. It only causes mpv to be less user friendly. The average user aren't chasing git master updates every day like you do, and they won't care until something actually breaks.

If nobody actually ever removes these things, then there's no point in ever deprecating them in the first place.

This does not preclude leaving OPT_REMOVED entries.

@kasper93
Copy link
Contributor

kasper93 commented Jun 19, 2024

What? Deprecated aliases inform users about replacements. Some of them in that patch series were spitting out warnings for several years. If someone doesn't bother to spend two seconds to update/change the thing that was removed, why is this our problem?

Please consider that the average user does not update mpv every week. In some cases, users migrate multiple versions forward. For example, when updating Ubuntu LTS, you jump from 0.34.1 to 0.37, and if you skipped the previous LTS, you start from 0.32.

Also, consider that there are guides and configs lying around in forums that are outdated. By not removing those aliases, we simply allow users to easily port those configs forward, for better or for worse.

If nobody actually ever removes these things, then there's no point in ever deprecating them in the first place.

I agree with @na-na-hi on this. Neither OPT_REMOVED nor OPT_REPLACED are intended to be removed. Their exact purpose is to mark old options for future users. OPT_REMOVED is after deprecated period, so depreciated things already were removed.

There are two types of option removal:

  1. The option (and the associated feature) gets deprecated, the deprecation_message is set, and after a few releases, the option is finally removed and marked with OPT_REMOVED, possibly with a useful message or simply to notify that the option was removed but once existed.
  2. The option is renamed, for whatever reason, but the functionality of this option is not changed. OPT_REPLACED is used to map it to the new version with a nagging depreciation warning for the user. A replaced option like that may be transformed into OPT_REMOVED if changes are made to the new option, as it shouldn't affect the old alias.

In both of these cases, OPT_REMOVED and OPT_REPLACED are the end. They should stay indefinitely in the code. All related code is already removed, and only the documentation in the form of these macros remains. There is no longer any deprecated code to remove. Only the nagging message for the user remains, but this is a good thing.

@Dudemanguy
Copy link
Member Author

OPT_REPLACED options were never meant to be removed
Neither OPT_REMOVED nor OPT_REPLACED are intended to be removed.

I'm sorry but this is frankly ridiculous. The default message when you use OPT_REPLACED literally has a big, fat "might be removed in the future".

@kasper93
Copy link
Contributor

kasper93 commented Jun 19, 2024

I'm sorry but this is frankly ridiculous. The default message when you use OPT_REPLACED literally has a big, fat "might be removed in the future".

Sure the option can be removed after some time and marked with OPT_REMOVED.

EDIT:

We could even have macro OPT_REPLACED(0.35, "container-fps-override") which would automatically mark it removed after two versions in 0.38. So we don't ever need to worry about his line ever again.

Same for normal deprecation, we could set a version which would trigger compiler warnings (or error) after 2 versions to remove the related code and mark such option OPT_REMOVED now.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 19, 2024

Why is this suddenly a rule now? In #12436, I removed a bunch of crap including OPT_REPLACED and no one complained. What's the point in changing something from OPT_REPLACED to OPT_REMOVED before removing it? The user already presumably spend months or maybe even years ignoring the message. What are they going to listen this time or something?

I'd totally get it if you guys said something like "option X is still used quite a bit in my opinion, let's hold off for a bit", but it basically sounds like a highly unreasonable amount of backwards compatibility which is not something mpv ever did. Especially not for dumb obscure options no one uses.

@kasper93
Copy link
Contributor

kasper93 commented Jun 19, 2024

Why is this suddenly a rule now? In #12436, I removed a bunch of crap including OPT_REPLACED and no one complained.

The fact no one complained doesn't make this everyone agreed.

I'd totally get it if you guys said something like "option X is still used quite a bit in my opinion, let's hold off for a bit", but it basically sounds like a highly unreasonable amount of backwards compatibility which is not something mpv ever did. Especially not for dumb obscure options no one uses.

In fact what I'm saying mostly is that OPT_REMOVED shouldn't be removed ever. When OPT_REPLACED is removed is different story, but by "removed" I mean replaced with OPT_REMOVED.

In wm4's words:

OPT_REMOVED can be used to inform the user of alternatives or reasons for the removal, which is better than an option not found error.

It is already removed, there is not much more we can do. And showing a meaningful message instead of opt not found is good thing and I don't consider it backward compatible, just something we get for free. (technically one line of code, but it is still free)

EDIT:

Also if we remove options after depeciation period, when and why we would even want to use OPT_REMOVED? It just doesn't makes sense then.

EDIT2:

I don't want to bikeshed this small thing forever, I just think @na-na-hi made a good point. But it is ultimately up to you, how to handle those things.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 19, 2024

The fact no one complained doesn't make this everyone agreed.

I mean your own thumbs up is currently there so I presume you agreed. This PR is not really any different in principle. The options here are just not nearly as old as the ones there.

As for OPT_REMOVED like I said earlier, it's only really useful in my opinion for niche situations where option semantics change in a way that cannot be simply mapped to the new option name. If you want to simply remove something completely with no real replacement, deprecation_message and making the option do nothing is a strictly better choice. Of course, there is no actual harm in leaving these in the codebase for a bit when something was recently removed, but eventually it becomes useless information. e.g. --vulkan-disable-events was removed in 7f5541f in 0.35.0. The message that is currently printed is "Unused". Is this really great, wonderful information that mpv needs to print until the end of time?

@kasper93
Copy link
Contributor

kasper93 commented Jun 19, 2024

I mean your own thumbs up is currently there so I presume you agreed.

Like I said, na-na-hi made a good point. I don't think it is strictly bad to remove those options, but now I see that we can do better without any additional cost in practice.

If you want to simply remove something completely with no real replacement, deprecation_message and making the option do nothing is a strictly better choice.

I feel like it would be inconsistent with the mpv cli options. Unknown options return error, removed should too. The only gain of OPT_REMOVED is additional message that might be useful for user.

No one reads warnings, until they are errors.

The message that is currently printed is "Unused". Is this really great, wonderful information that mpv needs to print until the end of time?

Of course not, I feel like it could be resolved easily with OPT_REMOVE_IN(0.35) which could print something like "removed in mpv v0.35" which is infinitely more useful and actually can be left until the end of time. But also can be removed completely if there is no information to say, except that it is no longer working.

@na-na-hi
Copy link
Contributor

na-na-hi commented Jun 19, 2024

The default message when you use OPT_REPLACED literally has a big, fat "might be removed in the future".

This is only there to discourage users from using that deprecated alias. But in practice, there is little reason to ever remove them unless the option it's aliased to is also removed, because a single line of OPT_REPLACED costs basically nothing, while having the benefit to avoid intentionally breaking user's configs for no good reason. This is just a simple tradeoff analysis.

What's the point in changing something from OPT_REPLACED to OPT_REMOVED before removing it?

My point is that there is absolutely no reason to remove OPT_REPLACED unless necessary, see above.

but it basically sounds like a highly unreasonable amount of backwards compatibility which is not something mpv ever did

There is no "unreasonable amount of backwards compatibility" here: OPT_REMOVED is a compatibility break, and OPT_REPLACED avoids compatibility breaks for no good reason with no cost. They don't add any real maintenance burden.

Is this really great, wonderful information that mpv needs to print until the end of time?

This is a small subset of cases (options now does nothing and has no replacement) compared to all of the other useful information removed. I think in this case only it's OK to omit OPT_REMOVED since there is nothing useful to tell and nothing can be done.

In summary, is there any benefit with removing them? To make us "feel good"? IMO this reason isn't good enough.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 19, 2024

I feel like it would be inconsistent with the mpv cli options. Unknown options return error, removed should too. The only gain of OPT_REMOVED is additional message that might be useful for user.

So what are you suggesting that instead of using .deprecation_message when removing an option we should just hard error when we remove something (see --drm-atomic for example). So much for all the effort on keeping a deprecation period. Or do you think we should do some extra long transition from a .deprecation_message -> OPT_REMOVED -> delete it for real? I find the middle step in this case to be completely pointless and redundant.

No one reads warnings, until they are errors.

If a user ignores a big fat warning for an extended period of time, I fail to see why this is our problem. It's doubtful such a person would even bother to read an error.

I feel like it could be resolved easily with OPT_REMOVE_IN(0.35) which could print something like "removed in mpv v0.35" which is infinitely more useful and actually can be left until the end of time

Why is this useful? Does anybody really need to know that mpv used to have some [insert random debugging option here] 20 versions later in the future?

This is only there to discourage users from using that deprecated alias.

Yes and eventually the endgoal is to make them unable to use it altogether. That's what deprecation means. Look if you really think OPT_REPLACED should never ever be removed, then the default message should be completely changed and such options shouldn't be considered deprecated.

This is a small subset of cases (options now does nothing and has no replacement) compared to all of the other useful information removed.

Useful? Why does any user need to know that --gamut-clipping used be a thing? What are we catering to some weirdo person that decides to upgrade from debian oldstable to master in one go? If some user is using some outdated meme config on the internet, we're only doing them a favor by breaking it.

In summary, is there any benefit with removing them?

Yes. As stated earlier, I consider the existing deprecated alias --fps, --cache-dir, --cache-unlink-files, and --sub-forced-only all to be the opposite of user friendly (user hostile if you will). These options all have terrible names and make the codebase actively worse by existing. In particular, I've never seen a user in the wild use --sub-forced-only correctly. I don't know if --sub-forced-events-only is the greatest name ever but at least I haven't seen anyone misuse it (or rather use it at all given it's super niche) yet. Removing it is for their own good. There is ample reason to remove the aliases for at least the aforementioned options given the deprecation has been more than long enough (at least 2 versions).

Nobody uses --demuxer-cue-codepage. I am highly confident because demuxer_cue was completely broken for an entire version and nobody ever noticed or complained. I only found it by accident and fixed it later. The subset of people that actually would read cuesheets with mpv and pass specific codepages is probably 0 (and you shouldn't need to anyway, the default auto should "just work"). I'm singling out this option in particular because it additionally causes pointless bloat by having an extra m_sub_options struct for the sole purpose of printing a warning that nobody will see. There's several other options in here that are also useless. Nobody uses --cdda-toc-bias. Nobody uses --drm-atomic. I highly doubt anyone uses --vo-sixel-exit-clear.

All in all, I find this entire discussion completely ludicrous and it's clear we're not going to see eye to eye on this. If you were just telling me "hey dudemanguy, you're removing thing X too fast, it should stick around longer", then we can have a discussion. But instead apparently mpv should be changing its philosophy to keep atrocious deprecated options like --fps in the codebase forever. Or completely useless bloat options that no one uses because we might hypothetically break some rando on the internet that copied some meme config from 10 years ago. mpv has never worked this way. Sure I did a big cleanup recently, but before that plenty of options were commonly removed in releases. Just scroll through the release history a bit.

It doesn't matter to me if having OPT_REMOVED or OPT_REPLACED is "not a maintenance burden". If the code is not useful and outlived its purpose, it should be removed.

@kasper93
Copy link
Contributor

kasper93 commented Jun 19, 2024

So what are you suggesting that instead of using .deprecation_message when removing an option we should just hard error when we remove something (see --drm-atomic for example).

I think there is misunderstanding. --drm-atomic was deprecated before, now (this pr) it is removed. You deprecate first, than you remove.

Or do you think we should do some extra long transition from a .deprecation_message -> OPT_REMOVED -> delete it for real?

No it should be normal deprecation period. OPT_REMOVED is there to notify the user afterwards. That's exactly the point, we can have faster removal, even of highly used options, by enforcing OPT_REMOVED that clearly guide user what to do. There is no guessing if the option is used by users or not.

Look if you really think OPT_REPLACED should never ever be removed, then the default message should be completely changed and such options shouldn't be considered deprecated.

User messages doesn't have to reflect perfectly the state of development. User messages should be understandable and clear for users. You don't explain rocket science to 5yo, you only say that rockets work.

Nobody uses...

Assumptions... last time we made an assumption about loadfile usage it got little bit of backlash. It is not like we have any statistic how mpv/libmpv is used. Also I would unify depreciation process to be uniform for all options/properties and not based of assumptions.

Why is this useful? Does anybody really need to know that mpv used to have some [insert random debugging option here] 20 versions later in the future?
[...]
break some rando on the internet that copied some meme config from 10 years ago. mpv has never worked this way.
[...]
from debian oldstable to master in one go?

Sorry, but I think you tunnel vision a bit. If we are strict about 2 releases policy for deprecation things removal, it is perfectly possibly that Billy, who doesn't know much, would have theirs config broken on Ubuntu LTS to LTS update.

In such cases user can skip deprecation period, which is fine, we cannot sync to the release cycles of all the distros. But here comes OPT_REMOVED with helpful message, that option X was removed and possibly alternative.

If you think it is not good to annotate removed option, please remove the OPT_REMOVED macro and remove options completely after depreciation period.

Note that @na-na-hi suggest to keep OPT_REPLACED indefinitely as it is helpful for users and doesn't add any maintenance cost. On this topic I can agree both ways, if you want to remove options after depreciation period, to force users to tinker with their configs, so be it. All I'm saying that there is still value in keeping them as OPT_REMOVED. Note that removing both would require user to not only update their config, but also search through commit histrory / interface changes to understand why the option is no longer working.

it's clear we're not going to see eye to eye on this.

We don't have to, but it is good to have all the arguments laid down.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 19, 2024

OPT_REMOVED is there to notify the user afterwards.

Again that's totally fine in some cases but as I've repeatedly said, there's a point where this is useless info that nobody needs. e.g. no user today is going to somehow type --xineramascreen and get confused because we removed the message about it getting replaced by --screen. It's a temporary guide that becomes obsolete with time.

User messages doesn't have to reflect perfectly the state of development. User messages should be understandable and clear for users.

"Warning: option --X was replaced with --Y and might be removed in the future." sounds 100% clear and understandable to me. If our policy is actually to never remove --X, then the message should be changed to reflect that.

Assumptions... last time we made an assumption about loadfile usage it got little bit of backlash.

Sure, I made a miscall on loadfile. The command was certainly commonly used but I did not expect the last argument to be used much so the breaking change for a more, imo, sensible argument order was worth it to me. Maybe I shouldn't have done that but oh well. But again, we removed literally dozens of options and deprecations in #12436 with virtually no complaints.

Also I would unify depreciation process to be uniform for all options/properties and not based of assumptions.

I don't agree. The importance of options/properties is not uniform thus the deprecation process cannot be uniform. It is inherently a sliding scale of what is considered important and what is not. Well unless you want to use an ungodly long deprecation period for everything I suppose. Let's say that for some bizarre reason we decided to completely break --slang. Yes it's an assumption, but I think it is safe to say this is one of the most commonly used mpv options. After all, there was that one time we broke its behavior on accident and there was nonstop issues and negative feedback. Anyways whatever deprecation period we use in this case would have be massive.

On the other hand, let's take --cdda-toc-bias again. Why am I pretty sure no one uses this? Because it would have fixed #8777 and probably #1614 and no one ever noticed. I didn't either until I actually dove into the code and discovered it's stupid that this is an option in the first place and should just always be done. I probably could have immediately removed the option and no one would have cared but fine let's be nice and have a brief deprecation period which has been more than long enough in my view.

If we are strict about 2 releases policy for deprecation things removal, it is perfectly possibly that Billy, who doesn't know much, would have theirs config broken on Ubuntu LTS to LTS update.

This is just an argument for possibly a longer deprecation period for something which is totally fine. We can go on a case-by-case if anyone thinks it is important enough.

If you think it is not good to annotate removed option, please remove the OPT_REMOVED macro and remove options completely after depreciation period.

As stated before, OPT_REMOVED still has a use when the semantics of an option changes and is an immediate breaking change. That happens sometimes. For something that has been deprecated for a long enough time and has been warning users, no I don't think using the OPT_REMOVED macro after removing the option completely is worth it. If there is a concern that users may not be aware of the option change for whatever reason, then the answer is simply to extend the deprecation period.

@na-na-hi
Copy link
Contributor

na-na-hi commented Jun 20, 2024

Look if you really think OPT_REPLACED should never ever be removed, then the default message should be completely changed and such options shouldn't be considered deprecated.

It's already doing that: the default messages says "and might be removed in the future". I'm sure you know what the word "might" means. There was never a requirement that deprecated options must be removed after being deprecated for X time.

we're only doing them a favor by breaking it.

The option is already removed, so it's already broken. What you're doing here is exactly the opposite of "doing them a favor" by removing the message which informs the user about the replacement option to use, so that he can fix his config.

In particular, I've never seen a user in the wild use --sub-forced-only correctly.

That's because the documentation of that option was very unclear. See #13804 (comment). This is the real reason why that option was misused. It has little to do with the naming of the option.

But instead apparently mpv should be changing its philosophy to keep atrocious deprecated options like --fps in the codebase forever.

"changing"? Quite the opposite, since the only one who changes anything here is you. Lots of OPT_REPLACED entries you removed in #12436 had been "deprecated" for more than 10 years, It had always worked like that until you removed them.

And guess what? Printing info about renamed options didn't even exist in the first place! It was ADDED in 7fb5df0 specifically because it's "more userfriendly." The whole point of the printing system is to improve user friendliness by objectively providing more information. Whether you personally think it's useful or not doesn't matter.

Also notice that the renamed options didn't work in that commit, but a later change to the option system "unbroke" these renamed options and made them work transparently again.

Or completely useless bloat options that no one uses because we might hypothetically break some rando on the internet that copied some meme config from 10 years ago. mpv has never worked this way. Sure I did a big cleanup recently, but before that plenty of options were commonly removed in releases. Just scroll through the release history a bit.

I have explained again and again that removing useless options doesn't preclude providing OPT_REMOVED entries.

It doesn't matter to me if having OPT_REMOVED or OPT_REPLACED is "not a maintenance burden". If the code is not useful and outlived its purpose, it should be removed.

So no practical benefit.

What does have a practical benefit though, is to remove this warning system altogether and print a generic message telling users to "RTFM" whenever they dare to use an option that doesn't exist. It would've achieved the same purpose with less amount of code to maintain. After all, who cares about user friendliness? /s

If there is a concern that users may not be aware of the option change for whatever reason, then the answer is simply to extend the deprecation period.

So what's the priority here? Removing useless code and inform users immediately with OPT_REMOVED, or extending the deprecation period and keep the useless bloat around? I'm seeing conflicting information here.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 20, 2024

I'm sure you know what the word "might" means.

It also obviously doesn't mean "never". Don't be stupid.

What you're doing here is exactly the opposite of "doing them a favor" by removing the message which informs the user about the replacement option to use, so that he can fix his config.

gamut-clipping was removed several versions ago and replaced by a completely new option with different semantics. Nobody is going to organically type --gamut-clipping today. The only way this would happen is because someone is blindly copying some config they found on the internet. Said person should be forced to read the manual and not blindly copy garbage they don't understand.

That's because the documentation of that option was very unclear. See #13804 (comment). This is the real reason why that option was misused. It has little to do with the naming of the option.

Man now this is an amazing bad faith argument. Don't be ridiculous. --sub-forced-only quite obviously sounds like "only select forced subtitles". Both the option name and the manual entry were atrocious. Come on at least give me that. You didn't even attempt to address the other ones I named either or do you actually think --cache-dir is a good name?

Lots of OPT_REPLACED entries you removed in #12436 had been "deprecated" for more than 10 years.

It's not a question. They were deprecated. 10 years is way more than enough time to remove them. I guess you think that OPT_REPLACED should apparently last forever. Again, open up a PR and change the wording of the deprecation message so that bad developers like me don't try to remove it. If you're bored, you can go through the entire mpv commit history and see if I'm the only person who ever removed an OPT_REPLACED deprecation. Maybe so, and then you can get me on this technicality. But I would say "spiritually", it's in line with normal development practices. Any OPT_REPLACED option is a deprecation. Deprecations are subject to removal after enough period of time. Everyone does this including mpv (sometimes in a very user-unfriendly way too).

It was ADDED in 7fb5df0 specifically because it's "more userfriendly."

Nobody is contesting that the functionality can be useful. The only thing that is being argued here is that such options have had a sufficient deprecation period and the mapping has outlived its practical use.

I have explained again and again that removing useless options doesn't preclude providing OPT_REMOVED entries.

And I have explained again and again that these options in question have already been providing deprecation messages for a long time.

So no practical benefit.

Yes if you conveniently ignore the vast majority of my response to that question and give some wild bad faith arguments, sure.

So what's the priority here? Removing useless code and inform users immediately with OPT_REMOVED, or extending the deprecation period and keep the useless bloat around?

Why is this so hard to understand? I've explained what I think OPT_REMOVED is good for like 5 different times by now and I'm not going to type it again. Scroll up.

@srk24
Copy link

srk24 commented Jun 20, 2024

Thank you for the work of every developer. I'd like to share some thoughts as an ordinary user. Take the example of --cache-dir mentioned earlier. According to the OP's suggestion, it would be deleted directly, and users would need to modify it themselves. However, when I checked the wiki and manual, I couldn't find any guidance on how to migrate. (In fact, with enough information, I could have known that I should set its sub-option, such as --icc-cache-dir. )

@hooke007
Copy link
Contributor

hooke007 commented Jun 20, 2024

@srk24
Copy link

srk24 commented Jun 20, 2024

Check https://github.com/mpv-player/mpv/blob/master/DOCS/interface-changes.rst image

Thx! I get it. I forgot to read this docs, always search in manual, my fault

@avih
Copy link
Member

avih commented Jun 20, 2024

Without getting into any discussion, I'd just share my point of view:

Keeping OPT_REMOVED for all removed options is useful to the user and doesn't have any maintenance burden, therefore I support keeping OPT_REMOVED forever for all removed options, except for reasons I can't forsee right now which neccessitate deleting it completelty.

That's not deprecation, because it's already past the deprecation preiod and already removed as a functional option, therefore it only served as a note to users "this doesn't exist anymore, do this or that instead", which is cheap for us and useful to the users.

@kasper93
Copy link
Contributor

kasper93 commented Jun 20, 2024

I don't agree. The importance of options/properties is not uniform thus the deprecation process cannot be uniform. It is inherently a sliding scale of what is considered important and what is not.

Why? I understand what you are saying, but why do you think longer deprecation time solves anything? We have already pretty long period, that certainly gives more than enough time for anyone to adjust to new changes if they want to.

Deprecation period is to allow users to migrate, if they want. And by having uniform policy it would be clear when/how the option is removed/replaced.

Even if we were to "break" --slang, two full releases is enough notification period for this. It may be one of the most used options. But having it linger for years, would not make it more convenient. Changes/Removal is mostly for developers to fix/clean the code, depreciation period is for users to adjust to those changes, shorter or no depreciation period means new mpv version are adopted slower as the breaking changes have to be resolved first.

On the other hand, let's take --cdda-toc-bias again. Why am I pretty sure no one uses this?

And why does it matter? Sure if it is not possible to have deprecation period. But otherwise why make specific exceptions of the rules, just because we assume it is not used? What does it help with, why cannot it go through normal period? To make us feel better that it was removed quicker?

It is not like mpv will ever have changes that significant that they cannot be ported quickly. See shared-script-properties, deprecated in 0.37, removed in 0.38. Highly used feature, scripts were certainly broken by it. But they got updated, at least some of them.

I won't circle back on other points, because everything has been said already. I feel like we are overthinking it, in my opinion having consistent deprecation policy would not only help us avoid thinking about it, but also users to understand when each feature would disappear.

EDIT:

"Warning: option --X was replaced with --Y and might be removed in the future." sounds 100% clear and understandable to me. If our policy is actually to never remove --X, then the message should be changed to reflect that.

The message says exactly what is says. option --X might be removed in the future. It is deprecated. It may be removed at any point, without additional notice. We are not saying it should be never removed. We are saying that until it works correctly with OPT_REPLACED there is no reason to actually remove it. But once, for any reason, it no longer works as replaced option, it can be directly removed, as at this point we are allowed to do whatever with it.

@Dudemanguy
Copy link
Member Author

However, when I checked the wiki and manual, I couldn't find any guidance on how to migrate. (In fact, with enough information, I could have known that I should set its sub-option, such as --icc-cache-dir. )

This is a real-time demonstration of what I meant by that deprecated alias being user hostile. It's not your fault. The name is extremely misleading and judging from this response you completely misunderstood what it did.

Keeping OPT_REMOVED for all removed options is useful to the user and doesn't have any maintenance burden, therefore I support keeping OPT_REMOVED forever for all removed options

I've stated this earlier but I don't agree that it is forever useful and given enough time it would be noise or possibly even confusing if someone happens to type in some ancient obscure option from a decade ago. We've removed plenty of options before with no special message left behind. Apparently I am in the minority on this or something so maybe someone make PR documenting the proposed policy change.

We have already pretty long period, that certainly gives more than enough time for anyone to adjust to new changes if they want to.
Even if we were to "break" --slang, two full releases is enough notification period for this.

It's sounds like our divergence is that you think 2 full releases is sufficient for everything. I don't. There's no reason we would ever do this but if we completely break --slang I would not consider 2 full releases to be enough. It's not just users having to update their config files, but undoubtedly there's a lot of scripts and other things out there that use this. I don't know what a good number would be but something more like a 5 year deprecation period (so roughly 5 releases if we assume 1 release per year) would be more in the ballpark on that.

I feel like we are overthinking it, in my opinion having consistent deprecation policy would not only help us avoid thinking about it, but also users to understand when each feature would disappear.

Yeah I think we don't disagree on this part as much as I initially thought. Currently, the only policy we have is basically "important stuff should be deprecated for a while; unimportant stuff can be removed whenever you feel like it". So to bring up the --cdda-toc-bias example again, I would consider that option to be obscure and unimportant so we're basically free to break it at anytime. And I've broken obscure options immediately in the past before. But in this case, I ended up waiting the 2 release cycle anyways so it's rather moot.

Anyway, if you want to change it to where everything must have at least some minimum deprecation period. I would not be opposed to that. My only pushback is that the difference between "important" and "unimportant" stuff is still meaningful and "important" things would likely need an even longer deprecation period than whatever the minimum is. So in my view, that's not technically a uniform policy however changes like that should be extremely rare at this stage. There should virtually be no reason why any of us would need to change any of the well-known highly used options in a non-compatible way.

We are saying that until it works correctly with OPT_REPLACED there is no reason to actually remove it.

That has never been my interpretation. If we are actually saying this, documentation should be updated.

@na-na-hi
Copy link
Contributor

na-na-hi commented Jun 20, 2024

Any OPT_REPLACED option is a deprecation. Deprecations are subject to removal after enough period of time.

I'm just saying that they weren't normally removed in practice because there is little reason to do so. I also already pointed out some reasons why removing them is beneficial. But I never said that you can't ever remove them. You can remove them with OPT_REMOVED entries.

I've explained what I think OPT_REMOVED is good for like 5 different times by now and I'm not going to type it again.

It's the same "feel good" argument here. You only want to apply OPT_REMOVED to arbitrary restricted situations and only for an arbitrary amount of time, because you personally think that they aren't useful to users otherwise. Someone already expressed their views on this right under your post, expressing otherwise. And there will be 1000x more users who think the same but haven't got a change to voice their opinions yet.

Sure, you can just tell them to "RTFM", but then what's the point of this warning system in the first place? Just delete it already. It's not existing in a meaningful way at the current state, and requires continuous effort to "clean up" manually. Using it in the intended way or deleting the system completely would relieve us of this manual labor.

I won't elaborate on the rest, which is basically "I know what's good and what's not for our users, and if some users don't use mpv in the way we want, well, fuck'em."

This is a real-time demonstration of what I meant by that deprecated alias being user hostile. It's not your fault.

It's already removed from the documentation. No new users are going to use it. The hostility is no more. You're just conveniently ignoring the fact that the existing users don't know how to migrate now because you're unwilling to leave an OPT_REMOVED entry. It would've helped the user to migrate. Again, "fuck everyone who dares to update mpv less frequently than we want them to."

@kasper93
Copy link
Contributor

This is a real-time demonstration of what I meant by that deprecated alias being user hostile. It's not your fault. The name is extremely misleading and judging from this response you completely misunderstood what it did.

Exactly and that's why OPT_REPLACED and OPT_REMOVED resolves this ambiguity, by printing the replacement option. What you suggest is removing it completely and leaving user up to themselves to find how the option is called now. @hooke007 got the wrong option, if only there was a way to show the correct one with OPT_REMOVED...

As @avih said:

therefore it only served as a note to users "this doesn't exist anymore, do this or that instead", which is cheap for us and useful to the users.

5 year deprecation period (so roughly 5 releases if we assume 1 release per year) would be more in the ballpark on that.

Dude... no one does that. I mean really. There are two kinds of users/script integrators, the ones that are active and will manage to fix it in 2 releases (which is 1-2 years) and the others that are not active or don't care and will fix it only after it becomes hard error, or never.

Side note, removal should be done on the beginning of release period to give most amount of time before stable release for latecomers.

I would consider longer deprecation period only if we break completely libmpv api, requiring significant development effort to integrate new version. Or if we deprecate the mpv custom shader hook in favor of new system. Or deprecate vo=gpu. But this kind of deprecation are not relevant for OPT_REPLACED and OPT_REMOVED that we are discussing here... And likely would stay very long time as dead part of mpv, same as few other vo's currently.

I agree some deprecations can be left for a long time, but I focused on OPT_* part, which are really rarely that hard to port that would require that.

Anyway, if you want to change it to where everything must have at least some minimum deprecation period.

We have it in the documentation:

Important/often used parts must be deprecated for at least 2 releases before
they can be broken. There must be at least 1 release where the deprecated
functionality still works, and a replacement is available (if technically
reasonable). For example, a feature deprecated in mpv 0.30.0 may be removed in
mpv 0.32.0. Minor releases do not count towards this.

I agree, that some things may not be important, but still it doesn't harm us to just wait a bit. Doesn't matter if we remove now or later, if the option is not used anyway.

That has never been my interpretation. If we are actually saying this, documentation should be updated.

The whole point of OPT_REPLACED is to deprecate the option, and notice that it may disappear at any time. But what is the point of removing them, if they still work perfectly fine? And well, the removal should be done with OPT_REMOVED.

@hooke007
Copy link
Contributor

It's not me who got the wrong option. I just told him to check the doc.
As a user, I hate alias.

video/out/gpu/video.c Outdated Show resolved Hide resolved
video/out/gpu/video.c Show resolved Hide resolved
video/out/vulkan/context.c Show resolved Hide resolved
video/out/gpu/video.c Show resolved Hide resolved
video/out/drm_common.c Show resolved Hide resolved
stream/stream_cdda.c Show resolved Hide resolved
@Dudemanguy
Copy link
Member Author

But I never said that you can't ever remove them. You can remove them with OPT_REMOVED entries.

You just complained that I removed 10 year old deprecated aliases, but OK. Formalize this. In what circumstances is it OK to remove them? 15 years? Only if the thing that it is aliasing also disappears? With regards to OPT_REMOVED, is this required when removing any option or only in certain circumstances? How long should an OPT_REMOVED be in the codebase? 10 years? Forever? If I'm in a retirement home and mpv is still maintained, should it still have an OPT_REMOVED informing users that --gamut-clipping was replaced by --gamut-mapping-mode=desaturate 5 decades ago (assume for the sake of this argument that --gamut-mapping-mode is still an option)? Clearly you feel very strongly about this so formalize this in the documentation and make a PR.

You only want to apply OPT_REMOVED to arbitrary restricted situations and only for an arbitrary amount of time, because you personally think that they aren't useful to users otherwise. Someone already expressed their views on this right under your post, expressing otherwise.

That user expressed that view based on a complete misunderstanding of an option (explained later). I fail to see how this backs you up in anyway. You used arbitrary as a pejorative here, but the process is fundamentally already arbitrary. Developers make judgement calls on deciding what should be removed, renamed, etc. There is no hard rule for this and can be for a variety of reasons. Your view that OPT_REMOVED should never be removed is just as arbitrary as my view that after enough time passes, it becomes useless code. It is made based upon individual judgements/opinions on what software development practices should be.

It's not existing in a meaningful way at the current state, and requires continuous effort to "clean up" manually. Using it in the intended way or deleting the system completely would relieve us of this manual labor.

This is what I would consider yet another argument made in bad faith. What you tacitly claim is "the intended way" is nothing more than your personal opinion. It is perfectly fine to think I am an idiot that uses the system in a poor way and so on. But you cannot claim to know what the true intent is. The only person that can do that is the one who actually wrote it which is not any of us in this thread. As for the "manual labor" point, I would file that in a "not an argument" category. mpv is maintained software, so developers will have to crack open some files and change things. It's how it is. If you wish to eliminate the "manual labor" of maintaining options/properties/apis, etc., then the only conclusion is to never remove any deprecations (or maybe never deprecate in the first place but that's quite unfeasible) and leave these things in the codebase forever. If that is the policy, it needs to be documented. Developers will naturally remove old deprecated things to clean up codebases.

You're just conveniently ignoring the fact that the existing users don't know how to migrate now because you're unwilling to leave an OPT_REMOVED entry. It would've helped the user to migrate.

An OPT_REMOVED entry would have been harmful in this specific case. I don't wish to drag the user into this bickering but from my understanding what they actually wanted was --icc-cache-dir. --cache-dir is the wrong option. It never did what they wanted. If the user had blindly obeyed a generic "this was replaced by --demuxer-cache-dir" message, they would not have gotten what the desired behavior. In this case, the hard breakage is the optimum outcome. It forced the user to consult documentation and realize that the correct option was something else completely. A classic XY Problem example. In this light, one could even argue that having the alias in the first place is a mistake and I should have completely removed it to avoid this situation. Alternatively, I suppose we could make the OPT_REMOVED print out a giant novel detailing and duplicating everything that's already in the manual to avoid this. That seems rather silly to me because consulting the documentation takes a couple of seconds, but OK there's no technical limitation if you insist that is the best approach.

And also I don't know why you keep acting like there was no warning that tells users how to migrate. It was just deemed no longer needed and thus deleted. If you think this guidance should last longer/indefinitely/etc. in some form, please elaborate on what your proposed policy like I said earlier.

I know what's good and what's not for our users, and if some users don't use mpv in the way we want, well, fuck'em
fuck everyone who dares to update mpv less frequently than we want them to.

Very nice of you to go into baseless personal attacks and completely misrepresent my arguments.

There are two kinds of users/script integrators, the ones that are active and will manage to fix it in 2 releases (which is 1-2 years) and the others that are not active or don't care and will fix it only after it becomes hard error, or never.

This is completely speculative, but I think this is optimistic. If we completely break something major that is used all the time, I would expect the pain to last many years. But I suppose there's no way to know without trying, not that we should. I can't think offhand of something that we did in the past that would really fit this category. But maybe you're right and it would all be fixed pretty fast. Who knows.

We have it in the documentation:

Right but section there clearly says "Important/often used parts". That's not everything. Right below, it says "Less useful parts can be broken immediately".

P.S. thanks for the actual PR feedback. I appreciate it. I have no intention of arguing forever with you.

Comment on lines 1 to 9
remove deprecated `--cache-dir` option alias
remove deprecated `--cache-unlink-files` option alias
remove deprecated `--demuxer-cue-codepage` option alias
remove deprecated `--fps` option alias
remove deprecated `--override-display-fps` option alias
remove deprecated `--sub-ass-force-style` option alias
remove deprecated `--cdrom-device` option alias
remove deprecated `--play-dir` option alias
remove deprecated `--sub-forced-only` option alias
remove deprecated `--vo-sixel-exit-clear` option alias
remove deprecated `--cdda-toc-bias` option
remove deprecated `--drm-atomic` option
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of them were renamed at 0.37. Based on the negligible benefit I consider removing renamed aliases must follow the 2 full release deprecation period. #12436 followed that: 0.37 was in development, and renames from 0.35 weren't removed.

These aliases can be removed after 0.39 is released.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are we counting differently? All of these were options were deprecated in 0.37, no? That's 1 release. 0.38 is 2 releases. So the upcoming release, 0.39 is fair game by that rule.

Copy link
Contributor

Choose a reason for hiding this comment

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

I want to make sure that the removal is synchronized with interface-changes.rst, which is now only updated at release. Under your interpretation, there will be a period that the removed options have no consumable documentations before the next release, which is the precondition I have for #14396.

I think the best thing to do here is make cleanup of deprecated aliases as a part of the release routine, not here.

@po5
Copy link
Contributor

po5 commented Jun 21, 2024

Yes and eventually the endgoal is to make them unable to use it altogether.

Punishing the user for using --play-dir that was around for 4 years instead of the new --play-direction is silly, even if you think the new name is better.
We shouldn't actively try to break user configs.

But again, we removed literally dozens of options and deprecations in #12436 with virtually no complaints.

You shouldn't expect complaints to come in overnight.
In my case I had a functionality in my Lua script that was silently broken in 5e0902c, a removal that had no benefits to anyone. It's only after someone noticed and complained that I could investigate why the functionality broke.

Despite what the code comments said, the track-switched event was not strictly equivalent to observing track-list as it doesn't fire on file load which is useful when you want to detect tracks the user explicitly switched to.
It's worth looking at the intention behind deprecations, where f5c2e3d tells us it was "for the sake of notifying API users", and that the events aren't meant to be removed (notice the use of the word "never", which I guess Dudemanguy needs to see to be convinced) unless there is a technical reason for it.
This would avoid unnecessary breakage, including silent hard to track down cases like above where the replacement isn't even truly a replacement, and all code for the deprecated functionality needs to be kept for internal use anyway.

@hooke007
Copy link
Contributor

We shouldn't actively try to break user configs.

Almostly every release will change/remove/rename some options/parameters. 'Breaking' happens all the time.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Jun 21, 2024

Punishing the user for using --play-dir that was around for 4 years instead of the new --play-direction is silly, even if you think the new name is better.

It was actually originally --play-direction renamed to --play-dir and then I unintentionally renamed it back to the original name. But anyways, I don't feel strongly about that particular one. If you feel it's too soon, we can hold off on it. (surprised nobody has complained about sub-ass-force-style yet tbh).

In my case I had a functionality po5/trackselect#4 that was silently broken in 5e0902c, a removal that had no benefits to anyone.

I'm sorry that happened, but it's not really to comparable to anything here or in the other PR. No
actual functionality was removed in either one. As for your issue, I don't believe any of the developers were ever aware of it. Why not open up an issue for it? I don't believe there currently is one. We've undeprecated things before.

Copy link
Contributor

@kasper93 kasper93 left a comment

Choose a reason for hiding this comment

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

Looks ok, also could be complemented by #14396

These were all deprecated in mpv 0.37.0 or earlier and are not
considered common enough options to warrant keeping the deprecated
mapping longer. Since demux_cue had only a single option in it, the
entire option substract is removed. This can be readded later if someone
wants to introduce a specific option to it again.
Most of these are pretty obscure things that were replaced a long time
ago. The special messages they were printing are also not really useful
at all so just remove them.
In both cases, setting these options did nothing other than give you a
warning that they may be removed in the future. Remove them now.
@Dudemanguy
Copy link
Member Author

I left the deprecated aliases for --play-dir, --sub-ass-force-style, and --override-display-fps for now.

@Dudemanguy Dudemanguy merged commit 111571b into mpv-player:master Jun 25, 2024
21 checks passed
@Dudemanguy Dudemanguy deleted the deprecation-cleanup branch June 25, 2024 02:19
@kasper93

This comment was marked as off-topic.

@Dudemanguy

This comment was marked as off-topic.

@kasper93

This comment was marked as off-topic.

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.

None yet

7 participants