Skip to content

Commit

Permalink
Merge commit '36b2df44453ba5e830369c76ab0683799a287605' into fp/updat…
Browse files Browse the repository at this point in the history
…e-core-13.13

* commit '36b2df44453ba5e830369c76ab0683799a287605': (34 commits)
  core release 13.13.0
  Fix an assertion failure if an async write callback ran during a write transaction (#6661)
  Remove catch() clause to prevent truncating stack trace in AsyncOper::do_recycle_and_execute() (#6667)
  Allow geo coordinate numeric argument substitutions (#6663)
  Fix a lock order inversion in tests (#6666)
  Avoid performing unaligned reads in Array::get_chunk()
  Fix a few UBSan failures hit by tests
  Use std::optional to store cached leaves in query nodes (#6653)
  maybe fix a race in a test (#6651)
  Access token refresh for websockets was not updating the location metadata (#6631)
  Updated release notes
  Prepare release
  Updated baas server tag for CI (#6650)
  Geospatial basic queries benchmarks (#6621)
  Geospatial feedback (#6645)
  Add support for early exit in BPlusTree::for_all()
  Filter out unresolved links in Dictionary::get_any()
  Benchmark for full-text search
  geospatial validation of polygons (#6607)
  Fix importing Results with deleted collection
  ...
  • Loading branch information
papafe committed May 30, 2023
2 parents 4fc4df8 + 36b2df4 commit 28da8ca
Show file tree
Hide file tree
Showing 90 changed files with 3,296 additions and 2,112 deletions.
60 changes: 58 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# 13.13.0 Release notes

### Enhancements
* None.

### Fixed
* Allow numeric substitutions into a geospatial query. Example `location GEOWITHIN geoCircle([$0, $1], $2)`. ([#6662](https://github.com/realm/realm-core/issues/6662))
* Access token refresh for websockets was not updating the location metadata ([#6630](https://github.com/realm/realm-core/issues/6630), since v13.9.3)
* Fix several UBSan failures which did not appear to result in functional bugs ([#6649](https://github.com/realm/realm-core/pull/6649)).
* Fix an out-of-bounds read in sectioned results when sectioned are removed by modifying all objects in that section to no longer appear in that section ([#6649](https://github.com/realm/realm-core/pull/6649), since v13.12.0)
* Using both synchronous and asynchronous transactions on the same thread or scheduler could hit the assertion failure "!realm.is_in_transaction()" if one of the callbacks for an asynchronous transaction happened to be scheduled during a synchronous transaction ([#6659](https://github.com/realm/realm-core/issues/6659), since v11.8.0)

### Breaking changes
* None.

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.

-----------

### Internals
* Simplify the implementation of query expression nodes which have a btree leaf cache.
* Fix a lock order inversion hit by object store tests running on linux. The cycle required test-specific code and so is not applicable to non-tests.
* Remove catch() clause to prevent truncating stack trace in AsyncOper::do_recycle_and_execute() ([PR #6667](https://github.com/realm/realm-core/pull/6667))

----------------------------------------------

# 13.12.0 Release notes

### Enhancements
* Improve performance of SectionedResults. With a single section it is now ~10% faster, and the runtime of sectioning no longer scales significantly with section count, giving >100% speedups when there are large numbers of sections ([PR #6606](https://github.com/realm/realm-core/pull/6606)).
* Very slightly improve performance of runtime thread checking on the main thread on Apple platforms. ([PR #6606](https://github.com/realm/realm-core/pull/6606))

### Fixed
* We could crash when removing backlinks in cases where forward links did not have a corresponding backlink due to corruption. We now silently ignore this inconsistency in release builds, allowing the app to continue. ([#6585](https://github.com/realm/realm-core/issues/6585), v6.0.0)
* If you freeze a Results based on a collection of objects, the result would be invalid if you delete the collection ([#6635](https://github.com/realm/realm-core/issues/6635), since V13.11.0)
* Geospatial polygons now have built in normalization and validation in line with the MongoDB server side behaviour and the geoJSON standard. ([#6607](https://github.com/realm/realm-core/pull/6607), since v13.11.0)
* Dictionary::get_any() would expose unresolved links rather than mapping them to null. In addition to allowing invalid objects to be read from Dictionaries, this resulted in queries on Dictionaries sometimes having incorrect results ([#6644](https://github.com/realm/realm-core/pull/6644)).

### Breaking changes
* `platform` and `cpu_arch` fields in the `device_info` structure in App::Config can no longer be provided by the SDK's, they are inferred by the library ([PR #6612](https://github.com/realm/realm-core/pull/6612))
* `bundle_id` is now a required field in the `device_info` structure in App::Config ([PR #6612](https://github.com/realm/realm-core/pull/6612))
* The API for sectioned results change notifications has changed. Changes are now reported in a vector rather than a sparse map.
* Renamed `GeoCenterSphere` to `GeoCircle` and in RQL `geoSphere` to `geoCircle`. The GeoPoints of query shapes are now validated before use and an exception will be thrown if invalid. Geospatial queries are no longer allowed on top-level tables. Fixed query results using ANY/ALL/NONE and matching on lists ([PR #6645](https://github.com/realm/realm-core/issues/6645))

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.

-----------

### Internals
* Upgraded to Catch from v3.0.1 to v3.3.2. ([#6623](https://github.com/realm/realm-core/issues/6623))
* Added some geospatial benchmarks. ([#6622](https://github.com/realm/realm-core/issues/6622))

----------------------------------------------

# 13.11.0 Release notes

### Enhancements
Expand All @@ -8,6 +64,7 @@
* Fixed a fatal error (reported to the sync error handler) during client reset (or automatic PBS to FLX migration) if the reset has been triggered during an async open and the schema being applied has added new classes. ([#6601](https://github.com/realm/realm-core/issues/6601), since automatic client resets were introduced in v11.5.0)
* Full text search would sometimes find words where the word only matches the beginning of the search token ([#6591](https://github.com/realm/realm-core/issues/6591), since v13.0.0)
* Added missing includes of `<cstdint>` surfaced by gcc13 ([#6616](https://github.com/realm/realm-core/pull/6616))
* Prevent crashing on Results.freeze if underlying object or table were removed by making Results.is_valid correctly report its state. ([#6401](https://github.com/realm/realm-core/issues/6401))

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Expand All @@ -18,6 +75,7 @@
* Add initial support for targeting WebAssembly with Emscripten ([PR #6263](https://github.com/realm/realm-core/pull/6263)).
* Sync session multiplexing is now enabled by default. The method `SyncManager::enable_session_multiplexing()` has been renamed `SyncManager::set_session_multiplexing()`. (PR [#6557](https://github.com/realm/realm-core/pull/6557))
* Bump protocol to v9 to indicate client has fix for client reset error during async open ([#6609](https://github.com/realm/realm-core/issues/6609))
* Fixed `Results::is_valid()` in order to return `false` if the results is bound to a deleted object or table. (PR [#6445](https://github.com/realm/realm-core/pull/6445))

----------------------------------------------

Expand All @@ -30,7 +88,6 @@

### Fixed
* Exclusion of words in a full text search does not work ([#6512](https://github.com/realm/realm-core/issues/6512), since v13.0.0 );
* Prevent crashing on Results.freeze if underlying object or table were removed by making Results.is_valid correctly report its state. ([#6401](https://github.com/realm/realm-core/issues/6401))

### Breaking changes
* Add `service_name` parameter to `realm_app_call_function` (PR [#6394](https://github.com/realm/realm-core/pull/6394)).
Expand All @@ -44,7 +101,6 @@
* Reduce the memory footprint of an automatic (discard or recover) client reset when there are large incoming changes from the server. ([#6567](https://github.com/realm/realm-core/issues/6567))
* `get_committed_file_format_version()` safe access to mappings vector from multiple threads.
* Add CI tests for Clang 16/Ubuntu 22.04 and update lint task ([PR #6563](https://github.com/realm/realm-core/pull/6563))
* Fixed `Results::is_valid()` in order to return `false` if the results is bound to a deleted object or table. (PR [#6445](https://github.com/realm/realm-core/pull/6445))

----------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription
import Foundation

let versionStr = "13.11.0"
let versionStr = "13.13.0"
let versionPieces = versionStr.split(separator: "-")
let versionCompontents = versionPieces[0].split(separator: ".")
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
Expand Down
2 changes: 0 additions & 2 deletions bindgen/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,9 @@ records:
DeviceInfo:
cppName: app::App::Config::DeviceInfo
fields:
platform: std::string
platform_version: std::string
sdk_version: std::string
sdk: std::string
cpu_arch: std::string
device_name: std::string
device_version: std::string
framework_name: std::string
Expand Down
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME=realm-core
VERSION=13.11.0
VERSION=13.13.0
OPENSSL_VERSION=3.0.8
WIN32_ZLIB_VERSION=1.2.13
MDBREALM_TEST_SERVER_TAG=2023-05-05
2 changes: 1 addition & 1 deletion evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ tasks:
export DEVELOPER_DIR="${xcode_developer_dir}"
fi
./evergreen/install_baas.sh -w ./baas-work-dir -b 773fd0e93fb569b0b4304bb4ca9401f33351e0f1 2>&1 | tee install_baas_output.log
./evergreen/install_baas.sh -w ./baas-work-dir -b df5aafd817ba377744d32976c15b175c9b68685a 2>&1 | tee install_baas_output.log
fi
- command: shell.exec
Expand Down
2 changes: 1 addition & 1 deletion external/catch
Submodule catch updated 470 files
11 changes: 9 additions & 2 deletions src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ bid128_to_string (char *str, BID_UINT128 x
__L1_Split_MiDi_6_Lead (HI_18Dig, ptr);
__L1_Split_MiDi_6 (LO_18Dig, ptr);
}
len = ptr - MiDi;

// Realm edit: silence warning about lengths by casting
// this should not be a problem under the assumption that
// we are working with strings with reasonable lengths
len = (int)(ptr - MiDi);
c_ptr_start = &(str[k]);
c_ptr = c_ptr_start;

Expand All @@ -222,7 +226,10 @@ bid128_to_string (char *str, BID_UINT128 x
for (k_lcv = 1; k_lcv < len; k_lcv++) {
__L0_MiDi2Str (MiDi[k_lcv], c_ptr);
}
k = k + (c_ptr - c_ptr_start);

// Realm edit: explicit cast to silence warning
// assumes working with strings of reasonable length
k = k + (unsigned int)(c_ptr - c_ptr_start);
}

// print E and sign of exponent
Expand Down
2 changes: 1 addition & 1 deletion src/external/s2/base/casts.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ template <class Dest, class Source>
inline Dest bit_cast(const Source& source) {
// Compile time assertion: sizeof(Dest) == sizeof(Source)
// A compile error here means your Dest and Source have different sizes.
typedef char VerifySizesAreEqual [sizeof(Dest) == sizeof(Source) ? 1 : -1];
COMPILE_ASSERT(sizeof(Dest) == sizeof(Source), different_sizes);

Dest dest;
memcpy(&dest, &source, sizeof(dest));
Expand Down
2 changes: 1 addition & 1 deletion src/external/s2/base/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define DCHECK_GE(val1, val2) REALM_ASSERT_DEBUG_EX(val1 >= val2, val1, val2)
#define DCHECK_GT(val1, val2) REALM_ASSERT_DEBUG_EX(val1 > val2, val1, val2)

static std::shared_ptr<realm::util::Logger>& s2_logger()
static inline std::shared_ptr<realm::util::Logger>& s2_logger()
{
return realm::util::Logger::get_default_logger();
}
Expand Down
63 changes: 1 addition & 62 deletions src/external/s2/base/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,8 @@
#define ABSTRACT = 0
#endif

// The COMPILE_ASSERT macro can be used to verify that a compile time
// expression is true. For example, you could use it to verify the
// size of a static array:
//
// COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
// content_type_names_incorrect_size);
//
// or to make sure a struct is smaller than a certain size:
//
// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);
//
// The second argument to the macro is the name of the variable. If
// the expression is false, most compilers will issue a warning/error
// containing the name of the variable.

template <bool>
struct CompileAssert {
};

#define COMPILE_ASSERT(expr, msg) \
typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]

// Implementation details of COMPILE_ASSERT:
//
// - COMPILE_ASSERT works by defining an array type that has -1
// elements (and thus is invalid) when the expression is false.
//
// - The simpler definition
//
// #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1]
//
// does not work, as gcc supports variable-length arrays whose sizes
// are determined at run-time (this is gcc's extension and not part
// of the C++ standard). As a result, gcc fails to reject the
// following code with the simple definition:
//
// int foo;
// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is
// // not a compile-time constant.
//
// - By using the type CompileAssert<(bool(expr))>, we ensures that
// expr is a compile-time constant. (Template arguments must be
// determined at compile-time.)
//
// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
//
// CompileAssert<bool(expr)>
//
// instead, these compilers will refuse to compile
//
// COMPILE_ASSERT(5 > 0, some_message);
//
// (They seem to think the ">" in "5 > 0" marks the end of the
// template argument list.)
//
// - The array size is (bool(expr) ? 1 : -1), instead of simply
//
// ((expr) ? 1 : -1).
//
// This is to avoid running into a bug in MS VC 7.1, which
// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.

static_assert(expr, #msg)

// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
Expand Down
8 changes: 5 additions & 3 deletions src/external/s2/s2loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ bool S2Loop::IsValid(string* err) const {
previous_index = ai + 1;
if (crosses) {
std::string msg = realm::util::format("Edges %1 and %2 cross. Edge locations in degrees: %3-%4 and %5-%6", i, ai, S2LatLng(vertex(i)), S2LatLng(vertex(i + 1)), S2LatLng(vertex(ai)), S2LatLng(vertex(ai + 1)));
s2_logger()->error(msg.c_str());
// additional debugging information, reverse Lat/Lng order.
if (NULL != err) {
*err = msg;
if (err) {
*err = msg;
}
else {
s2_logger()->error(msg.c_str());
}
break;
}
Expand Down
16 changes: 9 additions & 7 deletions src/external/s2/s2polygon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ bool S2Polygon::IsValid(const vector<S2Loop*>& loops, string* err) {
continue;
}
pair<int, int> other = edges[key];
s2_logger()->error("Duplicate edge: loop %1, edge %2 and loop %3, edge %4", i, j, other.first, other.second);
if (err) {
*err = realm::util::format("Duplicate edge: loop %1, edge %2 and loop %3, edge %4", i, j, other.first, other.second);
*err = realm::util::format("Duplicate edge: ring %1, edge %2 and ring %3, edge %4", i, j, other.first, other.second);
}
else {
s2_logger()->error("Duplicate edge: ring %1, edge %2 and ring %3, edge %4", i, j, other.first, other.second);
}
return false;
}
Expand All @@ -139,16 +141,16 @@ bool S2Polygon::IsValid(const vector<S2Loop*>& loops, string* err) {
// two loops cross.
for (size_t i = 0; i < loops.size(); ++i) {
if (!loops[i]->IsNormalized()) {
s2_logger()->error("Loop %1 encloses more than half the sphere", i);
if (err) *err = realm::util::format("Loop %1 encloses more than half the sphere", i);
s2_logger()->error("Ring %1 encloses more than half the sphere", i);
if (err) *err = realm::util::format("Ring %1 encloses more than half the sphere", i);
return false;
}
for (size_t j = i + 1; j < loops.size(); ++j) {
// This test not only checks for edge crossings, it also detects
// cases where the two boundaries cross at a shared vertex.
if (loops[i]->ContainsOrCrosses(loops[j]) < 0) {
s2_logger()->error("Loop %1 crosses loop %2", i, j);
if (err) *err = realm::util::format("Loop %1 crosses loop %2", i, j);
s2_logger()->error("Ring %1 crosses ring %2", i, j);
if (err) *err = realm::util::format("Ring %1 crosses ring %2", i, j);
return false;
}
}
Expand Down Expand Up @@ -1051,7 +1053,7 @@ bool S2Polygon::IsNormalized(string* err) const {
}
if (count > 1) {
if (err) {
*err = realm::util::format("Loop %1 shares more than one vertex with its parent loop %2", i, GetParent(i));
*err = realm::util::format("Ring %1 shares more than one vertex with its parent ring %2", i, GetParent(i));
}
return false;
}
Expand Down
13 changes: 0 additions & 13 deletions src/external/s2/util/math/mathutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ using std::vector;
#include "base/integral_types.h"
#include "base/logging.h"

template <class IntOut, class FloatIn>
IntOut MathUtil::Round(FloatIn x) {
COMPILE_ASSERT(!MathLimits<FloatIn>::kIsInteger, FloatIn_is_integer);
COMPILE_ASSERT(MathLimits<IntOut>::kIsInteger, IntOut_is_not_integer);

// We don't use sgn(x) below because there is no need to distinguish the
// (x == 0) case. Also note that there are specialized faster versions
// of this function for Intel processors at the bottom of this file.
return static_cast<IntOut>(x < 0 ? (x - 0.5) : (x + 0.5));
}

template int MathUtil::Round<int,double>(double x);

MathUtil::QuadraticRootType MathUtil::RealRootsForQuadratic(long double a,
long double b,
long double c,
Expand Down

0 comments on commit 28da8ca

Please sign in to comment.