From bc0a547701c1cf24f717200ba29c9691fdeb2b75 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 1 Apr 2026 17:08:11 -0700 Subject: [PATCH] Support Engine::compile overload to generate view-dependent variants (#9857) * a new tribool type in libutils (header only) * Support `Engine::compile` overload to generate view-dependent variants Implemented an `Engine::compile()` method to infer and generate shader permutations directly based on feature states from a provided `View` alongside `tribool` settings (skinning, shadowReceiver). - Added a new `Material::compile()` overload that directly accepts a precalculated `FixedCapacityVector`, decoupling the Material compilation process from specific feature flag checks. FIXES=[468058969] --- .../filament-android/src/main/cpp/Engine.cpp | 24 ++++ .../com/google/android/filament/Engine.java | 39 +++++++ filament/include/filament/Engine.h | 48 ++++++++ filament/src/Engine.cpp | 10 ++ filament/src/details/Engine.cpp | 85 ++++++++++++++ filament/src/details/Engine.h | 15 +++ filament/src/details/Material.cpp | 36 +++++- filament/src/details/Material.h | 13 ++- libs/utils/CMakeLists.txt | 2 + libs/utils/include/utils/tribool.h | 65 +++++++++++ libs/utils/test/test_tribool.cpp | 105 ++++++++++++++++++ 11 files changed, 433 insertions(+), 9 deletions(-) create mode 100644 libs/utils/include/utils/tribool.h create mode 100644 libs/utils/test/test_tribool.cpp diff --git a/android/filament-android/src/main/cpp/Engine.cpp b/android/filament-android/src/main/cpp/Engine.cpp index 62a753d775..00bd4fc680 100644 --- a/android/filament-android/src/main/cpp/Engine.cpp +++ b/android/filament-android/src/main/cpp/Engine.cpp @@ -22,6 +22,12 @@ #include #include +#include + +#include +#include + +#include "common/CallbackUtils.h" using namespace filament; using namespace utils; @@ -429,6 +435,24 @@ Java_com_google_android_filament_Engine_nIsPaused(JNIEnv*, jclass, return (jboolean)engine->isPaused(); } +extern "C" JNIEXPORT void JNICALL +Java_com_google_android_filament_Engine_nCompile(JNIEnv* env, jclass, + jlong nativeEngine, jint priority, jlong nativeMaterial, jlong nativeView, + jint shadowReceiver, jint skinning, jobject handler, jobject runnable) { + Engine* engine = (Engine*) nativeEngine; + Material* material = (Material*) nativeMaterial; + View* view = (View*) nativeView; + JniCallback* jniCallback = JniCallback::make(env, handler, runnable); + engine->compile( + (backend::CompilerPriorityQueue) priority, + material, view, + (utils::tribool::value_t) shadowReceiver, + (utils::tribool::value_t) skinning, + jniCallback->getHandler(), [jniCallback](Material*){ + JniCallback::postToJavaAndDestroy(jniCallback); + }); +} + extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetPaused(JNIEnv*, jclass, jlong nativeEngine, jboolean paused) { diff --git a/android/filament-android/src/main/java/com/google/android/filament/Engine.java b/android/filament-android/src/main/java/com/google/android/filament/Engine.java index b22a39af5c..cbee7cc6f8 100644 --- a/android/filament-android/src/main/java/com/google/android/filament/Engine.java +++ b/android/filament-android/src/main/java/com/google/android/filament/Engine.java @@ -205,6 +205,15 @@ public class Engine { REALTIME, }; + /** + * Three-state feature state. + */ + public enum FeatureState { + FALSE, + TRUE, + INDETERMINATE + } + /** * Constructs Engine objects using a builder pattern. */ @@ -618,6 +627,35 @@ public class Engine { return mNativeObject != 0; } + /** + * Asynchronously ensures that the variants of the specified Material required to render it + * in the provided View are compiled. This determines the necessary permutations of + * feature flags based on the supplied View, and compiles the corresponding shader variants. + * + * See {@link Material#compile(Material.CompilerPriorityQueue, int, Object, Runnable)} for + * important details about the compilation process, callback scheduling, priorities, and flushing the engine. + * + * @param priority Which priority queue to use, LOW or HIGH. + * @param material The Material whose variants will be compiled. + * @param view The View in which the material will be rendered. + * @param shadowReceiver Indicates whether to compile variants where the material receives shadows. + * Use FeatureState.INDETERMINATE to compile both permutations. + * @param skinning Indicates whether to compile variants with skinning. + * Use FeatureState.INDETERMINATE to compile both permutations. + * @param handler An {@link java.util.concurrent.Executor Executor}. On Android this can also be a {@link android.os.Handler Handler}. + * @param callback callback called on the main thread when the compilation is done + * by backend. + */ + public void compile(@NonNull Material.CompilerPriorityQueue priority, + @NonNull Material material, + @NonNull View view, + @NonNull FeatureState shadowReceiver, + @NonNull FeatureState skinning, + @Nullable Object handler, + @Nullable Runnable callback) { + nCompile(getNativeObject(), priority.ordinal(), material.getNativeObject(), view.getNativeObject(), shadowReceiver.ordinal(), skinning.ordinal(), handler, callback); + } + /** * Destroy the Engine instance and all associated resources. *

@@ -1531,6 +1569,7 @@ public class Engine { private static native void nDestroyEntity(long nativeEngine, int entity); private static native boolean nFlushAndWait(long nativeEngine, long timeout); private static native void nFlush(long nativeEngine); + private static native void nCompile(long nativeEngine, int priority, long nativeMaterial, long nativeView, int shadowReceiver, int skinning, Object handler, Runnable callback); private static native boolean nIsPaused(long nativeEngine); private static native void nSetPaused(long nativeEngine, boolean paused); private static native void nUnprotected(long nativeEngine); diff --git a/filament/include/filament/Engine.h b/filament/include/filament/Engine.h index c9dee81c9f..c646bf2478 100644 --- a/filament/include/filament/Engine.h +++ b/filament/include/filament/Engine.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1284,6 +1285,53 @@ public: */ bool* UTILS_NULLABLE getFeatureFlagPtr(char const* UTILS_NONNULL name) const noexcept; + + /** + * Asynchronously ensures that the variants of the specified Material needed to render it + * in the provided View are compiled. This takes into account the view's features + * (e.g. dynamic lighting, fog, stereo, shadowing), alongside the specified shadow receiver + * and skinning configurations. + * + * After issuing several Engine::compile() calls in a row, it is recommended to call + * Engine::flush() such that the backend can start the compilation work as soon as possible. + * The provided callback is guaranteed to be called on the main thread after all computed + * variants of the material are compiled. This can take hundreds of milliseconds. + * + * If all the needed variants are already compiled, the callback will be scheduled as + * soon as possible, but this might take a few dozen milliseconds, corresponding to how + * many previous frames are enqueued in the backend. + * + * If the same variant is scheduled for compilation multiple times, the first scheduling + * takes precedence; later scheduling are ignored. + * + * The callback is guaranteed to be called. If the engine is destroyed while some material + * variants are still compiling or in the queue, these will be discarded and the corresponding + * callback will be called. In that case however the Material pointer passed to the callback + * is guaranteed to be invalid (either because it's been destroyed by the user already, or, + * because it's been cleaned-up by the Engine). + * + * @param priority Which priority queue to use, LOW or HIGH. + * @param material The Material to compile. + * @param view The View in which the material will be rendered. + * @param shadowReceiver Indicates whether to compile the shadow-receiving variants. + * Pass \p utils::tribool::indeterminate to compile both permutations. + * @param skinning Indicates whether to compile the skinning variants. + * Pass \p utils::tribool::indeterminate to compile both permutations. + * @param handler Handler to dispatch the callback or nullptr for the default handler. + * @param callback Callback called on the main thread when the compilation is done + * by the backend. + * + * @see Material::compile + */ + void compile( + backend::CompilerPriorityQueue priority, + Material const* UTILS_NONNULL material, + View const* UTILS_NONNULL view, + utils::tribool shadowReceiver, + utils::tribool skinning, + backend::CallbackHandler* UTILS_NULLABLE handler = nullptr, + utils::Invocable&& callback = {}); + protected: //! \privatesection Engine() noexcept = default; diff --git a/filament/src/Engine.cpp b/filament/src/Engine.cpp index e514e14f24..940bb24f37 100644 --- a/filament/src/Engine.cpp +++ b/filament/src/Engine.cpp @@ -44,8 +44,10 @@ #include #include #include +#include #include +#include #include #include @@ -496,6 +498,14 @@ bool* Engine::getFeatureFlagPtr(char const* UTILS_NONNULL name) const noexcept { return downcast(this)->getFeatureFlagPtr(name); } +void Engine::compile(CompilerPriorityQueue priority, Material const* material, View const* view, + tribool shadowReceiver, tribool skinning, CallbackHandler* handler, + Invocable&& callback) { + downcast(this)->compile(priority, + downcast(material), downcast(view), shadowReceiver, skinning, + handler, std::move(callback)); +} + #if defined(__EMSCRIPTEN__) void Engine::resetBackendState() noexcept { downcast(this)->resetBackendState(); diff --git a/filament/src/details/Engine.cpp b/filament/src/details/Engine.cpp index 340c492adb..f18718e0b5 100644 --- a/filament/src/details/Engine.cpp +++ b/filament/src/details/Engine.cpp @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ #include #include #include +#include #include #include @@ -1673,6 +1675,89 @@ bool* FEngine::getFeatureFlagPtr(std::string_view name, bool const allowConstant return FeatureFlagManager::getFeatureFlagPtr(name, allowConstant); } +FixedCapacityVector FEngine::getMaterialCompileVariants( + FView const* view, + tribool const shadowReceiver, + tribool const skinning) noexcept { + + // the maximum possible is 6 variants (4 color + 2 depth) + auto variants = FixedCapacityVector::with_capacity(6); + + // apply() iteratively expands the `variants` vector by mutating existing elements + // in-place if `value` is determinate, or by duplicating them if `value` is indeterminate. + // + // @param start The index in `variants` to begin the operation. + // @param value The tribool state (false, true, or indeterminate) of the feature. + // @param setter A pointer to a member function of Variant that sets the feature bit. + auto apply = [&variants](size_t const start, tribool const value, auto setter) { + if (value.is_indeterminate()) { + size_t const count = variants.size(); + for (size_t i = start; i < count; ++i) { + // To maintain permutations, we first grab a copy of the variant + Variant v = variants[i]; + // Mutate the original in-place for the `false` state + (variants[i].*setter)(false); + // Set the `true` state on our copy and push it as a new permutation + (v.*setter)(true); + variants.push_back(v); + } + } else { + // The feature is statically known, so just mutate all existing elements in-place + bool const b = value.is_true(); + for (size_t i = start; i < variants.size(); ++i) { + (variants[i].*setter)(b); + } + } + }; + + Variant baseVariant{}; + baseVariant.setDirectionalLighting(view->hasDirectionalLighting()); + baseVariant.setDynamicLighting(view->hasDynamicLighting()); + baseVariant.setFog(view->hasFog()); + baseVariant.setShadowSampler2D(view->hasShadowing() && (view->getShadowType() != ShadowType::PCF)); + baseVariant.setStereo(view->hasStereo()); + + variants.push_back(baseVariant); + apply(0, skinning, &Variant::setSkinning); + apply(0, shadowReceiver, &Variant::setShadowReceiver); + + Variant depthVariant{}; + if (view->hasShadowing()) { + // needsShadowMap() is no good here, because it can change based on the visibility of the shadow maps + depthVariant = Variant{Variant::DEPTH_VARIANT}; + depthVariant.setDepthMoments(view->getShadowType() == ShadowType::VSM); + } + if (view->hasPostProcessPass()) { + // This is needed if we're going to generate the structure pass. That is however very hard to tell + // because the logic exists only in the FrameGraph. For now, we assume that if postFx is enabled, we'll + // need the depth variant. + depthVariant = Variant{Variant::DEPTH_VARIANT}; + } + + if (Variant::isValidDepthVariant(depthVariant)) { + // if we have a valid depth variant, add the stereo and skinning bits + depthVariant.setStereo(view->hasStereo()); + + size_t const depthStart = variants.size(); + variants.push_back(depthVariant); + apply(depthStart, skinning, &Variant::setSkinning); + } + + return variants; +} + +void FEngine::compile( + CompilerPriorityQueue const priority, + FMaterial const* material, + FView const* view, + tribool const shadowReceiver, + tribool const skinning, + CallbackHandler* handler, + Invocable&& callback) { + auto const variants = getMaterialCompileVariants(view, shadowReceiver, skinning); + material->compile(priority, variants, handler, std::move(callback)); +} + // ------------------------------------------------------------------------------------------------ Engine::Builder::Builder() noexcept = default; diff --git a/filament/src/details/Engine.h b/filament/src/details/Engine.h index 4f88ba5624..592aba64a7 100644 --- a/filament/src/details/Engine.h +++ b/filament/src/details/Engine.h @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -574,6 +575,20 @@ public: std::optional getFeatureFlag(char const* name) const noexcept; bool* getFeatureFlagPtr(std::string_view name, bool allowConstant = false) const noexcept; + void compile( + backend::CompilerPriorityQueue priority, + FMaterial const* material, + FView const* view, + utils::tribool shadowReceiver, + utils::tribool skinning, + backend::CallbackHandler* handler = nullptr, + utils::Invocable&& callback = {}); + + static utils::FixedCapacityVector getMaterialCompileVariants( + FView const* view, + utils::tribool shadowReceiver, + utils::tribool skinning) noexcept; + private: explicit FEngine(Builder const& builder); void init(); diff --git a/filament/src/details/Material.cpp b/filament/src/details/Material.cpp index 0c08842478..b7223e51c5 100644 --- a/filament/src/details/Material.cpp +++ b/filament/src/details/Material.cpp @@ -240,8 +240,7 @@ filament::DescriptorSetLayout const& FMaterial::getPerViewDescriptorSetLayout( void FMaterial::compile(CompilerPriorityQueue const priority, UserVariantFilterMask variantSpec, CallbackHandler* handler, - Invocable&& callback) noexcept { - + Invocable&& callback) const noexcept { DriverApi& driver = mEngine.getDriverApi(); // Turn off the STE variant if stereo is not supported. @@ -249,8 +248,7 @@ void FMaterial::compile(CompilerPriorityQueue const priority, variantSpec &= ~UserVariantFilterMask(UserVariantFilterBit::STE); } - UserVariantFilterMask const variantFilter = - ~variantSpec & UserVariantFilterMask(UserVariantFilterBit::ALL); + UserVariantFilterMask const variantFilter = ~variantSpec & UserVariantFilterMask(UserVariantFilterBit::ALL); ShaderModel const shaderModel = mEngine.getShaderModel(); bool const isStereoSupported = mEngine.getDriverApi().isStereoSupported(); @@ -264,6 +262,34 @@ void FMaterial::compile(CompilerPriorityQueue const priority, } } + compileAllPrograms(priority, handler, std::move(callback)); +} + +void FMaterial::compile(CompilerPriorityQueue const priority, + FixedCapacityVector const& variants, + CallbackHandler* handler, + Invocable&& callback) const noexcept { + DriverApi& driver = mEngine.getDriverApi(); + + ShaderModel const shaderModel = mEngine.getShaderModel(); + bool const isStereoSupported = driver.isStereoSupported(); + + if (UTILS_LIKELY(mIsParallelShaderCompileSupported)) { + for (auto const variant : variants) { + if (mDefinition.hasVariant(variant, shaderModel, isStereoSupported)) { + prepareProgram(driver, variant, priority); + } + } + } + + compileAllPrograms(priority, handler, std::move(callback)); +} + +void FMaterial::compileAllPrograms(CompilerPriorityQueue const priority, + CallbackHandler* handler, + Invocable&& callback) const noexcept { + DriverApi& driver = mEngine.getDriverApi(); + if (callback) { struct Callback { Invocable f; @@ -274,7 +300,7 @@ void FMaterial::compile(CompilerPriorityQueue const priority, delete c; } }; - auto* const user = new(std::nothrow) Callback{ std::move(callback), this }; + auto* const user = new(std::nothrow) Callback{ std::move(callback), const_cast(this) }; driver.compilePrograms(priority, handler, &Callback::func, user); } else { driver.compilePrograms(priority, nullptr, nullptr, nullptr); diff --git a/filament/src/details/Material.h b/filament/src/details/Material.h index 6f3fbbce4c..98b1e41711 100644 --- a/filament/src/details/Material.h +++ b/filament/src/details/Material.h @@ -106,7 +106,12 @@ public: void compile(CompilerPriorityQueue priority, UserVariantFilterMask variantSpec, backend::CallbackHandler* handler, - utils::Invocable&& callback) noexcept; + utils::Invocable&& callback) const noexcept; + + void compile(CompilerPriorityQueue priority, + utils::FixedCapacityVector const& variants, + backend::CallbackHandler* handler, + utils::Invocable&& callback) const noexcept; // Creates an instance of this material, specifying the batching mode. FMaterialInstance* createInstance(const char* name) const noexcept; @@ -311,9 +316,9 @@ private: utils::FixedCapacityVector processSpecializationConstants(Builder const& builder); - void precacheDepthVariants(backend::DriverApi& driver); - - void createAndCacheProgram(backend::DriverApi& driver, backend::Program&& p, Variant variant) const noexcept; + void compileAllPrograms(CompilerPriorityQueue priority, + backend::CallbackHandler* handler, + utils::Invocable&& callback) const noexcept; MaterialDefinition const& mDefinition; diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt index db2faba36d..f09efcbad2 100644 --- a/libs/utils/CMakeLists.txt +++ b/libs/utils/CMakeLists.txt @@ -22,6 +22,7 @@ set(DIST_HDRS ${PUBLIC_HDR_DIR}/${TARGET}/compiler.h ${PUBLIC_HDR_DIR}/${TARGET}/compressed_pair.h ${PUBLIC_HDR_DIR}/${TARGET}/CString.h + ${PUBLIC_HDR_DIR}/${TARGET}/tribool.h ${PUBLIC_HDR_DIR}/${TARGET}/ImmutableCString.h ${PUBLIC_HDR_DIR}/${TARGET}/Entity.h ${PUBLIC_HDR_DIR}/${TARGET}/EntityInstance.h @@ -179,6 +180,7 @@ if (FILAMENT_BUILD_TESTING) test/test_algorithm.cpp test/test_Allocators.cpp test/test_bitset.cpp + test/test_tribool.cpp test/test_CountDownLatch.cpp test/test_CString.cpp test/test_ImmutableCString.cpp diff --git a/libs/utils/include/utils/tribool.h b/libs/utils/include/utils/tribool.h new file mode 100644 index 0000000000..654e01e218 --- /dev/null +++ b/libs/utils/include/utils/tribool.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2026 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TNT_UTILS_TRIBOOL_H +#define TNT_UTILS_TRIBOOL_H + +#include + +namespace utils { + +class tribool { +public: + enum value_t : uint8_t { + False = 0, + True = 1, + Indeterminate = 2 + }; + + constexpr tribool() noexcept : mValue(Indeterminate) {} + constexpr tribool(bool v) noexcept : mValue(v ? True : False) {} + constexpr tribool(value_t v) noexcept : mValue(v) {} + + constexpr bool is_true() const noexcept { return mValue == True; } + constexpr bool is_false() const noexcept { return mValue == False; } + constexpr bool is_indeterminate() const noexcept { return mValue == Indeterminate; } + + constexpr tribool operator!() const noexcept { + return mValue == Indeterminate ? Indeterminate : (mValue == True ? False : True); + } + + constexpr tribool operator&&(tribool rhs) const noexcept { + if (mValue == False || rhs.mValue == False) return False; + if (mValue == True) return rhs; + return Indeterminate; + } + + constexpr tribool operator||(tribool rhs) const noexcept { + if (mValue == True || rhs.mValue == True) return True; + if (mValue == False) return rhs; + return Indeterminate; + } + + constexpr bool operator==(tribool rhs) const noexcept { return mValue == rhs.mValue; } + constexpr bool operator!=(tribool rhs) const noexcept { return mValue != rhs.mValue; } + +private: + value_t mValue; +}; + +} // namespace utils + +#endif // TNT_UTILS_TRIBOOL_H diff --git a/libs/utils/test/test_tribool.cpp b/libs/utils/test/test_tribool.cpp new file mode 100644 index 0000000000..1d801b1450 --- /dev/null +++ b/libs/utils/test/test_tribool.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2026 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +using namespace utils; + +TEST(TriboolTest, ConstructorsAndObservers) { + tribool t1; + EXPECT_TRUE(t1.is_indeterminate()); + EXPECT_FALSE(t1.is_true()); + EXPECT_FALSE(t1.is_false()); + + tribool t2(true); + EXPECT_TRUE(t2.is_true()); + EXPECT_FALSE(t2.is_indeterminate()); + EXPECT_FALSE(t2.is_false()); + + tribool t3(false); + EXPECT_TRUE(t3.is_false()); + EXPECT_FALSE(t3.is_true()); + EXPECT_FALSE(t3.is_indeterminate()); + + tribool t4(tribool::True); + EXPECT_TRUE(t4.is_true()); + + tribool t5(tribool::False); + EXPECT_TRUE(t5.is_false()); + + tribool t6(tribool::Indeterminate); + EXPECT_TRUE(t6.is_indeterminate()); +} + +TEST(TriboolTest, LogicalNot) { + EXPECT_TRUE((!tribool(true)).is_false()); + EXPECT_TRUE((!tribool(false)).is_true()); + EXPECT_TRUE((!tribool(tribool::Indeterminate)).is_indeterminate()); +} + +TEST(TriboolTest, LogicalAnd) { + tribool T(true); + tribool F(false); + tribool I(tribool::Indeterminate); + + EXPECT_TRUE((T && T).is_true()); + EXPECT_TRUE((T && F).is_false()); + EXPECT_TRUE((F && T).is_false()); + EXPECT_TRUE((F && F).is_false()); + + EXPECT_TRUE((T && I).is_indeterminate()); + EXPECT_TRUE((I && T).is_indeterminate()); + + EXPECT_TRUE((F && I).is_false()); + EXPECT_TRUE((I && F).is_false()); + + EXPECT_TRUE((I && I).is_indeterminate()); +} + +TEST(TriboolTest, LogicalOr) { + tribool T(true); + tribool F(false); + tribool I(tribool::Indeterminate); + + EXPECT_TRUE((T || T).is_true()); + EXPECT_TRUE((T || F).is_true()); + EXPECT_TRUE((F || T).is_true()); + EXPECT_TRUE((F || F).is_false()); + + EXPECT_TRUE((T || I).is_true()); + EXPECT_TRUE((I || T).is_true()); + + EXPECT_TRUE((F || I).is_indeterminate()); + EXPECT_TRUE((I || F).is_indeterminate()); + + EXPECT_TRUE((I || I).is_indeterminate()); +} + +TEST(TriboolTest, Equality) { + tribool T(true); + tribool F(false); + tribool I(tribool::Indeterminate); + + EXPECT_TRUE(T == tribool(true)); + EXPECT_TRUE(F == tribool(false)); + EXPECT_TRUE(I == tribool(tribool::Indeterminate)); + + EXPECT_TRUE(T != F); + EXPECT_TRUE(T != I); + EXPECT_TRUE(F != I); +}