Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lesquoyb
Copy link
Contributor

@lesquoyb lesquoyb commented Jun 2, 2025

Pull request that attempts to provide solutions for the "last" gama-server issues (#484 , #566, #619, gama-platform/gama.clients#20, maybe others?)

If it is accepted, the following changes to the documentation should also be done (to complete):

  • for commands activate and describe the description of the returned errors should be added
  • add the uri field in the error result of load command (and activate/describe)

@lesquoyb lesquoyb changed the title [GS] Fixes two NPE in the unpacking of compilation errors [GS] Multiple fixes and improvements for gama-server Jun 2, 2025
@lesquoyb lesquoyb linked an issue Jun 24, 2025 that may be closed by this pull request
@lesquoyb lesquoyb marked this pull request as ready for review June 25, 2025 03:27
RoiArthurB and others added 3 commits June 25, 2025 11:35
Introduces new preferences to control how #infinity, #nan, and integer overflows are written and parsed in JSON (as strings or literals). Updates JSON parsing and formatting logic to respect these preferences, adds constants for NaN and Infinity, and improves handling of special float values in JSON serialization and deserialization.
@lesquoyb
Copy link
Contributor Author

I've added a unit test model for to_json/from_json and taking into account the new Infinity and NaN cases, it seems like we are not here yet, some of those cases do not work

@AlexisDrogoul
Copy link
Member

What fails ?

@lesquoyb
Copy link
Contributor Author

lesquoyb commented Jun 27, 2025

You can check by running the new Serialization.experiment unit test file and see the multiple tests failing.
I can't really understand why some are failing, for example this one:

test infinity_from_literal {
	gama.pref_json_infinity_as_string <- false;
	assert from_json('{"x":Infinity}') = map(['x'::#infinity]);
}

Fails, but if I write this simple model:


model test

experiment ev {
	
	init {
		gama.pref_json_infinity_as_string <- false;
		write from_json('{"x":Infinity}');
		write map(['x'::#infinity]);
		write from_json('{"x":Infinity}') = map(['x'::#infinity]);	
	}
	
}

I have this output:

map(['x'::#infinity])
map(['x'::#infinity])
true

What is even stranger is that if I change pref_json_infinity_as_string to true I have exactly the same result, so maybe one of the problems is that the parameters are not properly handled ?

@lesquoyb lesquoyb merged commit 6e9acc0 into 2024-06 Jun 30, 2025
4 of 6 checks passed
@lesquoyb lesquoyb deleted the PR-multiple-GS-fixes branch June 30, 2025 07:11
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.

[GS] The seed isn't reinitialized during reload [GS] GamaRuntimeException not caught in the client [GS] error when closing connection

4 participants