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

Rename float=64 SCons option to precision=double #67399

Merged
merged 1 commit into from
Dec 10, 2022

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 14, 2022

This avoids confusion with the old bits=64 option and building for 64-bit CPUs in general.

See #66178 (comment) and #67308.

@Calinou Calinou requested review from a team as code owners October 14, 2022 16:54
@Calinou Calinou added this to the 4.0 milestone Oct 14, 2022
@Calinou Calinou force-pushed the rename-precision-double-scons branch from 0badaba to 0866f1e Compare October 14, 2022 17:06
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

Sure, either way works for me.

SConstruct Outdated Show resolved Hide resolved
@Calinou Calinou force-pushed the rename-precision-double-scons branch from 0866f1e to 3938f14 Compare October 14, 2022 17:09
@clayjohn
Copy link
Member

To me precision=64 implies that all int and float types will use 64 bits of precision. As far as I know, it will only apply to floats so the name precision is misleading

@akien-mga
Copy link
Member

akien-mga commented Oct 14, 2022

To me precision=64 implies that all int and float types will use 64 bits of precision. As far as I know, it will only apply to floats so the name precision is misleading

Here it would be precision=single|double and those terms are usually only used for floating point precision so I think it might be OK.

Alternatively, we could use real_t=single|double or real=single|double to match how it's called internally.

@Calinou Calinou force-pushed the rename-precision-double-scons branch from 3938f14 to 8ae42a0 Compare October 14, 2022 18:56
@fire
Copy link
Member

fire commented Oct 15, 2022

I have no opinion. More concerned about the feature being stabilized and gone through testing.

@DeeJayLSP
Copy link
Contributor

DeeJayLSP commented Nov 10, 2022

Why not float=single|double? It is more obvious and straight to the point.

@@ -179,7 +179,7 @@ opts.Add(BoolVariable("production", "Set defaults to build Godot for use in prod

# Components
opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True))
opts.Add(EnumVariable("float", "Floating-point precision", "32", ("32", "64")))
opts.Add(EnumVariable("precision", "Set the floating-point precision level", "single", ("single", "double")))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
opts.Add(EnumVariable("precision", "Set the floating-point precision level", "single", ("single", "double")))
opts.Add(EnumVariable("precision", "Set the floating-point precision level (`real_t`)", "single", ("single", "double")))

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Approved in PR review meeting. We agreed that precision=single|double makes the most sense.

It's still not perfect because it's not the floating point precision for everything. Many things are already double and this can't be configured (e.g. Variant::FLOAT is double, floats in GDScript are always 64-bit - but floats within Vector/Matrix types are using real_t and affected by this setting).

That's something for the documentation to cover however, for the setting it's good enough.

@akien-mga
Copy link
Member

CI needs to be updated:

Run ./bin/godot.linuxbsd.editor.dev.double.x86_64.san --version
/home/runner/work/_temp/007c26df-e409-44c2-9691-821a6ea78f70.sh: line 1: ./bin/godot.linuxbsd.editor.dev.double.x86_64.san: No such file or directory

@akien-mga
Copy link
Member

akien-mga commented Nov 22, 2022

Ping.

Note that the docs will need to be updated too after #68579 is merged.

This avoids confusion with the old `bits=64` option and building
for 64-bit CPUs in general.
@akien-mga akien-mga merged commit 21136aa into godotengine:master Dec 10, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants